@tamagui/core 1.0.0-alpha.11 → 1.0.0-alpha.12

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 (241) hide show
  1. package/dist/cjs/types.js.map +1 -1
  2. package/dist/esm/constants/constants.js +14 -0
  3. package/dist/esm/constants/constants.js.map +7 -0
  4. package/dist/esm/constants/platform.js +19 -0
  5. package/dist/esm/constants/platform.js.map +7 -0
  6. package/dist/esm/constants/pseudos.js +18 -0
  7. package/dist/esm/constants/pseudos.js.map +7 -0
  8. package/dist/esm/constants/rnw.js +22 -0
  9. package/dist/esm/constants/rnw.js.map +7 -0
  10. package/dist/esm/createComponent.js +464 -0
  11. package/dist/esm/createComponent.js.map +7 -0
  12. package/dist/esm/createFont.js +28 -0
  13. package/dist/esm/createFont.js.map +7 -0
  14. package/dist/esm/createShorthands.js +10 -0
  15. package/dist/esm/createShorthands.js.map +7 -0
  16. package/dist/esm/createTamagui.js +168 -0
  17. package/dist/esm/createTamagui.js.map +7 -0
  18. package/dist/esm/createTheme.js +20 -0
  19. package/dist/esm/createTheme.js.map +7 -0
  20. package/dist/esm/createTokens.js +33 -0
  21. package/dist/esm/createTokens.js.map +7 -0
  22. package/dist/esm/createVariable.js +25 -0
  23. package/dist/esm/createVariable.js.map +7 -0
  24. package/dist/esm/helpers/addStylesUsingClassname.js +57 -0
  25. package/dist/esm/helpers/addStylesUsingClassname.js.map +7 -0
  26. package/dist/esm/helpers/createMediaStyle.js +34 -0
  27. package/dist/esm/helpers/createMediaStyle.js.map +7 -0
  28. package/dist/esm/helpers/createPropMapper.js +160 -0
  29. package/dist/esm/helpers/createPropMapper.js.map +7 -0
  30. package/dist/esm/helpers/createTamaguiProvider.js +25 -0
  31. package/dist/esm/helpers/createTamaguiProvider.js.map +7 -0
  32. package/dist/esm/helpers/extendStaticConfig.js +59 -0
  33. package/dist/esm/helpers/extendStaticConfig.js.map +7 -0
  34. package/dist/esm/helpers/fixNativeShadow.js +8 -0
  35. package/dist/esm/helpers/fixNativeShadow.js.map +7 -0
  36. package/dist/esm/helpers/fixNativeShadow.native.js +30 -0
  37. package/dist/esm/helpers/fixNativeShadow.native.js.map +7 -0
  38. package/dist/esm/helpers/getSplitStyles.js +150 -0
  39. package/dist/esm/helpers/getSplitStyles.js.map +7 -0
  40. package/dist/esm/helpers/getStylesAtomic.js +83 -0
  41. package/dist/esm/helpers/getStylesAtomic.js.map +7 -0
  42. package/dist/esm/helpers/getStylesAtomic.native.js +10 -0
  43. package/dist/esm/helpers/getStylesAtomic.native.js.map +7 -0
  44. package/dist/esm/helpers/insertStyleRule.js +24 -0
  45. package/dist/esm/helpers/insertStyleRule.js.map +7 -0
  46. package/dist/esm/helpers/isObj.js +7 -0
  47. package/dist/esm/helpers/isObj.js.map +7 -0
  48. package/dist/esm/helpers/isTamaguiElement.js +10 -0
  49. package/dist/esm/helpers/isTamaguiElement.js.map +7 -0
  50. package/dist/esm/helpers/matchMedia.js +18 -0
  51. package/dist/esm/helpers/matchMedia.js.map +7 -0
  52. package/dist/esm/helpers/matchMedia.native.js +9 -0
  53. package/dist/esm/helpers/matchMedia.native.js.map +7 -0
  54. package/dist/esm/helpers/themeable.js +26 -0
  55. package/dist/esm/helpers/themeable.js.map +7 -0
  56. package/dist/esm/helpers/validate.js +60 -0
  57. package/dist/esm/helpers/validate.js.map +7 -0
  58. package/dist/esm/hooks/useConstant.js +15 -0
  59. package/dist/esm/hooks/useConstant.js.map +7 -0
  60. package/dist/esm/hooks/useFeatures.js +63 -0
  61. package/dist/esm/hooks/useFeatures.js.map +7 -0
  62. package/dist/esm/hooks/useMedia.js +173 -0
  63. package/dist/esm/hooks/useMedia.js.map +7 -0
  64. package/dist/esm/hooks/usePressable.js +13 -0
  65. package/dist/esm/hooks/usePressable.js.map +7 -0
  66. package/dist/esm/hooks/useTheme.js +89 -0
  67. package/dist/esm/hooks/useTheme.js.map +7 -0
  68. package/dist/esm/index.js +32 -0
  69. package/dist/esm/index.js.map +7 -0
  70. package/dist/esm/static/postProcessStyles.js +18 -0
  71. package/dist/esm/static/postProcessStyles.js.map +7 -0
  72. package/dist/esm/static.js +15 -0
  73. package/dist/esm/static.js.map +7 -0
  74. package/dist/esm/styled.js +21 -0
  75. package/dist/esm/styled.js.map +7 -0
  76. package/dist/esm/types.js +1 -0
  77. package/dist/esm/types.js.map +7 -0
  78. package/dist/esm/views/Animated.js +79 -0
  79. package/dist/esm/views/Animated.js.map +7 -0
  80. package/dist/esm/views/Stack.js +12 -0
  81. package/dist/esm/views/Stack.js.map +7 -0
  82. package/dist/esm/views/Text.js +60 -0
  83. package/dist/esm/views/Text.js.map +7 -0
  84. package/dist/esm/views/TextAncestorContext.js +18 -0
  85. package/dist/esm/views/TextAncestorContext.js.map +7 -0
  86. package/dist/esm/views/Theme.js +68 -0
  87. package/dist/esm/views/Theme.js.map +7 -0
  88. package/dist/esm/views/ThemeContext.js +6 -0
  89. package/dist/esm/views/ThemeContext.js.map +7 -0
  90. package/dist/esm/views/ThemeInverse.js +26 -0
  91. package/dist/esm/views/ThemeInverse.js.map +7 -0
  92. package/dist/esm/views/ThemeManagerContext.js +61 -0
  93. package/dist/esm/views/ThemeManagerContext.js.map +7 -0
  94. package/dist/esm/views/ThemeProvider.js +45 -0
  95. package/dist/esm/views/ThemeProvider.js.map +7 -0
  96. package/dist/jsx/constants/constants.js +13 -0
  97. package/dist/jsx/constants/platform.js +18 -0
  98. package/dist/jsx/constants/pseudos.js +17 -0
  99. package/dist/jsx/constants/rnw.js +21 -0
  100. package/dist/jsx/createComponent.js +458 -0
  101. package/dist/jsx/createFont.js +27 -0
  102. package/dist/jsx/createShorthands.js +9 -0
  103. package/dist/jsx/createTamagui.js +167 -0
  104. package/dist/jsx/createTheme.js +19 -0
  105. package/dist/jsx/createTokens.js +32 -0
  106. package/dist/jsx/createVariable.js +24 -0
  107. package/dist/jsx/helpers/addStylesUsingClassname.js +56 -0
  108. package/dist/jsx/helpers/createMediaStyle.js +33 -0
  109. package/dist/jsx/helpers/createPropMapper.js +159 -0
  110. package/dist/jsx/helpers/createTamaguiProvider.js +19 -0
  111. package/dist/jsx/helpers/extendStaticConfig.js +58 -0
  112. package/dist/jsx/helpers/fixNativeShadow.js +7 -0
  113. package/dist/jsx/helpers/fixNativeShadow.native.js +29 -0
  114. package/dist/jsx/helpers/getSplitStyles.js +149 -0
  115. package/dist/jsx/helpers/getStylesAtomic.js +82 -0
  116. package/dist/jsx/helpers/getStylesAtomic.native.js +9 -0
  117. package/dist/jsx/helpers/insertStyleRule.js +23 -0
  118. package/dist/jsx/helpers/isObj.js +6 -0
  119. package/dist/jsx/helpers/isTamaguiElement.js +9 -0
  120. package/dist/jsx/helpers/matchMedia.js +17 -0
  121. package/dist/jsx/helpers/matchMedia.native.js +8 -0
  122. package/dist/jsx/helpers/themeable.js +23 -0
  123. package/dist/jsx/helpers/validate.js +59 -0
  124. package/dist/jsx/hooks/useConstant.js +14 -0
  125. package/dist/jsx/hooks/useFeatures.js +57 -0
  126. package/dist/jsx/hooks/useMedia.js +172 -0
  127. package/dist/jsx/hooks/usePressable.js +12 -0
  128. package/dist/jsx/hooks/useTheme.js +88 -0
  129. package/dist/jsx/index.js +31 -0
  130. package/dist/jsx/static/postProcessStyles.js +17 -0
  131. package/dist/jsx/static.js +14 -0
  132. package/dist/jsx/styled.js +20 -0
  133. package/dist/jsx/types.js +0 -0
  134. package/dist/jsx/views/Animated.js +74 -0
  135. package/dist/jsx/views/Stack.js +11 -0
  136. package/dist/jsx/views/Text.js +59 -0
  137. package/dist/jsx/views/TextAncestorContext.js +14 -0
  138. package/dist/jsx/views/Theme.js +62 -0
  139. package/dist/jsx/views/ThemeContext.js +5 -0
  140. package/dist/jsx/views/ThemeInverse.js +22 -0
  141. package/dist/jsx/views/ThemeManagerContext.js +60 -0
  142. package/dist/jsx/views/ThemeProvider.js +39 -0
  143. package/package.json +10 -11
  144. package/src/createComponent.tsx +1 -1
  145. package/src/types.tsx +6 -6
  146. package/src/views/Text.tsx +2 -1
  147. package/types/constants/constants.d.ts +8 -0
  148. package/types/constants/constants.d.ts.map +1 -0
  149. package/types/constants/platform.d.ts +9 -0
  150. package/types/constants/platform.d.ts.map +1 -0
  151. package/types/constants/pseudos.d.ts +15 -0
  152. package/types/constants/pseudos.d.ts.map +1 -0
  153. package/types/constants/rnw.d.ts +2 -0
  154. package/types/constants/rnw.d.ts.map +1 -0
  155. package/types/createComponent.d.ts +17 -0
  156. package/types/createComponent.d.ts.map +1 -0
  157. package/types/createFont.d.ts +3 -0
  158. package/types/createFont.d.ts.map +1 -0
  159. package/types/createShorthands.d.ts +2 -0
  160. package/types/createShorthands.d.ts.map +1 -0
  161. package/types/createTamagui.d.ts +38 -0
  162. package/types/createTamagui.d.ts.map +1 -0
  163. package/types/createTheme.d.ts +5 -0
  164. package/types/createTheme.d.ts.map +1 -0
  165. package/types/createTokens.d.ts +55 -0
  166. package/types/createTokens.d.ts.map +1 -0
  167. package/types/createVariable.d.ts +15 -0
  168. package/types/createVariable.d.ts.map +1 -0
  169. package/types/helpers/addStylesUsingClassname.d.ts +3 -0
  170. package/types/helpers/addStylesUsingClassname.d.ts.map +1 -0
  171. package/types/helpers/createMediaStyle.d.ts +8 -0
  172. package/types/helpers/createMediaStyle.d.ts.map +1 -0
  173. package/types/helpers/createPropMapper.d.ts +3 -0
  174. package/types/helpers/createPropMapper.d.ts.map +1 -0
  175. package/types/helpers/createTamaguiProvider.d.ts +5 -0
  176. package/types/helpers/createTamaguiProvider.d.ts.map +1 -0
  177. package/types/helpers/extendStaticConfig.d.ts +5 -0
  178. package/types/helpers/extendStaticConfig.d.ts.map +1 -0
  179. package/types/helpers/fixNativeShadow.d.ts +2 -0
  180. package/types/helpers/fixNativeShadow.d.ts.map +1 -0
  181. package/types/helpers/fixNativeShadow.native.d.ts +2 -0
  182. package/types/helpers/fixNativeShadow.native.d.ts.map +1 -0
  183. package/types/helpers/getSplitStyles.d.ts +15 -0
  184. package/types/helpers/getSplitStyles.d.ts.map +1 -0
  185. package/types/helpers/getStylesAtomic.d.ts +3 -0
  186. package/types/helpers/getStylesAtomic.d.ts.map +1 -0
  187. package/types/helpers/getStylesAtomic.native.d.ts +2 -0
  188. package/types/helpers/getStylesAtomic.native.d.ts.map +1 -0
  189. package/types/helpers/insertStyleRule.d.ts +2 -0
  190. package/types/helpers/insertStyleRule.d.ts.map +1 -0
  191. package/types/helpers/isObj.d.ts +2 -0
  192. package/types/helpers/isObj.d.ts.map +1 -0
  193. package/types/helpers/isTamaguiElement.d.ts +3 -0
  194. package/types/helpers/isTamaguiElement.d.ts.map +1 -0
  195. package/types/helpers/matchMedia.d.ts +2 -0
  196. package/types/helpers/matchMedia.d.ts.map +1 -0
  197. package/types/helpers/matchMedia.native.d.ts +3 -0
  198. package/types/helpers/matchMedia.native.d.ts.map +1 -0
  199. package/types/helpers/themeable.d.ts +10 -0
  200. package/types/helpers/themeable.d.ts.map +1 -0
  201. package/types/helpers/validate.d.ts +4 -0
  202. package/types/helpers/validate.d.ts.map +1 -0
  203. package/types/hooks/useConstant.d.ts +2 -0
  204. package/types/hooks/useConstant.d.ts.map +1 -0
  205. package/types/hooks/useFeatures.d.ts +5 -0
  206. package/types/hooks/useFeatures.d.ts.map +1 -0
  207. package/types/hooks/useMedia.d.ts +16 -0
  208. package/types/hooks/useMedia.d.ts.map +1 -0
  209. package/types/hooks/usePressable.d.ts +3 -0
  210. package/types/hooks/usePressable.d.ts.map +1 -0
  211. package/types/hooks/useTheme.d.ts +20 -0
  212. package/types/hooks/useTheme.d.ts.map +1 -0
  213. package/types/index.d.ts +29 -0
  214. package/types/index.d.ts.map +1 -0
  215. package/types/static/postProcessStyles.d.ts +7 -0
  216. package/types/static/postProcessStyles.d.ts.map +1 -0
  217. package/types/static.d.ts +15 -0
  218. package/types/static.d.ts.map +1 -0
  219. package/types/styled.d.ts +21 -0
  220. package/types/styled.d.ts.map +1 -0
  221. package/types/types.d.ts +306 -0
  222. package/types/types.d.ts.map +1 -0
  223. package/types/views/Animated.d.ts +15 -0
  224. package/types/views/Animated.d.ts.map +1 -0
  225. package/types/views/Stack.d.ts +3 -0
  226. package/types/views/Stack.d.ts.map +1 -0
  227. package/types/views/Text.d.ts +3 -0
  228. package/types/views/Text.d.ts.map +1 -0
  229. package/types/views/TextAncestorContext.d.ts +3 -0
  230. package/types/views/TextAncestorContext.d.ts.map +1 -0
  231. package/types/views/Theme.d.ts +8 -0
  232. package/types/views/Theme.d.ts.map +1 -0
  233. package/types/views/ThemeContext.d.ts +18 -0
  234. package/types/views/ThemeContext.d.ts.map +1 -0
  235. package/types/views/ThemeInverse.d.ts +10 -0
  236. package/types/views/ThemeInverse.d.ts.map +1 -0
  237. package/types/views/ThemeManagerContext.d.ts +22 -0
  238. package/types/views/ThemeManagerContext.d.ts.map +1 -0
  239. package/types/views/ThemeProvider.d.ts +10 -0
  240. package/types/views/ThemeProvider.d.ts.map +1 -0
  241. package/types.d.ts +0 -559
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.tsx"],
4
- "sourcesContent": ["import React, { RefObject } from 'react'\nimport { TextProps as ReactTextProps, TextStyle } from 'react-native'\nimport { GestureResponderEvent, View, ViewProps, ViewStyle } from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {\n font: { [key: string]: GenericFont }\n color: { [key: string]: Val }\n space: { [key: string]: Val }\n size: { [key: string]: Val }\n radius: { [key: string]: Val }\n zIndex: { [key: string]: Val }\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]: {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n bg: string | Variable\n bg2: string | Variable\n bg3: string | Variable\n bg4: string | Variable\n color: string | Variable\n color2: string | Variable\n color3: string | Variable\n color4: string | Variable\n borderColor: string | Variable\n borderColor2: string | Variable\n shadowColor: string | Variable\n shadowColor2: string | Variable\n }\n}\ntype GenericShorthands = {}\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands,\n D extends GenericMedia\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\n// themes\nexport type ThemeName = keyof Themes extends `${infer Prefix}-${string}`\n ? Prefix | keyof Themes\n : keyof Themes\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeKeyVariables = `$${ThemeKeys}`\n// export type Spaces = TamaguiConfig['tokens']['spaces'][keyof TamaguiConfig['tokens']['spaces']]\n// export type FontSizes = TamaguiConfig['tokens']['fontSizes'][keyof TamaguiConfig['tokens']['fontSizes']]\n// export type Colors = TamaguiConfig['tokens']['colors'][keyof TamaguiConfig['tokens']['colors']]\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia\n> = CreateTamaguiConfig<A, B, C, D> & {\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n themeParsed: { [key: string]: Variable }\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends StaticComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont = {\n size: { [key: string | number]: number | Variable }\n lineHeight: { [key: string | number]: number | Variable }\n letterSpacing: { [key: string | number]: number | Variable }\n weight: { [key: string | number]: string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaProps<A> = {\n [key in `$${MediaQueryKey}`]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\ntype ComponentPropsBase = {\n className?: string\n tag?: string\n animated?: boolean\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: Tokens['space'][keyof Tokens['space']] | boolean | string | number\n pointerEvents?: string\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\nexport type SpaceTokens = `$${keyof Tokens['space']}`\n\n//\n// adds in theme short values to relevant props\n//\ntype ThemeValue<A> = Omit<A, string> | UnionableString | Variable\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]:\n | ThemeValue<T[K]>\n | (K extends ColorableKeys\n ? ThemeKeyVariables\n : K extends SizeKeys\n ? `$${keyof Tokens['size']}`\n : K extends FontKeys\n ? `$${keyof Tokens['font']}`\n : K extends FontSizeKeys\n ? `$${GetTokenFontKeysFor<'size'>}`\n : K extends SpaceKeys\n ? `$${keyof Tokens['space']}`\n : K extends ColorKeys\n ? `$${keyof Tokens['color']}`\n : K extends ZIndexKeys\n ? `$${keyof Tokens['zIndex']}`\n : K extends LineHeightKeys\n ? `$${GetTokenFontKeysFor<'lineHeight'>}`\n : K extends FontWeightKeys\n ? `$${GetTokenFontKeysFor<'weight'>}`\n : K extends FontLetterSpacingKeys\n ? `$${GetTokenFontKeysFor<'letterSpacing'>}`\n : {})\n}\n\n//\n// adds in shorthand props\n//\ntype WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : {}\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// adds theme and shorthands + pseudo styles with both\n//\ntype WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & {\n hoverStyle?: WithThemeAndShorthands<A> | null\n pressStyle?: WithThemeAndShorthands<A> | null\n}\n\n//\n// adds theme, shorthands, psuedos, then all the previous to media queries\n//\ntype WithThemeShorthandsPseudosAndMedia<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\ntype StackStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n>\n\nexport type StackProps = Omit<RNWInternalProps, 'children'> &\n Omit<ViewProps, 'display' | 'children'> &\n StackStyleProps &\n ComponentPropsBase & {\n ref?: RefObject<View | HTMLElement> | ((node: View | HTMLElement) => any)\n children?: any | any[]\n }\n\n//\n// Text props\n//\n\n// type EnhancedTextStyleProps = WithThemeValues<\n// Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps\n// >\n// export type TextStylePropsBase = EnhancedTextStyleProps\n// export type TextStyleProps<S = TextStylePropsBase> = S & {\n// hoverStyle?: S | null\n// pressStyle?: S | null\n// }\n\ntype TextStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps\n>\n\nexport type TextProps = Omit<ReactTextProps, 'style'> &\n TextStyleProps &\n ComponentPropsBase & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n }\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n StaticConfParsed = StaticConfigParsed,\n ParentVariantProps = any\n> = React.FunctionComponent<Props> & {\n staticConfig: StaticConfParsed\n variantProps?: VariantProps\n\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n initialWindowMetrics?: any\n fallback?: any\n children?: any\n}\n\nexport type RNWInternalProps = {\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n modal?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n accessibilityValue?: {\n max?: number\n min?: number\n now?: number\n text?: string\n }\n children?: any\n focusable?: boolean\n nativeID?: string\n onBlur?: (e: any) => void\n onClick?: (e: any) => void\n onClickCapture?: (e: any) => void\n onContextMenu?: (e: any) => void\n onFocus?: (e: any) => void\n onKeyDown?: (e: any) => void\n onKeyUp?: (e: any) => void\n onMoveShouldSetResponder?: (e: any) => boolean\n onMoveShouldSetResponderCapture?: (e: any) => boolean\n onResponderEnd?: (e: any) => void\n onResponderGrant?: (e: any) => void\n onResponderMove?: (e: any) => void\n onResponderReject?: (e: any) => void\n onResponderRelease?: (e: any) => void\n onResponderStart?: (e: any) => void\n onResponderTerminate?: (e: any) => void\n onResponderTerminationRequest?: (e: any) => boolean\n onScrollShouldSetResponder?: (e: any) => boolean\n onScrollShouldSetResponderCapture?: (e: any) => boolean\n onSelectionChangeShouldSetResponder?: (e: any) => boolean\n onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean\n onStartShouldSetResponder?: (e: any) => boolean\n onStartShouldSetResponderCapture?: (e: any) => boolean\n pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'\n testID?: string\n // unstable\n dataSet?: Object\n onMouseDown?: (e: any) => void\n onMouseEnter?: (e: any) => void\n onMouseLeave?: (e: any) => void\n onMouseMove?: (e: any) => void\n onMouseOver?: (e: any) => void\n onMouseOut?: (e: any) => void\n onMouseUp?: (e: any) => void\n onScroll?: (e: any) => void\n onTouchCancel?: (e: any) => void\n onTouchCancelCapture?: (e: any) => void\n onTouchEnd?: (e: any) => void\n onTouchEndCapture?: (e: any) => void\n onTouchMove?: (e: any) => void\n onTouchMoveCapture?: (e: any) => void\n onTouchStart?: (e: any) => void\n onTouchStartCapture?: (e: any) => void\n onWheel?: (e: any) => void\n href?: string\n hrefAttrs?: { download?: boolean; rel?: string; target?: string }\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: StaticComponent\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /*\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /*\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /*\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /*\n * Allows for defining extra valid props to be extracted beyond\n * the default ones.\n */\n validPropsExtra?: { [key: string]: any }\n\n /*\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /*\n * If this prop is encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /*\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /*\n * We need to wrap children\n */\n isZStack?: boolean\n}\n\ntype ColorableKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n\ntype SpaceKeys =\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n"],
4
+ "sourcesContent": ["import React, { RefObject } from 'react'\nimport { TextProps as ReactTextProps, TextStyle } from 'react-native'\nimport { GestureResponderEvent, View, ViewProps, ViewStyle } from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {\n font: { [key: string]: GenericFont }\n color: { [key: string]: Val }\n space: { [key: string]: Val }\n size: { [key: string]: Val }\n radius: { [key: string]: Val }\n zIndex: { [key: string]: Val }\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]: {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n bg: string | Variable\n bg2: string | Variable\n bg3: string | Variable\n bg4: string | Variable\n color: string | Variable\n color2: string | Variable\n color3: string | Variable\n color4: string | Variable\n borderColor: string | Variable\n borderColor2: string | Variable\n shadowColor: string | Variable\n shadowColor2: string | Variable\n }\n}\ntype GenericShorthands = {}\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands,\n D extends GenericMedia\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\n// themes\nexport type ThemeName = keyof Themes extends `${infer Prefix}-${string}`\n ? Prefix | keyof Themes\n : keyof Themes\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeKeyVariables = `$${ThemeKeys}`\n// export type Spaces = TamaguiConfig['tokens']['spaces'][keyof TamaguiConfig['tokens']['spaces']]\n// export type FontSizes = TamaguiConfig['tokens']['fontSizes'][keyof TamaguiConfig['tokens']['fontSizes']]\n// export type Colors = TamaguiConfig['tokens']['colors'][keyof TamaguiConfig['tokens']['colors']]\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia\n> = CreateTamaguiConfig<A, B, C, D> & {\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n themeParsed: { [key: string]: Variable }\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends StaticComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont = {\n size: { [key: string | number]: number | Variable }\n lineHeight: { [key: string | number]: number | Variable }\n letterSpacing: { [key: string | number]: number | Variable }\n weight: { [key: string | number]: string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaProps<A> = {\n [key in `$${MediaQueryKey}`]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\ntype ComponentPropsBase = {\n className?: string\n tag?: string\n animated?: boolean\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: Tokens['space'][keyof Tokens['space']] | boolean | string | number\n pointerEvents?: string\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\nexport type SpaceTokens = `$${keyof Tokens['space']}`\n\n//\n// adds in theme short values to relevant props\n//\ntype ThemeValue<A> = Omit<A, string> | UnionableString | Variable\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]:\n | ThemeValue<T[K]>\n | (K extends ColorableKeys\n ? ThemeKeyVariables\n : K extends SizeKeys\n ? `$${keyof Tokens['size']}`\n : K extends FontKeys\n ? `$${keyof Tokens['font']}`\n : K extends FontSizeKeys\n ? `$${GetTokenFontKeysFor<'size'>}`\n : K extends SpaceKeys\n ? `$${keyof Tokens['space']}`\n : K extends ColorKeys\n ? `$${keyof Tokens['color']}`\n : K extends ZIndexKeys\n ? `$${keyof Tokens['zIndex']}`\n : K extends LineHeightKeys\n ? `$${GetTokenFontKeysFor<'lineHeight'>}`\n : K extends FontWeightKeys\n ? `$${GetTokenFontKeysFor<'weight'>}`\n : K extends FontLetterSpacingKeys\n ? `$${GetTokenFontKeysFor<'letterSpacing'>}`\n : {})\n}\n\n//\n// adds in shorthand props\n//\ntype WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// adds theme and shorthands + pseudo styles with both\n//\ntype WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & {\n hoverStyle?: WithThemeAndShorthands<A> | null\n pressStyle?: WithThemeAndShorthands<A> | null\n}\n\n//\n// adds theme, shorthands, psuedos, then all the previous to media queries\n//\ntype WithThemeShorthandsPseudosAndMedia<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackStyleProps = WithThemeShorthandsPseudosAndMedia<StackStylePropsBase>\n\nexport type StackProps = Omit<RNWInternalProps, 'children'> &\n Omit<ViewProps, 'display' | 'children'> &\n StackStyleProps &\n ComponentPropsBase & {\n ref?: RefObject<View | HTMLElement> | ((node: View | HTMLElement) => any)\n children?: any | any[]\n }\n\n//\n// Text props\n//\n\n// type EnhancedTextStyleProps = WithThemeValues<\n// Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps\n// >\n// export type TextStylePropsBase = EnhancedTextStyleProps\n// export type TextStyleProps<S = TextStylePropsBase> = S & {\n// hoverStyle?: S | null\n// pressStyle?: S | null\n// }\n\ntype TextStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps\n>\n\nexport type TextProps = Omit<ReactTextProps, 'style'> &\n TextStyleProps &\n ComponentPropsBase & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n }\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n StaticConfParsed = StaticConfigParsed,\n ParentVariantProps = any\n> = React.FunctionComponent<Props> & {\n staticConfig: StaticConfParsed\n variantProps?: VariantProps\n\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n initialWindowMetrics?: any\n fallback?: any\n children?: any\n}\n\nexport type RNWInternalProps = {\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n modal?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n accessibilityValue?: {\n max?: number\n min?: number\n now?: number\n text?: string\n }\n children?: any\n focusable?: boolean\n nativeID?: string\n onBlur?: (e: any) => void\n onClick?: (e: any) => void\n onClickCapture?: (e: any) => void\n onContextMenu?: (e: any) => void\n onFocus?: (e: any) => void\n onKeyDown?: (e: any) => void\n onKeyUp?: (e: any) => void\n onMoveShouldSetResponder?: (e: any) => boolean\n onMoveShouldSetResponderCapture?: (e: any) => boolean\n onResponderEnd?: (e: any) => void\n onResponderGrant?: (e: any) => void\n onResponderMove?: (e: any) => void\n onResponderReject?: (e: any) => void\n onResponderRelease?: (e: any) => void\n onResponderStart?: (e: any) => void\n onResponderTerminate?: (e: any) => void\n onResponderTerminationRequest?: (e: any) => boolean\n onScrollShouldSetResponder?: (e: any) => boolean\n onScrollShouldSetResponderCapture?: (e: any) => boolean\n onSelectionChangeShouldSetResponder?: (e: any) => boolean\n onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean\n onStartShouldSetResponder?: (e: any) => boolean\n onStartShouldSetResponderCapture?: (e: any) => boolean\n pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'\n testID?: string\n // unstable\n dataSet?: Object\n onMouseDown?: (e: any) => void\n onMouseEnter?: (e: any) => void\n onMouseLeave?: (e: any) => void\n onMouseMove?: (e: any) => void\n onMouseOver?: (e: any) => void\n onMouseOut?: (e: any) => void\n onMouseUp?: (e: any) => void\n onScroll?: (e: any) => void\n onTouchCancel?: (e: any) => void\n onTouchCancelCapture?: (e: any) => void\n onTouchEnd?: (e: any) => void\n onTouchEndCapture?: (e: any) => void\n onTouchMove?: (e: any) => void\n onTouchMoveCapture?: (e: any) => void\n onTouchStart?: (e: any) => void\n onTouchStartCapture?: (e: any) => void\n onWheel?: (e: any) => void\n href?: string\n hrefAttrs?: { download?: boolean; rel?: string; target?: string }\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: StaticComponent\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /*\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /*\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /*\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /*\n * Allows for defining extra valid props to be extracted beyond\n * the default ones.\n */\n validPropsExtra?: { [key: string]: any }\n\n /*\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /*\n * If this prop is encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /*\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /*\n * We need to wrap children\n */\n isZStack?: boolean\n}\n\ntype ColorableKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n\ntype SpaceKeys =\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n"],
5
5
  "mappings": ";;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,14 @@
1
+ import { isWeb } from "./platform";
2
+ const stackDefaultStyles = {
3
+ alignItems: "stretch",
4
+ flexShrink: 0,
5
+ ...isWeb && {
6
+ display: "flex",
7
+ flexBasis: "auto",
8
+ boxSizing: "border-box"
9
+ }
10
+ };
11
+ export {
12
+ stackDefaultStyles
13
+ };
14
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/constants.ts"],
4
+ "sourcesContent": ["import { isWeb } from './platform'\n\nexport const stackDefaultStyles = {\n alignItems: 'stretch',\n flexShrink: 0,\n // more accurately match react-native defaults on web\n ...(isWeb && {\n display: 'flex',\n flexBasis: 'auto',\n boxSizing: 'border-box',\n }),\n}\n"],
5
+ "mappings": "AAAA;AAEO,MAAM,qBAAqB;AAAA,EAChC,YAAY;AAAA,EACZ,YAAY;AAAA,KAER,SAAS;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { useEffect, useLayoutEffect } from "react";
2
+ import { Platform } from "react-native";
3
+ const isWeb = process.env.TAMAGUI_TARGET === "web" ? true : Platform?.OS === "web";
4
+ const isSSR = isWeb && typeof window === "undefined";
5
+ const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
6
+ const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
7
+ const supportsTouchWeb = typeof window !== "undefined" && "ontouchstart" in window;
8
+ const isTouchDevice = !isWeb || supportsTouchWeb;
9
+ const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window["MSStream"];
10
+ export {
11
+ isChrome,
12
+ isSSR,
13
+ isTouchDevice,
14
+ isWeb,
15
+ isWebIOS,
16
+ supportsTouchWeb,
17
+ useIsomorphicLayoutEffect
18
+ };
19
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/platform.ts"],
4
+ "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web' ? true : Platform?.OS === 'web'\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const supportsTouchWeb = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchDevice = !isWeb || supportsTouchWeb\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
5
+ "mappings": "AAAA;AACA;AAEO,MAAM,QAAQ,QAAQ,IAAI,mBAAmB,QAAQ,OAAO,UAAU,OAAO;AAC7E,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,4BAA4B,QAAQ,YAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa;AAC1F,MAAM,mBAAmB,OAAO,WAAW,eAAe,kBAAkB;AAC5E,MAAM,gBAAgB,CAAC,SAAS;AAChC,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,aAChC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ const pseudos = {
2
+ focusStyle: {
3
+ name: "focus",
4
+ priority: 3
5
+ },
6
+ pressStyle: {
7
+ name: "active",
8
+ priority: 2
9
+ },
10
+ hoverStyle: {
11
+ name: "hover",
12
+ priority: 1
13
+ }
14
+ };
15
+ export {
16
+ pseudos
17
+ };
18
+ //# sourceMappingURL=pseudos.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/pseudos.ts"],
4
+ "sourcesContent": ["export const pseudos = {\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n}\n"],
5
+ "mappings": "AAAO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const interopRequire = /* @__PURE__ */ __name((src) => "default" in src ? src.default : src, "interopRequire");
4
+ const rnw = {};
5
+ if (process.env.IS_STATIC === "is_static") {
6
+ const createCompileableStyle = require("react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle");
7
+ const createReactDOMStyle = require("react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle");
8
+ const i18Style = require("react-native-web/dist/cjs/exports/StyleSheet/i18nStyle");
9
+ const atomic = require("react-native-web/dist/cjs/exports/StyleSheet/compile").atomic;
10
+ Object.assign(rnw, {
11
+ createCompileableStyle,
12
+ createReactDOMStyle,
13
+ i18Style,
14
+ atomic
15
+ });
16
+ } else if (process.env.TAMAGUI_TARGET === "web") {
17
+ Object.assign(rnw, interopRequire(require("react-native-web").TamaguiExports));
18
+ }
19
+ export {
20
+ rnw
21
+ };
22
+ //# sourceMappingURL=rnw.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/rnw.tsx"],
4
+ "sourcesContent": ["const interopRequire = (src: any) => ('default' in src ? src.default : src)\n\nexport const rnw: Record<string, any> = {}\n\n// in static mode, require them directly since we can't import react-native-web at all (it has flow stuff in it)\nif (process.env.IS_STATIC === 'is_static') {\n const createCompileableStyle = require('react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle')\n const createReactDOMStyle = require('react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle')\n const i18Style = require('react-native-web/dist/cjs/exports/StyleSheet/i18nStyle')\n const atomic = require('react-native-web/dist/cjs/exports/StyleSheet/compile').atomic\n Object.assign(rnw, {\n createCompileableStyle,\n createReactDOMStyle,\n i18Style,\n atomic,\n })\n} else if (process.env.TAMAGUI_TARGET === 'web') {\n // when targeting web (client) import it like so\n Object.assign(rnw, interopRequire(require('react-native-web').TamaguiExports))\n}\n"],
5
+ "mappings": ";;AAAA,MAAM,iBAAiB,wBAAC,QAAc,aAAa,MAAM,IAAI,UAAU,KAAhD;AAEhB,MAAM,MAA2B;AAGxC,IAAI,QAAQ,IAAI,cAAc,aAAa;AACzC,QAAM,yBAAyB,QAAQ;AACvC,QAAM,sBAAsB,QAAQ;AACpC,QAAM,WAAW,QAAQ;AACzB,QAAM,SAAS,QAAQ,wDAAwD;AAC/E,SAAO,OAAO,KAAK;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,WAEO,QAAQ,IAAI,mBAAmB,OAAO;AAE/C,SAAO,OAAO,KAAK,eAAe,QAAQ,oBAAoB;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,464 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { concatClassName, stylePropsView } from "@tamagui/helpers";
4
+ import { useForceUpdate } from "@tamagui/use-force-update";
5
+ import React, {
6
+ Children,
7
+ Fragment,
8
+ createElement,
9
+ forwardRef,
10
+ useCallback,
11
+ useContext,
12
+ useEffect,
13
+ useRef,
14
+ useState
15
+ } from "react";
16
+ import { StyleSheet, Text, View } from "react-native";
17
+ import { stackDefaultStyles } from "./constants/constants";
18
+ import { isTouchDevice, isWeb } from "./constants/platform";
19
+ import { rnw } from "./constants/rnw";
20
+ import { onConfiguredOnce } from "./createTamagui";
21
+ import { addStylesUsingClassname, useStylesAsClassname } from "./helpers/addStylesUsingClassname";
22
+ import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
23
+ import { getSplitStyles } from "./helpers/getSplitStyles";
24
+ import { useFeatures } from "./hooks/useFeatures";
25
+ import { usePressable } from "./hooks/usePressable";
26
+ import { TextAncestorContext } from "./views/TextAncestorContext";
27
+ import { ThemeManagerContext } from "./views/ThemeManagerContext";
28
+ const mouseUps = new Set();
29
+ if (typeof document !== "undefined") {
30
+ document.addEventListener("mouseup", () => {
31
+ mouseUps.forEach((x) => x());
32
+ mouseUps.clear();
33
+ });
34
+ }
35
+ function createComponent(configIn) {
36
+ let staticConfig;
37
+ if ("parsed" in configIn) {
38
+ staticConfig = configIn;
39
+ } else {
40
+ staticConfig = parseStaticConfig(configIn);
41
+ }
42
+ const { Component, validStyles, isText, isZStack } = staticConfig;
43
+ const validStyleProps = validStyles ?? stylePropsView;
44
+ let defaultProps = null;
45
+ let tamaguiConfig;
46
+ let defaultsStyle;
47
+ let defaultsClassName = "";
48
+ let initialTheme;
49
+ const component = forwardRef((props, forwardedRef) => {
50
+ const forceUpdate = useForceUpdate();
51
+ const features = useFeatures(props, { forceUpdate });
52
+ const manager = useContext(ThemeManagerContext);
53
+ const [state, set_] = useState(() => ({
54
+ hover: false,
55
+ press: false,
56
+ pressIn: false,
57
+ theme: manager.name
58
+ }));
59
+ const set = /* @__PURE__ */ __name((next) => set_((prev) => {
60
+ for (const key in next) {
61
+ if (prev[key] !== next[key]) {
62
+ return { ...prev, ...next };
63
+ }
64
+ }
65
+ return prev;
66
+ }), "set");
67
+ if (process.env.NODE_ENV === "development" && !isText && isWeb) {
68
+ Children.toArray(props.children).forEach((item) => {
69
+ if (typeof item === "string") {
70
+ console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
71
+ }
72
+ });
73
+ }
74
+ const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
75
+ const hostRef = useRef(null);
76
+ const theme = manager.theme || initialTheme;
77
+ const {
78
+ viewProps: viewPropsIn,
79
+ pseudos,
80
+ style,
81
+ classNames
82
+ } = getSplitStyles(props, staticConfig, theme);
83
+ const {
84
+ tag,
85
+ hitSlop,
86
+ children,
87
+ pointerEvents,
88
+ onPress,
89
+ onPressIn,
90
+ onPressOut,
91
+ onHoverIn,
92
+ onHoverOut,
93
+ space,
94
+ disabled,
95
+ onMouseEnter,
96
+ onMouseLeave,
97
+ hrefAttrs,
98
+ onMoveShouldSetResponder,
99
+ onMoveShouldSetResponderCapture,
100
+ onResponderEnd,
101
+ onResponderGrant,
102
+ onResponderMove,
103
+ onResponderReject,
104
+ onResponderRelease,
105
+ onResponderStart,
106
+ onResponderTerminate,
107
+ onResponderTerminationRequest,
108
+ onScrollShouldSetResponder,
109
+ onScrollShouldSetResponderCapture,
110
+ onSelectionChangeShouldSetResponder,
111
+ onSelectionChangeShouldSetResponderCapture,
112
+ onStartShouldSetResponder,
113
+ onStartShouldSetResponderCapture,
114
+ onMouseDown,
115
+ onClick,
116
+ accessible,
117
+ accessibilityRole,
118
+ onLayout,
119
+ ...viewProps
120
+ } = viewPropsIn;
121
+ if (!isWeb) {
122
+ if (accessible)
123
+ viewProps.accessible = accessible;
124
+ if (accessibilityRole)
125
+ viewProps.accessibilityRole = accessibilityRole;
126
+ }
127
+ if (isWeb) {
128
+ rnw.useResponderEvents(hostRef, {
129
+ onMoveShouldSetResponder,
130
+ onMoveShouldSetResponderCapture,
131
+ onResponderEnd,
132
+ onResponderGrant,
133
+ onResponderMove,
134
+ onResponderReject,
135
+ onResponderRelease,
136
+ onResponderStart,
137
+ onResponderTerminate,
138
+ onResponderTerminationRequest,
139
+ onScrollShouldSetResponder,
140
+ onScrollShouldSetResponderCapture,
141
+ onSelectionChangeShouldSetResponder,
142
+ onSelectionChangeShouldSetResponderCapture,
143
+ onStartShouldSetResponder,
144
+ onStartShouldSetResponderCapture
145
+ });
146
+ }
147
+ const isTracking = useRef(false);
148
+ const internal = useRef();
149
+ if (!internal.current) {
150
+ internal.current = {
151
+ isMounted: true
152
+ };
153
+ }
154
+ useEffect(() => {
155
+ internal.current.isMounted = true;
156
+ const dispose = manager?.onChangeTheme((name) => {
157
+ if (isTracking.current) {
158
+ set({ theme: name });
159
+ }
160
+ });
161
+ return () => {
162
+ dispose();
163
+ mouseUps.delete(unPress);
164
+ isTracking.current = false;
165
+ internal.current.isMounted = false;
166
+ };
167
+ }, [manager]);
168
+ const element = isWeb ? !Component || typeof Component === "string" ? tag || Component : Component : Component;
169
+ const ReactView = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
170
+ const ReactText = !isWeb ? Text : element || "span";
171
+ const ViewComponent = isText ? ReactText : ReactView;
172
+ const isHovering = !isTouchDevice && !disabled && pseudos && state.hover;
173
+ const isPressing = !disabled && pseudos && state.press;
174
+ const styles = [
175
+ style,
176
+ isHovering ? pseudos.hoverStyle || null : null,
177
+ isPressing ? pseudos.pressStyle || null : null
178
+ ];
179
+ if (isWeb) {
180
+ const stylesClassNames = useStylesAsClassname(styles);
181
+ const classList = isText ? [
182
+ defaultsClassName,
183
+ classNames,
184
+ stylesClassNames,
185
+ props.className
186
+ ] : [defaultsClassName, props.className, classNames, stylesClassNames];
187
+ const className = concatClassName(...classList);
188
+ if (process.env.NODE_ENV === "development") {
189
+ if (props["debug"]) {
190
+ console.log("\u{1F95A} className", { style, styles, classList, stylesClassNames, className });
191
+ }
192
+ }
193
+ viewProps.className = className;
194
+ } else {
195
+ viewProps.style = styles;
196
+ }
197
+ if (pointerEvents) {
198
+ viewProps.pointerEvents = pointerEvents;
199
+ }
200
+ if (isWeb) {
201
+ const platformMethodsRef = rnw.usePlatformMethods(viewProps);
202
+ const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
203
+ viewProps.ref = setRef;
204
+ if (props.href != null && hrefAttrs != null) {
205
+ const { download, rel, target } = hrefAttrs;
206
+ if (download != null) {
207
+ viewProps.download = download;
208
+ }
209
+ if (rel != null) {
210
+ viewProps.rel = rel;
211
+ }
212
+ if (typeof target === "string") {
213
+ viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
214
+ }
215
+ }
216
+ } else {
217
+ if (forwardedRef) {
218
+ viewProps.ref = forwardedRef;
219
+ }
220
+ }
221
+ const attachPress = !!(pseudos && pseudos.pressStyle || onPress || onPressOut || onPressIn || onClick);
222
+ const attachHover = isWeb && !isTouchDevice && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
223
+ const shouldAttach = internal.current.hasEverHadEvents || attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onClick" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props);
224
+ if (shouldAttach) {
225
+ internal.current.hasEverHadEvents = true;
226
+ }
227
+ const unPress = useCallback(() => {
228
+ if (!internal.current.isMounted)
229
+ return;
230
+ set({
231
+ press: false,
232
+ pressIn: false
233
+ });
234
+ }, []);
235
+ const events = shouldAttach ? {
236
+ ...!isWeb && {
237
+ onPressOut: (e) => {
238
+ unPress();
239
+ onPressOut?.(e);
240
+ }
241
+ },
242
+ ...isWeb && !isTouchDevice && {
243
+ onMouseEnter: attachHover || attachPress ? (e) => {
244
+ let next = {};
245
+ if (attachHover) {
246
+ next.hover = true;
247
+ }
248
+ if (state.pressIn) {
249
+ next.press = true;
250
+ }
251
+ if (Object.keys(next).length) {
252
+ set(next);
253
+ }
254
+ onHoverIn?.(e);
255
+ onMouseEnter?.(e);
256
+ } : void 0,
257
+ onMouseLeave: attachHover || attachPress ? (e) => {
258
+ let next = {};
259
+ mouseUps.add(unPress);
260
+ if (attachHover) {
261
+ next.hover = false;
262
+ }
263
+ if (state.pressIn) {
264
+ next.press = false;
265
+ next.pressIn = false;
266
+ }
267
+ if (Object.keys(next).length) {
268
+ set(next);
269
+ }
270
+ onHoverOut?.(e);
271
+ onMouseLeave?.(e);
272
+ } : void 0
273
+ },
274
+ onMouseDown: attachPress ? (e) => {
275
+ set({
276
+ press: true,
277
+ pressIn: true
278
+ });
279
+ onPressIn?.(e);
280
+ onMouseDown?.(e);
281
+ } : onPressIn,
282
+ onClick: attachPress ? (e) => {
283
+ onPress?.(e);
284
+ onClick?.(e);
285
+ unPress();
286
+ onPressOut?.(e);
287
+ } : onPressOut
288
+ } : null;
289
+ if (events) {
290
+ if (typeof ViewComponent !== "string") {
291
+ const [pressProps] = usePressable({
292
+ disabled,
293
+ hitSlop,
294
+ onPressIn: events.onMouseDown,
295
+ onPressOut: events.onPressOut,
296
+ onPress: events.onClick
297
+ });
298
+ Object.assign(viewProps, pressProps);
299
+ } else {
300
+ Object.assign(viewProps, events);
301
+ }
302
+ }
303
+ const childEls = spacedChildren({
304
+ children,
305
+ space,
306
+ flexDirection: props.flexDirection || defaultProps?.flexDirection,
307
+ isZStack
308
+ });
309
+ let content;
310
+ if (isWeb && rnw) {
311
+ const domProps = rnw.createDOMProps(viewProps);
312
+ const className = domProps.className && domProps.className !== viewProps.className ? `${domProps.className} ${viewProps.className}` : viewProps.className;
313
+ Object.assign(viewProps, domProps);
314
+ viewProps.className = className;
315
+ content = createElement(ViewComponent, viewProps, childEls);
316
+ } else {
317
+ content = createElement(ViewComponent, viewProps, childEls);
318
+ }
319
+ const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor;
320
+ if (shouldWrapTextAncestor) {
321
+ content = createElement(TextAncestorContext.Provider, { value: true }, content);
322
+ }
323
+ if (process.env.NODE_ENV === "development") {
324
+ if (props["debug"]) {
325
+ viewProps["debug"] = true;
326
+ console.log("\u{1F95A} props in:", props);
327
+ console.log("\u{1F95A} props out:", viewProps);
328
+ console.log(props.onClick?.toString());
329
+ console.log("\u{1F95A} etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
330
+ if (isWeb) {
331
+ console.log("\u{1F95A} component info", { staticConfig, tamaguiConfig });
332
+ }
333
+ }
334
+ }
335
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, features, content);
336
+ });
337
+ onConfiguredOnce((conf) => {
338
+ tamaguiConfig = conf;
339
+ initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]];
340
+ const next = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, true);
341
+ if (isWeb) {
342
+ if (next.classNames) {
343
+ defaultsClassName += next.classNames + " ";
344
+ }
345
+ defaultsClassName += addStylesUsingClassname([next.style, next.pseudos]);
346
+ } else {
347
+ if (!hasWarnedOnce) {
348
+ hasWarnedOnce = true;
349
+ console.log("\u26A0\uFE0F TODO account for default styles for media queries");
350
+ }
351
+ }
352
+ component.defaultProps = {
353
+ ...next.viewProps,
354
+ ...component.defaultProps
355
+ };
356
+ if (process.env.NODE_ENV === "development") {
357
+ if (staticConfig.defaultProps?.debug) {
358
+ console.log("tamagui debug component:", next, defaultsClassName, component.defaultProps);
359
+ }
360
+ }
361
+ });
362
+ component["staticConfig"] = {
363
+ validStyles: validStyleProps,
364
+ ...staticConfig
365
+ };
366
+ const res = component;
367
+ res["extractable"] = (Component2, conf) => {
368
+ Component2["staticConfig"] = extendStaticConfig(res, {
369
+ ...conf,
370
+ neverFlatten: true,
371
+ defaultProps: {
372
+ ...Component2.defaultProps,
373
+ ...conf?.defaultProps
374
+ }
375
+ });
376
+ return Component2;
377
+ };
378
+ return res;
379
+ }
380
+ __name(createComponent, "createComponent");
381
+ let hasWarnedOnce = false;
382
+ const Spacer = createComponent({
383
+ defaultProps: {
384
+ ...stackDefaultStyles,
385
+ size: true
386
+ },
387
+ variants: {
388
+ size: {
389
+ "...size": (size, { tokens }) => {
390
+ size = size == true ? "$true" : size;
391
+ return {
392
+ width: tokens.size[size] ?? size,
393
+ height: tokens.size[size] ?? size
394
+ };
395
+ }
396
+ },
397
+ direction: {
398
+ horizontal: {
399
+ height: 0
400
+ },
401
+ vertical: {
402
+ width: 0
403
+ }
404
+ }
405
+ }
406
+ });
407
+ function spacedChildren({
408
+ isZStack,
409
+ children,
410
+ space,
411
+ flexDirection
412
+ }) {
413
+ if (!space && !isZStack) {
414
+ return children;
415
+ }
416
+ const childrenList = Children.toArray(children);
417
+ const len = childrenList.length;
418
+ if (len === 1) {
419
+ return children;
420
+ }
421
+ const next = [];
422
+ for (const [index, child] of childrenList.entries()) {
423
+ if (child === null || child === void 0) {
424
+ continue;
425
+ }
426
+ const key = `${child?.["key"] ?? index}`;
427
+ next.push(/* @__PURE__ */ React.createElement(Fragment, {
428
+ key
429
+ }, isZStack ? /* @__PURE__ */ React.createElement(Absolute, null, child) : child));
430
+ if (child?.["type"]?.["isVisuallyHidden"]) {
431
+ continue;
432
+ }
433
+ if (index !== len - 1) {
434
+ if (space) {
435
+ next.push(/* @__PURE__ */ React.createElement(Spacer, {
436
+ key: `${key}_spacer`,
437
+ direction: flexDirection === "row" || flexDirection === "row-reverse" ? "horizontal" : "vertical",
438
+ size: space
439
+ }));
440
+ }
441
+ }
442
+ }
443
+ return next;
444
+ }
445
+ __name(spacedChildren, "spacedChildren");
446
+ const Absolute = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React.createElement(View, {
447
+ style: sheet.fullscreen
448
+ }, children), "Absolute");
449
+ const sheet = StyleSheet.create({
450
+ fullscreen: {
451
+ position: "absolute",
452
+ top: 0,
453
+ left: 0,
454
+ right: 0,
455
+ bottom: 0
456
+ }
457
+ });
458
+ export {
459
+ Spacer,
460
+ createComponent,
461
+ mouseUps,
462
+ spacedChildren
463
+ };
464
+ //# sourceMappingURL=createComponent.js.map