@tamagui/web 3.0.0-beta.765.1 → 3.0.0-beta.804.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/dist/cjs/createComponent.cjs +83 -86
  2. package/dist/cjs/createComponent.native.cjs +96 -103
  3. package/dist/cjs/createComponent.native.js +96 -103
  4. package/dist/cjs/createComponent.native.js.map +1 -1
  5. package/dist/cjs/createTamagui.cjs +9 -7
  6. package/dist/cjs/createTamagui.native.cjs +9 -7
  7. package/dist/cjs/createTamagui.native.js +9 -7
  8. package/dist/cjs/createTamagui.native.js.map +1 -1
  9. package/dist/cjs/helpers/defaultAnimationDriver.cjs +0 -1
  10. package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +0 -1
  11. package/dist/cjs/helpers/defaultAnimationDriver.native.js +0 -1
  12. package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
  13. package/dist/cjs/helpers/directStyleCSS.cjs +348 -0
  14. package/dist/cjs/helpers/directStyleCSS.native.cjs +20 -0
  15. package/dist/cjs/helpers/directStyleCSS.native.js +22 -0
  16. package/dist/cjs/helpers/directStyleCSS.native.js.map +1 -0
  17. package/dist/cjs/helpers/directStyleCSSCompiled.cjs +40 -0
  18. package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +46 -0
  19. package/dist/cjs/helpers/directStyleCSSCompiled.native.js +48 -0
  20. package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +1 -0
  21. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +92 -74
  22. package/dist/cjs/helpers/{getFontLanguage.native.cjs → getCSSStylesAtomicCompiled.cjs} +12 -8
  23. package/dist/cjs/helpers/{getFontLanguage.native.js → getCSSStylesAtomicCompiled.native.cjs} +12 -8
  24. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +36 -0
  25. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
  26. package/dist/cjs/helpers/getSplitStyles.cjs +2417 -548
  27. package/dist/cjs/helpers/getSplitStyles.native.cjs +2758 -621
  28. package/dist/cjs/helpers/getSplitStyles.native.js +2758 -621
  29. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  30. package/dist/cjs/helpers/getVariantExtras.cjs +8 -3
  31. package/dist/cjs/helpers/getVariantExtras.native.cjs +8 -3
  32. package/dist/cjs/helpers/getVariantExtras.native.js +8 -3
  33. package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
  34. package/dist/cjs/helpers/insertStyleRule.cjs +2 -1
  35. package/dist/cjs/helpers/insertStyleRule.native.cjs +68 -5
  36. package/dist/cjs/helpers/insertStyleRule.native.js +68 -5
  37. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  38. package/dist/cjs/helpers/mediaState.cjs +12 -0
  39. package/dist/cjs/helpers/mediaState.native.cjs +12 -0
  40. package/dist/cjs/helpers/mediaState.native.js +12 -0
  41. package/dist/cjs/helpers/mediaState.native.js.map +1 -1
  42. package/dist/cjs/helpers/normalizeStyle.cjs +16 -2
  43. package/dist/cjs/helpers/normalizeStyle.native.cjs +16 -2
  44. package/dist/cjs/helpers/normalizeStyle.native.js +16 -2
  45. package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
  46. package/dist/cjs/helpers/resolveRem.cjs +1 -1
  47. package/dist/cjs/helpers/skipProps.cjs +6 -1
  48. package/dist/cjs/helpers/skipProps.native.cjs +6 -1
  49. package/dist/cjs/helpers/skipProps.native.js +6 -1
  50. package/dist/cjs/helpers/skipProps.native.js.map +1 -1
  51. package/dist/cjs/helpers/styleFrontend.cjs +2 -8
  52. package/dist/cjs/helpers/styleFrontend.native.cjs +2 -10
  53. package/dist/cjs/helpers/styleFrontend.native.js +2 -10
  54. package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
  55. package/dist/cjs/helpers/styleToCSS.cjs +59 -0
  56. package/dist/cjs/helpers/{normalizeStylePropKeys.cjs → styleToCSS.native.cjs} +6 -4
  57. package/dist/cjs/helpers/{getFontLanguage.cjs → styleToCSS.native.js} +8 -4
  58. package/dist/cjs/helpers/styleToCSS.native.js.map +1 -0
  59. package/dist/cjs/helpers/subscribeToContextGroup.cjs +28 -1
  60. package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +45 -1
  61. package/dist/cjs/helpers/subscribeToContextGroup.native.js +45 -1
  62. package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
  63. package/dist/cjs/helpers/variables.cjs +3 -2
  64. package/dist/cjs/helpers/variables.native.cjs +3 -2
  65. package/dist/cjs/helpers/variables.native.js +3 -2
  66. package/dist/cjs/helpers/variables.native.js.map +1 -1
  67. package/dist/cjs/helpers/wrapStyleTags.cjs +5 -3
  68. package/dist/cjs/helpers/wrapStyleTags.native.cjs +3 -1
  69. package/dist/cjs/helpers/wrapStyleTags.native.js +3 -1
  70. package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
  71. package/dist/cjs/hooks/useComponentState.cjs +70 -89
  72. package/dist/cjs/hooks/useComponentState.native.cjs +70 -88
  73. package/dist/cjs/hooks/useComponentState.native.js +70 -88
  74. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  75. package/dist/cjs/hooks/useMedia.cjs +3 -15
  76. package/dist/cjs/hooks/useMedia.native.cjs +3 -15
  77. package/dist/cjs/hooks/useMedia.native.js +3 -15
  78. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  79. package/dist/cjs/hooks/useProps.cjs +7 -5
  80. package/dist/cjs/hooks/useProps.native.cjs +7 -5
  81. package/dist/cjs/hooks/useProps.native.js +7 -5
  82. package/dist/cjs/hooks/useProps.native.js.map +1 -1
  83. package/dist/cjs/hooks/useSplitStyles.cjs +42 -0
  84. package/dist/cjs/hooks/useSplitStyles.native.cjs +42 -0
  85. package/dist/cjs/hooks/useSplitStyles.native.js +44 -0
  86. package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -0
  87. package/dist/cjs/index.cjs +184 -70
  88. package/dist/cjs/index.native.cjs +184 -70
  89. package/dist/cjs/index.native.js +184 -70
  90. package/dist/cjs/index.native.js.map +1 -1
  91. package/dist/cjs/insertFont.cjs +1 -1
  92. package/dist/cjs/insertFont.native.cjs +1 -0
  93. package/dist/cjs/insertFont.native.js +1 -0
  94. package/dist/cjs/insertFont.native.js.map +1 -1
  95. package/dist/cjs/internal-runtime.cjs +33 -6
  96. package/dist/cjs/internal-runtime.native.cjs +33 -6
  97. package/dist/cjs/internal-runtime.native.js +33 -6
  98. package/dist/cjs/internal-runtime.native.js.map +1 -1
  99. package/dist/cjs/setupReactNative.cjs +1 -29
  100. package/dist/cjs/setupReactNative.native.cjs +1 -3
  101. package/dist/cjs/setupReactNative.native.js +1 -3
  102. package/dist/cjs/setupReactNative.native.js.map +1 -1
  103. package/dist/cjs/static-resolve.cjs +229 -0
  104. package/dist/cjs/static-resolve.native.cjs +242 -0
  105. package/dist/cjs/static-resolve.native.js +244 -0
  106. package/dist/cjs/static-resolve.native.js.map +1 -0
  107. package/dist/cjs/styled.cjs +23 -37
  108. package/dist/cjs/styled.native.cjs +22 -37
  109. package/dist/cjs/styled.native.js +22 -37
  110. package/dist/cjs/styled.native.js.map +1 -1
  111. package/dist/cjs/views/TamaguiProvider.cjs +4 -8
  112. package/dist/cjs/views/TamaguiProvider.native.cjs +4 -8
  113. package/dist/cjs/views/TamaguiProvider.native.js +4 -8
  114. package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
  115. package/dist/cjs/views/ThemeUpdate.cjs +1 -1
  116. package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
  117. package/dist/cjs/views/ThemeUpdate.native.js +1 -1
  118. package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
  119. package/dist/esm/createComponent.mjs +85 -88
  120. package/dist/esm/createComponent.mjs.map +1 -1
  121. package/dist/esm/createComponent.native.js +98 -105
  122. package/dist/esm/createComponent.native.js.map +1 -1
  123. package/dist/esm/createTamagui.mjs +9 -7
  124. package/dist/esm/createTamagui.mjs.map +1 -1
  125. package/dist/esm/createTamagui.native.js +9 -7
  126. package/dist/esm/createTamagui.native.js.map +1 -1
  127. package/dist/esm/helpers/defaultAnimationDriver.mjs +0 -1
  128. package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
  129. package/dist/esm/helpers/defaultAnimationDriver.native.js +0 -1
  130. package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
  131. package/dist/esm/helpers/directStyleCSS.mjs +320 -0
  132. package/dist/esm/helpers/directStyleCSS.mjs.map +1 -0
  133. package/dist/esm/helpers/directStyleCSS.native.js +1 -0
  134. package/dist/esm/helpers/directStyleCSSCompiled.mjs +11 -0
  135. package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +1 -0
  136. package/dist/esm/helpers/directStyleCSSCompiled.native.js +15 -0
  137. package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +1 -0
  138. package/dist/esm/helpers/getCSSStylesAtomic.mjs +86 -72
  139. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  140. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +9 -0
  141. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -0
  142. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +9 -0
  143. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
  144. package/dist/esm/helpers/getSplitStyles.mjs +2406 -545
  145. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  146. package/dist/esm/helpers/getSplitStyles.native.js +2751 -618
  147. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  148. package/dist/esm/helpers/getVariantExtras.mjs +8 -3
  149. package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
  150. package/dist/esm/helpers/getVariantExtras.native.js +8 -3
  151. package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
  152. package/dist/esm/helpers/insertStyleRule.mjs +2 -1
  153. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  154. package/dist/esm/helpers/insertStyleRule.native.js +69 -3
  155. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  156. package/dist/esm/helpers/mediaState.mjs +12 -1
  157. package/dist/esm/helpers/mediaState.mjs.map +1 -1
  158. package/dist/esm/helpers/mediaState.native.js +12 -1
  159. package/dist/esm/helpers/mediaState.native.js.map +1 -1
  160. package/dist/esm/helpers/normalizeStyle.mjs +16 -2
  161. package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
  162. package/dist/esm/helpers/normalizeStyle.native.js +16 -2
  163. package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
  164. package/dist/esm/helpers/resolveRem.mjs +1 -1
  165. package/dist/esm/helpers/resolveRem.mjs.map +1 -1
  166. package/dist/esm/helpers/skipProps.mjs +3 -1
  167. package/dist/esm/helpers/skipProps.mjs.map +1 -1
  168. package/dist/esm/helpers/skipProps.native.js +3 -1
  169. package/dist/esm/helpers/skipProps.native.js.map +1 -1
  170. package/dist/esm/helpers/styleFrontend.mjs +2 -4
  171. package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
  172. package/dist/esm/helpers/styleFrontend.native.js +2 -6
  173. package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
  174. package/dist/esm/helpers/styleToCSS.mjs +40 -0
  175. package/dist/esm/helpers/styleToCSS.mjs.map +1 -0
  176. package/dist/esm/helpers/styleToCSS.native.js +4 -0
  177. package/dist/esm/helpers/styleToCSS.native.js.map +1 -0
  178. package/dist/esm/helpers/subscribeToContextGroup.mjs +25 -1
  179. package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
  180. package/dist/esm/helpers/subscribeToContextGroup.native.js +42 -1
  181. package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
  182. package/dist/esm/helpers/variables.mjs +2 -1
  183. package/dist/esm/helpers/variables.mjs.map +1 -1
  184. package/dist/esm/helpers/variables.native.js +2 -1
  185. package/dist/esm/helpers/variables.native.js.map +1 -1
  186. package/dist/esm/helpers/wrapStyleTags.mjs +5 -3
  187. package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
  188. package/dist/esm/helpers/wrapStyleTags.native.js +3 -1
  189. package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
  190. package/dist/esm/hooks/useComponentState.mjs +71 -90
  191. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  192. package/dist/esm/hooks/useComponentState.native.js +71 -89
  193. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  194. package/dist/esm/hooks/useMedia.mjs +2 -15
  195. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  196. package/dist/esm/hooks/useMedia.native.js +2 -15
  197. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  198. package/dist/esm/hooks/useProps.mjs +7 -5
  199. package/dist/esm/hooks/useProps.mjs.map +1 -1
  200. package/dist/esm/hooks/useProps.native.js +7 -5
  201. package/dist/esm/hooks/useProps.native.js.map +1 -1
  202. package/dist/esm/hooks/useSplitStyles.mjs +17 -0
  203. package/dist/esm/hooks/useSplitStyles.mjs.map +1 -0
  204. package/dist/esm/hooks/useSplitStyles.native.js +14 -0
  205. package/dist/esm/hooks/useSplitStyles.native.js.map +1 -0
  206. package/dist/esm/index.js +57 -137
  207. package/dist/esm/index.mjs +57 -137
  208. package/dist/esm/index.native.js +57 -137
  209. package/dist/esm/insertFont.mjs +1 -1
  210. package/dist/esm/insertFont.mjs.map +1 -1
  211. package/dist/esm/insertFont.native.js +1 -0
  212. package/dist/esm/insertFont.native.js.map +1 -1
  213. package/dist/esm/internal-runtime.mjs +23 -4
  214. package/dist/esm/internal-runtime.mjs.map +1 -1
  215. package/dist/esm/internal-runtime.native.js +23 -4
  216. package/dist/esm/internal-runtime.native.js.map +1 -1
  217. package/dist/esm/setupReactNative.mjs +1 -29
  218. package/dist/esm/setupReactNative.mjs.map +1 -1
  219. package/dist/esm/setupReactNative.native.js +1 -3
  220. package/dist/esm/setupReactNative.native.js.map +1 -1
  221. package/dist/esm/static-resolve.mjs +194 -0
  222. package/dist/esm/static-resolve.mjs.map +1 -0
  223. package/dist/esm/static-resolve.native.js +205 -0
  224. package/dist/esm/static-resolve.native.js.map +1 -0
  225. package/dist/esm/styled.mjs +24 -40
  226. package/dist/esm/styled.mjs.map +1 -1
  227. package/dist/esm/styled.native.js +23 -40
  228. package/dist/esm/styled.native.js.map +1 -1
  229. package/dist/esm/views/TamaguiProvider.mjs +4 -8
  230. package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
  231. package/dist/esm/views/TamaguiProvider.native.js +4 -8
  232. package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
  233. package/dist/esm/views/ThemeUpdate.mjs +1 -1
  234. package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
  235. package/dist/esm/views/ThemeUpdate.native.js +1 -1
  236. package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
  237. package/package.json +25 -15
  238. package/reset.css +3 -3
  239. package/src/createComponent.tsx +175 -192
  240. package/src/createTamagui.ts +10 -9
  241. package/src/helpers/defaultAnimationDriver.tsx +0 -1
  242. package/src/helpers/directStyleCSS.native.ts +1 -0
  243. package/src/helpers/directStyleCSS.ts +534 -0
  244. package/src/helpers/directStyleCSSCompiled.ts +32 -0
  245. package/src/helpers/getCSSStylesAtomic.ts +168 -88
  246. package/src/helpers/getCSSStylesAtomicCompiled.ts +9 -0
  247. package/src/helpers/getSplitStyles.tsx +4653 -1003
  248. package/src/helpers/getVariantExtras.tsx +15 -3
  249. package/src/helpers/insertStyleRule.tsx +4 -2
  250. package/src/helpers/mediaState.ts +15 -0
  251. package/src/helpers/normalizeStyle.ts +27 -2
  252. package/src/helpers/resolveRem.ts +1 -1
  253. package/src/helpers/skipProps.ts +3 -0
  254. package/src/helpers/styleFrontend.ts +20 -27
  255. package/src/helpers/styleToCSS.native.ts +1 -0
  256. package/src/helpers/styleToCSS.ts +43 -0
  257. package/src/helpers/subscribeToContextGroup.tsx +30 -0
  258. package/src/helpers/variables.ts +2 -1
  259. package/src/helpers/warnOnce.ts +3 -4
  260. package/src/helpers/wrapStyleTags.tsx +1 -1
  261. package/src/hooks/useComponentState.ts +118 -158
  262. package/src/hooks/useMedia.tsx +2 -18
  263. package/src/hooks/useProps.tsx +19 -15
  264. package/src/hooks/useSplitStyles.tsx +26 -0
  265. package/src/index.ts +298 -73
  266. package/src/insertFont.ts +5 -1
  267. package/src/internal-runtime.ts +49 -24
  268. package/src/internalRuntimeTypes.ts +2 -7
  269. package/src/setupReactNative.ts +7 -30
  270. package/src/static-resolve.ts +396 -0
  271. package/src/styled.tsx +34 -11
  272. package/src/types.tsx +40 -30
  273. package/src/views/TamaguiProvider.tsx +23 -22
  274. package/src/views/ThemeUpdate.tsx +3 -1
  275. package/types/createComponent.d.ts.map +1 -1
  276. package/types/createTamagui.d.ts.map +1 -1
  277. package/types/helpers/defaultAnimationDriver.d.ts.map +1 -1
  278. package/types/helpers/directStyleCSS.d.ts +28 -0
  279. package/types/helpers/directStyleCSS.d.ts.map +1 -0
  280. package/types/helpers/directStyleCSS.native.d.ts +2 -0
  281. package/types/helpers/directStyleCSS.native.d.ts.map +1 -0
  282. package/types/helpers/directStyleCSSCompiled.d.ts +10 -0
  283. package/types/helpers/directStyleCSSCompiled.d.ts.map +1 -0
  284. package/types/helpers/getCSSStylesAtomic.d.ts +22 -1
  285. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  286. package/types/helpers/getCSSStylesAtomicCompiled.d.ts +4 -0
  287. package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -0
  288. package/types/helpers/getSplitStyles.d.ts +11 -4
  289. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  290. package/types/helpers/getVariantExtras.d.ts.map +1 -1
  291. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  292. package/types/helpers/mediaState.d.ts +4 -0
  293. package/types/helpers/mediaState.d.ts.map +1 -1
  294. package/types/helpers/normalizeStyle.d.ts +1 -1
  295. package/types/helpers/normalizeStyle.d.ts.map +1 -1
  296. package/types/helpers/skipProps.d.ts +2 -0
  297. package/types/helpers/skipProps.d.ts.map +1 -1
  298. package/types/helpers/styleFrontend.d.ts +13 -17
  299. package/types/helpers/styleFrontend.d.ts.map +1 -1
  300. package/types/helpers/styleToCSS.d.ts +2 -0
  301. package/types/helpers/styleToCSS.d.ts.map +1 -0
  302. package/types/helpers/styleToCSS.native.d.ts +2 -0
  303. package/types/helpers/styleToCSS.native.d.ts.map +1 -0
  304. package/types/helpers/subscribeToContextGroup.d.ts +1 -0
  305. package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
  306. package/types/helpers/variables.d.ts.map +1 -1
  307. package/types/helpers/warnOnce.d.ts.map +1 -1
  308. package/types/helpers/webPropsToSkip.native.d.ts +5 -0
  309. package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
  310. package/types/hooks/useComponentState.d.ts +3 -2
  311. package/types/hooks/useComponentState.d.ts.map +1 -1
  312. package/types/hooks/useMedia.d.ts +1 -5
  313. package/types/hooks/useMedia.d.ts.map +1 -1
  314. package/types/hooks/useProps.d.ts.map +1 -1
  315. package/types/hooks/useSplitStyles.d.ts +3 -0
  316. package/types/hooks/useSplitStyles.d.ts.map +1 -0
  317. package/types/index.d.ts +58 -72
  318. package/types/index.d.ts.map +1 -1
  319. package/types/insertFont.d.ts.map +1 -1
  320. package/types/internal-runtime.d.ts +24 -11
  321. package/types/internal-runtime.d.ts.map +1 -1
  322. package/types/internalRuntimeTypes.d.ts +1 -6
  323. package/types/internalRuntimeTypes.d.ts.map +1 -1
  324. package/types/setupReactNative.d.ts +2 -3
  325. package/types/setupReactNative.d.ts.map +1 -1
  326. package/types/static-resolve.d.ts +79 -0
  327. package/types/static-resolve.d.ts.map +1 -0
  328. package/types/styled.d.ts.map +1 -1
  329. package/types/types.d.ts +29 -22
  330. package/types/types.d.ts.map +1 -1
  331. package/types/views/TamaguiProvider.d.ts.map +1 -1
  332. package/types/views/ThemeUpdate.d.ts.map +1 -1
  333. package/dist/cjs/constants/accessibilityDirectMap.cjs +0 -34
  334. package/dist/cjs/constants/accessibilityDirectMap.native.cjs +0 -36
  335. package/dist/cjs/constants/accessibilityDirectMap.native.js +0 -38
  336. package/dist/cjs/constants/accessibilityDirectMap.native.js.map +0 -1
  337. package/dist/cjs/helpers/directStyle.cjs +0 -962
  338. package/dist/cjs/helpers/directStyle.native.cjs +0 -1165
  339. package/dist/cjs/helpers/directStyle.native.js +0 -1167
  340. package/dist/cjs/helpers/directStyle.native.js.map +0 -1
  341. package/dist/cjs/helpers/frontendProgram.cjs +0 -43
  342. package/dist/cjs/helpers/frontendProgram.native.cjs +0 -49
  343. package/dist/cjs/helpers/frontendProgram.native.js +0 -51
  344. package/dist/cjs/helpers/frontendProgram.native.js.map +0 -1
  345. package/dist/cjs/helpers/getFontLanguage.native.js.map +0 -1
  346. package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +0 -37
  347. package/dist/cjs/helpers/normalizeStylePropKeys.native.js +0 -39
  348. package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +0 -1
  349. package/dist/cjs/helpers/propMapper.cjs +0 -384
  350. package/dist/cjs/helpers/propMapper.native.cjs +0 -536
  351. package/dist/cjs/helpers/propMapper.native.js +0 -538
  352. package/dist/cjs/helpers/propMapper.native.js.map +0 -1
  353. package/dist/cjs/helpers/useRenderElement.cjs +0 -47
  354. package/dist/cjs/helpers/useRenderElement.native.cjs +0 -53
  355. package/dist/cjs/helpers/useRenderElement.native.js +0 -55
  356. package/dist/cjs/helpers/useRenderElement.native.js.map +0 -1
  357. package/dist/esm/constants/accessibilityDirectMap.mjs +0 -8
  358. package/dist/esm/constants/accessibilityDirectMap.mjs.map +0 -1
  359. package/dist/esm/constants/accessibilityDirectMap.native.js +0 -8
  360. package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -1
  361. package/dist/esm/helpers/directStyle.mjs +0 -929
  362. package/dist/esm/helpers/directStyle.mjs.map +0 -1
  363. package/dist/esm/helpers/directStyle.native.js +0 -1132
  364. package/dist/esm/helpers/directStyle.native.js.map +0 -1
  365. package/dist/esm/helpers/frontendProgram.mjs +0 -20
  366. package/dist/esm/helpers/frontendProgram.mjs.map +0 -1
  367. package/dist/esm/helpers/frontendProgram.native.js +0 -24
  368. package/dist/esm/helpers/frontendProgram.native.js.map +0 -1
  369. package/dist/esm/helpers/getFontLanguage.mjs +0 -4
  370. package/dist/esm/helpers/getFontLanguage.mjs.map +0 -1
  371. package/dist/esm/helpers/getFontLanguage.native.js +0 -6
  372. package/dist/esm/helpers/getFontLanguage.native.js.map +0 -1
  373. package/dist/esm/helpers/normalizeStylePropKeys.mjs +0 -4
  374. package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +0 -1
  375. package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -15
  376. package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -1
  377. package/dist/esm/helpers/propMapper.mjs +0 -360
  378. package/dist/esm/helpers/propMapper.mjs.map +0 -1
  379. package/dist/esm/helpers/propMapper.native.js +0 -511
  380. package/dist/esm/helpers/propMapper.native.js.map +0 -1
  381. package/dist/esm/helpers/useRenderElement.mjs +0 -26
  382. package/dist/esm/helpers/useRenderElement.mjs.map +0 -1
  383. package/dist/esm/helpers/useRenderElement.native.js +0 -31
  384. package/dist/esm/helpers/useRenderElement.native.js.map +0 -1
  385. package/src/constants/accessibilityDirectMap.native.tsx +0 -10
  386. package/src/constants/accessibilityDirectMap.tsx +0 -11
  387. package/src/helpers/directStyle.ts +0 -2294
  388. package/src/helpers/frontendProgram.ts +0 -48
  389. package/src/helpers/getFontLanguage.ts +0 -2
  390. package/src/helpers/normalizeStylePropKeys.native.ts +0 -12
  391. package/src/helpers/normalizeStylePropKeys.ts +0 -3
  392. package/src/helpers/propMapper.ts +0 -721
  393. package/src/helpers/useRenderElement.tsx +0 -73
  394. package/types/constants/accessibilityDirectMap.d.ts +0 -6
  395. package/types/constants/accessibilityDirectMap.d.ts.map +0 -1
  396. package/types/constants/accessibilityDirectMap.native.d.ts +0 -6
  397. package/types/constants/accessibilityDirectMap.native.d.ts.map +0 -1
  398. package/types/helpers/directStyle.d.ts +0 -15
  399. package/types/helpers/directStyle.d.ts.map +0 -1
  400. package/types/helpers/frontendProgram.d.ts +0 -10
  401. package/types/helpers/frontendProgram.d.ts.map +0 -1
  402. package/types/helpers/getFontLanguage.d.ts +0 -2
  403. package/types/helpers/getFontLanguage.d.ts.map +0 -1
  404. package/types/helpers/normalizeStylePropKeys.d.ts +0 -2
  405. package/types/helpers/normalizeStylePropKeys.d.ts.map +0 -1
  406. package/types/helpers/normalizeStylePropKeys.native.d.ts +0 -13
  407. package/types/helpers/normalizeStylePropKeys.native.d.ts.map +0 -1
  408. package/types/helpers/propMapper.d.ts +0 -6
  409. package/types/helpers/propMapper.d.ts.map +0 -1
  410. package/types/helpers/useRenderElement.d.ts +0 -13
  411. package/types/helpers/useRenderElement.d.ts.map +0 -1
@@ -38,9 +38,21 @@ export const getVariantExtras = (styleState: GetStyleState) => {
38
38
  // font identity survives in the font_<name> class.
39
39
  const className = props.className
40
40
  if (typeof className === 'string') {
41
- const match = /(?:^|\s)font_([A-Za-z0-9_-]+)/.exec(className)
42
- if (match && fonts[match[1]]) {
43
- return fonts[match[1]]
41
+ let start = 0
42
+ for (let index = 0; index <= className.length; index++) {
43
+ if (index !== className.length && className.charCodeAt(index) > 32) continue
44
+ if (
45
+ index - start > 5 &&
46
+ className.charCodeAt(start) === 102 &&
47
+ className.charCodeAt(start + 1) === 111 &&
48
+ className.charCodeAt(start + 2) === 110 &&
49
+ className.charCodeAt(start + 3) === 116 &&
50
+ className.charCodeAt(start + 4) === 95
51
+ ) {
52
+ const name = className.slice(start + 5, index)
53
+ if (fonts[name]) return fonts[name]
54
+ }
55
+ start = index + 1
44
56
  }
45
57
  }
46
58
 
@@ -339,7 +339,7 @@ export function stopAccumulatingRules() {
339
339
  }
340
340
 
341
341
  export function updateRules(identifier: string, rules: string[]) {
342
- if (trackAllRules) {
342
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS && trackAllRules) {
343
343
  allRules[identifier] = rules.join(' ')
344
344
  sortedRulesStale = true
345
345
  }
@@ -352,7 +352,9 @@ export function setNonce(_: string) {
352
352
  }
353
353
 
354
354
  export function insertStyleRules(rulesToInsert: RulesToInsert) {
355
- if (process.env.TAMAGUI_TARGET !== 'web') return
355
+ if (process.env.TAMAGUI_DID_OUTPUT_CSS || process.env.TAMAGUI_TARGET !== 'web') {
356
+ return
357
+ }
356
358
 
357
359
  if (!sheet && document.head) {
358
360
  const styleTag = document.createElement('style')
@@ -11,3 +11,18 @@ export const mediaQueryConfig: MediaQueries = {}
11
11
  export const getMedia = () => mediaState
12
12
 
13
13
  export const mediaKeys = new Set<string>()
14
+
15
+ export function mediaKeyMatch(
16
+ key: string,
17
+ dimensions: { width: number; height: number }
18
+ ) {
19
+ const mediaQueries = mediaQueryConfig[key]
20
+ for (const query in mediaQueries) {
21
+ const expectedVal = +mediaQueries[query]
22
+ const isMax = query.startsWith('max')
23
+ const isWidth = query.endsWith('Width')
24
+ const givenVal = dimensions[isWidth ? 'width' : 'height']
25
+ if (isMax ? givenVal >= expectedVal : givenVal <= expectedVal) return false
26
+ }
27
+ return true
28
+ }
@@ -1,7 +1,16 @@
1
+ import { isWeb } from '@tamagui/constants'
2
+ import { stylePropsTransform } from '@tamagui/helpers'
3
+ import {
4
+ addTransformValue,
5
+ createTransformAccumulator,
6
+ finalizeTransformAccumulator,
7
+ type TransformAccumulator,
8
+ } from '@tamagui/style-grammar/runtime'
1
9
  import { expandStyle } from './expandStyle'
2
10
  import { fixStyles } from './expandStyles'
3
11
  import { normalizeValueWithProperty } from './normalizeValueWithProperty'
4
12
  import { styleOriginalValues } from './styleOriginalValues'
13
+ import { transformsToString } from './transformsToString'
5
14
 
6
15
  /**
7
16
  * This is what you want to run before Object.assign() a style onto another.
@@ -11,18 +20,28 @@ import { styleOriginalValues } from './styleOriginalValues'
11
20
  * 3. Preserves original-value provenance across expanded longhands
12
21
  */
13
22
 
14
- export function normalizeStyle(style: Record<string, any>, disableNormalize = false) {
23
+ export function normalizeStyle(
24
+ style: Record<string, any>,
25
+ disableNormalize = false,
26
+ mergeTransforms = false
27
+ ) {
15
28
  const res: Record<string, any> = {}
16
29
  const originalValues = styleOriginalValues.get(style)
17
30
  let nextOriginalValues: Record<string, any> | undefined
31
+ let transformAccumulator: TransformAccumulator | undefined
18
32
 
19
33
  for (let key in style) {
20
34
  const prop = style[key]
21
35
  if (prop == null) continue
22
36
  const originalValue = originalValues?.[key]
37
+ if (mergeTransforms && (key === 'transform' || key in stylePropsTransform)) {
38
+ transformAccumulator ||= createTransformAccumulator()
39
+ addTransformValue(transformAccumulator, key, prop)
40
+ continue
41
+ }
23
42
  const value = disableNormalize ? prop : normalizeValueWithProperty(prop, key)
24
43
  // expand react-native shorthands
25
- const out = expandStyle(key, value)
44
+ const out = mergeTransforms ? undefined : expandStyle(key, value)
26
45
  if (out) {
27
46
  for (const [nextKey, nextValue] of out) {
28
47
  res[nextKey] = nextValue
@@ -40,6 +59,12 @@ export function normalizeStyle(style: Record<string, any>, disableNormalize = fa
40
59
  }
41
60
  }
42
61
 
62
+ if (transformAccumulator) {
63
+ const transform = finalizeTransformAccumulator(transformAccumulator)
64
+ res.transform =
65
+ isWeb && Array.isArray(transform) ? transformsToString(transform) : transform
66
+ }
67
+
43
68
  fixStyles(res)
44
69
 
45
70
  if (nextOriginalValues) {
@@ -13,5 +13,5 @@ export function resolveRem(value: string): string {
13
13
  * Checks if a value is a rem string
14
14
  */
15
15
  export function isRemValue(value: unknown): value is string {
16
- return typeof value === 'string' && value.includes('rem')
16
+ return typeof value === 'string' && value.endsWith('rem')
17
17
  }
@@ -1,6 +1,8 @@
1
1
  import { nativeOnlyProps } from './nativeOnlyProps'
2
2
  import { webPropsToSkip } from './webPropsToSkip'
3
3
 
4
+ export const HOC_CLASSNAME_MARKER = 'data-tamagui-hoc-class'
5
+
4
6
  /**
5
7
  * These are props that dont pass down below Tamagui styled components
6
8
  */
@@ -17,6 +19,7 @@ export const skipProps = {
17
19
  disableNativeStyle: 1,
18
20
  render: 1,
19
21
  style: 1, // handled after the prop loop to preserve authored order
22
+ [HOC_CLASSNAME_MARKER]: 1,
20
23
  group: 1,
21
24
  container: 1,
22
25
  animatePresence: 1,
@@ -44,6 +44,22 @@ export type FrontendComponent = FunctionComponent<any> & {
44
44
  staticConfig: FrontendStaticConfig
45
45
  }
46
46
 
47
+ export type FrontendClassPlanEntry = readonly [
48
+ property: string,
49
+ value: unknown,
50
+ condition?: string,
51
+ modifiers?: readonly string[],
52
+ ]
53
+
54
+ export type FrontendClassPlan =
55
+ | 'raw'
56
+ | null
57
+ | readonly FrontendClassPlanEntry[]
58
+ | {
59
+ entries: readonly FrontendClassPlanEntry[]
60
+ preserveRawClass: boolean
61
+ }
62
+
47
63
  /**
48
64
  * A component's authoring syntax. It is chosen by the package the component was
49
65
  * imported from and frozen onto its static config when the component is created:
@@ -58,15 +74,10 @@ export type FrontendComponent = FunctionComponent<any> & {
58
74
  */
59
75
  export type StyleFrontend = {
60
76
  /**
61
- * Turns authored props into the neutral props the shared renderer consumes.
62
- * Runs once per render in `createComponent`, before component state is derived,
63
- * because reconstructed enter/exit, pseudo, media and related state props must
64
- * exist before the animation and state machinery reads them.
77
+ * Classifies one class candidate. The shared style cursor owns the className
78
+ * character walk and feeds every returned entry through its one property sink.
65
79
  */
66
- preprocessProps: (
67
- props: Record<string, any>,
68
- config: StyleFrontendConfig
69
- ) => Record<string, any>
80
+ getClassPlan?: (candidate: string, config: StyleFrontendConfig) => FrontendClassPlan
70
81
 
71
82
  /**
72
83
  * Resolves frontend-specific static style input (a class-string base, string
@@ -79,26 +90,8 @@ export type StyleFrontend = {
79
90
  ) => Config
80
91
  }
81
92
 
82
- /**
83
- * Marks props that already went through `preprocessProps`, so the style split does
84
- * not tokenize a second time. A Symbol key is invisible to the `for..in` prop loop,
85
- * so it never leaks into style processing.
86
- */
87
- export const STYLE_FRONTEND_PREPROCESSED: unique symbol = Symbol(
88
- 'tamaguiStyleFrontendPreprocessed'
89
- )
90
-
91
- /**
92
- * Internal ordered-prop channel for raw CSS classes a frontend does not own.
93
- * Numbered keys let passthrough segments keep their exact position among claimed
94
- * style contributions while the shared renderer still handles them as className.
95
- */
96
- export const STYLE_FRONTEND_PASSTHROUGH_PREFIX = '__tamagui_frontend_passthrough_'
97
-
98
93
  /**
99
94
  * The regular Tamagui frontend: props are already the renderer's input shape, so
100
95
  * preprocessing is identity and costs one property read plus one call.
101
96
  */
102
- export const regularStyleFrontend: StyleFrontend = {
103
- preprocessProps: (props) => props,
104
- }
97
+ export const regularStyleFrontend: StyleFrontend = {}
@@ -0,0 +1 @@
1
+ export function styleToCSS(_style: Record<string, any>) {}
@@ -0,0 +1,43 @@
1
+ import { defaultOffset } from './defaultOffset'
2
+ import { normalizeColor } from './normalizeColor'
3
+ import { normalizeValueWithProperty } from './normalizeValueWithProperty'
4
+
5
+ export function styleToCSS(style: Record<string, any>) {
6
+ const { shadowOffset, shadowRadius, shadowColor, shadowOpacity } = style
7
+ if (
8
+ shadowRadius != null ||
9
+ shadowColor ||
10
+ shadowOffset != null ||
11
+ shadowOpacity != null
12
+ ) {
13
+ const offset = shadowOffset || defaultOffset
14
+ const width = normalizeValueWithProperty(offset.width)
15
+ const height = normalizeValueWithProperty(offset.height)
16
+ const radius = normalizeValueWithProperty(shadowRadius)
17
+ const color = normalizeColor(shadowColor, shadowOpacity)
18
+ if (color) {
19
+ const shadow = `${width} ${height} ${radius} ${color}`
20
+ style.boxShadow = style.boxShadow ? `${style.boxShadow}, ${shadow}` : shadow
21
+ }
22
+ delete style.shadowOffset
23
+ delete style.shadowRadius
24
+ delete style.shadowColor
25
+ delete style.shadowOpacity
26
+ }
27
+
28
+ const { textShadowColor, textShadowOffset, textShadowRadius } = style
29
+ if (textShadowColor || textShadowOffset || textShadowRadius) {
30
+ const { height, width } = textShadowOffset || defaultOffset
31
+ const radius = textShadowRadius || 0
32
+ const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor')
33
+ if (color && (height !== 0 || width !== 0 || radius !== 0)) {
34
+ const blurRadius = normalizeValueWithProperty(radius)
35
+ const offsetX = normalizeValueWithProperty(width)
36
+ const offsetY = normalizeValueWithProperty(height)
37
+ style.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`
38
+ }
39
+ delete style.textShadowColor
40
+ delete style.textShadowOffset
41
+ delete style.textShadowRadius
42
+ }
43
+ }
@@ -1,4 +1,5 @@
1
1
  import { mergeIfNotShallowEqual } from '@tamagui/is-equal-shallow'
2
+ import { useRef } from 'react'
2
3
  import { getMediaState } from '../hooks/useMedia'
3
4
  import type { ComponentSetStateShallow, DisposeFn, AllGroupContexts } from '../types'
4
5
 
@@ -9,6 +10,35 @@ type SubscribeToContextGroupProps = {
9
10
  groupContext: AllGroupContexts
10
11
  }
11
12
 
13
+ export const useGroupSetRevision = (
14
+ pseudoGroups: Set<string> | undefined,
15
+ mediaGroups: Set<string> | undefined
16
+ ) => {
17
+ const previous = useRef({ pseudoGroups, mediaGroups, revision: 0 })
18
+
19
+ if (
20
+ !setsEqual(previous.current.pseudoGroups, pseudoGroups) ||
21
+ !setsEqual(previous.current.mediaGroups, mediaGroups)
22
+ ) {
23
+ previous.current = {
24
+ pseudoGroups,
25
+ mediaGroups,
26
+ revision: previous.current.revision + 1,
27
+ }
28
+ }
29
+
30
+ return previous.current.revision
31
+ }
32
+
33
+ const setsEqual = (a: Set<string> | undefined, b: Set<string> | undefined) => {
34
+ if (a === b) return true
35
+ if (!a || !b || a.size !== b.size) return false
36
+ for (const value of a) {
37
+ if (!b.has(value)) return false
38
+ }
39
+ return true
40
+ }
41
+
12
42
  export const subscribeToContextGroup = (props: SubscribeToContextGroupProps) => {
13
43
  const { pseudoGroups, mediaGroups, groupContext } = props
14
44
  if (pseudoGroups || mediaGroups) {
@@ -1,4 +1,5 @@
1
1
  import { reservedThemeProps, simpleHash } from '@tamagui/helpers'
2
+ import { platformMatches } from '@tamagui/constants'
2
3
  import {
3
4
  grammarPlatformNames,
4
5
  isRootThemeName,
@@ -12,7 +13,6 @@ import { getSetting } from '../config'
12
13
  import { createVariable, isVariable } from '../createVariable'
13
14
  import { getConfigRevisionState, type ConfigRevisionState } from './grammarConfig'
14
15
  import { themeUpdateStateKey, type ThemeUpdateLayerInfo } from './themeUpdateState'
15
- import { platformMatches } from './directStyle'
16
16
  import { findVariableToken, isUnitlessVariableKey } from './variableValue'
17
17
  import { warnOnce } from './warnOnce'
18
18
  import type {
@@ -278,6 +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
282
  const cycleDropped = getCycleDroppedKeys(props)
282
283
  const themes = props.themes as
283
284
  | Record<string, InlineValues['values'] | undefined>
@@ -1,10 +1,9 @@
1
1
  // One development warning per key, for the whole runtime.
2
2
  //
3
3
  // The set is BOUNDED rather than trusted to stay small, and that bound is what
4
- // lets a warning quote the offending value. `getCSSStylesAtomic` takes a
5
- // flattened style object from react-native-web, so a page rendering a
6
- // CMS-supplied colour can vary a refused value without limit, and keying on the
7
- // value alone would grow this set forever.
4
+ // lets a warning quote the offending value. A page rendering a CMS-supplied
5
+ // colour can vary a refused value without limit, and keying on the value alone
6
+ // would grow this set forever.
8
7
  //
9
8
  // Keying on the PROPERTY alone was the first answer to that and it was too
10
9
  // quiet: a second, different typo in the same prop said nothing, and once a
@@ -67,7 +67,7 @@ function getCachedStyleTag(styleObject: StyleObject) {
67
67
  }
68
68
 
69
69
  export function getStyleTags(styles: StyleObject[]) {
70
- if (process.env.TAMAGUI_TARGET !== 'native') {
70
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS && process.env.TAMAGUI_TARGET !== 'native') {
71
71
  if (styles.length) {
72
72
  queueStyleTagCacheClear()
73
73
  return <>{styles.map(getCachedStyleTag)}</>