@tamagui/web 1.89.26 → 1.89.27-1708112217600

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 (338) hide show
  1. package/dist/cjs/Tamagui.native.js +85 -28
  2. package/dist/cjs/Tamagui.native.js.map +3 -3
  3. package/dist/cjs/_withStableStyle.native.js +50 -5
  4. package/dist/cjs/_withStableStyle.native.js.map +3 -3
  5. package/dist/cjs/config.native.js +76 -32
  6. package/dist/cjs/config.native.js.map +3 -3
  7. package/dist/cjs/constants/accessibilityDirectMap.native.js +1 -1
  8. package/dist/cjs/constants/accessibilityDirectMap.native.js.map +3 -3
  9. package/dist/cjs/constants/constants.native.js +1 -1
  10. package/dist/cjs/constants/constants.native.js.map +3 -3
  11. package/dist/cjs/constants/isDevTools.native.js +2 -2
  12. package/dist/cjs/constants/isDevTools.native.js.map +3 -3
  13. package/dist/cjs/contexts/ComponentContext.native.js +1 -2
  14. package/dist/cjs/contexts/ComponentContext.native.js.map +3 -3
  15. package/dist/cjs/createComponent.native.js +687 -381
  16. package/dist/cjs/createComponent.native.js.map +3 -3
  17. package/dist/cjs/createFont.native.js +80 -20
  18. package/dist/cjs/createFont.native.js.map +3 -3
  19. package/dist/cjs/createShorthands.native.js.map +3 -3
  20. package/dist/cjs/createTamagui.native.js +218 -92
  21. package/dist/cjs/createTamagui.native.js.map +3 -3
  22. package/dist/cjs/createTheme.native.js +3 -1
  23. package/dist/cjs/createTheme.native.js.map +3 -3
  24. package/dist/cjs/createTokens.native.js.map +3 -3
  25. package/dist/cjs/createVariable.native.js +27 -19
  26. package/dist/cjs/createVariable.native.js.map +3 -3
  27. package/dist/cjs/createVariables.native.js +13 -16
  28. package/dist/cjs/createVariables.native.js.map +3 -3
  29. package/dist/cjs/defaultComponentState.native.js +38 -6
  30. package/dist/cjs/defaultComponentState.native.js.map +3 -3
  31. package/dist/cjs/helpers/ThemeManager.native.js +213 -85
  32. package/dist/cjs/helpers/ThemeManager.native.js.map +3 -3
  33. package/dist/cjs/helpers/ThemeManagerContext.native.js +1 -2
  34. package/dist/cjs/helpers/ThemeManagerContext.native.js.map +3 -3
  35. package/dist/cjs/helpers/createMediaStyle.native.js +26 -29
  36. package/dist/cjs/helpers/createMediaStyle.native.js.map +3 -3
  37. package/dist/cjs/helpers/createShallowSetState.native.js +29 -3
  38. package/dist/cjs/helpers/createShallowSetState.native.js.map +3 -3
  39. package/dist/cjs/helpers/createStyledContext.native.js +65 -19
  40. package/dist/cjs/helpers/createStyledContext.native.js.map +3 -3
  41. package/dist/cjs/helpers/defaultOffset.native.js +4 -1
  42. package/dist/cjs/helpers/defaultOffset.native.js.map +3 -3
  43. package/dist/cjs/helpers/expandStyle.native.js +78 -18
  44. package/dist/cjs/helpers/expandStyle.native.js.map +3 -3
  45. package/dist/cjs/helpers/expandStyles.native.js +6 -4
  46. package/dist/cjs/helpers/expandStyles.native.js.map +3 -3
  47. package/dist/cjs/helpers/getExpandedShorthands.native.js +3 -3
  48. package/dist/cjs/helpers/getExpandedShorthands.native.js.map +3 -3
  49. package/dist/cjs/helpers/getFontLanguage.native.js +3 -1
  50. package/dist/cjs/helpers/getFontLanguage.native.js.map +3 -3
  51. package/dist/cjs/helpers/getGroupPropParts.native.js +53 -4
  52. package/dist/cjs/helpers/getGroupPropParts.native.js.map +3 -3
  53. package/dist/cjs/helpers/getSplitStyles.native.js +573 -361
  54. package/dist/cjs/helpers/getSplitStyles.native.js.map +3 -3
  55. package/dist/cjs/helpers/getStylesAtomic.native.js +1 -1
  56. package/dist/cjs/helpers/getStylesAtomic.native.js.map +3 -3
  57. package/dist/cjs/helpers/getThemeCSSRules.native.js.map +3 -3
  58. package/dist/cjs/helpers/getVariantExtras.native.js +87 -20
  59. package/dist/cjs/helpers/getVariantExtras.native.js.map +3 -3
  60. package/dist/cjs/helpers/insertStyleRule.js +17 -17
  61. package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
  62. package/dist/cjs/helpers/insertStyleRule.native.js +70 -156
  63. package/dist/cjs/helpers/insertStyleRule.native.js.map +3 -3
  64. package/dist/cjs/helpers/isObj.native.js +3 -1
  65. package/dist/cjs/helpers/isObj.native.js.map +3 -3
  66. package/dist/cjs/helpers/isTamaguiComponent.native.js +1 -1
  67. package/dist/cjs/helpers/isTamaguiComponent.native.js.map +3 -3
  68. package/dist/cjs/helpers/isTamaguiElement.native.js +3 -2
  69. package/dist/cjs/helpers/isTamaguiElement.native.js.map +3 -3
  70. package/dist/cjs/helpers/log.native.js +40 -3
  71. package/dist/cjs/helpers/log.native.js.map +3 -3
  72. package/dist/cjs/helpers/matchMedia.native.js +41 -5
  73. package/dist/cjs/helpers/matchMedia.native.js.map +3 -3
  74. package/dist/cjs/helpers/mergeProps.native.js +26 -10
  75. package/dist/cjs/helpers/mergeProps.native.js.map +3 -3
  76. package/dist/cjs/helpers/mergeVariants.native.js +25 -16
  77. package/dist/cjs/helpers/mergeVariants.native.js.map +3 -3
  78. package/dist/cjs/helpers/normalizeColor.native.js +11 -12
  79. package/dist/cjs/helpers/normalizeColor.native.js.map +3 -3
  80. package/dist/cjs/helpers/normalizeShadow.native.js +3 -9
  81. package/dist/cjs/helpers/normalizeShadow.native.js.map +3 -3
  82. package/dist/cjs/helpers/normalizeStyle.native.js +12 -12
  83. package/dist/cjs/helpers/normalizeStyle.native.js.map +3 -3
  84. package/dist/cjs/helpers/normalizeStylePropKeys.native.js +1 -1
  85. package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +3 -3
  86. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +44 -13
  87. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +3 -3
  88. package/dist/cjs/helpers/objectIdentityKey.native.js +9 -6
  89. package/dist/cjs/helpers/objectIdentityKey.native.js.map +3 -3
  90. package/dist/cjs/helpers/propMapper.native.js +228 -120
  91. package/dist/cjs/helpers/propMapper.native.js.map +3 -3
  92. package/dist/cjs/helpers/proxyThemeToParents.native.js +66 -14
  93. package/dist/cjs/helpers/proxyThemeToParents.native.js.map +3 -3
  94. package/dist/cjs/helpers/proxyThemeVariables.native.js +5 -3
  95. package/dist/cjs/helpers/proxyThemeVariables.native.js.map +3 -3
  96. package/dist/cjs/helpers/pseudoDescriptors.native.js +37 -4
  97. package/dist/cjs/helpers/pseudoDescriptors.native.js.map +3 -3
  98. package/dist/cjs/helpers/registerCSSVariable.native.js +5 -3
  99. package/dist/cjs/helpers/registerCSSVariable.native.js.map +3 -3
  100. package/dist/cjs/helpers/skipProps.native.js +1 -2
  101. package/dist/cjs/helpers/skipProps.native.js.map +3 -3
  102. package/dist/cjs/helpers/themeable.native.js +78 -20
  103. package/dist/cjs/helpers/themeable.native.js.map +3 -3
  104. package/dist/cjs/helpers/themes.native.js +1 -1
  105. package/dist/cjs/helpers/themes.native.js.map +3 -3
  106. package/dist/cjs/helpers/timer.native.js +3 -3
  107. package/dist/cjs/helpers/timer.native.js.map +3 -3
  108. package/dist/cjs/helpers/transformsToString.native.js +3 -3
  109. package/dist/cjs/helpers/transformsToString.native.js.map +3 -3
  110. package/dist/cjs/hooks/useConfiguration.native.js +62 -6
  111. package/dist/cjs/hooks/useConfiguration.native.js.map +3 -3
  112. package/dist/cjs/hooks/useDisableSSR.native.js +2 -1
  113. package/dist/cjs/hooks/useDisableSSR.native.js.map +3 -3
  114. package/dist/cjs/hooks/useIsTouchDevice.native.js +3 -2
  115. package/dist/cjs/hooks/useIsTouchDevice.native.js.map +3 -3
  116. package/dist/cjs/hooks/useMedia.native.js +177 -77
  117. package/dist/cjs/hooks/useMedia.native.js.map +3 -3
  118. package/dist/cjs/hooks/useProps.native.js +98 -27
  119. package/dist/cjs/hooks/useProps.native.js.map +3 -3
  120. package/dist/cjs/hooks/useTheme.native.js +254 -157
  121. package/dist/cjs/hooks/useTheme.native.js.map +3 -3
  122. package/dist/cjs/hooks/useThemeName.native.js +54 -5
  123. package/dist/cjs/hooks/useThemeName.native.js.map +3 -3
  124. package/dist/cjs/index.native.js.map +2 -2
  125. package/dist/cjs/inject-styles.native.js +3 -3
  126. package/dist/cjs/inject-styles.native.js.map +3 -3
  127. package/dist/cjs/insertFont.native.js +20 -18
  128. package/dist/cjs/insertFont.native.js.map +3 -3
  129. package/dist/cjs/interfaces/CSSColorNames.native.js.map +2 -2
  130. package/dist/cjs/interfaces/GetRef.native.js.map +2 -2
  131. package/dist/cjs/interfaces/KeyTypes.native.js.map +2 -2
  132. package/dist/cjs/interfaces/RNExclusiveTypes.native.js.map +2 -2
  133. package/dist/cjs/interfaces/Role.native.js.map +2 -2
  134. package/dist/cjs/interfaces/TamaguiComponentEvents.native.js.map +2 -2
  135. package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js.map +2 -2
  136. package/dist/cjs/interfaces/TamaguiComponentState.native.js.map +2 -2
  137. package/dist/cjs/interfaces/WebOnlyPressEvents.native.js.map +2 -2
  138. package/dist/cjs/setupHooks.native.js +1 -1
  139. package/dist/cjs/setupHooks.native.js.map +3 -3
  140. package/dist/cjs/setupReactNative.native.js +12 -6
  141. package/dist/cjs/setupReactNative.native.js.map +3 -3
  142. package/dist/cjs/styled.native.js +74 -29
  143. package/dist/cjs/styled.native.js.map +3 -3
  144. package/dist/cjs/type-utils.native.js.map +2 -2
  145. package/dist/cjs/types.native.js.map +2 -2
  146. package/dist/cjs/views/Configuration.native.js +23 -4
  147. package/dist/cjs/views/Configuration.native.js.map +3 -3
  148. package/dist/cjs/views/FontLanguage.native.js +31 -4
  149. package/dist/cjs/views/FontLanguage.native.js.map +3 -3
  150. package/dist/cjs/views/FontLanguage.types.native.js.map +2 -2
  151. package/dist/cjs/views/Slot.native.js +80 -21
  152. package/dist/cjs/views/Slot.native.js.map +3 -3
  153. package/dist/cjs/views/Stack.native.js +1 -2
  154. package/dist/cjs/views/Stack.native.js.map +3 -3
  155. package/dist/cjs/views/TamaguiProvider.native.js +76 -20
  156. package/dist/cjs/views/TamaguiProvider.native.js.map +3 -3
  157. package/dist/cjs/views/Text.native.js +52 -15
  158. package/dist/cjs/views/Text.native.js.map +3 -3
  159. package/dist/cjs/views/Theme.native.js +78 -41
  160. package/dist/cjs/views/Theme.native.js.map +3 -3
  161. package/dist/cjs/views/ThemeDebug.native.js +2 -5
  162. package/dist/cjs/views/ThemeDebug.native.js.map +3 -3
  163. package/dist/cjs/views/ThemeProvider.native.js +18 -15
  164. package/dist/cjs/views/ThemeProvider.native.js.map +3 -3
  165. package/dist/cjs/views/View.native.js +1 -2
  166. package/dist/cjs/views/View.native.js.map +3 -3
  167. package/dist/esm/Tamagui.native.js +85 -28
  168. package/dist/esm/Tamagui.native.js.map +3 -3
  169. package/dist/esm/_withStableStyle.native.js +49 -5
  170. package/dist/esm/_withStableStyle.native.js.map +3 -3
  171. package/dist/esm/config.native.js +76 -32
  172. package/dist/esm/config.native.js.map +3 -3
  173. package/dist/esm/constants/accessibilityDirectMap.native.js +1 -1
  174. package/dist/esm/constants/accessibilityDirectMap.native.js.map +3 -3
  175. package/dist/esm/constants/constants.native.js +1 -1
  176. package/dist/esm/constants/constants.native.js.map +3 -3
  177. package/dist/esm/constants/isDevTools.native.js +2 -2
  178. package/dist/esm/constants/isDevTools.native.js.map +3 -3
  179. package/dist/esm/contexts/ComponentContext.native.js +1 -1
  180. package/dist/esm/contexts/ComponentContext.native.js.map +3 -3
  181. package/dist/esm/createComponent.native.js +689 -403
  182. package/dist/esm/createComponent.native.js.map +3 -3
  183. package/dist/esm/createFont.native.js +80 -20
  184. package/dist/esm/createFont.native.js.map +3 -3
  185. package/dist/esm/createShorthands.native.js.map +3 -3
  186. package/dist/esm/createTamagui.mjs +0 -1
  187. package/dist/esm/createTamagui.native.js +219 -97
  188. package/dist/esm/createTamagui.native.js.map +3 -3
  189. package/dist/esm/createTheme.native.js +3 -1
  190. package/dist/esm/createTheme.native.js.map +3 -3
  191. package/dist/esm/createTokens.native.js.map +3 -3
  192. package/dist/esm/createVariable.native.js +27 -19
  193. package/dist/esm/createVariable.native.js.map +3 -3
  194. package/dist/esm/createVariables.mjs +0 -1
  195. package/dist/esm/createVariables.native.js +13 -15
  196. package/dist/esm/createVariables.native.js.map +3 -3
  197. package/dist/esm/defaultComponentState.native.js +38 -6
  198. package/dist/esm/defaultComponentState.native.js.map +3 -3
  199. package/dist/esm/helpers/ThemeManager.native.js +213 -85
  200. package/dist/esm/helpers/ThemeManager.native.js.map +3 -3
  201. package/dist/esm/helpers/ThemeManagerContext.native.js +1 -1
  202. package/dist/esm/helpers/ThemeManagerContext.native.js.map +3 -3
  203. package/dist/esm/helpers/createMediaStyle.native.js +26 -28
  204. package/dist/esm/helpers/createMediaStyle.native.js.map +3 -3
  205. package/dist/esm/helpers/createShallowSetState.native.js +29 -3
  206. package/dist/esm/helpers/createShallowSetState.native.js.map +3 -3
  207. package/dist/esm/helpers/createStyledContext.native.js +55 -18
  208. package/dist/esm/helpers/createStyledContext.native.js.map +3 -3
  209. package/dist/esm/helpers/defaultOffset.native.js +4 -1
  210. package/dist/esm/helpers/defaultOffset.native.js.map +3 -3
  211. package/dist/esm/helpers/expandStyle.native.js +78 -18
  212. package/dist/esm/helpers/expandStyle.native.js.map +3 -3
  213. package/dist/esm/helpers/expandStyles.native.js +6 -4
  214. package/dist/esm/helpers/expandStyles.native.js.map +3 -3
  215. package/dist/esm/helpers/getExpandedShorthands.native.js +3 -3
  216. package/dist/esm/helpers/getExpandedShorthands.native.js.map +3 -3
  217. package/dist/esm/helpers/getFontLanguage.native.js +3 -1
  218. package/dist/esm/helpers/getFontLanguage.native.js.map +3 -3
  219. package/dist/esm/helpers/getGroupPropParts.native.js +53 -4
  220. package/dist/esm/helpers/getGroupPropParts.native.js.map +3 -3
  221. package/dist/esm/helpers/getSplitStyles.native.js +578 -392
  222. package/dist/esm/helpers/getSplitStyles.native.js.map +3 -3
  223. package/dist/esm/helpers/getStylesAtomic.native.js +1 -1
  224. package/dist/esm/helpers/getStylesAtomic.native.js.map +3 -3
  225. package/dist/esm/helpers/getThemeCSSRules.native.js.map +3 -3
  226. package/dist/esm/helpers/getVariantExtras.native.js +87 -20
  227. package/dist/esm/helpers/getVariantExtras.native.js.map +3 -3
  228. package/dist/esm/helpers/insertStyleRule.js +17 -17
  229. package/dist/esm/helpers/insertStyleRule.js.map +1 -1
  230. package/dist/esm/helpers/insertStyleRule.mjs +14 -13
  231. package/dist/esm/helpers/insertStyleRule.native.js +70 -156
  232. package/dist/esm/helpers/insertStyleRule.native.js.map +3 -3
  233. package/dist/esm/helpers/isObj.native.js +3 -1
  234. package/dist/esm/helpers/isObj.native.js.map +3 -3
  235. package/dist/esm/helpers/isTamaguiComponent.native.js +1 -1
  236. package/dist/esm/helpers/isTamaguiComponent.native.js.map +3 -3
  237. package/dist/esm/helpers/isTamaguiElement.native.js +3 -1
  238. package/dist/esm/helpers/isTamaguiElement.native.js.map +3 -3
  239. package/dist/esm/helpers/log.native.js +40 -3
  240. package/dist/esm/helpers/log.native.js.map +3 -3
  241. package/dist/esm/helpers/matchMedia.native.js +41 -5
  242. package/dist/esm/helpers/matchMedia.native.js.map +3 -3
  243. package/dist/esm/helpers/mergeProps.native.js +26 -10
  244. package/dist/esm/helpers/mergeProps.native.js.map +3 -3
  245. package/dist/esm/helpers/mergeVariants.native.js +25 -16
  246. package/dist/esm/helpers/mergeVariants.native.js.map +3 -3
  247. package/dist/esm/helpers/normalizeColor.native.js +11 -11
  248. package/dist/esm/helpers/normalizeColor.native.js.map +3 -3
  249. package/dist/esm/helpers/normalizeShadow.native.js +3 -9
  250. package/dist/esm/helpers/normalizeShadow.native.js.map +3 -3
  251. package/dist/esm/helpers/normalizeStyle.native.js +12 -12
  252. package/dist/esm/helpers/normalizeStyle.native.js.map +3 -3
  253. package/dist/esm/helpers/normalizeStylePropKeys.native.js +1 -1
  254. package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +3 -3
  255. package/dist/esm/helpers/normalizeValueWithProperty.native.js +44 -13
  256. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +3 -3
  257. package/dist/esm/helpers/objectIdentityKey.native.js +9 -6
  258. package/dist/esm/helpers/objectIdentityKey.native.js.map +3 -3
  259. package/dist/esm/helpers/propMapper.native.js +228 -120
  260. package/dist/esm/helpers/propMapper.native.js.map +3 -3
  261. package/dist/esm/helpers/proxyThemeToParents.native.js +66 -13
  262. package/dist/esm/helpers/proxyThemeToParents.native.js.map +3 -3
  263. package/dist/esm/helpers/proxyThemeVariables.native.js +5 -3
  264. package/dist/esm/helpers/proxyThemeVariables.native.js.map +3 -3
  265. package/dist/esm/helpers/pseudoDescriptors.native.js +37 -4
  266. package/dist/esm/helpers/pseudoDescriptors.native.js.map +3 -3
  267. package/dist/esm/helpers/registerCSSVariable.native.js +5 -2
  268. package/dist/esm/helpers/registerCSSVariable.native.js.map +3 -3
  269. package/dist/esm/helpers/skipProps.native.js +1 -2
  270. package/dist/esm/helpers/skipProps.native.js.map +3 -3
  271. package/dist/esm/helpers/themeable.native.js +76 -19
  272. package/dist/esm/helpers/themeable.native.js.map +3 -3
  273. package/dist/esm/helpers/themes.native.js +1 -1
  274. package/dist/esm/helpers/themes.native.js.map +3 -3
  275. package/dist/esm/helpers/timer.native.js +3 -3
  276. package/dist/esm/helpers/timer.native.js.map +3 -3
  277. package/dist/esm/helpers/transformsToString.native.js +3 -3
  278. package/dist/esm/helpers/transformsToString.native.js.map +3 -3
  279. package/dist/esm/hooks/useConfiguration.native.js +62 -6
  280. package/dist/esm/hooks/useConfiguration.native.js.map +3 -3
  281. package/dist/esm/hooks/useDisableSSR.native.js +2 -1
  282. package/dist/esm/hooks/useDisableSSR.native.js.map +3 -3
  283. package/dist/esm/hooks/useIsTouchDevice.native.js +3 -1
  284. package/dist/esm/hooks/useIsTouchDevice.native.js.map +3 -3
  285. package/dist/esm/hooks/useMedia.native.js +177 -77
  286. package/dist/esm/hooks/useMedia.native.js.map +3 -3
  287. package/dist/esm/hooks/useProps.native.js +98 -27
  288. package/dist/esm/hooks/useProps.native.js.map +3 -3
  289. package/dist/esm/hooks/useTheme.native.js +254 -157
  290. package/dist/esm/hooks/useTheme.native.js.map +3 -3
  291. package/dist/esm/hooks/useThemeName.native.js +54 -5
  292. package/dist/esm/hooks/useThemeName.native.js.map +3 -3
  293. package/dist/esm/index.native.js +2 -18
  294. package/dist/esm/index.native.js.map +3 -3
  295. package/dist/esm/inject-styles.native.js +3 -3
  296. package/dist/esm/inject-styles.native.js.map +3 -3
  297. package/dist/esm/insertFont.native.js +20 -18
  298. package/dist/esm/insertFont.native.js.map +3 -3
  299. package/dist/esm/setupHooks.native.js +1 -1
  300. package/dist/esm/setupHooks.native.js.map +3 -3
  301. package/dist/esm/setupReactNative.native.js +12 -6
  302. package/dist/esm/setupReactNative.native.js.map +3 -3
  303. package/dist/esm/styled.native.js +74 -29
  304. package/dist/esm/styled.native.js.map +3 -3
  305. package/dist/esm/types.native.js.map +1 -1
  306. package/dist/esm/views/Configuration.native.js +22 -4
  307. package/dist/esm/views/Configuration.native.js.map +3 -3
  308. package/dist/esm/views/FontLanguage.native.js +30 -4
  309. package/dist/esm/views/FontLanguage.native.js.map +3 -3
  310. package/dist/esm/views/Slot.native.js +79 -21
  311. package/dist/esm/views/Slot.native.js.map +3 -3
  312. package/dist/esm/views/Stack.native.js +1 -1
  313. package/dist/esm/views/Stack.native.js.map +3 -3
  314. package/dist/esm/views/TamaguiProvider.native.js +75 -20
  315. package/dist/esm/views/TamaguiProvider.native.js.map +3 -3
  316. package/dist/esm/views/Text.native.js +52 -15
  317. package/dist/esm/views/Text.native.js.map +3 -3
  318. package/dist/esm/views/Theme.native.js +77 -41
  319. package/dist/esm/views/Theme.native.js.map +3 -3
  320. package/dist/esm/views/ThemeDebug.native.js +2 -5
  321. package/dist/esm/views/ThemeDebug.native.js.map +3 -3
  322. package/dist/esm/views/ThemeProvider.native.js +18 -15
  323. package/dist/esm/views/ThemeProvider.native.js.map +3 -3
  324. package/dist/esm/views/View.native.js +1 -1
  325. package/dist/esm/views/View.native.js.map +3 -3
  326. package/package.json +11 -11
  327. package/src/helpers/getSplitStyles.tsx +1 -1
  328. package/src/helpers/insertStyleRule.tsx +62 -59
  329. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  330. package/dist/cjs/internalWithTheme.js +0 -25
  331. package/dist/cjs/internalWithTheme.js.map +0 -6
  332. package/dist/cjs/internalWithTheme.native.js +0 -30
  333. package/dist/cjs/internalWithTheme.native.js.map +0 -6
  334. package/dist/esm/internalWithTheme.js +0 -10
  335. package/dist/esm/internalWithTheme.js.map +0 -6
  336. package/dist/esm/internalWithTheme.mjs +0 -14
  337. package/dist/esm/internalWithTheme.native.js +0 -10
  338. package/dist/esm/internalWithTheme.native.js.map +0 -6
@@ -30,162 +30,459 @@ __export(createComponent_exports, {
30
30
  spacedChildren: () => spacedChildren
31
31
  });
32
32
  module.exports = __toCommonJS(createComponent_exports);
33
- var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr"), import_react = __toESM(require("react")), import_config = require("./config"), import_constants2 = require("./constants/constants"), import_ComponentContext = require("./contexts/ComponentContext"), import_createVariable = require("./createVariable"), import_defaultComponentState = require("./defaultComponentState"), import_createShallowSetState = require("./helpers/createShallowSetState"), import_getSplitStyles = require("./helpers/getSplitStyles"), import_isObj = require("./helpers/isObj"), import_log = require("./helpers/log"), import_mergeProps = require("./helpers/mergeProps"), import_themeable = require("./helpers/themeable"), import_useMedia = require("./hooks/useMedia"), import_useTheme = require("./hooks/useTheme"), import_setupHooks = require("./setupHooks"), import_Slot = require("./views/Slot"), import_Theme = require("./views/Theme"), import_ThemeDebug = require("./views/ThemeDebug"), import_jsx_runtime = require("react/jsx-runtime");
34
- let tamaguiConfig, time, debugKeyListeners, startVisualizer;
35
- const mouseUps = /* @__PURE__ */ new Set();
33
+ var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr"), import_react = __toESM(require("react")), import_config = require("./config"), import_constants2 = require("./constants/constants"), import_ComponentContext = require("./contexts/ComponentContext"), import_createVariable = require("./createVariable"), import_defaultComponentState = require("./defaultComponentState"), import_createShallowSetState = require("./helpers/createShallowSetState"), import_getSplitStyles = require("./helpers/getSplitStyles"), import_isObj = require("./helpers/isObj"), import_log = require("./helpers/log"), import_mergeProps = require("./helpers/mergeProps"), import_themeable = require("./helpers/themeable"), import_useMedia = require("./hooks/useMedia"), import_useTheme = require("./hooks/useTheme"), import_setupHooks = require("./setupHooks"), import_Slot = require("./views/Slot"), import_Theme = require("./views/Theme"), import_ThemeDebug = require("./views/ThemeDebug");
34
+ function _array_like_to_array(arr, len) {
35
+ (len == null || len > arr.length) && (len = arr.length);
36
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
37
+ arr2[i] = arr[i];
38
+ return arr2;
39
+ }
40
+ function _array_with_holes(arr) {
41
+ if (Array.isArray(arr))
42
+ return arr;
43
+ }
44
+ function _array_without_holes(arr) {
45
+ if (Array.isArray(arr))
46
+ return _array_like_to_array(arr);
47
+ }
48
+ function _define_property(obj, key, value) {
49
+ return key in obj ? Object.defineProperty(obj, key, {
50
+ value,
51
+ enumerable: !0,
52
+ configurable: !0,
53
+ writable: !0
54
+ }) : obj[key] = value, obj;
55
+ }
56
+ function _iterable_to_array(iter) {
57
+ if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
58
+ return Array.from(iter);
59
+ }
60
+ function _iterable_to_array_limit(arr, i) {
61
+ var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
62
+ if (_i != null) {
63
+ var _arr = [], _n = !0, _d = !1, _s, _e;
64
+ try {
65
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
66
+ ;
67
+ } catch (err) {
68
+ _d = !0, _e = err;
69
+ } finally {
70
+ try {
71
+ !_n && _i.return != null && _i.return();
72
+ } finally {
73
+ if (_d)
74
+ throw _e;
75
+ }
76
+ }
77
+ return _arr;
78
+ }
79
+ }
80
+ function _non_iterable_rest() {
81
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
82
+ }
83
+ function _non_iterable_spread() {
84
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85
+ }
86
+ function _object_spread(target) {
87
+ for (var i = 1; i < arguments.length; i++) {
88
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
89
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
90
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
91
+ }))), ownKeys2.forEach(function(key) {
92
+ _define_property(target, key, source[key]);
93
+ });
94
+ }
95
+ return target;
96
+ }
97
+ function ownKeys(object, enumerableOnly) {
98
+ var keys = Object.keys(object);
99
+ if (Object.getOwnPropertySymbols) {
100
+ var symbols = Object.getOwnPropertySymbols(object);
101
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
102
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
103
+ })), keys.push.apply(keys, symbols);
104
+ }
105
+ return keys;
106
+ }
107
+ function _object_spread_props(target, source) {
108
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
109
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
110
+ }), target;
111
+ }
112
+ function _object_without_properties(source, excluded) {
113
+ if (source == null)
114
+ return {};
115
+ var target = _object_without_properties_loose(source, excluded), key, i;
116
+ if (Object.getOwnPropertySymbols) {
117
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
118
+ for (i = 0; i < sourceSymbolKeys.length; i++)
119
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
120
+ }
121
+ return target;
122
+ }
123
+ function _object_without_properties_loose(source, excluded) {
124
+ if (source == null)
125
+ return {};
126
+ var target = {}, sourceKeys = Object.keys(source), key, i;
127
+ for (i = 0; i < sourceKeys.length; i++)
128
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
129
+ return target;
130
+ }
131
+ function _sliced_to_array(arr, i) {
132
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
133
+ }
134
+ function _tagged_template_literal(strings, raw) {
135
+ return raw || (raw = strings.slice(0)), Object.freeze(Object.defineProperties(strings, {
136
+ raw: {
137
+ value: Object.freeze(raw)
138
+ }
139
+ }));
140
+ }
141
+ function _to_consumable_array(arr) {
142
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
143
+ }
144
+ function _unsupported_iterable_to_array(o, minLen) {
145
+ if (o) {
146
+ if (typeof o == "string")
147
+ return _array_like_to_array(o, minLen);
148
+ var n = Object.prototype.toString.call(o).slice(8, -1);
149
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
150
+ return Array.from(n);
151
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
152
+ return _array_like_to_array(o, minLen);
153
+ }
154
+ }
155
+ function _templateObject() {
156
+ var data = _tagged_template_literal([
157
+ "start (ignore)"
158
+ ]);
159
+ return _templateObject = function() {
160
+ return data;
161
+ }, data;
162
+ }
163
+ function _templateObject1() {
164
+ var data = _tagged_template_literal([
165
+ "did-finish-ssr"
166
+ ]);
167
+ return _templateObject1 = function() {
168
+ return data;
169
+ }, data;
170
+ }
171
+ function _templateObject2() {
172
+ var data = _tagged_template_literal([
173
+ "stateref"
174
+ ]);
175
+ return _templateObject2 = function() {
176
+ return data;
177
+ }, data;
178
+ }
179
+ function _templateObject3() {
180
+ var data = _tagged_template_literal([
181
+ "pre-use-state"
182
+ ]);
183
+ return _templateObject3 = function() {
184
+ return data;
185
+ }, data;
186
+ }
187
+ function _templateObject4() {
188
+ var data = _tagged_template_literal([
189
+ "use-state"
190
+ ]);
191
+ return _templateObject4 = function() {
192
+ return data;
193
+ }, data;
194
+ }
195
+ function _templateObject5() {
196
+ var data = _tagged_template_literal([
197
+ "use-context"
198
+ ]);
199
+ return _templateObject5 = function() {
200
+ return data;
201
+ }, data;
202
+ }
203
+ function _templateObject6() {
204
+ var data = _tagged_template_literal([
205
+ "theme-props"
206
+ ]);
207
+ return _templateObject6 = function() {
208
+ return data;
209
+ }, data;
210
+ }
211
+ function _templateObject7() {
212
+ var data = _tagged_template_literal([
213
+ "pre-theme-media"
214
+ ]);
215
+ return _templateObject7 = function() {
216
+ return data;
217
+ }, data;
218
+ }
219
+ function _templateObject8() {
220
+ var data = _tagged_template_literal([
221
+ "theme"
222
+ ]);
223
+ return _templateObject8 = function() {
224
+ return data;
225
+ }, data;
226
+ }
227
+ function _templateObject9() {
228
+ var data = _tagged_template_literal([
229
+ "media"
230
+ ]);
231
+ return _templateObject9 = function() {
232
+ return data;
233
+ }, data;
234
+ }
235
+ function _templateObject10() {
236
+ var data = _tagged_template_literal([
237
+ "split-styles"
238
+ ]);
239
+ return _templateObject10 = function() {
240
+ return data;
241
+ }, data;
242
+ }
243
+ function _templateObject11() {
244
+ var data = _tagged_template_literal([
245
+ "animations"
246
+ ]);
247
+ return _templateObject11 = function() {
248
+ return data;
249
+ }, data;
250
+ }
251
+ function _templateObject12() {
252
+ var data = _tagged_template_literal([
253
+ "destructure"
254
+ ]);
255
+ return _templateObject12 = function() {
256
+ return data;
257
+ }, data;
258
+ }
259
+ function _templateObject13() {
260
+ var data = _tagged_template_literal([
261
+ "events-hooks"
262
+ ]);
263
+ return _templateObject13 = function() {
264
+ return data;
265
+ }, data;
266
+ }
267
+ function _templateObject14() {
268
+ var data = _tagged_template_literal([
269
+ "events-setup"
270
+ ]);
271
+ return _templateObject14 = function() {
272
+ return data;
273
+ }, data;
274
+ }
275
+ function _templateObject15() {
276
+ var data = _tagged_template_literal([
277
+ "events"
278
+ ]);
279
+ return _templateObject15 = function() {
280
+ return data;
281
+ }, data;
282
+ }
283
+ function _templateObject16() {
284
+ var data = _tagged_template_literal([
285
+ "hooks"
286
+ ]);
287
+ return _templateObject16 = function() {
288
+ return data;
289
+ }, data;
290
+ }
291
+ function _templateObject17() {
292
+ var data = _tagged_template_literal([
293
+ "spaced-as-child"
294
+ ]);
295
+ return _templateObject17 = function() {
296
+ return data;
297
+ }, data;
298
+ }
299
+ function _templateObject18() {
300
+ var data = _tagged_template_literal([
301
+ "create-element"
302
+ ]);
303
+ return _templateObject18 = function() {
304
+ return data;
305
+ }, data;
306
+ }
307
+ function _templateObject19() {
308
+ var data = _tagged_template_literal([
309
+ "group-context"
310
+ ]);
311
+ return _templateObject19 = function() {
312
+ return data;
313
+ }, data;
314
+ }
315
+ function _templateObject20() {
316
+ var data = _tagged_template_literal([
317
+ "themed-children"
318
+ ]);
319
+ return _templateObject20 = function() {
320
+ return data;
321
+ }, data;
322
+ }
323
+ function _templateObject21() {
324
+ var data = _tagged_template_literal([
325
+ "rest"
326
+ ]);
327
+ return _templateObject21 = function() {
328
+ return data;
329
+ }, data;
330
+ }
331
+ var tamaguiConfig, time, debugKeyListeners, startVisualizer, mouseUps = /* @__PURE__ */ new Set();
36
332
  if (typeof document < "u") {
37
- const cancelTouches = () => {
38
- mouseUps.forEach((x) => x()), mouseUps.clear();
333
+ var cancelTouches = function() {
334
+ mouseUps.forEach(function(x) {
335
+ return x();
336
+ }), mouseUps.clear();
39
337
  };
40
- addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = () => {
41
- var _a;
42
- const devVisualizerConfig = (_a = import_config.devConfig) == null ? void 0 : _a.visualizer;
338
+ addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = function() {
339
+ var devVisualizerConfig = import_config.devConfig === null || import_config.devConfig === void 0 ? void 0 : import_config.devConfig.visualizer;
43
340
  if (devVisualizerConfig) {
44
341
  debugKeyListeners = /* @__PURE__ */ new Set();
45
- let tm, isShowing = !1;
46
- const options = {
342
+ var tm, isShowing = !1, options = _object_spread({
47
343
  key: "Alt",
48
- delay: 800,
49
- ...typeof devVisualizerConfig == "object" ? devVisualizerConfig : {}
50
- };
51
- document.addEventListener("blur", () => {
344
+ delay: 800
345
+ }, typeof devVisualizerConfig == "object" ? devVisualizerConfig : {});
346
+ document.addEventListener("blur", function() {
52
347
  clearTimeout(tm);
53
- }), document.addEventListener("keydown", ({ key, defaultPrevented }) => {
54
- defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(() => {
55
- isShowing = !0, debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!0));
348
+ }), document.addEventListener("keydown", function(param) {
349
+ var key = param.key, defaultPrevented = param.defaultPrevented;
350
+ defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(function() {
351
+ isShowing = !0, debugKeyListeners == null || debugKeyListeners.forEach(function(l) {
352
+ return l(!0);
353
+ });
56
354
  }, options.delay)));
57
- }), document.addEventListener("keyup", ({ key, defaultPrevented }) => {
58
- defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && (debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!1))));
355
+ }), document.addEventListener("keyup", function(param) {
356
+ var key = param.key, defaultPrevented = param.defaultPrevented;
357
+ defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && (debugKeyListeners == null || debugKeyListeners.forEach(function(l) {
358
+ return l(!1);
359
+ })));
59
360
  });
60
361
  }
61
362
  });
62
363
  }
63
- let BaseText, BaseView, hasSetupBaseViews = !1;
364
+ var BaseText, BaseView, hasSetupBaseViews = !1;
64
365
  function createComponent(staticConfig) {
65
- var _a;
66
- const { componentName } = staticConfig;
67
- let config = null, defaultProps = staticConfig.defaultProps;
68
- (0, import_config.onConfiguredOnce)((conf) => {
69
- var _a2;
366
+ var _staticConfig_defaultProps, componentName = staticConfig.componentName, config = null, defaultProps = staticConfig.defaultProps;
367
+ (0, import_config.onConfiguredOnce)(function(conf) {
70
368
  if (config = conf, componentName) {
71
- const defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[componentName];
72
- defaultForComponent && (defaultProps = { ...defaultForComponent, ...defaultProps });
369
+ var _conf_defaultProps, defaultForComponent = (_conf_defaultProps = conf.defaultProps) === null || _conf_defaultProps === void 0 ? void 0 : _conf_defaultProps[componentName];
370
+ defaultForComponent && (defaultProps = _object_spread({}, defaultForComponent, defaultProps));
73
371
  }
74
372
  });
75
- const {
76
- Component,
77
- isText,
78
- isInput,
79
- isZStack,
80
- isHOC,
81
- validStyles: validStyles2 = {},
82
- variants = {}
83
- } = staticConfig;
84
- process.env.NODE_ENV === "development" && ((_a = staticConfig.defaultProps) != null && _a.debug) && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${componentName || "Component"}]`, {
373
+ var Component = staticConfig.Component, isText = staticConfig.isText, isInput = staticConfig.isInput, isZStack = staticConfig.isZStack, isHOC = staticConfig.isHOC, _staticConfig_validStyles = staticConfig.validStyles, _$validStyles = _staticConfig_validStyles === void 0 ? {} : _staticConfig_validStyles, _staticConfig_variants = staticConfig.variants, variants = _staticConfig_variants === void 0 ? {} : _staticConfig_variants;
374
+ process.env.NODE_ENV === "development" && (!((_staticConfig_defaultProps = staticConfig.defaultProps) === null || _staticConfig_defaultProps === void 0) && _staticConfig_defaultProps.debug) && process.env.IS_STATIC !== "is_static" && (0, import_log.log)("\u{1F41B} [".concat(componentName || "Component", "]"), {
85
375
  staticConfig,
86
376
  defaultProps,
87
377
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
88
378
  });
89
- const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
90
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
91
- const internalID = process.env.NODE_ENV === "development" ? (0, import_react.useId)() : "";
379
+ var component = /* @__PURE__ */ (0, import_react.forwardRef)(function(propsIn, forwardedRef) {
380
+ var _animationsConfig_usePresence, _props_accessibilityState, _themeState_state, _props_accessibilityState1, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? (0, import_react.useId)() : "";
92
381
  if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
382
+ var _hooks_getBaseViews;
93
383
  hasSetupBaseViews = !0;
94
- const baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
384
+ var baseViews = (_hooks_getBaseViews = import_setupHooks.hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(import_setupHooks.hooks);
95
385
  baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
96
386
  }
97
- process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && ((_c = propsIn["data-test-renders"]).current ?? (_c.current = 0), propsIn["data-test-renders"].current += 1);
98
- const componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext);
99
- let styledContextProps, overriddenContextProps, contextValue;
100
- const { context } = staticConfig;
387
+ if (process.env.NODE_ENV === "test" && propsIn["data-test-renders"]) {
388
+ var _propsIn_datatestrenders, _current, _;
389
+ (_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
390
+ }
391
+ var componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, context = staticConfig.context;
101
392
  if (context) {
102
393
  contextValue = (0, import_react.useContext)(context);
103
- const { inverseShorthands } = (0, import_config.getConfig)();
104
- for (const key in context.props) {
105
- const propVal = (
106
- // because its after default props but before props this annoying amount of checks
107
- propsIn[key] ?? propsIn[inverseShorthands[key]] ?? (defaultProps == null ? void 0 : defaultProps[key]) ?? (defaultProps == null ? void 0 : defaultProps[inverseShorthands[key]])
108
- );
109
- propVal === void 0 ? contextValue && (key in validStyles2 || key in variants) && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]) : (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal);
394
+ var inverseShorthands = (0, import_config.getConfig)().inverseShorthands;
395
+ for (var key in context.props) {
396
+ var _propsIn_key, _ref, _ref1, propVal = (_ref1 = (_ref = (_propsIn_key = propsIn[key]) !== null && _propsIn_key !== void 0 ? _propsIn_key : propsIn[inverseShorthands[key]]) !== null && _ref !== void 0 ? _ref : defaultProps == null ? void 0 : defaultProps[key]) !== null && _ref1 !== void 0 ? _ref1 : defaultProps == null ? void 0 : defaultProps[inverseShorthands[key]];
397
+ if (propVal === void 0) {
398
+ if (contextValue) {
399
+ var isValidValue = key in _$validStyles || key in variants;
400
+ isValidValue && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]);
401
+ }
402
+ } else
403
+ overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal;
110
404
  }
111
405
  }
112
- const curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps;
113
- let props = propsIn;
406
+ var curDefaultProps = styledContextProps ? _object_spread({}, defaultProps, styledContextProps) : defaultProps, props = propsIn;
114
407
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
115
- const debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
116
- process.env.NODE_ENV === "development" && import_constants.isClient && (0, import_react.useEffect)(() => {
117
- let overlay = null;
118
- const debugVisualizerHandler = (show = !1) => {
119
- const node = curState.host;
408
+ var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
409
+ if (process.env.NODE_ENV === "development" && import_constants.isClient && (0, import_react.useEffect)(function() {
410
+ var overlay = null, debugVisualizerHandler = function() {
411
+ var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curState.host;
120
412
  if (node)
121
413
  if (show) {
122
414
  overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
123
- const dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
124
- tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.style.webkitFontSmoothing = "none", tooltip.innerText = `${componentName2 || ""} ${dataAt} ${dataIn}`.trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
415
+ var dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
416
+ tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.style.webkitFontSmoothing = "none", tooltip.innerText = "".concat(componentName2 || "", " ").concat(dataAt, " ").concat(dataIn).trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
125
417
  } else
126
418
  overlay && node.removeChild(overlay);
127
419
  };
128
- return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */ new Set()), debugKeyListeners.add(debugVisualizerHandler), () => {
420
+ return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */ new Set()), debugKeyListeners.add(debugVisualizerHandler), function() {
129
421
  debugKeyListeners == null || debugKeyListeners.delete(debugVisualizerHandler);
130
422
  };
131
- }, [componentName2]), !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time && (time = require("@tamagui/timer").timer().start()), process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
132
- const stateRef = (0, import_react.useRef)({});
133
- process.env.NODE_ENV === "development" && time && time`stateref`;
134
- const animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, curState = stateRef.current, willBeAnimatedClient = !!(!!(hasAnimationProp && !isHOC && useAnimations) || curState.hasAnimated), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
423
+ }, [
424
+ componentName2
425
+ ]), !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
426
+ var timer = require("@tamagui/timer").timer();
427
+ time = timer.start();
428
+ }
429
+ process.env.NODE_ENV === "development" && time && time(_templateObject()), process.env.NODE_ENV === "development" && time && time(_templateObject1());
430
+ var stateRef = (0, import_react.useRef)({});
431
+ process.env.NODE_ENV === "development" && time && time(_templateObject2());
432
+ var animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, curState = stateRef.current, willBeAnimatedClient = function() {
433
+ var next = !!(hasAnimationProp && !isHOC && useAnimations);
434
+ return !!(next || curState.hasAnimated);
435
+ }(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
135
436
  willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
136
- const isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && ((_d = animationsConfig == null ? void 0 : animationsConfig.usePresence) == null ? void 0 : _d.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative;
137
- let isAnimated = willBeAnimated;
138
- !isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time`pre-use-state`;
139
- const hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = props.forceStyle ? { ...states[0], [props.forceStyle]: !0 } : states[0], setState = states[1];
140
- let setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, debugProp);
437
+ var isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && (animationsConfig == null || (_animationsConfig_usePresence = animationsConfig.usePresence) === null || _animationsConfig_usePresence === void 0 ? void 0 : _animationsConfig_usePresence.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative, isAnimated = willBeAnimated;
438
+ !isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time(_templateObject3());
439
+ var hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = props.forceStyle ? _object_spread_props(_object_spread({}, states[0]), _define_property({}, props.forceStyle, !0)) : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, debugProp);
141
440
  if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
142
- process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
143
- const { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
441
+ process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn("has presenceState ".concat(JSON.stringify(presenceState)));
442
+ var enterVariant = presenceState.enterVariant, exitVariant = presenceState.exitVariant, enterExitVariant = presenceState.enterExitVariant, custom = presenceState.custom;
144
443
  (0, import_isObj.isObj)(custom) && Object.assign(props, custom);
145
- const exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
146
- state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
444
+ var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
445
+ state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn('Animating presence ENTER "'.concat(env, '"')), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn('Animating presence EXIT "'.concat(exv, '"')), props[exv] = exitVariant !== enterExitVariant);
147
446
  }
148
- const shouldAvoidClasses = !!(!import_constants.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
447
+ var shouldAvoidClasses = !!(!import_constants.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
149
448
  // disableClassName="until-hydrated" to be more straightforward
150
449
  // see issue if not, Button sets disableClassName to true <Button animation="" /> with
151
450
  // the react-native driver errors because it tries to animate var(--color) to rbga(..)
152
451
  propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
153
452
  if (groupName && !curState.group) {
154
- const listeners = /* @__PURE__ */ new Set();
453
+ var listeners = /* @__PURE__ */ new Set();
155
454
  curState.group = {
156
455
  listeners,
157
- emit(name, state2) {
158
- listeners.forEach((l) => l(name, state2));
456
+ emit: function(name2, state2) {
457
+ listeners.forEach(function(l) {
458
+ return l(name2, state2);
459
+ });
159
460
  },
160
- subscribe(cb) {
161
- return listeners.add(cb), () => {
461
+ subscribe: function(cb) {
462
+ return listeners.add(cb), function() {
162
463
  listeners.delete(cb);
163
464
  };
164
465
  }
165
466
  };
166
467
  }
167
468
  if (groupName) {
168
- const groupContextState = componentContext.groups.state, og = setStateShallow;
169
- setStateShallow = (state2) => {
469
+ var groupContextState = componentContext.groups.state, og = setStateShallow;
470
+ setStateShallow = function(state2) {
170
471
  og(state2), curState.group.emit(groupName, {
171
472
  pseudo: state2
172
473
  });
173
- const next = {
174
- ...groupContextState[groupName],
175
- ...state2
176
- };
474
+ var next = _object_spread({}, groupContextState[groupName], state2);
177
475
  groupContextState[groupName] = next;
178
476
  };
179
477
  }
180
- process.env.NODE_ENV === "development" && time && time`use-state`;
181
- const hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled);
182
- process.env.NODE_ENV === "development" && time && time`use-context`;
183
- const element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component;
184
- let elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
478
+ process.env.NODE_ENV === "development" && time && time(_templateObject4());
479
+ var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), _props_disabled, isDisabled = (_props_disabled = props.disabled) !== null && _props_disabled !== void 0 ? _props_disabled : (_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled;
480
+ process.env.NODE_ENV === "development" && time && time(_templateObject5());
481
+ var isTaggable = !Component || typeof Component == "string", element = import_constants.isWeb && isTaggable && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
185
482
  animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
186
- const disableTheme = !1 || isHOC;
187
- process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (curState.themeShallow = !0);
188
- const themeStateProps = {
483
+ var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
484
+ process.env.NODE_ENV === "development" && time && time(_templateObject6()), props.themeShallow && (curState.themeShallow = !0);
485
+ var themeStateProps = {
189
486
  name: props.theme,
190
487
  componentName: componentName2,
191
488
  disable: disableTheme,
@@ -193,28 +490,46 @@ function createComponent(staticConfig) {
193
490
  inverse: props.themeInverse,
194
491
  debug: debugProp
195
492
  };
196
- if (typeof curState.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
197
- const name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : "") + (isAnimated ? "(animated)" : "") + (isReactNative ? "(rnw)" : "") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
198
- if (console.info(
199
- `%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`,
200
- "background: green; color: white;"
201
- ), import_constants.isServer)
202
- (0, import_log.log)({ noClassNames, isAnimated, shouldAvoidClasses, isWeb: import_constants.isWeb, supportsCSSVars });
493
+ if (typeof curState.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = function() {
494
+ return stateRef.current.isListeningToTheme;
495
+ }), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
496
+ var name = "".concat(componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"), type = (hasEnterStyle ? "(hasEnter)" : "") + (isAnimated ? "(animated)" : "") + (isReactNative ? "(rnw)" : "") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = "".concat(internalID, " ").concat(name).concat(dataIs ? " ".concat(dataIs) : "", " ").concat(type);
497
+ if (console.info("%c ".concat(banner, " (hydrated: ").concat(isHydrated, ") (unmounted: ").concat(state.unmounted, ")"), "background: green; color: white;"), import_constants.isServer)
498
+ (0, import_log.log)({
499
+ noClassNames,
500
+ isAnimated,
501
+ shouldAvoidClasses,
502
+ isWeb: import_constants.isWeb,
503
+ supportsCSSVars
504
+ });
203
505
  else {
204
506
  console.groupEnd();
205
- const stateLog = `${`${state.press || state.pressIn ? " PRESS " : ""}`}${state.hover ? " HOVER " : ""}${state.focus ? " FOCUS" : " "}`, ch = propsIn.children;
206
- let childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
207
- childLog.length && (childLog = `(children: ${childLog})`), console.groupCollapsed(`${childLog}${stateLog}Props:`), (0, import_log.log)("props in:", propsIn), (0, import_log.log)("final props:", props), (0, import_log.log)({ state, staticConfig, elementType, themeStateProps }), (0, import_log.log)({ contextProps: styledContextProps, overriddenContextProps }), (0, import_log.log)({ presence, isAnimated, isHOC, hasAnimationProp, useAnimations }), console.groupEnd();
507
+ var pressLog = "".concat(state.press || state.pressIn ? " PRESS " : ""), stateLog = "".concat(pressLog).concat(state.hover ? " HOVER " : "").concat(state.focus ? " FOCUS" : " "), ch = propsIn.children, childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
508
+ childLog.length && (childLog = "(children: ".concat(childLog, ")")), console.groupCollapsed("".concat(childLog).concat(stateLog, "Props:")), (0, import_log.log)("props in:", propsIn), (0, import_log.log)("final props:", props), (0, import_log.log)({
509
+ state,
510
+ staticConfig,
511
+ elementType,
512
+ themeStateProps
513
+ }), (0, import_log.log)({
514
+ contextProps: styledContextProps,
515
+ overriddenContextProps
516
+ }), (0, import_log.log)({
517
+ presence,
518
+ isAnimated,
519
+ isHOC,
520
+ hasAnimationProp,
521
+ useAnimations
522
+ }), console.groupEnd();
208
523
  }
209
524
  }
210
- process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
211
- const [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
525
+ process.env.NODE_ENV === "development" && time && time(_templateObject7());
526
+ var _useThemeWithState = _sliced_to_array((0, import_useTheme.useThemeWithState)(themeStateProps), 2), themeState = _useThemeWithState[0], theme = _useThemeWithState[1];
212
527
  elementType = Component || elementType;
213
- const isStringElement = typeof elementType == "string";
214
- process.env.NODE_ENV === "development" && time && time`theme`;
215
- const mediaState = (0, import_useMedia.useMedia)(stateRef, componentContext);
216
- (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
217
- const resolveValues = (
528
+ var isStringElement = typeof elementType == "string";
529
+ process.env.NODE_ENV === "development" && time && time(_templateObject8());
530
+ var mediaState = (0, import_useMedia.useMedia)(stateRef, componentContext);
531
+ (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time(_templateObject9());
532
+ var resolveValues = (
218
533
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
219
534
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
220
535
  ), styleProps = {
@@ -223,206 +538,186 @@ function createComponent(staticConfig) {
223
538
  resolveValues,
224
539
  isExiting,
225
540
  isAnimated
226
- }, splitStyles = (0, import_getSplitStyles.useSplitStyles)(
227
- props,
228
- staticConfig,
229
- theme,
230
- ((_f = themeState == null ? void 0 : themeState.state) == null ? void 0 : _f.name) || "",
231
- state,
232
- styleProps,
233
- null,
234
- componentContext,
235
- elementType,
236
- debugProp
237
- );
238
- props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style || (splitStyles.style = {}), splitStyles.style.opacity = 0), process.env.NODE_ENV === "development" && time && time`split-styles`, curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
239
- const isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
541
+ }, splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, styleProps, null, componentContext, elementType, debugProp);
542
+ if (props.group && props.untilMeasured === "hide" && !curState.hasMeasured) {
543
+ var _splitStyles;
544
+ (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
545
+ }
546
+ process.env.NODE_ENV === "development" && time && time(_templateObject10()), curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
547
+ var isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
240
548
  (0, import_useMedia.setMediaShouldUpdate)(stateRef, {
241
549
  enabled: shouldListenForMedia,
242
550
  keys: mediaListeningKeys
243
551
  });
244
- const {
245
- viewProps: viewPropsIn,
246
- pseudos,
247
- style: splitStylesStyle,
248
- classNames,
249
- space
250
- } = splitStyles, propsWithAnimation = props, {
251
- asChild,
252
- children,
253
- themeShallow,
254
- spaceDirection: _spaceDirection,
255
- disabled: disabledProp,
256
- onPress,
257
- onLongPress,
258
- onPressIn,
259
- onPressOut,
260
- onHoverIn,
261
- onHoverOut,
262
- onMouseUp,
263
- onMouseDown,
264
- onMouseEnter,
265
- onMouseLeave,
266
- onFocus,
267
- onBlur,
268
- separator,
269
- // ignore from here on out
270
- forceStyle: _forceStyle,
271
- // @ts-ignore for next/link compat etc
272
- onClick,
273
- theme: _themeProp,
274
- // @ts-ignore
275
- defaultVariants,
276
- ...nonTamaguiProps
277
- } = viewPropsIn;
278
- let viewProps = nonTamaguiProps;
552
+ var viewPropsIn = splitStyles.viewProps, pseudos = splitStyles.pseudos, splitStylesStyle = splitStyles.style, classNames = splitStyles.classNames, space = splitStyles.space, propsWithAnimation = props, asChild = viewPropsIn.asChild, children = viewPropsIn.children, themeShallow = viewPropsIn.themeShallow, _spaceDirection = viewPropsIn.spaceDirection, disabledProp = viewPropsIn.disabled, onPress = viewPropsIn.onPress, onLongPress = viewPropsIn.onLongPress, onPressIn = viewPropsIn.onPressIn, onPressOut = viewPropsIn.onPressOut, onHoverIn = viewPropsIn.onHoverIn, onHoverOut = viewPropsIn.onHoverOut, onMouseUp = viewPropsIn.onMouseUp, onMouseDown = viewPropsIn.onMouseDown, onMouseEnter = viewPropsIn.onMouseEnter, onMouseLeave = viewPropsIn.onMouseLeave, onFocus = viewPropsIn.onFocus, onBlur = viewPropsIn.onBlur, separator = viewPropsIn.separator, _forceStyle = viewPropsIn.forceStyle, onClick = viewPropsIn.onClick, _themeProp = viewPropsIn.theme, defaultVariants = viewPropsIn.defaultVariants, nonTamaguiProps = _object_without_properties(viewPropsIn, [
553
+ "asChild",
554
+ "children",
555
+ "themeShallow",
556
+ "spaceDirection",
557
+ "disabled",
558
+ "onPress",
559
+ "onLongPress",
560
+ "onPressIn",
561
+ "onPressOut",
562
+ "onHoverIn",
563
+ "onHoverOut",
564
+ "onMouseUp",
565
+ "onMouseDown",
566
+ "onMouseEnter",
567
+ "onMouseLeave",
568
+ "onFocus",
569
+ "onBlur",
570
+ "separator",
571
+ "forceStyle",
572
+ "onClick",
573
+ "theme",
574
+ "defaultVariants"
575
+ ]), viewProps = nonTamaguiProps;
279
576
  isHOC && _themeProp && (viewProps.theme = _themeProp);
280
- let animationStyles;
577
+ var animationStyles;
281
578
  if (
282
579
  // if it supports css vars we run it on server too to get matching initial style
283
580
  (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
284
581
  ) {
285
- const animations = useAnimations({
582
+ var _themeState_state1, animations = useAnimations({
286
583
  props: propsWithAnimation,
287
584
  // if hydrating, send empty style
288
585
  style: splitStylesStyle || {},
289
586
  presence,
290
587
  componentState: state,
291
588
  styleProps,
292
- theme: (_g = themeState.state) == null ? void 0 : _g.theme,
589
+ theme: (_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.theme,
293
590
  pseudos: pseudos || null,
294
591
  staticConfig,
295
592
  stateRef
296
593
  });
297
- (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles), process.env.NODE_ENV === "development" && time && time`animations`;
594
+ (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles), process.env.NODE_ENV === "development" && time && time(_templateObject11());
298
595
  }
299
- process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(
300
- `You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
596
+ process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
301
597
 
302
- If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
303
- ), process.env.NODE_ENV === "development" && time && time`destructure`;
304
- const disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
598
+ If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time(_templateObject12());
599
+ var disabled = ((_props_accessibilityState1 = props.accessibilityState) === null || _props_accessibilityState1 === void 0 ? void 0 : _props_accessibilityState1.disabled) || // @ts-expect-error (comes from core)
305
600
  props.accessibilityDisabled;
306
- groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
307
- nonTamaguiProps.onLayout,
308
- (e) => {
309
- stateRef.current.group.emit(groupName, {
310
- layout: e.nativeEvent.layout
311
- }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState((prev) => ({ ...prev })), stateRef.current.hasMeasured = !0;
312
- }
313
- )), viewProps = ((_j = (_i = import_setupHooks.hooks).usePropsTransform) == null ? void 0 : _j.call(
314
- _i,
315
- elementType,
316
- nonTamaguiProps,
317
- stateRef,
318
- curState.willHydrate
319
- )) ?? nonTamaguiProps, curState.composedRef || (curState.composedRef = (0, import_compose_refs.composeRefs)(
320
- (x) => stateRef.current.host = x,
321
- forwardedRef
322
- )), viewProps.ref = curState.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
601
+ groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
602
+ stateRef.current.group.emit(groupName, {
603
+ layout: e.nativeEvent.layout
604
+ }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
605
+ return _object_spread({}, prev);
606
+ }), stateRef.current.hasMeasured = !0;
607
+ }));
608
+ var _hooks_usePropsTransform1;
609
+ viewProps = (_hooks_usePropsTransform1 = (_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curState.willHydrate)) !== null && _hooks_usePropsTransform1 !== void 0 ? _hooks_usePropsTransform1 : nonTamaguiProps, curState.composedRef || (curState.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
610
+ return stateRef.current.host = x;
611
+ }, forwardedRef)), viewProps.ref = curState.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach(function(item) {
323
612
  typeof item == "string" && item !== `
324
- ` && console.error(
325
- `Unexpected text node: ${item}. A text node cannot be a child of a <View>.`
326
- );
327
- }), process.env.NODE_ENV === "development" && time && time`events-hooks`;
328
- const { pseudoGroups, mediaGroups } = splitStyles;
329
- curState.unPress || (curState.unPress = () => setStateShallow({ press: !1, pressIn: !1 }));
330
- const unPress = curState.unPress, shouldEnter = state.unmounted;
331
- (0, import_react.useEffect)(() => {
613
+ ` && console.error("Unexpected text node: ".concat(item, ". A text node cannot be a child of a <View>."));
614
+ }), process.env.NODE_ENV === "development" && time && time(_templateObject13());
615
+ var pseudoGroups = splitStyles.pseudoGroups, mediaGroups = splitStyles.mediaGroups;
616
+ curState.unPress || (curState.unPress = function() {
617
+ return setStateShallow({
618
+ press: !1,
619
+ pressIn: !1
620
+ });
621
+ });
622
+ var unPress = curState.unPress, shouldEnter = state.unmounted;
623
+ (0, import_react.useEffect)(function() {
332
624
  if (shouldEnter) {
333
- setStateShallow({ unmounted: !1 });
625
+ setStateShallow({
626
+ unmounted: !1
627
+ });
334
628
  return;
335
629
  }
336
- let disposeGroupsListener;
630
+ var disposeGroupsListener;
337
631
  if (pseudoGroups || mediaGroups) {
338
- const current = {
632
+ var current = {
339
633
  pseudo: {},
340
634
  media: {}
341
635
  };
342
- disposeGroupsListener = componentContext.groups.subscribe(
343
- (name, { layout, pseudo }) => {
344
- if (pseudo && (pseudoGroups != null && pseudoGroups.has(name)))
345
- Object.assign(current.pseudo, pseudo), persist();
346
- else if (layout && mediaGroups) {
347
- const mediaState2 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
348
- next !== current.media && (Object.assign(current.media, next), persist());
349
- }
350
- function persist() {
351
- setStateShallow({
352
- // force it to be referentially different so it always updates
353
- group: {
354
- ...state.group,
355
- [name]: current
356
- }
357
- });
358
- }
636
+ disposeGroupsListener = componentContext.groups.subscribe(function(name2, param) {
637
+ var layout = param.layout, pseudo = param.pseudo, persist = function() {
638
+ setStateShallow({
639
+ // force it to be referentially different so it always updates
640
+ group: _object_spread_props(_object_spread({}, state.group), _define_property({}, name2, current))
641
+ });
642
+ };
643
+ if (pseudo && (pseudoGroups != null && pseudoGroups.has(name2)))
644
+ Object.assign(current.pseudo, pseudo), persist();
645
+ else if (layout && mediaGroups) {
646
+ var mediaState2 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
647
+ next !== current.media && (Object.assign(current.media, next), persist());
359
648
  }
360
- );
649
+ });
361
650
  }
362
- return () => {
651
+ return function() {
363
652
  disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
364
653
  };
365
654
  }, [
366
655
  shouldEnter,
367
- pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
368
- mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
656
+ pseudoGroups ? Object.keys(_to_consumable_array(pseudoGroups)).join("") : 0,
657
+ mediaGroups ? Object.keys(_to_consumable_array(mediaGroups)).join("") : 0
369
658
  ]);
370
- const runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
371
- process.env.NODE_ENV === "development" && time && time`events-setup`;
372
- const events = shouldAttach && !isDisabled && !props.asChild ? {
373
- onPressOut: attachPress ? (e) => {
659
+ var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
660
+ process.env.NODE_ENV === "development" && time && time(_templateObject14());
661
+ var events = shouldAttach && !isDisabled && !props.asChild ? _object_spread(_object_spread_props(_object_spread({
662
+ onPressOut: attachPress ? function(e) {
374
663
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
375
- } : void 0,
376
- ...(isHoverable || attachPress) && {
377
- onMouseEnter: (e) => {
378
- const next = {};
379
- needsHoverState && (next.hover = !0), runtimePressStyle && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
380
- },
381
- onMouseLeave: (e) => {
382
- const next = {};
383
- mouseUps.add(unPress), needsHoverState && (next.hover = !1), runtimePressStyle && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
384
- }
664
+ } : void 0
665
+ }, (isHoverable || attachPress) && {
666
+ onMouseEnter: function(e) {
667
+ var next = {};
668
+ needsHoverState && (next.hover = !0), runtimePressStyle && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
385
669
  },
386
- onPressIn: attachPress ? (e) => {
670
+ onMouseLeave: function(e) {
671
+ var next = {};
672
+ mouseUps.add(unPress), needsHoverState && (next.hover = !1), runtimePressStyle && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
673
+ }
674
+ }), {
675
+ onPressIn: attachPress ? function(e) {
387
676
  runtimePressStyle && setStateShallow({
388
677
  press: !0,
389
678
  pressIn: !0
390
679
  }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && mouseUps.add(unPress);
391
680
  } : void 0,
392
- onPress: attachPress ? (e) => {
681
+ onPress: attachPress ? function(e) {
393
682
  unPress(), import_constants.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
394
- } : void 0,
395
- ...attachPress && onLongPress && {
396
- onLongPress: (e) => {
397
- unPress(), onLongPress == null || onLongPress(e);
398
- }
683
+ } : void 0
684
+ }), attachPress && onLongPress && {
685
+ onLongPress: function(e) {
686
+ unPress(), onLongPress == null || onLongPress(e);
687
+ }
688
+ }, attachFocus && {
689
+ onFocus: function(e) {
690
+ setStateShallow({
691
+ focus: !0
692
+ }), onFocus == null || onFocus(e);
399
693
  },
400
- ...attachFocus && {
401
- onFocus: (e) => {
402
- setStateShallow({
403
- focus: !0
404
- }), onFocus == null || onFocus(e);
405
- },
406
- onBlur: (e) => {
407
- setStateShallow({
408
- focus: !1
409
- }), onBlur == null || onBlur(e);
410
- }
694
+ onBlur: function(e) {
695
+ setStateShallow({
696
+ focus: !1
697
+ }), onBlur == null || onBlur(e);
411
698
  }
412
- } : null;
413
- events && !asChild && Object.assign(events, {
414
- cancelable: !viewProps.rejectResponderTermination,
415
- disabled: isDisabled,
416
- hitSlop: viewProps.hitSlop,
417
- delayLongPress: viewProps.delayLongPress,
418
- delayPressIn: viewProps.delayPressIn,
419
- delayPressOut: viewProps.delayPressOut,
420
- focusable: viewProps.focusable ?? !0,
421
- minPressDuration: 0
422
- }), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
423
- const direction = props.spaceDirection || "both";
424
- process.env.NODE_ENV === "development" && time && time`hooks`;
425
- let content = !children || asChild ? children : spacedChildren({
699
+ }) : null;
700
+ if (events && !asChild) {
701
+ var _viewProps_focusable;
702
+ Object.assign(events, {
703
+ cancelable: !viewProps.rejectResponderTermination,
704
+ disabled: isDisabled,
705
+ hitSlop: viewProps.hitSlop,
706
+ delayLongPress: viewProps.delayLongPress,
707
+ delayPressIn: viewProps.delayPressIn,
708
+ delayPressOut: viewProps.delayPressOut,
709
+ focusable: (_viewProps_focusable = viewProps.focusable) !== null && _viewProps_focusable !== void 0 ? _viewProps_focusable : !0,
710
+ minPressDuration: 0
711
+ });
712
+ }
713
+ process.env.NODE_ENV === "development" && time && time(_templateObject15()), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", {
714
+ events,
715
+ isHoverable,
716
+ attachPress
717
+ }), (_hooks_useEvents = import_setupHooks.hooks.useEvents) === null || _hooks_useEvents === void 0 || _hooks_useEvents.call(import_setupHooks.hooks, viewProps, events, splitStyles, setStateShallow, staticConfig);
718
+ var direction = props.spaceDirection || "both";
719
+ process.env.NODE_ENV === "development" && time && time(_templateObject16());
720
+ var content = !children || asChild ? children : spacedChildren({
426
721
  separator,
427
722
  children,
428
723
  space,
@@ -430,50 +725,60 @@ If you meant to do this, you can disable this warning - either change untilMeasu
430
725
  isZStack,
431
726
  debug: debugProp
432
727
  });
433
- asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
434
- let useChildrenResult;
435
- import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
436
- elementType,
437
- content,
438
- viewProps,
439
- events,
440
- staticConfig
441
- )), useChildrenResult ? content = useChildrenResult : content = (0, import_react.createElement)(elementType, viewProps, content);
442
- const ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
443
- ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
444
- const groupState = curState.group, subGroupContext = (0, import_react.useMemo)(() => {
445
- var _a3, _b2;
728
+ if (asChild)
729
+ if (elementType = import_Slot.Slot, 0)
730
+ var webStyleEvents, passEvents;
731
+ else
732
+ Object.assign(viewProps, {
733
+ onPress,
734
+ onLongPress
735
+ });
736
+ process.env.NODE_ENV === "development" && time && time(_templateObject17());
737
+ var useChildrenResult;
738
+ import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps, events, staticConfig)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ (0, import_react.createElement)(elementType, viewProps, content);
739
+ var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
740
+ ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ import_react.default.createElement(ResetPresence, null, content)), process.env.NODE_ENV === "development" && time && time(_templateObject18());
741
+ var groupState = curState.group, subGroupContext = (0, import_react.useMemo)(function() {
742
+ var _splitStyles_style, _splitStyles_style1;
446
743
  if (!(!groupState || !groupName))
447
- return groupState.listeners.clear(), {
448
- ...componentContext.groups,
744
+ return groupState.listeners.clear(), _object_spread_props(_object_spread({}, componentContext.groups), {
449
745
  // change reference so as we mutate it doesn't affect siblings etc
450
- state: {
451
- ...componentContext.groups.state,
452
- [groupName]: {
453
- pseudo: import_defaultComponentState.defaultComponentStateMounted,
454
- // capture just initial width and height if they exist
455
- // will have top, left, width, height (not x, y)
456
- layout: {
457
- width: fromPx((_a3 = splitStyles.style) == null ? void 0 : _a3.width),
458
- height: fromPx((_b2 = splitStyles.style) == null ? void 0 : _b2.height)
459
- }
746
+ state: _object_spread_props(_object_spread({}, componentContext.groups.state), _define_property({}, groupName, {
747
+ pseudo: import_defaultComponentState.defaultComponentStateMounted,
748
+ // capture just initial width and height if they exist
749
+ // will have top, left, width, height (not x, y)
750
+ layout: {
751
+ width: fromPx((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width),
752
+ height: fromPx((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)
460
753
  }
461
- },
754
+ })),
462
755
  emit: groupState.emit,
463
756
  subscribe: groupState.subscribe
464
- };
465
- }, [groupName]);
466
- if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
467
- const contextProps = staticConfig.context.props;
468
- for (const key in contextProps)
469
- (viewProps.style && key in viewProps.style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = ((_n = viewProps.style) == null ? void 0 : _n[key]) ?? viewProps[key]);
757
+ });
758
+ }, [
759
+ groupName
760
+ ]);
761
+ if (groupName && subGroupContext && (content = /* @__PURE__ */ import_react.default.createElement(import_ComponentContext.ComponentContext.Provider, _object_spread_props(_object_spread({}, componentContext), {
762
+ groups: subGroupContext
763
+ }), content)), process.env.NODE_ENV === "development" && time && time(_templateObject19()), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time(_templateObject20()), process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ import_react.default.createElement(import_ThemeDebug.ThemeDebug, {
764
+ themeState,
765
+ themeProps: props
766
+ }, content)), staticConfig.context) {
767
+ var contextProps = staticConfig.context.props;
768
+ for (var key1 in contextProps)
769
+ if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
770
+ var _viewProps_style;
771
+ overriddenContextProps || (overriddenContextProps = {});
772
+ var _viewProps_style_key;
773
+ overriddenContextProps[key1] = (_viewProps_style_key = (_viewProps_style = viewProps.style) === null || _viewProps_style === void 0 ? void 0 : _viewProps_style[key1]) !== null && _viewProps_style_key !== void 0 ? _viewProps_style_key : viewProps[key1];
774
+ }
470
775
  }
471
776
  if (overriddenContextProps) {
472
- const Provider = staticConfig.context.Provider;
473
- content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
777
+ var Provider = staticConfig.context.Provider;
778
+ content = /* @__PURE__ */ import_react.default.createElement(Provider, _object_spread({}, contextValue, overriddenContextProps), content);
474
779
  }
475
780
  if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
476
- const title = `render <${typeof elementType == "string" ? elementType : "Component"} /> (${internalID}) with props`;
781
+ var element1 = typeof elementType == "string" ? elementType : "Component", title = "render <".concat(element1, " /> (").concat(internalID, ") with props");
477
782
  if (import_constants.isWeb) {
478
783
  console.groupCollapsed(title);
479
784
  try {
@@ -511,36 +816,32 @@ If you meant to do this, you can disable this warning - either change untilMeasu
511
816
  }
512
817
  } else {
513
818
  (0, import_log.log)(title), (0, import_log.log)("final styles:");
514
- for (const key in splitStylesStyle)
515
- (0, import_log.log)(key, splitStylesStyle[key]);
819
+ for (var key2 in splitStylesStyle)
820
+ (0, import_log.log)(key2, splitStylesStyle[key2]);
516
821
  }
517
822
  if (debugProp === "break")
518
823
  debugger;
519
824
  }
520
- return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
825
+ return process.env.NODE_ENV === "development" && time && (time(_templateObject21()), globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function() {
521
826
  delete globalThis.willPrint, time.print(), time = null;
522
827
  }, 50))), content;
523
828
  });
524
829
  staticConfig.componentName && (component.displayName = staticConfig.componentName);
525
- let res = component;
526
- (process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = (0, import_react.memo)(res)), res.staticConfig = staticConfig;
830
+ var res = component;
831
+ (process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */ (0, import_react.memo)(res)), res.staticConfig = staticConfig;
527
832
  function extendStyledConfig(extended) {
528
- return {
529
- ...staticConfig,
530
- ...extended,
833
+ return _object_spread_props(_object_spread({}, staticConfig, extended), {
531
834
  neverFlatten: !0,
532
835
  isHOC: !0,
533
836
  isStyledHOC: !1
534
- };
837
+ });
535
838
  }
536
839
  function extractable(Component2, extended) {
537
840
  return Component2.staticConfig = extendStyledConfig(extended), Component2.styleable = styleable, Component2;
538
841
  }
539
842
  function styleable(Component2, options) {
540
- var _a2;
541
- let out = ((_a2 = Component2.render) == null ? void 0 : _a2.length) === 2 ? Component2 : (0, import_react.forwardRef)(Component2);
542
- const extendedConfig = extendStyledConfig(options == null ? void 0 : options.staticConfig);
543
- return out = options != null && options.disableTheme ? out : (0, import_themeable.themeable)(out, extendedConfig), process.env.TAMAGUI_MEMOIZE_STYLEABLE && (out = (0, import_react.memo)(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
843
+ var _Component_render, isForwardedRefAlready = ((_Component_render = Component2.render) === null || _Component_render === void 0 ? void 0 : _Component_render.length) === 2, out = isForwardedRefAlready ? Component2 : /* @__PURE__ */ (0, import_react.forwardRef)(Component2), extendedConfig = extendStyledConfig(options == null ? void 0 : options.staticConfig);
844
+ return out = options != null && options.disableTheme ? out : (0, import_themeable.themeable)(out, extendedConfig), process.env.TAMAGUI_MEMOIZE_STYLEABLE && (out = /* @__PURE__ */ (0, import_react.memo)(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
544
845
  }
545
846
  return res.extractable = extractable, res.styleable = styleable, res;
546
847
  }
@@ -548,9 +849,10 @@ function Unspaced(props) {
548
849
  return props.children;
549
850
  }
550
851
  Unspaced.isUnspaced = !0;
551
- const getSpacerSize = (size, { tokens }) => {
852
+ var getSpacerSize = function(size, param) {
853
+ var tokens = param.tokens;
552
854
  size = size === !0 ? "$true" : size;
553
- const sizePx = tokens.space[size] ?? size;
855
+ var _tokens_space_size, sizePx = (_tokens_space_size = tokens.space[size]) !== null && _tokens_space_size !== void 0 ? _tokens_space_size : size;
554
856
  return {
555
857
  width: sizePx,
556
858
  height: sizePx,
@@ -562,13 +864,12 @@ const getSpacerSize = (size, { tokens }) => {
562
864
  memo: !0,
563
865
  componentName: "Spacer",
564
866
  validStyles: import_helpers.validStyles,
565
- defaultProps: {
566
- ...import_constants2.stackDefaultStyles,
867
+ defaultProps: _object_spread_props(_object_spread({}, import_constants2.stackDefaultStyles), {
567
868
  // avoid nesting issues
568
869
  tag: "span",
569
870
  size: !0,
570
871
  pointerEvents: "none"
571
- },
872
+ }),
572
873
  variants: {
573
874
  size: {
574
875
  "...": getSpacerSize
@@ -592,73 +893,73 @@ const getSpacerSize = (size, { tokens }) => {
592
893
  }
593
894
  });
594
895
  function spacedChildren(props) {
595
- var _a, _b, _c;
596
- const { isZStack, children, space, direction, spaceFlex, separator } = props, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
896
+ var _childrenList__type, _childrenList_, isZStack = props.isZStack, children = props.children, space = props.space, direction = props.direction, spaceFlex = props.spaceFlex, separator = props.separator, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
597
897
  if (!(hasSpace || hasSeparator || isZStack))
598
898
  return children;
599
- const childrenList = import_react.Children.toArray(children);
600
- if (childrenList.length <= 1 && !isZStack && !((_b = (_a = childrenList[0]) == null ? void 0 : _a.type) != null && _b.shouldForwardSpace))
899
+ var childrenList = import_react.Children.toArray(children), len = childrenList.length;
900
+ if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace))
601
901
  return childrenList;
602
- const final = [];
603
- for (let [index, child] of childrenList.entries()) {
604
- const isEmpty = child == null || Array.isArray(child) && child.length === 0;
605
- if (!isEmpty && import_react.default.isValidElement(child) && ((_c = child.type) != null && _c.shouldForwardSpace) && (child = import_react.default.cloneElement(child, {
606
- space,
607
- spaceFlex,
608
- separator,
609
- key: child.key
610
- })), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(
611
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, index)
612
- ), isUnspaced(child) && index === 0 || isZStack)
613
- continue;
614
- const next = childrenList[index + 1];
615
- next && !isUnspaced(next) && (separator ? (hasSpace && final.push(
616
- createSpacer({
617
- key: `_${index}_00tmgui`,
618
- direction,
619
- space,
620
- spaceFlex
621
- })
622
- ), final.push(
623
- import_react.default.isValidElement(separator) ? import_react.default.cloneElement(separator, { key: `sep_${index}` }) : separator
624
- ), hasSpace && final.push(
625
- createSpacer({
626
- key: `_${index}01tmgui`,
627
- direction,
902
+ var final = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
903
+ try {
904
+ for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
905
+ var _step_value = _sliced_to_array(_step.value, 2), index = _step_value[0], child = _step_value[1], _child_type, isEmpty = child == null || Array.isArray(child) && child.length === 0;
906
+ if (!isEmpty && /* @__PURE__ */ import_react.default.isValidElement(child) && (!((_child_type = child.type) === null || _child_type === void 0) && _child_type.shouldForwardSpace) && (child = /* @__PURE__ */ import_react.default.cloneElement(child, {
628
907
  space,
629
- spaceFlex
630
- })
631
- )) : final.push(
632
- createSpacer({
633
- key: `_${index}02tmgui`,
634
- direction,
635
- space,
636
- spaceFlex
637
- })
638
- ));
908
+ spaceFlex,
909
+ separator,
910
+ key: child.key
911
+ })), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */ import_react.default.createElement(import_react.Fragment, {
912
+ key: index
913
+ }, isZStack ? /* @__PURE__ */ import_react.default.createElement(AbsoluteFill, null, child) : child)), !(isUnspaced(child) && index === 0) && !isZStack) {
914
+ var next = childrenList[index + 1];
915
+ next && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
916
+ key: "_".concat(index, "_00tmgui"),
917
+ direction,
918
+ space,
919
+ spaceFlex
920
+ })), final.push(/* @__PURE__ */ import_react.default.isValidElement(separator) ? /* @__PURE__ */ import_react.default.cloneElement(separator, {
921
+ key: "sep_".concat(index)
922
+ }) : separator), hasSpace && final.push(createSpacer({
923
+ key: "_".concat(index, "01tmgui"),
924
+ direction,
925
+ space,
926
+ spaceFlex
927
+ }))) : final.push(createSpacer({
928
+ key: "_".concat(index, "02tmgui"),
929
+ direction,
930
+ space,
931
+ spaceFlex
932
+ })));
933
+ }
934
+ }
935
+ } catch (err) {
936
+ _didIteratorError = !0, _iteratorError = err;
937
+ } finally {
938
+ try {
939
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
940
+ } finally {
941
+ if (_didIteratorError)
942
+ throw _iteratorError;
943
+ }
639
944
  }
640
945
  return process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)(" Spaced children", final, props), final;
641
946
  }
642
- function createSpacer({ key, direction, space, spaceFlex }) {
643
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
644
- Spacer,
645
- {
646
- size: space,
647
- direction,
648
- ...typeof spaceFlex < "u" && {
649
- flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
650
- }
651
- },
652
- key
653
- );
947
+ function createSpacer(param) {
948
+ var key = param.key, direction = param.direction, space = param.space, spaceFlex = param.spaceFlex;
949
+ return /* @__PURE__ */ import_react.default.createElement(Spacer, _object_spread({
950
+ key,
951
+ size: space,
952
+ direction
953
+ }, typeof spaceFlex < "u" && {
954
+ flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
955
+ }));
654
956
  }
655
957
  function isUnspaced(child) {
656
- const t = child == null ? void 0 : child.type;
958
+ var t = child == null ? void 0 : child.type;
657
959
  return (t == null ? void 0 : t.isVisuallyHidden) || (t == null ? void 0 : t.isUnspaced);
658
960
  }
659
- const AbsoluteFill = createComponent({
660
- defaultProps: {
661
- ...import_constants2.stackDefaultStyles,
961
+ var AbsoluteFill = createComponent({
962
+ defaultProps: _object_spread_props(_object_spread({}, import_constants2.stackDefaultStyles), {
662
963
  flexDirection: "column",
663
964
  position: "absolute",
664
965
  top: 0,
@@ -666,20 +967,25 @@ const AbsoluteFill = createComponent({
666
967
  bottom: 0,
667
968
  left: 0,
668
969
  pointerEvents: "box-none"
669
- }
970
+ })
670
971
  });
671
972
  function hasAnimatedStyleValue(style) {
672
- return Object.keys(style).some((k) => {
673
- const val = style[k];
973
+ return Object.keys(style).some(function(k) {
974
+ var val = style[k];
674
975
  return val && typeof val == "object" && "_animation" in val;
675
976
  });
676
977
  }
677
978
  function getMediaState(mediaGroups, layout) {
678
- return Object.fromEntries(
679
- [...mediaGroups].map((mediaKey) => [mediaKey, (0, import_useMedia.mediaKeyMatch)(mediaKey, layout)])
680
- );
979
+ return Object.fromEntries(_to_consumable_array(mediaGroups).map(function(mediaKey) {
980
+ return [
981
+ mediaKey,
982
+ (0, import_useMedia.mediaKeyMatch)(mediaKey, layout)
983
+ ];
984
+ }));
681
985
  }
682
- const fromPx = (val) => typeof val != "string" ? val : +val.replace("px", "");
986
+ var fromPx = function(val) {
987
+ return typeof val != "string" ? val : +val.replace("px", "");
988
+ };
683
989
  // Annotate the CommonJS export names for ESM import in node:
684
990
  0 && (module.exports = {
685
991
  Spacer,