@tamagui/core 1.0.0-beta.179 → 1.0.0-beta.181

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 (244) hide show
  1. package/dist/cjs/Tamagui.js +18 -1
  2. package/dist/cjs/Tamagui.js.map +2 -2
  3. package/dist/cjs/ThemeContext.js +4 -0
  4. package/dist/cjs/ThemeManager.js +30 -14
  5. package/dist/cjs/ThemeManager.js.map +2 -2
  6. package/dist/cjs/conf.js +10 -1
  7. package/dist/cjs/conf.js.map +2 -2
  8. package/dist/cjs/constants/constants.js +6 -0
  9. package/dist/cjs/constants/platform.js +12 -0
  10. package/dist/cjs/constants/pseudos.js +37 -0
  11. package/dist/cjs/constants/pseudos.js.map +7 -0
  12. package/dist/cjs/constants/rnw.js +4 -0
  13. package/dist/cjs/contexts/ButtonInsideButtonContext.js +4 -0
  14. package/dist/cjs/createComponent.js +132 -126
  15. package/dist/cjs/createComponent.js.map +2 -2
  16. package/dist/cjs/createFont.js +4 -0
  17. package/dist/cjs/createShallowUpdate.js +1 -0
  18. package/dist/cjs/createShallowUpdate.js.map +7 -0
  19. package/dist/cjs/createShorthands.js +4 -0
  20. package/dist/cjs/createTamagui.js +12 -0
  21. package/dist/cjs/createTamagui.js.map +2 -2
  22. package/dist/cjs/createTheme.js +4 -0
  23. package/dist/cjs/createTokens.js +5 -0
  24. package/dist/cjs/createTokens.js.map +1 -1
  25. package/dist/cjs/createVariable.js +9 -0
  26. package/dist/cjs/defaultComponentState.js +0 -30
  27. package/dist/cjs/defaultComponentState.js.map +3 -3
  28. package/dist/cjs/devtools.js +32 -0
  29. package/dist/cjs/devtools.js.map +7 -0
  30. package/dist/cjs/helpers/RNComponents.js +38 -0
  31. package/dist/cjs/helpers/RNComponents.js.map +7 -0
  32. package/dist/cjs/helpers/addStylesUsingClassname.js +8 -0
  33. package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
  34. package/dist/cjs/helpers/areEqualSets.js +4 -0
  35. package/dist/cjs/helpers/createMediaStyle.js +8 -6
  36. package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
  37. package/dist/cjs/helpers/createPropMapper.js +57 -56
  38. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  39. package/dist/cjs/helpers/createShallowUpdate.js +55 -0
  40. package/dist/cjs/helpers/createShallowUpdate.js.map +7 -0
  41. package/dist/cjs/helpers/createTamaguiProvider.js +5 -5
  42. package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
  43. package/dist/cjs/helpers/extendStaticConfig.js +8 -6
  44. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  45. package/dist/cjs/helpers/fixNativeShadow.js +4 -0
  46. package/dist/cjs/helpers/fixNativeShadow.native.js +6 -2
  47. package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
  48. package/dist/cjs/helpers/getExpandedShorthands.js +4 -0
  49. package/dist/cjs/helpers/getSplitStyles.js +94 -47
  50. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  51. package/dist/cjs/helpers/getStylesAtomic.js +20 -2
  52. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  53. package/dist/cjs/helpers/getStylesAtomic.native.js +4 -0
  54. package/dist/cjs/helpers/insertStyleRule.js +46 -26
  55. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  56. package/dist/cjs/helpers/isObj.js +4 -0
  57. package/dist/cjs/helpers/isTamaguiElement.js +4 -0
  58. package/dist/cjs/helpers/matchMedia.js +4 -0
  59. package/dist/cjs/helpers/matchMedia.native.js +4 -0
  60. package/dist/cjs/helpers/themeable.js +8 -2
  61. package/dist/cjs/helpers/themeable.js.map +2 -2
  62. package/dist/cjs/helpers/validate.js +46 -5
  63. package/dist/cjs/helpers/validate.js.map +2 -2
  64. package/dist/cjs/helpers/withStaticProperties.js +4 -0
  65. package/dist/cjs/helpers/wrapThemeManagerContext.js +4 -0
  66. package/dist/cjs/hooks/useConstant.js +4 -0
  67. package/dist/cjs/hooks/useFeatures.js +101 -12
  68. package/dist/cjs/hooks/useFeatures.js.map +2 -2
  69. package/dist/cjs/hooks/useIsMounted.js +4 -0
  70. package/dist/cjs/hooks/useIsTouchDevice.js +4 -0
  71. package/dist/cjs/hooks/useMedia.js +36 -43
  72. package/dist/cjs/hooks/useMedia.js.map +2 -2
  73. package/dist/cjs/hooks/usePressable.js +4 -0
  74. package/dist/cjs/hooks/useTheme.js +28 -13
  75. package/dist/cjs/hooks/useTheme.js.map +2 -2
  76. package/dist/cjs/hooks/useUnmountEffect.js +4 -0
  77. package/dist/cjs/index.js +14 -0
  78. package/dist/cjs/index.js.map +2 -2
  79. package/dist/cjs/styled.js +8 -15
  80. package/dist/cjs/styled.js.map +2 -2
  81. package/dist/cjs/tamagui-base.css +8 -0
  82. package/dist/cjs/tamagui-base.css.map +7 -0
  83. package/dist/cjs/types-rnw.js.map +1 -1
  84. package/dist/cjs/types.js.map +1 -1
  85. package/dist/cjs/views/Stack.js +5 -0
  86. package/dist/cjs/views/Stack.js.map +2 -2
  87. package/dist/cjs/views/Text.js +5 -0
  88. package/dist/cjs/views/Text.js.map +2 -2
  89. package/dist/cjs/views/TextAncestorContext.js +6 -0
  90. package/dist/cjs/views/Theme.js +17 -19
  91. package/dist/cjs/views/Theme.js.map +2 -2
  92. package/dist/cjs/views/ThemeInverse.js +5 -0
  93. package/dist/cjs/views/ThemeProvider.js +4 -0
  94. package/dist/cjs/views/ThemeReset.js +4 -0
  95. package/dist/esm/Tamagui.js +10 -2
  96. package/dist/esm/Tamagui.js.map +2 -2
  97. package/dist/esm/ThemeManager.js +21 -11
  98. package/dist/esm/ThemeManager.js.map +2 -2
  99. package/dist/esm/conf.js +0 -1
  100. package/dist/esm/conf.js.map +2 -2
  101. package/dist/esm/constants/pseudos.js +18 -0
  102. package/dist/esm/constants/pseudos.js.map +7 -0
  103. package/dist/esm/createComponent.js +122 -129
  104. package/dist/esm/createComponent.js.map +2 -2
  105. package/dist/esm/createShallowUpdate.js +1 -0
  106. package/dist/esm/createShallowUpdate.js.map +7 -0
  107. package/dist/esm/createTamagui.js +8 -0
  108. package/dist/esm/createTamagui.js.map +2 -2
  109. package/dist/esm/createTokens.js.map +1 -1
  110. package/dist/esm/defaultComponentState.js +0 -11
  111. package/dist/esm/defaultComponentState.js.map +3 -3
  112. package/dist/esm/devtools.js +14 -0
  113. package/dist/esm/devtools.js.map +7 -0
  114. package/dist/esm/helpers/RNComponents.js +12 -0
  115. package/dist/esm/helpers/RNComponents.js.map +7 -0
  116. package/dist/esm/helpers/addStylesUsingClassname.js +4 -1
  117. package/dist/esm/helpers/addStylesUsingClassname.js.map +2 -2
  118. package/dist/esm/helpers/createMediaStyle.js +3 -6
  119. package/dist/esm/helpers/createMediaStyle.js.map +2 -2
  120. package/dist/esm/helpers/createPropMapper.js +53 -56
  121. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  122. package/dist/esm/helpers/createShallowUpdate.js +19 -0
  123. package/dist/esm/helpers/createShallowUpdate.js.map +7 -0
  124. package/dist/esm/helpers/createTamaguiProvider.js +1 -4
  125. package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
  126. package/dist/esm/helpers/extendStaticConfig.js +5 -6
  127. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  128. package/dist/esm/helpers/fixNativeShadow.native.js +2 -2
  129. package/dist/esm/helpers/fixNativeShadow.native.js.map +2 -2
  130. package/dist/esm/helpers/getSplitStyles.js +89 -48
  131. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  132. package/dist/esm/helpers/getStylesAtomic.js +15 -2
  133. package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
  134. package/dist/esm/helpers/insertStyleRule.js +36 -26
  135. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  136. package/dist/esm/helpers/themeable.js +4 -2
  137. package/dist/esm/helpers/themeable.js.map +2 -2
  138. package/dist/esm/helpers/validate.js +17 -5
  139. package/dist/esm/helpers/validate.js.map +2 -2
  140. package/dist/esm/hooks/useFeatures.js +96 -17
  141. package/dist/esm/hooks/useFeatures.js.map +2 -2
  142. package/dist/esm/hooks/useMedia.js +25 -43
  143. package/dist/esm/hooks/useMedia.js.map +2 -2
  144. package/dist/esm/hooks/useTheme.js +20 -13
  145. package/dist/esm/hooks/useTheme.js.map +2 -2
  146. package/dist/esm/index.js +3 -0
  147. package/dist/esm/index.js.map +2 -2
  148. package/dist/esm/styled.js +4 -12
  149. package/dist/esm/styled.js.map +2 -2
  150. package/dist/esm/tamagui-base.css +8 -0
  151. package/dist/esm/tamagui-base.css.map +7 -0
  152. package/dist/esm/views/Stack.js +1 -0
  153. package/dist/esm/views/Stack.js.map +2 -2
  154. package/dist/esm/views/Text.js +1 -0
  155. package/dist/esm/views/Text.js.map +2 -2
  156. package/dist/esm/views/Theme.js +13 -19
  157. package/dist/esm/views/Theme.js.map +2 -2
  158. package/dist/jsx/Tamagui.js +10 -2
  159. package/dist/jsx/ThemeManager.js +21 -11
  160. package/dist/jsx/conf.js +0 -1
  161. package/dist/jsx/constants/pseudos.js +17 -0
  162. package/dist/jsx/createComponent.js +115 -123
  163. package/dist/jsx/createShallowUpdate.js +0 -0
  164. package/dist/jsx/createTamagui.js +8 -0
  165. package/dist/jsx/defaultComponentState.js +0 -11
  166. package/dist/jsx/devtools.js +13 -0
  167. package/dist/jsx/helpers/RNComponents.js +11 -0
  168. package/dist/jsx/helpers/addStylesUsingClassname.js +4 -1
  169. package/dist/jsx/helpers/createMediaStyle.js +3 -6
  170. package/dist/jsx/helpers/createPropMapper.js +53 -56
  171. package/dist/jsx/helpers/createShallowUpdate.js +18 -0
  172. package/dist/jsx/helpers/createTamaguiProvider.js +1 -2
  173. package/dist/jsx/helpers/extendStaticConfig.js +5 -6
  174. package/dist/jsx/helpers/fixNativeShadow.native.js +2 -2
  175. package/dist/jsx/helpers/getSplitStyles.js +89 -48
  176. package/dist/jsx/helpers/getStylesAtomic.js +15 -2
  177. package/dist/jsx/helpers/insertStyleRule.js +36 -26
  178. package/dist/jsx/helpers/themeable.js +4 -3
  179. package/dist/jsx/helpers/validate.js +17 -5
  180. package/dist/jsx/hooks/useFeatures.js +96 -17
  181. package/dist/jsx/hooks/useMedia.js +25 -43
  182. package/dist/jsx/hooks/useTheme.js +20 -13
  183. package/dist/jsx/index.js +3 -0
  184. package/dist/jsx/styled.js +4 -12
  185. package/dist/jsx/tamagui-base.css +7 -0
  186. package/dist/jsx/views/Stack.js +1 -0
  187. package/dist/jsx/views/Text.js +1 -0
  188. package/dist/jsx/views/Theme.js +13 -19
  189. package/package.json +6 -6
  190. package/types/Tamagui.d.ts +16 -1
  191. package/types/Tamagui.d.ts.map +1 -1
  192. package/types/ThemeManager.d.ts +3 -3
  193. package/types/ThemeManager.d.ts.map +1 -1
  194. package/types/conf.d.ts.map +1 -1
  195. package/types/createComponent.d.ts +5 -7
  196. package/types/createComponent.d.ts.map +1 -1
  197. package/types/createFont.d.ts +1 -1
  198. package/types/createFont.d.ts.map +1 -1
  199. package/types/createTamagui.d.ts.map +1 -1
  200. package/types/createTokens.d.ts +8 -0
  201. package/types/createTokens.d.ts.map +1 -1
  202. package/types/defaultComponentState.d.ts +0 -12
  203. package/types/defaultComponentState.d.ts.map +1 -1
  204. package/types/helpers/RNComponents.d.ts +2 -0
  205. package/types/helpers/RNComponents.d.ts.map +1 -0
  206. package/types/helpers/addStylesUsingClassname.d.ts.map +1 -1
  207. package/types/helpers/createMediaStyle.d.ts +1 -1
  208. package/types/helpers/createMediaStyle.d.ts.map +1 -1
  209. package/types/helpers/createPropMapper.d.ts +2 -2
  210. package/types/helpers/createPropMapper.d.ts.map +1 -1
  211. package/types/helpers/createShallowUpdate.d.ts +4 -0
  212. package/types/helpers/createShallowUpdate.d.ts.map +1 -0
  213. package/types/helpers/createTamaguiProvider.d.ts +1 -1
  214. package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
  215. package/types/helpers/extendStaticConfig.d.ts +2 -2
  216. package/types/helpers/extendStaticConfig.d.ts.map +1 -1
  217. package/types/helpers/getSplitStyles.d.ts +4 -14
  218. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  219. package/types/helpers/getStylesAtomic.d.ts.map +1 -1
  220. package/types/helpers/insertStyleRule.d.ts +2 -1
  221. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  222. package/types/helpers/themeable.d.ts +3 -1
  223. package/types/helpers/themeable.d.ts.map +1 -1
  224. package/types/helpers/validate.d.ts.map +1 -1
  225. package/types/hooks/useFeatures.d.ts +7 -5
  226. package/types/hooks/useFeatures.d.ts.map +1 -1
  227. package/types/hooks/useMedia.d.ts +3 -3
  228. package/types/hooks/useMedia.d.ts.map +1 -1
  229. package/types/hooks/useTheme.d.ts +1 -1
  230. package/types/hooks/useTheme.d.ts.map +1 -1
  231. package/types/index.d.ts +1 -0
  232. package/types/index.d.ts.map +1 -1
  233. package/types/styled.d.ts +13 -8
  234. package/types/styled.d.ts.map +1 -1
  235. package/types/types-rnw.d.ts +0 -5
  236. package/types/types-rnw.d.ts.map +1 -1
  237. package/types/types.d.ts +124 -90
  238. package/types/types.d.ts.map +1 -1
  239. package/types/views/Stack.d.ts +2 -2
  240. package/types/views/Stack.d.ts.map +1 -1
  241. package/types/views/Text.d.ts +2 -2
  242. package/types/views/Text.d.ts.map +1 -1
  243. package/types/views/Theme.d.ts +1 -0
  244. package/types/views/Theme.d.ts.map +1 -1
@@ -1,11 +1,9 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
9
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -46,24 +44,15 @@ var __copyProps = (to, from, except, desc) => {
46
44
  }
47
45
  return to;
48
46
  };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
50
47
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
51
48
  var styled_exports = {};
52
49
  __export(styled_exports, {
53
50
  styled: () => styled
54
51
  });
55
52
  module.exports = __toCommonJS(styled_exports);
56
- var ReactNative = __toESM(require("react-native"));
57
53
  var import_react_native = require("react-native");
58
54
  var import_createComponent = require("./createComponent");
59
- var import_extendStaticConfig = require("./helpers/extendStaticConfig");
60
- const RNComponents = /* @__PURE__ */ new WeakMap();
61
- for (const key of ["Image", "TextInput", "Text", "View"]) {
62
- const val = ReactNative[key];
63
- if (val && typeof val === "object") {
64
- RNComponents.set(val, true);
65
- }
66
- }
55
+ var import_RNComponents = require("./helpers/RNComponents");
67
56
  function styled(Component, options, staticExtractionOptions) {
68
57
  const staticConfigProps = (() => {
69
58
  if (options) {
@@ -71,7 +60,7 @@ function styled(Component, options, staticExtractionOptions) {
71
60
  if (defaultVariants) {
72
61
  Object.assign(defaultProps, defaultVariants);
73
62
  }
74
- const isReactNativeWeb = RNComponents.has(Component);
63
+ const isReactNativeWeb = "staticConfig" in Component ? Component.staticConfig.isReactNativeWeb : import_RNComponents.RNComponents.has(Component);
75
64
  const isTamagui = !isReactNativeWeb && "staticConfig" in Component;
76
65
  const Comp = Component;
77
66
  const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === import_react_native.Image : false));
@@ -83,6 +72,7 @@ function styled(Component, options, staticExtractionOptions) {
83
72
  isTamagui,
84
73
  variants,
85
74
  defaultProps,
75
+ defaultVariants,
86
76
  componentName: name,
87
77
  isReactNativeWeb,
88
78
  isInput,
@@ -93,9 +83,12 @@ function styled(Component, options, staticExtractionOptions) {
93
83
  }
94
84
  return {};
95
85
  })();
96
- const config = (0, import_extendStaticConfig.extendStaticConfig)(Component, staticConfigProps);
97
- const component = (0, import_createComponent.createComponent)(config);
86
+ const component = (0, import_createComponent.createComponent)(staticConfigProps, Component);
98
87
  return component;
99
88
  }
100
89
  __name(styled, "styled");
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ styled
93
+ });
101
94
  //# sourceMappingURL=styled.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
- "sourcesContent": ["import * as ReactNative from 'react-native'\nimport { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport {\n GetProps,\n GetVariantProps,\n MediaPropKeys,\n MediaProps,\n PseudoProps,\n PsuedoPropKeys,\n StaticComponent,\n StaticConfig,\n StylableComponent,\n VariantDefinitions,\n} from './types'\n\n// bye bye tree shaking... but only way to properly detect react-native components...\n// also neither rnw nor react support tree shaking atm\nconst RNComponents = new WeakMap()\n// I was looping over all of them, but casuses deprecation warnings and there's only a few\n// we realistically support - lets whitelist rather than blacklist\nfor (const key of ['Image', 'TextInput', 'Text', 'View']) {\n const val = ReactNative[key]\n if (val && typeof val === 'object') {\n RNComponents.set(val, true)\n }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n // = VariantDefinitions<GetProps<ParentComponent>> gives type inference to variants: { true: { ... } }\n // but causes \"Type instantiation is excessively deep and possibly infinite.\"...\n Variants extends VariantDefinitions<any> | symbol =\n | VariantDefinitions<GetProps<ParentComponent>>\n | symbol\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 defaultVariants?: Variants extends Object ? GetVariantProps<Variants> : never\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb = RNComponents.has(Component)\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = 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 const conf: 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 componentName: name,\n isReactNativeWeb,\n isInput,\n isText,\n isImage,\n }\n return conf\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n\n type ParentProps = GetProps<ParentComponent>\n type VariantProps = Variants extends symbol ? {} : Expand<GetVariantProps<Variants>>\n type VariantKeys = Variants extends symbol ? never : keyof Variants[keyof Variants]\n type ParentPropsWithoutOurVariants = VariantKeys extends never\n ? ParentProps\n : Omit<ParentProps, VariantKeys>\n type StyleProps = VariantProps & ParentPropsWithoutOurVariants\n type Props = Variants extends undefined | symbol\n ? ParentProps\n : Omit<\n ParentProps extends Object ? ParentProps : {},\n (VariantKeys extends never ? ImpossibleKey : VariantKeys) | MediaPropKeys | PsuedoPropKeys\n > &\n VariantProps &\n MediaProps<StyleProps> &\n PseudoProps<StyleProps>\n\n return component as StaticComponent<Props, VariantProps>\n}\n\ntype ImpossibleKey = 1234556123312321\ntype Expand<T> = T extends infer O ? { [K in keyof O]?: O[K] } : never\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,0BAAuC;AAEvC,6BAAgC;AAChC,gCAAmC;AAgBnC,MAAM,eAAe,oBAAI,QAAQ;AAGjC,WAAW,OAAO,CAAC,SAAS,aAAa,QAAQ,MAAM,GAAG;AACxD,QAAM,MAAM,YAAY;AACxB,MAAI,OAAO,OAAO,QAAQ,UAAU;AAClC,iBAAa,IAAI,KAAK,IAAI;AAAA,EAC5B;AACF;AAEO,gBAQL,WAEA,SAKA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAC/B,QAAI,SAAS;AACX,YAA6D,cAArD,YAAU,MAAM,oBAAqC,IAAjB,yBAAiB,IAAjB,CAApC,YAAU,QAAM;AACxB,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBAAmB,aAAa,IAAI,SAAS;AACnD,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO;AACb,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,4BAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,gCAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,2BAAO;AAClF,YAAM,OAAqB,gDACtB,0BACC,CAAC,aAAa;AAAA,QAChB,WAAW;AAAA,MACb,IAJyB;AAAA,QAKzB;AAAA,QAGA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AACH,QAAM,SAAS,kDAAmB,WAAW,iBAAiB;AAC9D,QAAM,YAAY,4CAAgB,MAAO;AAmBzC,SAAO;AACT;AAtEgB;",
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> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\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 if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = 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 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 isInput,\n isText,\n isImage,\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 symbol\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 | symbol\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// test types:\n// // variants\n// export const XStack = styled(Stack, {\n// flexDirection: 'row',\n// name: 'XStack',\n// variants: {\n// fullscreen: {\n// true: {},\n// },\n// elevation: {\n// '...size': (val) => ({}),\n// },\n// },\n// })\n// const InBetween = styled(XStack, {})\n// type INBVariants = typeof InBetween extends TamaguiComponent<any, any, any, infer Variants> ? Variants: never\n// const SwitchFrame = styled(InBetween, {\n// name: 'Switch',\n// tag: 'button',\n// borderRadius: 100,\n// borderWidth: 0,\n// variants: {\n// name: {\n// true: {\n// backgroundColor: 'aliceblue'\n// },\n// // 1: {\n\n// // },\n// // ':number': (val) => {\n// // return {}\n// // },\n// // \"...fontSize\": (val) => {\n// // return {}\n// // },\n// // \"...color\": (val) => {\n// // return {}\n// // }\n// }\n// },\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n// const x = <XStack fullscreen />\n// const y = <XStack fullscreen />\n// const z = <SwitchFrame fullscreen name />\n\n// depth:\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuC;AAEvC,6BAAgC;AAChC,0BAA6B;AAoBtB,gBAML,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAC/B,QAAI,SAAS;AACX,YAA6D,cAArD,YAAU,MAAM,oBAAqC,IAAjB,yBAAiB,IAAjB,CAApC,YAAU,QAAM;AACxB,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,iCAAa,IAAI,SAAS;AAChC,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO;AACb,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,4BAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,gCAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,2BAAO;AAClF,YAAM,OAA8B,gDAC/B,0BACC,CAAC,aAAa;AAAA,QAChB,WAAW;AAAA,MACb,IAJkC;AAAA,QAKlC;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,4CAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AAxFgB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,8 @@
1
+ .tamagui-absolute-fill {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ }
8
+ /*# sourceMappingURL=tamagui-base.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tamagui-base.css"],
4
+ "sourcesContent": [".tamagui-absolute-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n"],
5
+ "mappings": "AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types-rnw.tsx"],
4
- "sourcesContent": ["// The following list is sourced from:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L76\ntype RNWCursorValue =\n | 'alias'\n | 'all-scroll'\n | 'auto'\n | 'cell'\n | 'context-menu'\n | 'copy'\n | 'crosshair'\n | 'default'\n | 'grab'\n | 'grabbing'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'text'\n | 'vertical-text'\n | 'move'\n | 'none'\n | 'no-drop'\n | 'not-allowed'\n | 'zoom-in'\n | 'zoom-out'\n | 'col-resize'\n | 'e-resize'\n | 'ew-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'ns-resize'\n | 'nw-resize'\n | 'row-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n\n// This list is the combination of the following two lists:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js#L10\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L12\n// Plus the single hard-coded value \"label\" from here:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L36\ntype RNWWebAccessibilityRole =\n | 'adjustable'\n | 'article'\n | 'banner'\n | 'blockquote'\n | 'button'\n | 'code'\n | 'complementary'\n | 'contentinfo'\n | 'deletion'\n | 'emphasis'\n | 'figure'\n | 'form'\n | 'header'\n | 'image'\n | 'imagebutton'\n | 'insertion'\n | 'keyboardkey'\n | 'label'\n | 'link'\n | 'list'\n | 'listitem'\n | 'main'\n | 'navigation'\n | 'none'\n | 'region'\n | 'search'\n | 'strong'\n | 'summary'\n | 'text'\n\ninterface PressableStateCallbackType {\n hovered?: boolean\n focused?: boolean\n}\n\nexport interface RNWViewProps {\n // our internal hack to pass className down (until styleq transition)\n dataSet?: any\n\n // TODO get proper types:\n target?: any\n rel?: any\n download?: any\n\n accessibilityRole?: RNWWebAccessibilityRole\n href?: string\n hrefAttrs?: {\n target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n rel?: string\n download?: boolean\n }\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseUp?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\n // For compatibility with RNW internals\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWTextProps {\n dir?: 'ltr' | 'rtl' | 'auto'\n focusable?: boolean\n accessibilityRole?: RNWWebAccessibilityRole\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 pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n href?: string\n hrefAttrs?: {\n target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n rel?: string\n download?: boolean\n }\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n // For compatibility with RNW internals\n onMoveShouldSetResponder?: unknown\n onMoveShouldSetResponderCapture?: unknown\n onResponderEnd?: unknown\n onResponderGrant?: unknown\n onResponderMove?: unknown\n onResponderReject?: unknown\n onResponderRelease?: unknown\n onResponderStart?: unknown\n onResponderTerminate?: unknown\n onResponderTerminationRequest?: unknown\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n onStartShouldSetResponder?: unknown\n onStartShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWViewStyle {\n cursor?: RNWCursorValue\n transitionProperty?: string\n display?: 'flex' | 'inline-flex' | 'none'\n}\n\nexport interface RNWTextStyle {\n // The following list is sourced from:\n // - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L128\n userSelect?: 'all' | 'auto' | 'contain' | 'none' | 'text'\n}\n"],
4
+ "sourcesContent": ["// The following list is sourced from:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L76\ntype RNWCursorValue =\n | 'alias'\n | 'all-scroll'\n | 'auto'\n | 'cell'\n | 'context-menu'\n | 'copy'\n | 'crosshair'\n | 'default'\n | 'grab'\n | 'grabbing'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'text'\n | 'vertical-text'\n | 'move'\n | 'none'\n | 'no-drop'\n | 'not-allowed'\n | 'zoom-in'\n | 'zoom-out'\n | 'col-resize'\n | 'e-resize'\n | 'ew-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'ns-resize'\n | 'nw-resize'\n | 'row-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n\n// This list is the combination of the following two lists:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js#L10\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L12\n// Plus the single hard-coded value \"label\" from here:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L36\ntype RNWWebAccessibilityRole =\n | 'adjustable'\n | 'article'\n | 'banner'\n | 'blockquote'\n | 'button'\n | 'code'\n | 'complementary'\n | 'contentinfo'\n | 'deletion'\n | 'emphasis'\n | 'figure'\n | 'form'\n | 'header'\n | 'image'\n | 'imagebutton'\n | 'insertion'\n | 'keyboardkey'\n | 'label'\n | 'link'\n | 'list'\n | 'listitem'\n | 'main'\n | 'navigation'\n | 'none'\n | 'region'\n | 'search'\n | 'strong'\n | 'summary'\n | 'text'\n\ninterface PressableStateCallbackType {\n hovered?: boolean\n focused?: boolean\n}\n\nexport interface RNWViewProps {\n // our internal hack to pass className down (until styleq transition)\n dataSet?: any\n\n // TODO get proper types:\n target?: any\n rel?: any\n download?: any\n\n accessibilityRole?: RNWWebAccessibilityRole\n href?: string\n hrefAttrs?: {\n target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n rel?: string\n download?: boolean\n }\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseUp?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\n // For compatibility with RNW internals\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWTextProps {\n dir?: 'ltr' | 'rtl' | 'auto'\n focusable?: boolean\n accessibilityRole?: RNWWebAccessibilityRole\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 pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n href?: string\n // TODO hrefAttrs or come up with proper html escape hatch\n // hrefAttrs?: {\n // target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n // rel?: string\n // download?: boolean\n // }\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n // For compatibility with RNW internals\n onMoveShouldSetResponder?: unknown\n onMoveShouldSetResponderCapture?: unknown\n onResponderEnd?: unknown\n onResponderGrant?: unknown\n onResponderMove?: unknown\n onResponderReject?: unknown\n onResponderRelease?: unknown\n onResponderStart?: unknown\n onResponderTerminate?: unknown\n onResponderTerminationRequest?: unknown\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n onStartShouldSetResponder?: unknown\n onStartShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWViewStyle {\n cursor?: RNWCursorValue\n transitionProperty?: string\n display?: 'flex' | 'inline-flex' | 'none'\n}\n\nexport interface RNWTextStyle {\n // The following list is sourced from:\n // - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L128\n userSelect?: 'all' | 'auto' | 'contain' | 'none' | 'text'\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.tsx"],
4
- "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport CSS from 'csstype'\nimport React from 'react'\nimport {\n GestureResponderEvent,\n Image,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ResolveVariableTypes } from './helpers/createPropMapper'\nimport { RNWTextProps, RNWViewProps } from './types-rnw'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<\n Props & React.RefAttributes<Ref>\n>\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\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 type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n font: { [key: GenericKey]: GenericFont }\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\nexport type TamaguiBaseTheme = {\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 background: VariableColorVal\n backgroundHover: VariableColorVal\n backgroundPress: VariableColorVal\n backgroundFocus: VariableColorVal\n color: VariableColorVal\n colorHover: VariableColorVal\n colorPress: VariableColorVal\n colorFocus: VariableColorVal\n borderColor: VariableColorVal\n borderColorHover: VariableColorVal\n borderColorPress: VariableColorVal\n borderColorFocus: VariableColorVal\n shadowColor: VariableColorVal\n shadowColorHover: VariableColorVal\n shadowColorPress: VariableColorVal\n shadowColorFocus: VariableColorVal\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]:\n | Partial<TamaguiBaseTheme> & {\n [key: string]: VariableVal\n }\n}\ntype GenericShorthands = {\n // [key: string]: string\n}\n\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\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 = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n animations: AnimationDriver<E>\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 GenericAnimations\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']\nexport type ThemeName = GetAltThemeNames<keyof Themes>\n// export type ThemeNameWithSubThemes = GetSubThemes<ThemeName>\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = GetAnimationKeys<TamaguiConfig> & {}\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\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 E extends GenericAnimations = GenericAnimations\n> = CreateTamaguiConfig<A, B, C, D, E> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']['animations']\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]: 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 MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: 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 Something<A> = A extends symbol ? Something<{}> : A\n\ntype ComponentPropsBase = Something<{\n debug?: boolean | 'break' | 'verbose'\n disabled?: boolean\n className?: string\n id?: string\n tag?: string\n theme?: ThemeName | null\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?: SpaceTokens\n}>\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\ntype GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`\n\nexport type SizeTokens = GetTokenString<keyof Tokens['size']> | number\nexport type FontTokens = GetTokenString<keyof Tokens['font']>\nexport type FontSizeTokens = `$${GetTokenFontKeysFor<'size'>}` | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightTokens =\n | `$${GetTokenFontKeysFor<'weight'>}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number\nexport type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeObject>\n | CSSColorNames\nexport type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number\n\n//\n// adds theme short values to relevant props\n//\n\nexport type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends 'size'\n ? SizeTokens\n : K extends 'font'\n ? FontTokens\n : K extends 'fontSize'\n ? FontSizeTokens\n : K extends 'space'\n ? SpaceTokens\n : K extends 'color'\n ? ColorTokens\n : K extends 'zIndex'\n ? ZIndexTokens\n : K extends 'lineHeight'\n ? FontLineHeightTokens\n : K extends 'fontWeight'\n ? FontWeightTokens\n : K extends 'letterSpacing'\n ? FontLetterSpacingTokens\n : {}\n\nexport type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends SpaceKeys\n ? K extends 'shadowOffset'\n ? { width: SpaceTokens; height: SpaceTokens }\n : SpaceTokens\n : K extends ColorKeys\n ? ColorTokens\n : K extends ZIndexKeys\n ? ZIndexTokens\n : K extends LineHeightKeys\n ? FontLineHeightTokens\n : K extends FontWeightKeys\n ? FontWeightTokens\n : K extends FontLetterSpacingKeys\n ? FontLetterSpacingTokens\n : never\n\nexport type ThemeValueFallback = UnionableString | Variable\n\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]: ThemeValueGet<K> extends never\n ? T[K]\n : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback\n}\n\n// adds shorthand props\nexport type WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n// adds pseudo props\nexport type PseudoProps<A> = {\n hoverStyle?: A | null\n pressStyle?: A | null\n focusStyle?: A | null\n exitStyle?: A | null\n enterStyle?: A | null\n}\n\nexport type PsuedoPropKeys = keyof PseudoProps<any>\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// combines all of theme, shorthands, psuedos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... media queries and animations\n//\ntype WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>> & {\n animation?: AnimationKeys\n }\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 = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\n\nexport type StackProps = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\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\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n WebOnlyStyleProps & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\n\nexport type TextProps = ReactTextProps & RNWTextProps & TextStyleProps & ComponentPropsBase\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n Ref = any,\n StaticConfParsed extends StaticConfigParsed = StaticConfigParsed\n> = React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>> &\n StaticComponentObject<StaticConfParsed, VariantProps>\n\ntype StaticComponentObject<Conf extends StaticConfigParsed, VariantProps extends any> = {\n staticConfig: Conf\n variantProps?: VariantProps\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 injectCSS?: boolean\n fallback?: any\n children?: any\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any,\n staticConfig: StaticConfig,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: React.FunctionComponent<any> & StaticComponentObject<any, any>\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 * Used for applying sub theme style\n */\n componentName?: string\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 * Attempts to attach focus styles at runtime (useful for native)\n */\n isInput?: boolean\n\n /**\n * React native web images need special handling for className support\n */\n isImage?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /**\n * If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * If these props are encountered, leave them un-extracted.\n */\n inlineProps?: 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 * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isReactNativeWeb?: boolean\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isTamagui?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | StaticComponent\n | React.Component\n | React.ForwardRefExoticComponent<any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetProps<A extends StylableComponent> = A extends StaticComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? Omit<Props, keyof StackProps> & StackProps\n : A extends new (props: infer Props) => any\n ? Omit<Props, keyof StackProps> & StackProps\n : {}\n\nexport type VariantDefinitions<MyProps> = {\n [propName: string]:\n | {\n [Key in '...fontSize']?: FontSizeVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...size']?: SizeVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...color']?: ColorVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...lineHeight']?: FontLineHeightVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...letterSpacing']?: FontLetterSpacingVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...zIndex']?: ZIndexVariantSpreadFunction<MyProps>\n }\n | {\n [Key in '...theme']?: ThemeVariantSpreadFunction<MyProps>\n }\n | {\n [Key in string]: MyProps | VariantSpreadFunction<MyProps, any>\n }\n}\n\nexport type GetVariantProps<Variants extends Object> = {\n [key in keyof Variants]?: GetVariantValues<keyof Variants[key], keyof Variants[key]>\n}\n\nexport type VariantSpreadExtras<Props> = {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n}\n\nexport type VariantSpreadFunction<Props, Val = any> = (\n val: Val,\n config: VariantSpreadExtras<Props>\n) =>\n | WithVariableValues<TextStylePropsBase>\n | WithVariableValues<StackStylePropsBase>\n | null\n | undefined\n\ntype WithVariableValues<A extends { [key: string]: any }> = {\n [Key in keyof A]: A[Key] | Variable\n}\n\nexport type GetVariants<Props> = void | {\n [key: string]: {\n [key: string]: Partial<Props> | VariantSpreadFunction<Props>\n }\n}\n\nexport type GetVariantValues<Key, Val> = Key extends `...${infer VariantSpread}`\n ? ThemeValueByCategory<VariantSpread>\n : Key extends 'true' | 'false'\n ? boolean\n : Key extends ':string'\n ? string\n : Key extends ':boolean'\n ? boolean\n : Key extends ':number'\n ? number\n : Val\n\nexport type FontSizeVariantSpreadFunction<A> = VariantSpreadFunction<A, FontSizeTokens>\nexport type SizeVariantSpreadFunction<A> = VariantSpreadFunction<A, SizeTokens>\nexport type ColorVariantSpreadFunction<A> = VariantSpreadFunction<A, ColorTokens>\nexport type FontLineHeightVariantSpreadFunction<A> = VariantSpreadFunction<A, FontLineHeightTokens>\nexport type FontLetterSpacingVariantSpreadFunction<A> = VariantSpreadFunction<\n A,\n FontLetterSpacingTokens\n>\nexport type ZIndexVariantSpreadFunction<A> = VariantSpreadFunction<A, ZIndexTokens>\nexport type ThemeVariantSpreadFunction<A> = VariantSpreadFunction<A, ThemeTokens>\n\n/**\n * --------------------------------------------\n * end variants\n * --------------------------------------------\n */\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 | 'shadowColor'\n\ntype SpaceKeys =\n | 'space'\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\ntype CSSColorNames =\n | 'aliceblue'\n | 'antiquewhite'\n | 'aqua'\n | 'aquamarine'\n | 'azure'\n | 'beige'\n | 'bisque'\n | 'black'\n | 'blanchedalmond'\n | 'blue'\n | 'blueviolet'\n | 'brown'\n | 'burlywood'\n | 'cadetblue'\n | 'chartreuse'\n | 'chocolate'\n | 'coral'\n | 'cornflowerblue'\n | 'cornsilk'\n | 'crimson'\n | 'cyan'\n | 'darkblue'\n | 'darkcyan'\n | 'darkgoldenrod'\n | 'darkgray'\n | 'darkgreen'\n | 'darkkhaki'\n | 'darkmagenta'\n | 'darkolivegreen'\n | 'darkorange'\n | 'darkorchid'\n | 'darkred'\n | 'darksalmon'\n | 'darkseagreen'\n | 'darkslateblue'\n | 'darkslategray'\n | 'darkturquoise'\n | 'darkviolet'\n | 'deeppink'\n | 'deepskyblue'\n | 'dimgray'\n | 'dodgerblue'\n | 'firebrick'\n | 'floralwhite'\n | 'forestgreen'\n | 'fuchsia'\n | 'gainsboro'\n | 'ghostwhite'\n | 'gold'\n | 'goldenrod'\n | 'gray'\n | 'green'\n | 'greenyellow'\n | 'honeydew'\n | 'hotpink'\n | 'indianred '\n | 'indigo '\n | 'ivory'\n | 'khaki'\n | 'lavender'\n | 'lavenderblush'\n | 'lawngreen'\n | 'lemonchiffon'\n | 'lightblue'\n | 'lightcoral'\n | 'lightcyan'\n | 'lightgoldenrodyellow'\n | 'lightgrey'\n | 'lightgreen'\n | 'lightpink'\n | 'lightsalmon'\n | 'lightseagreen'\n | 'lightskyblue'\n | 'lightslategray'\n | 'lightsteelblue'\n | 'lightyellow'\n | 'lime'\n | 'limegreen'\n | 'linen'\n | 'magenta'\n | 'maroon'\n | 'mediumaquamarine'\n | 'mediumblue'\n | 'mediumorchid'\n | 'mediumpurple'\n | 'mediumseagreen'\n | 'mediumslateblue'\n | 'mediumspringgreen'\n | 'mediumturquoise'\n | 'mediumvioletred'\n | 'midnightblue'\n | 'mintcream'\n | 'mistyrose'\n | 'moccasin'\n | 'navajowhite'\n | 'navy'\n | 'oldlace'\n | 'olive'\n | 'olivedrab'\n | 'orange'\n | 'orangered'\n | 'orchid'\n | 'palegoldenrod'\n | 'palegreen'\n | 'paleturquoise'\n | 'palevioletred'\n | 'papayawhip'\n | 'peachpuff'\n | 'peru'\n | 'pink'\n | 'plum'\n | 'powderblue'\n | 'purple'\n | 'red'\n | 'rosybrown'\n | 'royalblue'\n | 'saddlebrown'\n | 'salmon'\n | 'sandybrown'\n | 'seagreen'\n | 'seashell'\n | 'sienna'\n | 'silver'\n | 'skyblue'\n | 'slateblue'\n | 'slategray'\n | 'snow'\n | 'springgreen'\n | 'steelblue'\n | 'tan'\n | 'teal'\n | 'thistle'\n | 'tomato'\n | 'turquoise'\n | 'violet'\n | 'wheat'\n | 'white'\n | 'whitesmoke'\n | 'yellow'\n | 'yellowgreen'\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n avoidClasses?: boolean\n useAnimations: UseAnimationHook\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = { animation: string; [key: string]: any }\nexport type UseAnimationState = {\n style: ViewStyle | null | undefined\n isMounted: boolean\n exitStyle?: ViewStyle | null\n onDidAnimate?: any\n delay?: number\n}\n\nexport type UseAnimationHook = (\n props: UseAnimationProps,\n state: UseAnimationState\n) => {\n style?: StackStylePropsBase\n}\n"],
4
+ "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport CSS from 'csstype'\nimport React from 'react'\nimport {\n GestureResponderEvent,\n Image,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ResolveVariableTypes } from './helpers/createPropMapper'\nimport { RNWTextProps, RNWViewProps } from './types-rnw'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<\n Props & React.RefAttributes<Ref>\n>\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\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 type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n font: { [key: GenericKey]: GenericFont }\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\nexport type TamaguiBaseTheme = {\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 background: VariableColorVal\n backgroundHover: VariableColorVal\n backgroundPress: VariableColorVal\n backgroundFocus: VariableColorVal\n color: VariableColorVal\n colorHover: VariableColorVal\n colorPress: VariableColorVal\n colorFocus: VariableColorVal\n borderColor: VariableColorVal\n borderColorHover: VariableColorVal\n borderColorPress: VariableColorVal\n borderColorFocus: VariableColorVal\n shadowColor: VariableColorVal\n shadowColorHover: VariableColorVal\n shadowColorPress: VariableColorVal\n shadowColorFocus: VariableColorVal\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]:\n | Partial<TamaguiBaseTheme> & {\n [key: string]: VariableVal\n }\n}\ntype GenericShorthands = {\n // [key: string]: string\n}\n\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\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 = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n animations: AnimationDriver<E>\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 GenericAnimations\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']\nexport type ThemeName = GetAltThemeNames<keyof Themes>\n// export type ThemeNameWithSubThemes = GetSubThemes<ThemeName>\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = GetAnimationKeys<TamaguiConfig>\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\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 E extends GenericAnimations = GenericAnimations\n> = CreateTamaguiConfig<A, B, C, D, E> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']['animations']\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 TamaguiComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: Partial<{ [key in Key]: number | Variable }>\n letterSpacing: Partial<{ [key in Key]: number | Variable }>\n weight: Partial<{ [key in Key]: number | string | Variable }>\n family: string | Variable\n style?: Partial<{ [key in Key]: TextStyle['fontStyle'] | Variable }>\n transform?: Partial<{ [key in Key]: TextStyle['textTransform'] | 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 MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: 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//\nexport type TamaguiComponentPropsBase = {\n space?: SpaceTokens\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationKeys\n animateOnly?: string[]\n children?: any | any[]\n debug?: boolean | 'break' | 'verbose'\n disabled?: boolean\n className?: string\n id?: string\n tag?: string\n theme?: ThemeName | null\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: MouseEvent) => any\n onMouseLeave?: (e: MouseEvent) => any\n onMouseDown?: (e: MouseEvent) => any\n}\n\ntype GetTokenFontKeysFor<\n A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight' | 'transform' | 'style'\n> = keyof Tokens['font'][keyof Tokens['font']][A]\n\ntype GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`\n\n// base tokens\nexport type SizeTokens = GetTokenString<keyof Tokens['size']> | number\nexport type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeObject>\n | CSSColorNames\nexport type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number\nexport type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number\n\n// font tokens\nexport type FontTokens = GetTokenString<keyof Tokens['font']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightTokens =\n | `$${GetTokenFontKeysFor<'weight'>}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number\nexport type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | TextStyle['fontStyle']\nexport type FontTransformTokens =\n | `$${GetTokenFontKeysFor<'transform'>}`\n | TextStyle['textTransform']\n\n//\n// adds theme short values to relevant props\n//\n\nexport type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends 'size'\n ? SizeTokens\n : K extends 'font'\n ? FontTokens\n : K extends 'fontSize'\n ? FontSizeTokens\n : K extends 'space'\n ? SpaceTokens\n : K extends 'color'\n ? ColorTokens\n : K extends 'zIndex'\n ? ZIndexTokens\n : K extends 'lineHeight'\n ? FontLineHeightTokens\n : K extends 'fontWeight'\n ? FontWeightTokens\n : K extends 'letterSpacing'\n ? FontLetterSpacingTokens\n : {}\n\nexport type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends SpaceKeys\n ? K extends 'shadowOffset'\n ? { width: SpaceTokens; height: SpaceTokens }\n : SpaceTokens\n : K extends ColorKeys\n ? ColorTokens\n : K extends ZIndexKeys\n ? ZIndexTokens\n : K extends LineHeightKeys\n ? FontLineHeightTokens\n : K extends FontWeightKeys\n ? FontWeightTokens\n : K extends FontLetterSpacingKeys\n ? FontLetterSpacingTokens\n : never\n\nexport type ThemeValueFallback = UnionableString | Variable\n\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]: ThemeValueGet<K> extends never\n ? T[K]\n : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback\n}\n\n// adds shorthand props\nexport type WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n// adds pseudo props\nexport type PseudoProps<A> = {\n hoverStyle?: A | null\n pressStyle?: A | null\n focusStyle?: A | null\n exitStyle?: A | null\n enterStyle?: A | null\n}\n\nexport type PsuedoPropKeys = keyof PseudoProps<any>\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// combines all of theme, shorthands, psuedos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... media queries and animations\n//\ntype WithThemeShorthandsPseudosMediaAnimation<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 StackPropsBaseShared = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\nexport type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackPropsBaseShared & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n WebOnlyStyleProps & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\nexport type TextPropsBaseShared = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\nexport type TextPropsBase = TextPropsBaseShared & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextPropsBaseShared & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfig\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?: Partial<StaticConfig>) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n injectCSS?: boolean\n children?: React.ReactNode\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: React.FunctionComponent<any> & StaticComponentObject\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 * Used for applying sub theme style\n */\n componentName?: string\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 * Attempts to attach focus styles at runtime (useful for native)\n */\n isInput?: boolean\n\n /**\n * React native web images need special handling for className support\n */\n isImage?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /**\n * If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * If these props are encountered, leave them un-extracted.\n */\n inlineProps?: 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 * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isReactNativeWeb?: boolean\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isTamagui?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n | React.Component\n | React.ForwardRefExoticComponent<any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer BaseProps\n>\n ? BaseProps\n : never\n\nexport type GetProps<A extends StylableComponent> = A extends TamaguiComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? GetGenericComponentTamaguiProps<Props>\n : A extends new (props: infer Props) => any\n ? GetGenericComponentTamaguiProps<Props>\n : {}\n\ntype GetGenericComponentTamaguiProps<P> = P &\n Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>\n\nexport type SpreadKeys =\n | '...fontSize'\n | '...fontStyle'\n | '...fontTransform'\n | '...lineHeight'\n | '...letterSpacing'\n | '...size'\n | '...color'\n | '...zIndex'\n | '...theme'\n | '...radius'\n\nexport type VariantDefinitions<\n Parent extends StylableComponent = TamaguiComponent,\n MyProps extends Object = GetProps<Parent>,\n Val = any\n> = VariantDefinitionFromProps<MyProps, Val>\n\nexport type VariantDefinitionFromProps<MyProps, Val> = MyProps extends Object\n ? {\n [propName: string]:\n | VariantSpreadFunction<MyProps, Val>\n | ({\n [Key in SpreadKeys]?: Key extends '...fontSize'\n ? FontSizeVariantSpreadFunction<MyProps>\n : Key extends '...size'\n ? SizeVariantSpreadFunction<MyProps>\n : Key extends '...color'\n ? ColorVariantSpreadFunction<MyProps>\n : Key extends '...lineHeight'\n ? FontLineHeightVariantSpreadFunction<MyProps>\n : Key extends '...fontTransform'\n ? FontTransformVariantSpreadFunction<MyProps>\n : Key extends '...fontStyle'\n ? FontStyleVariantSpreadFunction<MyProps>\n : Key extends '...letterSpacing'\n ? FontLetterSpacingVariantSpreadFunction<MyProps>\n : Key extends '...zIndex'\n ? ZIndexVariantSpreadFunction<MyProps>\n : Key extends '...radius'\n ? RadiusVariantSpreadFunction<MyProps>\n : Key extends '...theme'\n ? ThemeVariantSpreadFunction<MyProps>\n : never\n } & {\n [Key in string | number]?: MyProps | VariantSpreadFunction<MyProps, Val>\n } & {\n [Key in VariantTypeKeys]?: Key extends ':number'\n ? VariantSpreadFunction<MyProps, number>\n : Key extends ':boolean'\n ? VariantSpreadFunction<MyProps, boolean>\n : Key extends ':string'\n ? VariantSpreadFunction<MyProps, string>\n : never\n })\n }\n : never\n\nexport type GetVariantProps<Variants> = {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n}\n\nexport type VariantSpreadExtras<Props> = {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n}\n\ntype PropLike = { [key: string]: any }\n\nexport type VariantSpreadFunction<Props extends PropLike, Val = any> = (\n val: Val,\n config: VariantSpreadExtras<Props>\n) =>\n | {\n [Key in keyof Props]: Props[Key] | Variable\n }\n | null\n | undefined\n\nexport type VariantTypeKeys = ':string' | ':boolean' | ':number'\n\nexport type GetVariantValues<Key> = Key extends `...${infer VariantSpread}`\n ? ThemeValueByCategory<VariantSpread>\n : Key extends 'true' | 'false'\n ? boolean\n : Key extends ':string'\n ? string\n : Key extends ':boolean'\n ? boolean\n : Key extends ':number'\n ? number\n : Key\n\nexport type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontSizeTokens\n>\nexport type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SizeTokens>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLineHeightTokens\n>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLetterSpacingTokens\n>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontTransformTokens\n>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>\n\n/**\n * --------------------------------------------\n * end variants\n * --------------------------------------------\n */\n\ntype SizeKeys =\n | 'width'\n | 'height'\n | 'minWidth'\n | 'minHeight'\n | 'maxWidth'\n | 'maxHeight'\n | 'shadowRadius'\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 | 'shadowColor'\n | 'textShadowColor'\n\ntype SpaceKeys =\n | 'space'\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\ntype CSSColorNames =\n | 'aliceblue'\n | 'antiquewhite'\n | 'aqua'\n | 'aquamarine'\n | 'azure'\n | 'beige'\n | 'bisque'\n | 'black'\n | 'blanchedalmond'\n | 'blue'\n | 'blueviolet'\n | 'brown'\n | 'burlywood'\n | 'cadetblue'\n | 'chartreuse'\n | 'chocolate'\n | 'coral'\n | 'cornflowerblue'\n | 'cornsilk'\n | 'crimson'\n | 'cyan'\n | 'darkblue'\n | 'darkcyan'\n | 'darkgoldenrod'\n | 'darkgray'\n | 'darkgreen'\n | 'darkkhaki'\n | 'darkmagenta'\n | 'darkolivegreen'\n | 'darkorange'\n | 'darkorchid'\n | 'darkred'\n | 'darksalmon'\n | 'darkseagreen'\n | 'darkslateblue'\n | 'darkslategray'\n | 'darkturquoise'\n | 'darkviolet'\n | 'deeppink'\n | 'deepskyblue'\n | 'dimgray'\n | 'dodgerblue'\n | 'firebrick'\n | 'floralwhite'\n | 'forestgreen'\n | 'fuchsia'\n | 'gainsboro'\n | 'ghostwhite'\n | 'gold'\n | 'goldenrod'\n | 'gray'\n | 'green'\n | 'greenyellow'\n | 'honeydew'\n | 'hotpink'\n | 'indianred '\n | 'indigo '\n | 'ivory'\n | 'khaki'\n | 'lavender'\n | 'lavenderblush'\n | 'lawngreen'\n | 'lemonchiffon'\n | 'lightblue'\n | 'lightcoral'\n | 'lightcyan'\n | 'lightgoldenrodyellow'\n | 'lightgrey'\n | 'lightgreen'\n | 'lightpink'\n | 'lightsalmon'\n | 'lightseagreen'\n | 'lightskyblue'\n | 'lightslategray'\n | 'lightsteelblue'\n | 'lightyellow'\n | 'lime'\n | 'limegreen'\n | 'linen'\n | 'magenta'\n | 'maroon'\n | 'mediumaquamarine'\n | 'mediumblue'\n | 'mediumorchid'\n | 'mediumpurple'\n | 'mediumseagreen'\n | 'mediumslateblue'\n | 'mediumspringgreen'\n | 'mediumturquoise'\n | 'mediumvioletred'\n | 'midnightblue'\n | 'mintcream'\n | 'mistyrose'\n | 'moccasin'\n | 'navajowhite'\n | 'navy'\n | 'oldlace'\n | 'olive'\n | 'olivedrab'\n | 'orange'\n | 'orangered'\n | 'orchid'\n | 'palegoldenrod'\n | 'palegreen'\n | 'paleturquoise'\n | 'palevioletred'\n | 'papayawhip'\n | 'peachpuff'\n | 'peru'\n | 'pink'\n | 'plum'\n | 'powderblue'\n | 'purple'\n | 'red'\n | 'rosybrown'\n | 'royalblue'\n | 'saddlebrown'\n | 'salmon'\n | 'sandybrown'\n | 'seagreen'\n | 'seashell'\n | 'sienna'\n | 'silver'\n | 'skyblue'\n | 'slateblue'\n | 'slategray'\n | 'snow'\n | 'springgreen'\n | 'steelblue'\n | 'tan'\n | 'teal'\n | 'thistle'\n | 'tomato'\n | 'turquoise'\n | 'violet'\n | 'wheat'\n | 'white'\n | 'whitesmoke'\n | 'yellow'\n | 'yellowgreen'\n\nexport type TamaguiComponentState = {\n hover: boolean\n press: boolean\n pressIn: boolean\n focus: boolean\n mounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Object\n}\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n avoidClasses?: boolean\n useAnimations: UseAnimationHook\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase &\n Record<string, any> & {\n animation: string\n }\n\nexport type UseAnimationHelpers = {\n staticConfig: StaticConfigParsed\n getStyle: (props?: {\n isEntering?: boolean\n exitVariant?: string | null\n enterVariant?: string | null\n }) => ViewStyle\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n // style: ViewStyle | null | undefined\n // isMounted: boolean\n // exitStyle?: ViewStyle | null\n onDidAnimate?: any\n delay?: number\n // mergedStyles(props?: { isExiting?: boolean }): ViewStyle\n}\n\nexport type UseAnimationHook = (\n props: UseAnimationProps,\n helpers: UseAnimationHelpers\n) => {\n style?: StackStylePropsBase | StackStylePropsBase[]\n safeToUnmount?: () => void\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -40,8 +40,13 @@ module.exports = __toCommonJS(Stack_exports);
40
40
  var import_constants = require("../constants/constants");
41
41
  var import_createComponent = require("../createComponent");
42
42
  const Stack = (0, import_createComponent.createComponent)({
43
+ componentName: "Stack",
43
44
  defaultProps: __spreadProps(__spreadValues({}, import_constants.stackDefaultStyles), {
44
45
  flexDirection: "column"
45
46
  })
46
47
  });
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ Stack
51
+ });
47
52
  //# sourceMappingURL=Stack.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Stack.tsx"],
4
- "sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps } from '../types'\n\nexport const Stack = createComponent<StackProps, View>({\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAmC;AACnC,6BAAgC;AAGzB,MAAM,QAAQ,4CAAkC;AAAA,EACrD,cAAc,iCACT,sCADS;AAAA,IAEZ,eAAe;AAAA,EACjB;AACF,CAAC;",
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAmC;AACnC,6BAAgC;AAGzB,MAAM,QAAQ,4CAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc,iCACT,sCADS;AAAA,IAEZ,eAAe;AAAA,EACjB;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -44,6 +44,7 @@ const ellipseStyle = {
44
44
  whiteSpace: "nowrap"
45
45
  };
46
46
  const Text = (0, import_createComponent.createComponent)({
47
+ componentName: "Text",
47
48
  isText: true,
48
49
  defaultProps: {
49
50
  display: import_platform.isWeb ? "inline" : "flex",
@@ -87,4 +88,8 @@ const Text = (0, import_createComponent.createComponent)({
87
88
  cursor: true
88
89
  })
89
90
  });
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ Text
94
+ });
90
95
  //# sourceMappingURL=Text.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Text.tsx"],
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 } 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>({\n isText: true,\n defaultProps: {\n display: isWeb ? 'inline' : 'flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n ':number': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\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 deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAgD;AAGhD,sBAAsB;AACtB,6BAAgC;AAGhC,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,4CAAqC;AAAA,EACvD,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,wBAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,wBACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,wBAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,aAAa,iDACR,6BACA,oCACC,yBAAS;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAEJ,CAAC;",
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 defaultProps: {\n display: isWeb ? 'inline' : 'flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n ':number': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\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 deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAgD;AAGhD,sBAAsB;AACtB,6BAAgC;AAGhC,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,4CAAoD;AAAA,EACtE,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,wBAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,wBACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,wBAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,aAAa,iDACR,6BACA,oCACC,yBAAS;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAEJ,CAAC;",
6
6
  "names": []
7
7
  }
@@ -36,4 +36,10 @@ const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
36
36
  value: false
37
37
  }, props.children);
38
38
  }, "TextAncestorProvider");
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ FallbackNativeContext,
42
+ TextAncestorContext,
43
+ TextAncestorProvider
44
+ });
39
45
  //# sourceMappingURL=TextAncestorContext.js.map
@@ -27,33 +27,27 @@ module.exports = __toCommonJS(Theme_exports);
27
27
  var import_react = __toESM(require("react"));
28
28
  var import_platform = require("../constants/platform");
29
29
  var import_wrapThemeManagerContext = require("../helpers/wrapThemeManagerContext");
30
- var import_static = require("../static");
30
+ var import_useTheme = require("../hooks/useTheme");
31
31
  import_react.default["createElement"];
32
32
  const Theme = (0, import_react.memo)(/* @__PURE__ */ __name(function Theme2(props) {
33
33
  var _a, _b;
34
- const { name, theme, themeManager, themes, className } = (0, import_static.useChangeThemeEffect)(props.name, void 0, props);
35
- const contents = (0, import_react.useMemo)(() => {
36
- if (!name || !theme) {
37
- return props.children;
38
- }
39
- return (0, import_wrapThemeManagerContext.wrapThemeManagerContext)(props.children, themeManager);
40
- }, [props.children, themeManager]);
41
- if (!themes) {
42
- console.warn("Error, no themes in context", props);
43
- return props.children;
44
- }
45
- if (!name || !theme) {
46
- if (process.env.NODE_ENV === "development" && name && !theme) {
34
+ const { name, theme, themeManager, themes, className } = (0, import_useTheme.useChangeThemeEffect)(props.name, props.componentName, props);
35
+ if (!themes || !name || !theme) {
36
+ if (name && !theme && process.env.NODE_ENV === "development") {
47
37
  console.warn(`No theme found by name ${name}`);
48
38
  }
49
39
  return props.children;
50
40
  }
41
+ const contents = (0, import_react.useMemo)(() => (0, import_wrapThemeManagerContext.wrapThemeManagerContext)(props.children, themeManager), [props.children, themeManager]);
42
+ if (props.componentName === "Drawer") {
43
+ console.log("ok?", className, themeManager);
44
+ }
51
45
  if (import_platform.isWeb) {
52
- if (props.disableThemeClass) {
53
- return contents;
54
- }
55
- return /* @__PURE__ */ import_react.default.createElement("div", {
56
- className: props.className ? `${className || ""} ${props.className || ""}` : className || "",
46
+ return /* @__PURE__ */ import_react.default.createElement("span", {
47
+ className: [
48
+ `tui_Theme`,
49
+ ...!props.disableThemeClass ? [props.className, className].filter(Boolean) : []
50
+ ].join(" "),
57
51
  style: {
58
52
  display: "contents",
59
53
  color: (_b = (_a = themes[name]) == null ? void 0 : _a.color) == null ? void 0 : _b.toString()
@@ -62,4 +56,8 @@ const Theme = (0, import_react.memo)(/* @__PURE__ */ __name(function Theme2(prop
62
56
  }
63
57
  return contents;
64
58
  }, "Theme"));
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ Theme
62
+ });
65
63
  //# sourceMappingURL=Theme.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Theme.tsx"],
4
- "sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../static'\nimport { ThemeName } from '../types'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n children?: any\n debug?: boolean\n}\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n undefined,\n props\n )\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 if (!name || !theme) {\n return props.children\n }\n return wrapThemeManagerContext(props.children, themeManager)\n }, [props.children, themeManager])\n\n if (!themes) {\n console.warn('Error, no themes in context', props)\n return props.children\n }\n\n if (!name || !theme) {\n if (process.env.NODE_ENV === 'development' && name && !theme) {\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\n\n if (isWeb) {\n if (props.disableThemeClass) {\n return contents\n }\n return (\n <div\n className={\n props.className ? `${className || ''} ${props.className || ''}` : className || ''\n }\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: themes[name]?.color?.toString(),\n }}\n >\n {contents}\n </div>\n )\n }\n\n return contents\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,sBAAsB;AACtB,qCAAwC;AACxC,oBAAqC;AAIrC,qBAAM;AAUC,MAAM,QAAQ,uBAAK,uCAAe,OAAmB;AAlB5D;AAmBE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,wCACvD,MAAM,MACN,QACA,KACF;AAIA,QAAM,WAAW,0BAAQ,MAAM;AAC7B,QAAI,CAAC,QAAQ,CAAC,OAAO;AACnB,aAAO,MAAM;AAAA,IACf;AACA,WAAO,4DAAwB,MAAM,UAAU,YAAY;AAAA,EAC7D,GAAG,CAAC,MAAM,UAAU,YAAY,CAAC;AAEjC,MAAI,CAAC,QAAQ;AACX,YAAQ,KAAK,+BAA+B,KAAK;AACjD,WAAO,MAAM;AAAA,EACf;AAEA,MAAI,CAAC,QAAQ,CAAC,OAAO;AACnB,QAAI,QAAQ,IAAI,aAAa,iBAAiB,QAAQ,CAAC,OAAO;AAC5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAAO,MAAM;AAAA,EACf;AAEA,MAAI,uBAAO;AACT,QAAI,MAAM,mBAAmB;AAC3B,aAAO;AAAA,IACT;AACA,WACE,mDAAC;AAAA,MACC,WACE,MAAM,YAAY,GAAG,aAAa,MAAM,MAAM,aAAa,OAAO,aAAa;AAAA,MAEjF,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,mBAAO,UAAP,mBAAc,UAAd,mBAAqB;AAAA,MAC9B;AAAA,OAEC,QACH;AAAA,EAEJ;AAEA,SAAO;AACT,GAjD0B,QAiDzB;",
4
+ "sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../hooks/useTheme'\nimport { ThemeName } from '../types'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n debug?: boolean\n}\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 if (!themes || !name || !theme) {\n if (name && !theme && process.env.NODE_ENV === 'development') {\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\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 () => wrapThemeManagerContext(props.children, themeManager),\n [props.children, themeManager]\n )\n\n if (props.componentName === 'Drawer') {\n console.log('ok?', className, themeManager)\n }\n\n if (isWeb) {\n return (\n <span\n className={[\n `tui_Theme`,\n ...(!props.disableThemeClass ? [props.className, className].filter(Boolean) : []),\n ].join(' ')}\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: themes[name]?.color?.toString(),\n }}\n >\n {contents}\n </span>\n )\n }\n\n return contents\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,sBAAsB;AACtB,qCAAwC;AACxC,sBAAqC;AAIrC,qBAAM;AAWC,MAAM,QAAQ,uBAAK,uCAAe,OAAmB;AAnB5D;AAoBE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,0CACvD,MAAM,MACN,MAAM,eACN,KACF;AAEA,MAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;AAC9B,QAAI,QAAQ,CAAC,SAAS,QAAQ,IAAI,aAAa,eAAe;AAC5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAAO,MAAM;AAAA,EACf;AAIA,QAAM,WAAW,0BACf,MAAM,4DAAwB,MAAM,UAAU,YAAY,GAC1D,CAAC,MAAM,UAAU,YAAY,CAC/B;AAEA,MAAI,MAAM,kBAAkB,UAAU;AACpC,YAAQ,IAAI,OAAO,WAAW,YAAY;AAAA,EAC5C;AAEA,MAAI,uBAAO;AACT,WACE,mDAAC;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,GAAI,CAAC,MAAM,oBAAoB,CAAC,MAAM,WAAW,SAAS,EAAE,OAAO,OAAO,IAAI,CAAC;AAAA,MACjF,EAAE,KAAK,GAAG;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,mBAAO,UAAP,mBAAc,UAAd,mBAAqB;AAAA,MAC9B;AAAA,OAEC,QACH;AAAA,EAEJ;AAEA,SAAO;AACT,GA5C0B,QA4CzB;",
6
6
  "names": []
7
7
  }
@@ -44,4 +44,9 @@ const ThemeInverse = /* @__PURE__ */ __name((props) => {
44
44
  name
45
45
  }, props.children);
46
46
  }, "ThemeInverse");
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ ThemeInverse,
50
+ setThemeInversions
51
+ });
47
52
  //# sourceMappingURL=ThemeInverse.js.map
@@ -59,4 +59,8 @@ const ThemeProvider = /* @__PURE__ */ __name((props) => {
59
59
  disableThemeClass: props.disableRootThemeClass
60
60
  }, props.children));
61
61
  }, "ThemeProvider");
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ ThemeProvider
65
+ });
62
66
  //# sourceMappingURL=ThemeProvider.js.map
@@ -56,4 +56,8 @@ const ThemeReset = /* @__PURE__ */ __name((props) => {
56
56
  name
57
57
  }, props.children);
58
58
  }, "ThemeReset");
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ ThemeReset
62
+ });
59
63
  //# sourceMappingURL=ThemeReset.js.map
@@ -1,11 +1,19 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import * as Helpers from "@tamagui/helpers";
4
+ import { getConfig } from "./conf";
3
5
  import { rnw } from "./constants/rnw";
4
- import { getAllSelectors, getAllTransforms } from "./helpers/insertStyleRule";
6
+ import { getAllSelectors, getAllTransforms, getInsertedRules } from "./helpers/insertStyleRule";
5
7
  class TamaguiManager {
6
8
  constructor() {
7
- this.config = null;
8
9
  this.rnw = rnw;
10
+ this.Helpers = Helpers;
11
+ }
12
+ get config() {
13
+ return getConfig();
14
+ }
15
+ get insertedRules() {
16
+ return getInsertedRules();
9
17
  }
10
18
  get allSelectors() {
11
19
  return getAllSelectors();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Tamagui.ts"],
4
- "sourcesContent": ["import { rnw } from './constants/rnw'\nimport { getAllSelectors, getAllTransforms } from './helpers/insertStyleRule'\nimport { TamaguiInternalConfig } from './types'\n\n// serves a central store for state\n\nclass TamaguiManager {\n config: TamaguiInternalConfig | null = null\n rnw = rnw\n\n get allSelectors() {\n return getAllSelectors()\n }\n\n get allTransforms() {\n return getAllTransforms()\n }\n\n get identifierToValue() {\n return identifierToValue\n }\n}\n\nexport const Tamagui = new TamaguiManager()\n\nconst identifierToValue = new Map<string, any>()\n\nexport const getValueFromIdentifier = (identifier: string) => {\n return identifierToValue.get(identifier)\n}\n\nexport const setIdentifierValue = (identifier: string, value: any) => {\n identifierToValue.set(identifier, value)\n}\n"],
5
- "mappings": ";;AAAA;AACA;AAKA,MAAM,eAAe;AAAA,EAArB;AACE,kBAAuC;AACvC,eAAM;AAAA;AAAA,MAEF,eAAe;AACjB,WAAO,gBAAgB;AAAA,EACzB;AAAA,MAEI,gBAAgB;AAClB,WAAO,iBAAiB;AAAA,EAC1B;AAAA,MAEI,oBAAoB;AACtB,WAAO;AAAA,EACT;AACF;AAfA;AAiBO,MAAM,UAAU,IAAI,eAAe;AAE1C,MAAM,oBAAoB,oBAAI,IAAiB;AAExC,MAAM,yBAAyB,wBAAC,eAAuB;AAC5D,SAAO,kBAAkB,IAAI,UAAU;AACzC,GAFsC;AAI/B,MAAM,qBAAqB,wBAAC,YAAoB,UAAe;AACpE,oBAAkB,IAAI,YAAY,KAAK;AACzC,GAFkC;",
4
+ "sourcesContent": ["import * as Helpers from '@tamagui/helpers'\n\nimport { getConfig } from './conf'\nimport { rnw } from './constants/rnw'\nimport { getAllSelectors, getAllTransforms, getInsertedRules } from './helpers/insertStyleRule'\nimport { TamaguiInternalConfig } from './types'\n\n// serves a central store for state\n\nclass TamaguiManager {\n rnw = rnw\n Helpers = Helpers\n\n get config() {\n return getConfig()\n }\n\n get insertedRules() {\n return getInsertedRules()\n }\n\n get allSelectors() {\n return getAllSelectors()\n }\n\n get allTransforms() {\n return getAllTransforms()\n }\n\n get identifierToValue() {\n return identifierToValue\n }\n}\n\nexport const Tamagui = new TamaguiManager()\n\nconst identifierToValue = new Map<string, any>()\n\nexport const getValueFromIdentifier = (identifier: string) => {\n return identifierToValue.get(identifier)\n}\n\nexport const setIdentifierValue = (identifier: string, value: any) => {\n identifierToValue.set(identifier, value)\n}\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AACA;AAKA,MAAM,eAAe;AAAA,EAArB;AACE,eAAM;AACN,mBAAU;AAAA;AAAA,MAEN,SAAS;AACX,WAAO,UAAU;AAAA,EACnB;AAAA,MAEI,gBAAgB;AAClB,WAAO,iBAAiB;AAAA,EAC1B;AAAA,MAEI,eAAe;AACjB,WAAO,gBAAgB;AAAA,EACzB;AAAA,MAEI,gBAAgB;AAClB,WAAO,iBAAiB;AAAA,EAC1B;AAAA,MAEI,oBAAoB;AACtB,WAAO;AAAA,EACT;AACF;AAvBA;AAyBO,MAAM,UAAU,IAAI,eAAe;AAE1C,MAAM,oBAAoB,oBAAI,IAAiB;AAExC,MAAM,yBAAyB,wBAAC,eAAuB;AAC5D,SAAO,kBAAkB,IAAI,UAAU;AACzC,GAFsC;AAI/B,MAAM,qBAAqB,wBAAC,YAAoB,UAAe;AACpE,oBAAkB,IAAI,YAAY,KAAK;AACzC,GAFkC;",
6
6
  "names": []
7
7
  }