@tamagui/core 1.0.1-beta.151 → 1.0.1-beta.152

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 (216) hide show
  1. package/dist/cjs/Tamagui.js +4 -1
  2. package/dist/cjs/Tamagui.js.map +1 -1
  3. package/dist/cjs/addTheme.js.map +1 -1
  4. package/dist/cjs/constants/platform.js.map +1 -1
  5. package/dist/cjs/constants/platform.native.js.map +1 -1
  6. package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
  7. package/dist/cjs/contexts/FontLanguageContext.js.map +1 -1
  8. package/dist/cjs/contexts/TextAncestorContext.js +6 -7
  9. package/dist/cjs/contexts/TextAncestorContext.js.map +2 -2
  10. package/dist/cjs/contexts/ThemeContext.js.map +1 -1
  11. package/dist/cjs/createComponent.js +166 -83
  12. package/dist/cjs/createComponent.js.map +2 -2
  13. package/dist/cjs/createFont.js.map +1 -1
  14. package/dist/cjs/createShorthands.js.map +1 -1
  15. package/dist/cjs/createTamagui.js +5 -3
  16. package/dist/cjs/createTamagui.js.map +2 -2
  17. package/dist/cjs/createTokens.js.map +1 -1
  18. package/dist/cjs/createVariable.js +3 -1
  19. package/dist/cjs/createVariable.js.map +2 -2
  20. package/dist/cjs/createVariables.js.map +1 -1
  21. package/dist/cjs/helpers/ThemeManager.js.map +2 -2
  22. package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
  23. package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
  24. package/dist/cjs/helpers/calc.js.map +2 -2
  25. package/dist/cjs/helpers/createMediaStyle.js +10 -4
  26. package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
  27. package/dist/cjs/helpers/createPropMapper.js +89 -9
  28. package/dist/cjs/helpers/createPropMapper.js.map +1 -1
  29. package/dist/cjs/helpers/createShallowUpdate.js +12 -9
  30. package/dist/cjs/helpers/createShallowUpdate.js.map +1 -1
  31. package/dist/cjs/helpers/cssHash.js.map +1 -1
  32. package/dist/cjs/helpers/expandStyle.js.map +2 -2
  33. package/dist/cjs/helpers/expandStyles.js.map +1 -1
  34. package/dist/cjs/helpers/extendStaticConfig.js +10 -7
  35. package/dist/cjs/helpers/extendStaticConfig.js.map +1 -1
  36. package/dist/cjs/helpers/getAnimationDriver.js.map +1 -1
  37. package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
  38. package/dist/cjs/helpers/getFont.js.map +1 -1
  39. package/dist/cjs/helpers/getSize.js.map +1 -1
  40. package/dist/cjs/helpers/getSplitStyles.js +40 -4
  41. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  42. package/dist/cjs/helpers/getStackSize.js.map +1 -1
  43. package/dist/cjs/helpers/getStylesAtomic.js +8 -2
  44. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  45. package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
  46. package/dist/cjs/helpers/getThemeCSSRules.js +7 -3
  47. package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
  48. package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
  49. package/dist/cjs/helpers/getVariantExtras.js +9 -7
  50. package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
  51. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  52. package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
  53. package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
  54. package/dist/cjs/helpers/matchMedia.js.map +1 -1
  55. package/dist/cjs/helpers/matchMedia.native.js +4 -1
  56. package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
  57. package/dist/cjs/helpers/mergeProps.js.map +1 -1
  58. package/dist/cjs/helpers/mergeTransform.js.map +1 -1
  59. package/dist/cjs/helpers/normalizeColor.js +4 -1
  60. package/dist/cjs/helpers/normalizeColor.js.map +2 -2
  61. package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
  62. package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
  63. package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
  64. package/dist/cjs/helpers/startTransition.js +4 -1
  65. package/dist/cjs/helpers/startTransition.js.map +2 -2
  66. package/dist/cjs/helpers/themeable.js +12 -5
  67. package/dist/cjs/helpers/themeable.js.map +2 -2
  68. package/dist/cjs/helpers/themes.js.map +1 -1
  69. package/dist/cjs/hooks/useConstant.js.map +1 -1
  70. package/dist/cjs/hooks/useIsMounted.js.map +1 -1
  71. package/dist/cjs/hooks/useIsSSR.js.map +1 -1
  72. package/dist/cjs/hooks/useIsTouchDevice.js.map +1 -1
  73. package/dist/cjs/hooks/useMedia.js +10 -7
  74. package/dist/cjs/hooks/useMedia.js.map +2 -2
  75. package/dist/cjs/hooks/usePressable.js.map +1 -1
  76. package/dist/cjs/hooks/useSafeRef.js.map +1 -1
  77. package/dist/cjs/hooks/useServerHooks.js.map +1 -1
  78. package/dist/cjs/hooks/useTheme.js +6 -1
  79. package/dist/cjs/hooks/useTheme.js.map +2 -2
  80. package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
  81. package/dist/cjs/injectStyles.js.map +1 -1
  82. package/dist/cjs/insertFont.js +2 -0
  83. package/dist/cjs/insertFont.js.map +2 -2
  84. package/dist/cjs/styled.js +3 -1
  85. package/dist/cjs/styled.js.map +1 -1
  86. package/dist/cjs/updateTheme.js +7 -4
  87. package/dist/cjs/updateTheme.js.map +1 -1
  88. package/dist/cjs/views/FontLanguage.js +5 -7
  89. package/dist/cjs/views/FontLanguage.js.map +1 -1
  90. package/dist/cjs/views/FontLanguage.native.js +6 -7
  91. package/dist/cjs/views/FontLanguage.native.js.map +1 -1
  92. package/dist/cjs/views/Slot.js +16 -8
  93. package/dist/cjs/views/Slot.js.map +1 -1
  94. package/dist/cjs/views/Stack.js.map +1 -1
  95. package/dist/cjs/views/TamaguiProvider.js +21 -12
  96. package/dist/cjs/views/TamaguiProvider.js.map +1 -1
  97. package/dist/cjs/views/Text.js.map +1 -1
  98. package/dist/cjs/views/Theme.js +25 -11
  99. package/dist/cjs/views/Theme.js.map +2 -2
  100. package/dist/cjs/views/ThemeInverse.js +6 -7
  101. package/dist/cjs/views/ThemeInverse.js.map +1 -1
  102. package/dist/cjs/views/ThemeProvider.js +14 -8
  103. package/dist/cjs/views/ThemeProvider.js.map +2 -2
  104. package/dist/cjs/views/ThemeReset.js +9 -4
  105. package/dist/cjs/views/ThemeReset.js.map +2 -2
  106. package/dist/esm/Tamagui.js.map +1 -1
  107. package/dist/esm/addTheme.js.map +1 -1
  108. package/dist/esm/constants/constants.js.map +1 -1
  109. package/dist/esm/constants/platform.js.map +1 -1
  110. package/dist/esm/constants/platform.native.js.map +1 -1
  111. package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
  112. package/dist/esm/contexts/FontLanguageContext.js.map +1 -1
  113. package/dist/esm/contexts/TextAncestorContext.js +6 -4
  114. package/dist/esm/contexts/TextAncestorContext.js.map +1 -1
  115. package/dist/esm/contexts/ThemeContext.js.map +1 -1
  116. package/dist/esm/createComponent.js +162 -82
  117. package/dist/esm/createComponent.js.map +2 -2
  118. package/dist/esm/createFont.js.map +1 -1
  119. package/dist/esm/createShorthands.js.map +1 -1
  120. package/dist/esm/createTamagui.js +5 -3
  121. package/dist/esm/createTamagui.js.map +2 -2
  122. package/dist/esm/createTokens.js.map +1 -1
  123. package/dist/esm/createVariable.js +3 -1
  124. package/dist/esm/createVariable.js.map +2 -2
  125. package/dist/esm/createVariables.js.map +1 -1
  126. package/dist/esm/helpers/RNComponents.js.map +1 -1
  127. package/dist/esm/helpers/ThemeManager.js.map +2 -2
  128. package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
  129. package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
  130. package/dist/esm/helpers/calc.js.map +2 -2
  131. package/dist/esm/helpers/createMediaStyle.js +10 -4
  132. package/dist/esm/helpers/createMediaStyle.js.map +2 -2
  133. package/dist/esm/helpers/createPropMapper.js +89 -9
  134. package/dist/esm/helpers/createPropMapper.js.map +1 -1
  135. package/dist/esm/helpers/createShallowUpdate.js +12 -9
  136. package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
  137. package/dist/esm/helpers/cssHash.js.map +1 -1
  138. package/dist/esm/helpers/expandStyle.js.map +2 -2
  139. package/dist/esm/helpers/expandStyles.js.map +1 -1
  140. package/dist/esm/helpers/extendStaticConfig.js +10 -7
  141. package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
  142. package/dist/esm/helpers/getAnimationDriver.js.map +1 -1
  143. package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
  144. package/dist/esm/helpers/getFont.js.map +1 -1
  145. package/dist/esm/helpers/getSize.js.map +1 -1
  146. package/dist/esm/helpers/getSplitStyles.js +40 -4
  147. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  148. package/dist/esm/helpers/getStackSize.js.map +1 -1
  149. package/dist/esm/helpers/getStylesAtomic.js +4 -1
  150. package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
  151. package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
  152. package/dist/esm/helpers/getThemeCSSRules.js +7 -3
  153. package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
  154. package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -1
  155. package/dist/esm/helpers/getVariantExtras.js +9 -7
  156. package/dist/esm/helpers/getVariantExtras.js.map +1 -1
  157. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  158. package/dist/esm/helpers/isTamaguiComponent.js.map +1 -1
  159. package/dist/esm/helpers/isTamaguiElement.js.map +1 -1
  160. package/dist/esm/helpers/matchMedia.js.map +1 -1
  161. package/dist/esm/helpers/matchMedia.native.js.map +1 -1
  162. package/dist/esm/helpers/mergeProps.js.map +1 -1
  163. package/dist/esm/helpers/normalizeColor.js.map +1 -1
  164. package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
  165. package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
  166. package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
  167. package/dist/esm/helpers/startTransition.js.map +1 -1
  168. package/dist/esm/helpers/themeable.js +8 -4
  169. package/dist/esm/helpers/themeable.js.map +1 -1
  170. package/dist/esm/helpers/themes.js.map +1 -1
  171. package/dist/esm/hooks/useConstant.js.map +1 -1
  172. package/dist/esm/hooks/useId.js.map +1 -1
  173. package/dist/esm/hooks/useIsMounted.js.map +1 -1
  174. package/dist/esm/hooks/useIsSSR.js.map +1 -1
  175. package/dist/esm/hooks/useIsTouchDevice.js.map +1 -1
  176. package/dist/esm/hooks/useMedia.js +10 -7
  177. package/dist/esm/hooks/useMedia.js.map +2 -2
  178. package/dist/esm/hooks/usePressable.js.map +1 -1
  179. package/dist/esm/hooks/useSafeRef.js.map +1 -1
  180. package/dist/esm/hooks/useServerHooks.js.map +1 -1
  181. package/dist/esm/hooks/useTheme.js +6 -1
  182. package/dist/esm/hooks/useTheme.js.map +2 -2
  183. package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
  184. package/dist/esm/index.js.map +1 -1
  185. package/dist/esm/injectStyles.js.map +1 -1
  186. package/dist/esm/insertFont.js +2 -0
  187. package/dist/esm/insertFont.js.map +2 -2
  188. package/dist/esm/static.js.map +1 -1
  189. package/dist/esm/styled.js +3 -1
  190. package/dist/esm/styled.js.map +1 -1
  191. package/dist/esm/updateTheme.js +7 -4
  192. package/dist/esm/updateTheme.js.map +1 -1
  193. package/dist/esm/views/FontLanguage.js +5 -4
  194. package/dist/esm/views/FontLanguage.js.map +1 -1
  195. package/dist/esm/views/FontLanguage.native.js +6 -4
  196. package/dist/esm/views/FontLanguage.native.js.map +1 -1
  197. package/dist/esm/views/Slot.js +12 -7
  198. package/dist/esm/views/Slot.js.map +1 -1
  199. package/dist/esm/views/Stack.js.map +1 -1
  200. package/dist/esm/views/TamaguiProvider.js +17 -11
  201. package/dist/esm/views/TamaguiProvider.js.map +1 -1
  202. package/dist/esm/views/Text.js.map +1 -1
  203. package/dist/esm/views/Theme.js +21 -10
  204. package/dist/esm/views/Theme.js.map +2 -2
  205. package/dist/esm/views/ThemeInverse.js +6 -4
  206. package/dist/esm/views/ThemeInverse.js.map +1 -1
  207. package/dist/esm/views/ThemeProvider.js +10 -7
  208. package/dist/esm/views/ThemeProvider.js.map +1 -1
  209. package/dist/esm/views/ThemeReset.js +5 -3
  210. package/dist/esm/views/ThemeReset.js.map +1 -1
  211. package/package.json +10 -10
  212. package/src/createVariable.ts +2 -1
  213. package/src/helpers/createMediaStyle.ts +2 -2
  214. package/src/insertFont.ts +1 -0
  215. package/types/createVariable.d.ts +1 -1
  216. package/src/helpers/cssHash.ts +0 -28
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useUnmountEffect.ts"],
4
4
  "sourcesContent": ["import { useEffect } from 'react'\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],
5
- "mappings": "AAAA;AAEO,0BAA0B,UAAsB;AACrD,SAAO,UAAU,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC;AAC7C;",
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAEnB,SAAS,iBAAiB,UAAsB;AACrD,SAAO,UAAU,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC;AAC7C;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './addTheme'\nexport * from './updateTheme'\nexport * from './styled'\nexport * from './types'\n\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './config'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getAnimationDriver'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/startTransition'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport {\n configureMedia,\n getMedia,\n mediaState,\n useMedia,\n mediaObjectToString,\n addMediaQueryListener,\n removeMediaQueryListener,\n mediaQueryConfig,\n} from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useIsSSR'\nexport * from './hooks/useUnmountEffect'\nexport * from './hooks/useSafeRef'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './contexts/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\nexport * from './views/FontLanguage'\nexport * from './views/TamaguiProvider'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/helpers'\n"],
5
- "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;",
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,SAAS,kBAAkB,WAAW,WAAW,WAAW,wBAAwB;AAEpF,cAAc;AACd,cAAc;AACd,SAAS,sBAAsB;AAE/B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,sBAAsB,2BAA2B;AAC1D,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/injectStyles.ts"],
4
4
  "sourcesContent": ["// for vite dev mode\n\nconst stylesheets: Record<string, HTMLElement> = {}\n\ninterface InjectStylesOptions {\n filePath: string\n css: string\n}\n\nexport const injectStyles = ({ filePath, css }: InjectStylesOptions) => {\n let stylesheet = stylesheets[filePath]\n if (!stylesheet) {\n const styleEl = document.createElement('style')\n styleEl.setAttribute('data-file', filePath)\n styleEl.setAttribute('type', 'text/css')\n stylesheet = stylesheets[filePath] = styleEl\n document.head.appendChild(styleEl)\n }\n stylesheet.innerHTML = css\n}\n"],
5
- "mappings": "AAEA,MAAM,cAA2C,CAAC;AAO3C,MAAM,eAAe,CAAC,EAAE,UAAU,UAA+B;AACtE,MAAI,aAAa,YAAY;AAC7B,MAAI,CAAC,YAAY;AACf,UAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,YAAQ,aAAa,aAAa,QAAQ;AAC1C,YAAQ,aAAa,QAAQ,UAAU;AACvC,iBAAa,YAAY,YAAY;AACrC,aAAS,KAAK,YAAY,OAAO;AAAA,EACnC;AACA,aAAW,YAAY;AACzB;",
5
+ "mappings": "AAEA,MAAM,cAA2C,CAAC;AAO3C,MAAM,eAAe,CAAC,EAAE,UAAU,IAAI,MAA2B;AACtE,MAAI,aAAa,YAAY;AAC7B,MAAI,CAAC,YAAY;AACf,UAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,YAAQ,aAAa,aAAa,QAAQ;AAC1C,YAAQ,aAAa,QAAQ,UAAU;AACvC,iBAAa,YAAY,YAAY;AACrC,aAAS,KAAK,YAAY,OAAO;AAAA,EACnC;AACA,aAAW,YAAY;AACzB;",
6
6
  "names": []
7
7
  }
@@ -39,6 +39,8 @@ function parseFont(definition) {
39
39
  function registerFontVariables(parsedFont) {
40
40
  const response = [];
41
41
  for (const fkey in parsedFont) {
42
+ if (fkey === "face")
43
+ continue;
42
44
  if (fkey === "family") {
43
45
  const val = parsedFont[fkey];
44
46
  registerCSSVariable(val);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/insertFont.ts"],
4
- "sourcesContent": ["import { setConfigFont } from './config'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\n/**\n * Runtime dynamic insert font\n */\nexport function insertFont<A extends GenericFont>(name: string, fontIn: A): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const fontVars = registerFontVariables(parsed)\n const style = document.createElement('style')\n style.innerText = `:root .font_${name} {${fontVars.join(';')}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family' || attrKey === 'face') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any\n // is a theme reference\n if (val.val?.[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any) {\n const response: string[] = []\n\n for (const fkey in parsedFont) {\n if (fkey === 'family') {\n const val = parsedFont[fkey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = parsedFont[fkey][fskey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n }\n }\n }\n }\n return response\n}\n"],
5
- "mappings": "AAAA;AACA;AAEA;AACA;AAMO,oBAA2C,MAAc,QAAkC;AAChG,QAAM,OAAO,WAAW,MAAM;AAC9B,QAAM,UAAU,gBAAgB,MAAM,IAAI;AAC1C,QAAM,SAAS,UAAU,OAAO;AAChC,MAAI,QAAQ,IAAI,mBAAmB,SAAS,OAAO,aAAa,aAAa;AAC3E,UAAM,WAAW,sBAAsB,MAAM;AAC7C,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,YAAY,eAAe,SAAS,SAAS,KAAK,GAAG;AAC3D,UAAM,aAAa,qBAAqB,IAAI;AAC5C,aAAS,KAAK,YAAY,KAAK;AAAA,EACjC;AACA,gBAAc,MAAM,SAAS,MAAM;AACnC,SAAO;AACT;AAEO,mBAA0C,YAAsC;AAzBvF;AA0BE,QAAM,SAAc,CAAC;AACrB,aAAW,WAAW,YAAY;AAChC,UAAM,OAAO,WAAW;AACxB,QAAI,YAAY,YAAY,YAAY,QAAQ;AAC9C,aAAO,WAAW;AAClB;AAAA,IACF;AACA,WAAO,WAAW,CAAC;AACnB,eAAW,OAAO,MAAM;AACtB,UAAI,MAAM,KAAK;AAEf,UAAI,WAAI,QAAJ,mBAAU,QAAO,KAAK;AACxB,cAAM,IAAI;AAAA,MACZ;AACA,aAAO,SAAS,IAAI,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;AAEO,+BAA+B,YAAiB;AACrD,QAAM,WAAqB,CAAC;AAE5B,aAAW,QAAQ,YAAY;AAC7B,QAAI,SAAS,UAAU;AACrB,YAAM,MAAM,WAAW;AACvB,0BAAoB,GAAG;AACvB,eAAS,KAAK,cAAc,GAAG,CAAC;AAAA,IAClC,OAAO;AACL,iBAAW,SAAS,WAAW,OAAO;AACpC,cAAM,OAAO,WAAW,MAAM;AAC9B,YAAI,OAAO,SAAS,UAAU;AAAA,QAE9B,OAAO;AACL,gBAAM,MAAM,WAAW,MAAM;AAC7B,8BAAoB,GAAG;AACvB,mBAAS,KAAK,cAAc,GAAG,CAAC;AAAA,QAClC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { setConfigFont } from './config'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\n/**\n * Runtime dynamic insert font\n */\nexport function insertFont<A extends GenericFont>(name: string, fontIn: A): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const fontVars = registerFontVariables(parsed)\n const style = document.createElement('style')\n style.innerText = `:root .font_${name} {${fontVars.join(';')}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family' || attrKey === 'face') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any\n // is a theme reference\n if (val.val?.[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any) {\n const response: string[] = []\n\n for (const fkey in parsedFont) {\n if (fkey === 'face') continue\n if (fkey === 'family') {\n const val = parsedFont[fkey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = parsedFont[fkey][fskey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n }\n }\n }\n }\n return response\n}\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAE3B,SAA6B,uBAAuB;AACpD,SAAS,qBAAqB,qBAAqB;AAM5C,SAAS,WAAkC,MAAc,QAAkC;AAChG,QAAM,OAAO,WAAW,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,IACF;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/static.ts"],
4
4
  "sourcesContent": ["// only stuff that gets extracted or needed by tamagui-static\n\nexport * from './index'\n\n// for static\n\nexport {\n createDOMProps,\n useElementLayout,\n useMergeRefs,\n usePlatformMethods,\n useResponderEvents,\n} from '@tamagui/rnw'\n\nexport * from './helpers/proxyThemeVariables'\n"],
5
- "mappings": "AAEA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;",
5
+ "mappings": "AAEA,cAAc;AAId;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,9 @@ function styled(Component, options, staticExtractionOptions) {
16
16
  isReactNativeWeb = true;
17
17
  } else {
18
18
  if (process.env.NODE_ENV === "development") {
19
- console.warn(`Invalid styled() component: Tamagui only accepts react-native Text, View, Image, TextInput, or another styled Tamagui view`);
19
+ console.warn(
20
+ `Invalid styled() component: Tamagui only accepts react-native Text, View, Image, TextInput, or another styled Tamagui view`
21
+ );
20
22
  }
21
23
  }
22
24
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
4
  "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n const parentStaticConfig =\n 'staticConfig' in Component ? (Component.staticConfig as StaticConfig) : null\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n let isReactNativeWeb = parentStaticConfig?.isReactNativeWeb || RNComponents.has(Component)\n // this can happen due to smart-ness in fake-react-native, rough heuristic here to ensure we match (could be better..)\n if (!('staticConfig' in Component) && !isReactNativeWeb) {\n if (RNComponents.has(Component['displayName'])) {\n RNComponents.add(Component)\n isReactNativeWeb = true\n } else {\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Invalid styled() component: Tamagui only accepts react-native Text, View, Image, TextInput, or another styled Tamagui view`\n )\n }\n }\n }\n const reactNativeWebComponent = isReactNativeWeb\n ? parentStaticConfig?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && !!parentStaticConfig\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {}\n// }\n// },\n// disabled: {\n// true: {\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// }\n// })\n// type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
5
- "mappings": "AAAA;AAEA;AACA;AAoBO,gBAIL,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAC/B,UAAM,qBACJ,kBAAkB,YAAa,UAAU,eAAgC;AAC3E,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,UAAI,mBAAmB,0DAAoB,qBAAoB,aAAa,IAAI,SAAS;AAEzF,UAAI,CAAE,mBAAkB,cAAc,CAAC,kBAAkB;AACvD,YAAI,aAA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I,SAAS;AAEzF,UAAI,EAAE,kBAAkB,cAAc,CAAC,kBAAkB;AACvD,YAAI,aAAa,IAAI,UAAU,cAAc,GAAG;AAC9C,uBAAa,IAAI,SAAS;AAC1B,6BAAmB;AAAA,QACrB,OAAO;AACL,cAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,oBAAQ;AAAA,cACN;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AACA,YAAM,0BAA0B,oBAC5B,yDAAoB,4BAA2B,YAC/C;AACJ,YAAM,YAAY,CAAC,oBAAoB,CAAC,CAAC;AACzC,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,EAAE,aAAa,YAAY,CAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,EAAE,aAAa,YAAY,CAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,EAAE,aAAa,WAAW,CAAC,YAAY,WAAW,SAAS,OAAO;AAElF,YAAM,OAA8B;AAAA,QAClC,GAAG;AAAA,QACH,GAAI,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;",
6
6
  "names": []
7
7
  }
@@ -5,10 +5,13 @@ function updateTheme({ name, theme }) {
5
5
  if (process.env.TAMAGUI_TARGET === "native") {
6
6
  activeThemeManagers.forEach((manager) => {
7
7
  if (manager.name === name) {
8
- manager.update({
9
- name,
10
- theme: next.theme
11
- }, true);
8
+ manager.update(
9
+ {
10
+ name,
11
+ theme: next.theme
12
+ },
13
+ true
14
+ );
12
15
  }
13
16
  });
14
17
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/updateTheme.ts"],
4
4
  "sourcesContent": ["import { addTheme } from './addTheme'\nimport { activeThemeManagers } from './hooks/useTheme'\nimport { ThemeObject } from './types'\n\nexport function updateTheme({ name, theme }: { name: string; theme: ThemeObject }) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.name === name) {\n manager.update(\n {\n name,\n theme: next.theme,\n },\n true\n )\n }\n })\n }\n\n return next\n}\n"],
5
- "mappings": "AAAA;AACA;AAGO,qBAAqB,EAAE,MAAM,SAA+C;AACjF,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,SAAS,MAAM;AACzB,gBAAQ,OACN;AAAA,UACE;AAAA,UACA,OAAO,KAAK;AAAA,QACd,GACA,IACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
5
+ "mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAG7B,SAAS,YAAY,EAAE,MAAM,MAAM,GAAyC;AACjF,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,SAAS,MAAM;AACzB,gBAAQ;AAAA,UACN;AAAA,YACE;AAAA,YACA,OAAO,KAAK;AAAA,UACd;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,12 @@
1
- import React from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  const FontLanguage = ({ children, ...props }) => {
3
- return /* @__PURE__ */ React.createElement("div", {
3
+ return /* @__PURE__ */ jsx("div", {
4
4
  style: {
5
5
  display: "contents"
6
6
  },
7
- className: Object.entries(props).map(([name, language]) => `t_lang-${name}-${language}`).join(" ")
8
- }, children);
7
+ className: Object.entries(props).map(([name, language]) => `t_lang-${name}-${language}`).join(" "),
8
+ children
9
+ });
9
10
  };
10
11
  export {
11
12
  FontLanguage
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/FontLanguage.tsx"],
4
4
  "sourcesContent": ["import React from 'react'\n\nimport { FontLanguageProps } from './FontLanguage.types'\n\nexport const FontLanguage = ({ children, ...props }: FontLanguageProps) => {\n return (\n <div\n style={{\n display: 'contents',\n }}\n className={Object.entries(props)\n .map(([name, language]) => `t_lang-${name}-${language}`)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],
5
- "mappings": "AAAA;AAIO,MAAM,eAAe,CAAC,EAAE,aAAa,YAA+B;AACzE,SACE,oCAAC;AAAA,IACC,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,WAAW,OAAO,QAAQ,KAAK,EAC5B,IAAI,CAAC,CAAC,MAAM,cAAc,UAAU,QAAQ,UAAU,EACtD,KAAK,GAAG;AAAA,KAEV,QACH;AAEJ;",
5
+ "mappings": "AAMI;AAFG,MAAM,eAAe,CAAC,EAAE,aAAa,MAAM,MAAyB;AACzE,SACE,oBAAC;AAAA,IACC,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,WAAW,OAAO,QAAQ,KAAK,EAC5B,IAAI,CAAC,CAAC,MAAM,QAAQ,MAAM,UAAU,QAAQ,UAAU,EACtD,KAAK,GAAG;AAAA,IAEV;AAAA,GACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,12 @@
1
- import React, { useMemo } from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
2
3
  import { FontLanguageContext } from "../contexts/FontLanguageContext";
3
4
  const FontLanguage = ({ children, ...props }) => {
4
5
  const value = useMemo(() => props, [JSON.stringify(props)]);
5
- return /* @__PURE__ */ React.createElement(FontLanguageContext.Provider, {
6
- value
7
- }, children);
6
+ return /* @__PURE__ */ jsx(FontLanguageContext.Provider, {
7
+ value,
8
+ children
9
+ });
8
10
  };
9
11
  export {
10
12
  FontLanguage
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/FontLanguage.native.tsx"],
4
4
  "sourcesContent": ["import React, { useMemo } from 'react'\n\nimport { FontLanguageContext } from '../contexts/FontLanguageContext'\nimport { FontLanguageProps } from './FontLanguage.types'\n\nexport const FontLanguage = ({ children, ...props }: FontLanguageProps) => {\n const value = useMemo(() => props, [JSON.stringify(props)])\n return <FontLanguageContext.Provider value={value}>{children}</FontLanguageContext.Provider>\n}\n"],
5
- "mappings": "AAAA;AAEA;AAGO,MAAM,eAAe,CAAC,EAAE,aAAa,YAA+B;AACzE,QAAM,QAAQ,QAAQ,MAAM,OAAO,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAC1D,SAAO,oCAAC,oBAAoB,UAApB;AAAA,IAA6B;AAAA,KAAe,QAAS;AAC/D;",
5
+ "mappings": "AAOS;AAPT,SAAgB,eAAe;AAE/B,SAAS,2BAA2B;AAG7B,MAAM,eAAe,CAAC,EAAE,aAAa,MAAM,MAAyB;AACzE,QAAM,QAAQ,QAAQ,MAAM,OAAO,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAC1D,SAAO,oBAAC,oBAAoB,UAApB;AAAA,IAA6B;AAAA,IAAe;AAAA,GAAS;AAC/D;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
1
2
  import { composeRefs } from "@tamagui/compose-refs";
2
3
  import * as React from "react";
3
4
  import { isWeb } from "../constants/platform";
@@ -16,15 +17,17 @@ const Slot = React.forwardRef((props, forwardedRef) => {
16
17
  return child;
17
18
  }
18
19
  });
19
- return /* @__PURE__ */ React.createElement(SlotClone, {
20
+ return /* @__PURE__ */ jsx(SlotClone, {
20
21
  ...slotProps,
21
- ref: forwardedRef
22
- }, React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null);
22
+ ref: forwardedRef,
23
+ children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null
24
+ });
23
25
  }
24
- return /* @__PURE__ */ React.createElement(SlotClone, {
26
+ return /* @__PURE__ */ jsx(SlotClone, {
25
27
  ...slotProps,
26
- ref: forwardedRef
27
- }, children);
28
+ ref: forwardedRef,
29
+ children
30
+ });
28
31
  });
29
32
  Slot.displayName = "Slot";
30
33
  const SlotClone = React.forwardRef((props, forwardedRef) => {
@@ -40,7 +43,9 @@ const SlotClone = React.forwardRef((props, forwardedRef) => {
40
43
  });
41
44
  SlotClone.displayName = "SlotClone";
42
45
  const Slottable = ({ children }) => {
43
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
46
+ return /* @__PURE__ */ jsx(Fragment, {
47
+ children
48
+ });
44
49
  };
45
50
  function isSlottable(child) {
46
51
  return React.isValidElement(child) && child.type === Slottable;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Slot.tsx"],
4
4
  "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n const childrenArray = React.Children.toArray(children)\n const slottable = childrenArray.find(isSlottable)\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children as React.ReactNode\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null)\n return React.isValidElement(newElement)\n ? (newElement.props.children as React.ReactNode)\n : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeSlotProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child) && child.type === Slottable\n}\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeSlotProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = handleRegex.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nconst handleRegex = /^on[A-Z]/\n\nexport function mergeEvent(a?: Function, b?: Function) {\n return (...args: unknown[]) => {\n a?.(...args)\n b?.(...args)\n }\n}\n"],
5
- "mappings": "AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;AACnC,QAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;AACrD,QAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,MAAI,WAAW;AAEb,UAAM,aAAa,UAAU,MAAM;AAEnC,UAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,UAAI,UAAU,WAAW;AAGvB,YAAI,MAAM,SAAS,MAAM,UAAU,IAAI;AAAG,iBAAO,MAAM,SAAS,KAAK,IAAI;AACzE,eAAO,MAAM,eAAe,UAAU,IACjC,WAAW,MAAM,WAClB;AAAA,MACN,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,WACE,oCAAC;AAAA,MAAW,GAAG;AAAA,MAAW,KAAK;AAAA,OAC5B,MAAM,eAAe,UAAU,IAC5B,MAAM,aAAa,YAAY,QAAW,WAAW,IACrD,IACN;AAAA,EAEJ;AAEA,SACE,oCAAC;AAAA,IAAW,GAAG;AAAA,IAAW,KAAK;AAAA,KAC5B,QACH;AAEJ,CAAC;AA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AY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAEA,MAAM,cAAc;AAEb,SAAS,WAAW,GAAc,GAAc;AACrD,SAAO,IAAI,SAAoB;AAC7B,2BAAI,GAAG;AACP,2BAAI,GAAG;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Stack.tsx"],
4
4
  "sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps, StackPropsBase } from '../types'\n\nexport const Stack = createComponent<StackProps, View, StackPropsBase>({\n componentName: 'Stack',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
5
- "mappings": "AAEA;AACA;AAGO,MAAM,QAAQ,gBAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,eAAe;AAAA,EACjB;AACF,CAAC;",
5
+ "mappings": "AAEA,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAGzB,MAAM,QAAQ,gBAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,eAAe;AAAA,EACjB;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import * as React from "react";
2
3
  import { isClient, isRSC, isSSR } from "../constants/platform";
3
4
  import { ButtonInsideButtonContext } from "../contexts/ButtonInsideButtonContext";
@@ -11,10 +12,11 @@ function TamaguiProvider({
11
12
  ...themePropsProvider
12
13
  }) {
13
14
  if (isRSC) {
14
- return /* @__PURE__ */ React.createElement("span", {
15
+ return /* @__PURE__ */ jsx("span", {
15
16
  style: { display: "contents" },
16
- className: `t_${config.defaultTheme || "light"}`
17
- }, children);
17
+ className: `t_${config.defaultTheme || "light"}`,
18
+ children
19
+ });
18
20
  }
19
21
  if (!isSSR) {
20
22
  useMediaQueryListeners();
@@ -31,14 +33,18 @@ function TamaguiProvider({
31
33
  };
32
34
  }, [config, disableInjectCSS]);
33
35
  }
34
- return /* @__PURE__ */ React.createElement(ButtonInsideButtonContext.Provider, {
35
- value: false
36
- }, /* @__PURE__ */ React.createElement(TextAncestorProvider, null, /* @__PURE__ */ React.createElement(ThemeProvider, {
37
- defaultTheme: config.defaultTheme || "light",
38
- themeClassNameOnRoot: config.themeClassNameOnRoot,
39
- disableRootThemeClass: config.disableRootThemeClass,
40
- ...themePropsProvider
41
- }, children)));
36
+ return /* @__PURE__ */ jsx(ButtonInsideButtonContext.Provider, {
37
+ value: false,
38
+ children: /* @__PURE__ */ jsx(TextAncestorProvider, {
39
+ children: /* @__PURE__ */ jsx(ThemeProvider, {
40
+ defaultTheme: config.defaultTheme || "light",
41
+ themeClassNameOnRoot: config.themeClassNameOnRoot,
42
+ disableRootThemeClass: config.disableRootThemeClass,
43
+ ...themePropsProvider,
44
+ children
45
+ })
46
+ })
47
+ });
42
48
  }
43
49
  export {
44
50
  TamaguiProvider
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TamaguiProvider.tsx"],
4
4
  "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport * as React from 'react'\n\nimport { isClient, isRSC, isSSR } from '../constants/platform'\nimport { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'\nimport { TextAncestorProvider } from '../contexts/TextAncestorContext'\nimport { useMediaQueryListeners } from '../hooks/useMedia'\nimport type { TamaguiProviderProps } from '../types'\nimport { ThemeProvider } from './ThemeProvider'\n\nexport function TamaguiProvider({\n children,\n disableInjectCSS,\n config,\n ...themePropsProvider\n}: TamaguiProviderProps) {\n if (isRSC) {\n return (\n <span style={{ display: 'contents' }} className={`t_${config.defaultTheme || 'light'}`}>\n {children}\n </span>\n )\n }\n\n if (!isSSR) {\n useMediaQueryListeners()\n }\n\n if (isClient) {\n // inject CSS if asked to (not SSR compliant)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n if (disableInjectCSS) return\n const style = document.createElement('style')\n style.appendChild(document.createTextNode(config.getCSS()))\n document.head.appendChild(style)\n return () => {\n document.head.removeChild(style)\n }\n }, [config, disableInjectCSS])\n }\n\n return (\n <ButtonInsideButtonContext.Provider value={false}>\n <TextAncestorProvider>\n <ThemeProvider\n defaultTheme={config.defaultTheme || 'light'}\n themeClassNameOnRoot={config.themeClassNameOnRoot}\n disableRootThemeClass={config.disableRootThemeClass}\n {...themePropsProvider}\n >\n {children}\n </ThemeProvider>\n </TextAncestorProvider>\n </ButtonInsideButtonContext.Provider>\n )\n}\n"],
5
- "mappings": "AACA;AAEA;AACA;AACA;AACA;AAEA;AAEO,yBAAyB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,GACoB;AACvB,MAAI,OAAO;AACT,WACE,oCAAC;AAAA,MAAK,OAAO,EAAE,SAAS,WAAW;AAAA,MAAG,WAAW,KAAK,OAAO,gBAAgB;AAAA,OAC1E,QACH;AAAA,EAEJ;AAEA,MAAI,CAAC,OAAO;AACV,2BAAuB;AAAA,EACzB;AAEA,MAAI,UAAU;AAGZ,UAAM,gBAAgB,MAAM;AAC1B,UAAI;AAAkB;AACtB,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,YAAY,SAAS,eAAe,OAAO,OAAO,CAAC,CAAC;AAC1D,eAAS,KAAK,YAAY,KAAK;AAC/B,aAAO,MAAM;A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,OAAO;AAAA,QAC7B,GAAG;AAAA,QAEH;AAAA,OACH;AAAA,KACF;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Text.tsx"],
4
4
  "sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n componentName: 'Text',\n isText: true,\n\n defaultProps: {\n display: 'flex',\n fontFamily: 'System',\n ...(isWeb && {\n display: 'inline',\n boxSizing: 'border-box',\n wordWrap: 'break-word',\n }),\n },\n\n variants: {\n ...(isWeb && {\n numberOfLines: {\n 1: ellipseStyle,\n\n ':number': (numberOfLines) =>\n numberOfLines >= 1\n ? {\n WebkitLineClamp: numberOfLines,\n WebkitBoxOrient: 'vertical',\n display: '-webkit-box',\n overflow: 'hidden',\n }\n : null,\n },\n }),\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\n cursor: 'inherit',\n },\n },\n\n pressable: {\n true: {\n cursor: 'pointer',\n },\n },\n\n ellipse: {\n true: isWeb\n ? ellipseStyle\n : {\n numberOfLines: 1,\n lineBreakMode: 'clip',\n },\n },\n },\n\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n },\n})\n"],
5
- "mappings": "AAAA;AAGA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,gBAAoD;AAAA,EACtE,eAAe;AAAA,EACf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X,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,UAAU;AAAA,IACR,GAAI,SAAS;AAAA,MACX,eAAe;AAAA,QACb,GAAG;AAAA,QAEH,WAAW,CAAC,kBACV,iBAAiB,IACb;AAAA,UACE,iBAAiB;AAAA,UACjB,iBAAiB;AAAA,UACjB,SAAS;AAAA,UACT,UAAU;AAAA,QACZ,IACA;AAAA,MACR;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EAEA,YAAY,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAE5C,aAAa;AAAA,IACX,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import React, { memo, useMemo } from "react";
2
3
  import { isWeb } from "../constants/platform";
3
4
  import { variableToString } from "../createVariable";
@@ -6,9 +7,16 @@ import { useChangeThemeEffect } from "../hooks/useTheme";
6
7
  React["createElement"];
7
8
  const Theme = memo(function Theme2(props) {
8
9
  var _a;
9
- const { name, theme, themeManager, themes, className } = useChangeThemeEffect(props.name, props.componentName, props);
10
+ const { name, theme, themeManager, themes, className } = useChangeThemeEffect(
11
+ props.name,
12
+ props.componentName,
13
+ props
14
+ );
10
15
  const missingTheme = !themes || !name || !theme;
11
- const contents = useMemo(() => missingTheme ? null : wrapThemeManagerContext(props.children, themeManager), [missingTheme, props.children, themeManager]);
16
+ const contents = useMemo(
17
+ () => missingTheme ? null : wrapThemeManagerContext(props.children, themeManager),
18
+ [missingTheme, props.children, themeManager]
19
+ );
12
20
  if (missingTheme) {
13
21
  if (name && !theme && process.env.NODE_ENV === "development") {
14
22
  console.warn(`No theme found by name ${name}`);
@@ -16,22 +24,25 @@ const Theme = memo(function Theme2(props) {
16
24
  return props.children;
17
25
  }
18
26
  if (isWeb) {
19
- return /* @__PURE__ */ React.createElement("span", {
27
+ return /* @__PURE__ */ jsx("span", {
20
28
  className: (!props.disableThemeClass ? [props.className, className].filter(Boolean) : []).join(" "),
21
29
  style: {
22
30
  display: "contents",
23
31
  color: variableToString((_a = themes[name]) == null ? void 0 : _a.color)
24
- }
25
- }, contents);
32
+ },
33
+ children: contents
34
+ });
26
35
  }
27
36
  return contents;
28
37
  });
29
38
  function wrapThemeManagerContext(children, themeManager, shouldSetChildrenThemeToParent) {
30
- return themeManager ? /* @__PURE__ */ React.createElement(ThemeManagerContext.Provider, {
31
- value: themeManager
32
- }, shouldSetChildrenThemeToParent ? /* @__PURE__ */ React.createElement(Theme, {
33
- name: themeManager.parentName
34
- }, children) : children) : children;
39
+ return themeManager ? /* @__PURE__ */ jsx(ThemeManagerContext.Provider, {
40
+ value: themeManager,
41
+ children: shouldSetChildrenThemeToParent ? /* @__PURE__ */ jsx(Theme, {
42
+ name: themeManager.parentName,
43
+ children
44
+ }) : children
45
+ }) : children;
35
46
  }
36
47
  export {
37
48
  Theme,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Theme.tsx"],
4
4
  "sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { variableToString } from '../createVariable'\nimport { ThemeManager, ThemeManagerContext } from '../helpers/ThemeManager'\nimport { ThemeProps, useChangeThemeEffect } from '../hooks/useTheme'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n props.componentName,\n props\n )\n\n const missingTheme = !themes || !name || !theme\n\n // memo here, changing theme without re-rendering all children is a critical optimization\n // may require some effort of end user to memoize but without this memo they'd have no option\n const contents = useMemo(\n () => (missingTheme ? null : wrapThemeManagerContext(props.children, themeManager)),\n [missingTheme, props.children, themeManager]\n )\n\n if (missingTheme) {\n if (name && !theme && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\n\n if (isWeb) {\n return (\n <span\n className={(!props.disableThemeClass\n ? [props.className, className].filter(Boolean)\n : []\n ).join(' ')}\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: variableToString(themes[name]?.color),\n }}\n >\n {contents}\n </span>\n )\n }\n\n return contents\n})\n\nexport function wrapThemeManagerContext(\n children: any,\n themeManager?: ThemeManager | null,\n shouldSetChildrenThemeToParent?: boolean\n) {\n return themeManager ? (\n <ThemeManagerContext.Provider value={themeManager}>\n {shouldSetChildrenThemeToParent ? (\n <Theme name={themeManager.parentName}>{children}</Theme>\n ) : (\n children\n )}\n </ThemeManagerContext.Provider>\n ) : (\n children\n )\n}\n"],
5
- "mappings": "AAAA;AAEA;AACA;AACA;AACA;AAGA,MAAM;AAEC,MAAM,QAAQ,KAAK,gBAAe,OAAmB;AAV5D;AAWE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,qBACvD,MAAM,MACN,MAAM,eACN,KACF;AAEA,QAAM,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC;AAI1C,QAAM,WAAW,QACf,MAAO,eAAe,OAAO,wBAAwB,MAAM,UAAU,YAAY,GACjF,CAAC,cAAc,MAAM,UAAU,YAAY,CAC7C;AAEA,MAAI,cAAc;AAChB,QAAI,QAAQ,CAAC,SAAS,QAAQ,IAAI,aAAa,eAAe;AAE5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAA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S,EAAE,OAAO,OAAO,IAC3C,CAAC,GACH,KAAK,GAAG;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,kBAAiB,YAAO,UAAP,mBAAc,KAAK;AAAA,MAC7C;AAAA,MAEC;AAAA,KACH;AAAA,EAEJ;AAEA,SAAO;AACT,CAAC;AAEM,SAAS,wBACd,UACA,cACA,gCACA;AACA,SAAO,eACL,oBAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,IAClC,2CACC,oBAAC;AAAA,MAAM,MAAM,aAAa;AAAA,MAAa;AAAA,KAAS,IAEhD;AAAA,GAEJ,IAEA;AAEJ;",
6
+ "names": ["Theme"]
7
7
  }
@@ -1,4 +1,5 @@
1
- import React, { useState } from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { useIsomorphicLayoutEffect } from "../constants/platform";
3
4
  import { useDefaultThemeName, useThemeName } from "../hooks/useTheme";
4
5
  import { Theme } from "./Theme";
@@ -20,9 +21,10 @@ const ThemeInverse = ({
20
21
  if (disable) {
21
22
  return children;
22
23
  }
23
- return /* @__PURE__ */ React.createElement(Theme, {
24
- name
25
- }, children);
24
+ return /* @__PURE__ */ jsx(Theme, {
25
+ name,
26
+ children
27
+ });
26
28
  };
27
29
  export {
28
30
  ThemeInverse
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/ThemeInverse.tsx"],
4
4
  "sourcesContent": ["import React, { useState } from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { useDefaultThemeName, useThemeName } from '../hooks/useTheme'\nimport { Theme } from './Theme'\n\nexport const ThemeInverse = ({\n children,\n disable,\n}: {\n children: React.ReactNode\n disable?: boolean\n}) => {\n const themeName = useThemeName()\n const defaultTheme = useDefaultThemeName()\n const [name, setName] = useState<null | string>(null)\n\n // ssr\n useIsomorphicLayoutEffect(() => {\n if (themeName.startsWith('dark')) {\n setName('light')\n }\n if (themeName.startsWith('light')) {\n setName('dark')\n }\n }, [defaultTheme, themeName])\n\n if (disable) {\n return children as JSX.Element\n }\n\n return <Theme name={name}>{children}</Theme>\n}\n"],
5
- "mappings": "AAAA;AAEA;AACA;AACA;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,MAII;AACJ,QAAM,YAAY,aAAa;AAC/B,QAAM,eAAe,oBAAoB;AACzC,QAAM,CAAC,MAAM,WAAW,SAAwB,IAAI;AAGpD,4BAA0B,MAAM;AAC9B,QAAI,UAAU,WAAW,MAAM,GAAG;AAChC,cAAQ,OAAO;AAAA,IACjB;AACA,QAAI,UAAU,WAAW,OAAO,GAAG;AACjC,cAAQ,MAAM;AAAA,IAChB;AAAA,EACF,GAAG,CAAC,cAAc,SAAS,CAAC;AAE5B,MAAI,SAAS;AACX,WAAO;AAAA,EACT;AAEA,SAAO,oCAAC;AAAA,IAAM;AAAA,KAAa,QAAS;AACtC;",
5
+ "mappings": "AA+BS;AA/BT,SAAgB,gBAAgB;AAEhC,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB,oBAAoB;AAClD,SAAS,aAAa;AAEf,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AACF,MAGM;AACJ,QAAM,YAAY,aAAa;AAC/B,QAAM,eAAe,oBAAoB;AACzC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAwB,IAAI;AAGpD,4BAA0B,MAAM;AAC9B,QAAI,UAAU,WAAW,MAAM,GAAG;AAChC,cAAQ,OAAO;AAAA,IACjB;AACA,QAAI,UAAU,WAAW,OAAO,GAAG;AACjC,cAAQ,MAAM;AAAA,IAChB;AAAA,EACF,GAAG,CAAC,cAAc,SAAS,CAAC;AAE5B,MAAI,SAAS;AACX,WAAO;AAAA,EACT;AAEA,SAAO,oBAAC;AAAA,IAAM;AAAA,IAAa;AAAA,GAAS;AACtC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import React, { useLayoutEffect, useMemo } from "react";
2
3
  import { getConfig, getHasConfigured } from "../config";
3
4
  import { THEME_CLASSNAME_PREFIX } from "../constants/constants";
@@ -31,13 +32,15 @@ const ThemeProvider = (props) => {
31
32
  defaultTheme: props.defaultTheme
32
33
  };
33
34
  }, [props.defaultTheme]);
34
- return /* @__PURE__ */ React.createElement(ThemeContext.Provider, {
35
- value: themeContext
36
- }, /* @__PURE__ */ React.createElement(Theme, {
37
- className: props.className,
38
- name: props.defaultTheme,
39
- disableThemeClass: props.disableRootThemeClass
40
- }, props.children));
35
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, {
36
+ value: themeContext,
37
+ children: /* @__PURE__ */ jsx(Theme, {
38
+ className: props.className,
39
+ name: props.defaultTheme,
40
+ disableThemeClass: props.disableRootThemeClass,
41
+ children: props.children
42
+ })
43
+ });
41
44
  };
42
45
  export {
43
46
  ThemeProvider
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/ThemeProvider.tsx"],
4
4
  "sourcesContent": ["import React, { useLayoutEffect, useMemo } from 'react'\n\nimport { getConfig, getHasConfigured } from '../config'\nimport { THEME_CLASSNAME_PREFIX } from '../constants/constants'\nimport { ThemeContext } from '../contexts/ThemeContext'\nimport { Theme } from './Theme'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProviderProps = {\n className?: string\n defaultTheme: string\n disableRootThemeClass?: boolean\n themeClassNameOnRoot?: boolean\n children?: any\n reset?: boolean\n}\n\nexport const ThemeProvider = (props: ThemeProviderProps) => {\n if (process.env.NODE_ENV === 'development') {\n if (!getHasConfigured()) {\n throw new Error(`Missing configureThemes() call, add to your root file`)\n }\n }\n\n // ensure theme is attached to root body node as well to work with modals by default\n if (typeof document !== 'undefined') {\n useLayoutEffect(() => {\n if (props.disableRootThemeClass) {\n return\n }\n const cn = `${THEME_CLASSNAME_PREFIX}${props.defaultTheme}`\n const target = props.themeClassNameOnRoot ? document.documentElement : document.body\n target.classList.add(cn)\n return () => {\n target.classList.remove(cn)\n }\n }, [props.defaultTheme, props.disableRootThemeClass, props.themeClassNameOnRoot])\n }\n\n const themeContext = useMemo(() => {\n return {\n get themes() {\n return getConfig().themes\n },\n defaultTheme: props.defaultTheme,\n }\n }, [props.defaultTheme])\n\n return (\n <ThemeContext.Provider value={themeContext}>\n <Theme\n className={props.className}\n name={props.defaultTheme}\n disableThemeClass={props.disableRootThemeClass}\n >\n {props.children}\n </Theme>\n </ThemeContext.Provider>\n )\n}\n"],
5
- "mappings": "AAAA;AAEA;AACA;AACA;AACA;AAGA,MAAM;AAWC,MAAM,gBAAgB,CAAC,UAA8B;AAC1D,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,iBAAiB,GAAG;AACvB,YAAM,IAAI,MAAM,uDAAuD;AAAA,IACzE;AAAA,EACF;AAGA,MAAI,OAAO,aAAa,aAAa;AACnC,oBAAgB,MAAM;AACpB,UAAI,MAAM,uBAAuB;AAC/B;AAAA,MACF;AACA,YAAM,KAAK,GAAG,yBAAyB,MAAM;AAC7C,YAAM,SAAS,MAAM,uBAAuB,SAAS,kBAAkB,SAAS;AAChF,aAAO,UAAU,IAAI,EAAE;AACvB,aAAO,MAAM;AACX,eAAO,UAAU,OAAO,EAAE;AAAA,MAC5B;AAAA,IACF,GAAG,CAAC,MAAM,cAAc,MAAM,uBAAuB,MAAM,oBAAoB,CAAC;AAAA,EAClF;AAEA,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO;AAAA,MACL,IAAI,SAAS;AACX,eAAO,UAAU,EAAE;AAAA,MACrB;AAAA,MACA,cAAc,MAAM;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,YAAY,CAAC;AAEvB,SACE,oCAAC,aAAa,UAAb;AAAA,IAAsB,OAAO;AAAA,KAC5B,oCAAC;AAAA,IACC,WAAW,MAAM;AAAA,IACjB,MAAM,MAAM;AAAA,IACZ,mBAAmB,MAAM;AAAA,KAExB,MAAM,QACT,CACF;AAEJ;",
5
+ "mappings": "AAoDM;AApDN,OAAO,SAAS,iBAAiB,eAAe;AAEhD,SAAS,WAAW,wBAAwB;AAC5C,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAGtB,MAAM;AAWC,MAAM,gBAAgB,CAAC,UAA8B;AAC1D,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,iBAAiB,GAAG;AACvB,YAAM,IAAI,MAAM,uDAAuD;AAAA,IACzE;AAAA,EACF;AAGA,MAAI,OAAO,aAAa,aAAa;AACnC,oBAAgB,MAAM;AACpB,UAAI,MAAM,uBAAuB;AAC/B;AAAA,MACF;AACA,YAAM,KAAK,GAAG,yBAAyB,MAAM;AAC7C,YAAM,SAAS,MAAM,uBAAuB,SAAS,kBAAkB,SAAS;AAChF,aAAO,UAAU,IAAI,EAAE;AACvB,aAAO,MAAM;AACX,eAAO,UAAU,OAAO,EAAE;AAAA,MAC5B;AAAA,IACF,GAAG,CAAC,MAAM,cAAc,MAAM,uBAAuB,MAAM,oBAAoB,CAAC;AAAA,EAClF;AAEA,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO;AAAA,MACL,IAAI,SAAS;AACX,eAAO,UAAU,EAAE;AAAA,MACrB;AAAA,MACA,cAAc,MAAM;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,YAAY,CAAC;AAEvB,SACE,oBAAC,aAAa,UAAb;AAAA,IAAsB,OAAO;AAAA,IAC5B,8BAAC;AAAA,MACC,WAAW,MAAM;AAAA,MACjB,MAAM,MAAM;AAAA,MACZ,mBAAmB,MAAM;AAAA,MAExB,gBAAM;AAAA,KACT;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import React, { useContext, useLayoutEffect, useState } from "react";
2
3
  import { isWeb } from "../constants/platform";
3
4
  import { ThemeManagerContext } from "../helpers/ThemeManager";
@@ -25,11 +26,12 @@ const ThemeReset = (props) => {
25
26
  if (!themeManager || !props.children) {
26
27
  return props.children || null;
27
28
  }
28
- return /* @__PURE__ */ React.createElement(Theme, {
29
+ return /* @__PURE__ */ jsx(Theme, {
29
30
  className: "tui-theme-reset",
30
31
  reset: true,
31
- name
32
- }, props.children);
32
+ name,
33
+ children: props.children
34
+ });
33
35
  };
34
36
  export {
35
37
  ThemeReset
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/ThemeReset.tsx"],
4
4
  "sourcesContent": ["import React, { useContext, useLayoutEffect, useState } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { ThemeManagerContext } from '../helpers/ThemeManager'\nimport { Theme } from './Theme'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\n// resets the theme to the parent theme\nexport const ThemeReset = (props: { children?: any }) => {\n const themeManager = useContext(ThemeManagerContext)\n const [name, setName] = useState<string | null>(null)\n\n // this component doesn't work with SSR, so must run only client side\n // we could at least prevent more flickering by having the ssr head script\n // that changes to dark initially also go through and change all of these\n if (!isWeb || typeof document !== 'undefined') {\n useLayoutEffect(() => {\n if (!themeManager) return\n if (name !== themeManager.parentName) {\n setName(themeManager.parentName)\n }\n }, [themeManager?.parentName])\n\n useLayoutEffect(() => {\n if (!themeManager) return\n return themeManager.onChangeTheme(() => {\n setName(themeManager.parentName)\n })\n }, [])\n }\n\n if (!themeManager || !props.children) {\n return props.children || null\n }\n\n return (\n <Theme className=\"tui-theme-reset\" reset name={name}>\n {props.children}\n </Theme>\n )\n}\n"],
5
- "mappings": "AAAA;AAEA;AACA;AACA;AAGA,MAAM;AAGC,MAAM,aAAa,CAAC,UAA8B;AACvD,QAAM,eAAe,WAAW,mBAAmB;AACnD,QAAM,CAAC,MAAM,WAAW,SAAwB,IAAI;AAKpD,MAAI,CAAC,SAAS,OAAO,aAAa,aAAa;AAC7C,oBAAgB,MAAM;AACpB,UAAI,CA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AAM;AAAA,GACT;AAEJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.0.1-beta.151",
3
+ "version": "1.0.1-beta.152",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -27,14 +27,14 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@expo/match-media": "^0.3.0",
30
- "@tamagui/compose-refs": "^1.0.1-beta.151",
31
- "@tamagui/helpers": "^1.0.1-beta.151",
32
- "@tamagui/normalize-css-color-lite": "^1.0.1-beta.151",
33
- "@tamagui/rnw": "^1.0.1-beta.151",
34
- "@tamagui/rnw-lite": "^1.0.1-beta.151",
35
- "@tamagui/use-debounce": "^1.0.1-beta.151",
36
- "@tamagui/use-event": "^1.0.1-beta.151",
37
- "@tamagui/use-force-update": "^1.0.1-beta.151",
30
+ "@tamagui/compose-refs": "^1.0.1-beta.152",
31
+ "@tamagui/helpers": "^1.0.1-beta.152",
32
+ "@tamagui/normalize-css-color-lite": "^1.0.1-beta.152",
33
+ "@tamagui/rnw": "^1.0.1-beta.152",
34
+ "@tamagui/rnw-lite": "^1.0.1-beta.152",
35
+ "@tamagui/use-debounce": "^1.0.1-beta.152",
36
+ "@tamagui/use-event": "^1.0.1-beta.152",
37
+ "@tamagui/use-force-update": "^1.0.1-beta.152",
38
38
  "expo-screen-orientation": "^4.3.0",
39
39
  "hyphenate-style-name": "^1.0.4"
40
40
  },
@@ -43,7 +43,7 @@
43
43
  "react-dom": "*"
44
44
  },
45
45
  "devDependencies": {
46
- "@tamagui/build": "^1.0.1-beta.151",
46
+ "@tamagui/build": "^1.0.1-beta.152",
47
47
  "@types/react": "^18.0.15",
48
48
  "csstype": "^3.0.10",
49
49
  "esbuild": "^0.14.49",