@tamagui/core 1.0.1-rc.5 → 1.0.1-rc.6

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 (166) hide show
  1. package/dist/cjs/addTheme.js +1 -1
  2. package/dist/cjs/addTheme.js.map +1 -1
  3. package/dist/cjs/config.js +1 -1
  4. package/dist/cjs/config.js.map +1 -1
  5. package/dist/cjs/constants/constants.js +1 -1
  6. package/dist/cjs/constants/constants.js.map +1 -1
  7. package/dist/cjs/createComponent.js +86 -19
  8. package/dist/cjs/createComponent.js.map +2 -2
  9. package/dist/cjs/createTamagui.js +8 -4
  10. package/dist/cjs/createTamagui.js.map +2 -2
  11. package/dist/cjs/helpers/ThemeManager.js +21 -7
  12. package/dist/cjs/helpers/ThemeManager.js.map +2 -2
  13. package/dist/cjs/helpers/ThemeManager.test.js +5 -5
  14. package/dist/cjs/helpers/ThemeManager.test.js.map +1 -1
  15. package/dist/cjs/helpers/createMediaStyle.js +1 -1
  16. package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
  17. package/dist/cjs/helpers/createPropMapper.js +12 -3
  18. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  19. package/dist/cjs/helpers/createProxy.js +1 -1
  20. package/dist/cjs/helpers/createProxy.js.map +1 -1
  21. package/dist/cjs/helpers/expandStyle.js +18 -3
  22. package/dist/cjs/helpers/expandStyle.js.map +2 -2
  23. package/dist/cjs/helpers/extendStaticConfig.js +1 -1
  24. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  25. package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
  26. package/dist/cjs/helpers/getSize.js.map +2 -2
  27. package/dist/cjs/helpers/getSplitStyles.js +56 -12
  28. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  29. package/dist/cjs/helpers/getStylesAtomic.js +15 -13
  30. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  31. package/dist/cjs/helpers/getThemeCSSRules.js +5 -3
  32. package/dist/cjs/helpers/getThemeCSSRules.js.map +2 -2
  33. package/dist/cjs/helpers/insertStyleRule.js +4 -2
  34. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  35. package/dist/cjs/helpers/isTamaguiComponent.js +1 -1
  36. package/dist/cjs/helpers/isTamaguiComponent.js.map +2 -2
  37. package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
  38. package/dist/cjs/helpers/matchMedia.js.map +2 -2
  39. package/dist/cjs/helpers/mergeTransform.js +3 -1
  40. package/dist/cjs/helpers/mergeTransform.js.map +2 -2
  41. package/dist/cjs/helpers/normalizeColor.js +1 -1
  42. package/dist/cjs/helpers/normalizeColor.js.map +2 -2
  43. package/dist/cjs/helpers/normalizeValueWithProperty.js +8 -2
  44. package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
  45. package/dist/cjs/helpers/registerCSSVariable.js.map +2 -2
  46. package/dist/cjs/hooks/useElementLayout.js +1 -1
  47. package/dist/cjs/hooks/useElementLayout.js.map +2 -2
  48. package/dist/cjs/hooks/useMedia.js +5 -4
  49. package/dist/cjs/hooks/useMedia.js.map +2 -2
  50. package/dist/cjs/hooks/useTheme.js +33 -9
  51. package/dist/cjs/hooks/useTheme.js.map +2 -2
  52. package/dist/cjs/insertFont.js.map +2 -2
  53. package/dist/cjs/styled.js +3 -1
  54. package/dist/cjs/styled.js.map +2 -2
  55. package/dist/cjs/types.js.map +1 -1
  56. package/dist/cjs/vendor/Pressability.native.js.map +2 -2
  57. package/dist/cjs/views/FontLanguage.native.js.map +2 -2
  58. package/dist/cjs/views/Slot.js.map +2 -2
  59. package/dist/cjs/views/Stack.test.js +1 -1
  60. package/dist/cjs/views/Stack.test.js.map +1 -1
  61. package/dist/cjs/views/TamaguiProvider.js +1 -1
  62. package/dist/cjs/views/TamaguiProvider.js.map +2 -2
  63. package/dist/cjs/views/Theme.js +5 -2
  64. package/dist/cjs/views/Theme.js.map +2 -2
  65. package/dist/esm/addTheme.js +1 -1
  66. package/dist/esm/addTheme.js.map +1 -1
  67. package/dist/esm/config.js +1 -1
  68. package/dist/esm/config.js.map +1 -1
  69. package/dist/esm/constants/constants.js +1 -1
  70. package/dist/esm/constants/constants.js.map +1 -1
  71. package/dist/esm/createComponent.js +93 -20
  72. package/dist/esm/createComponent.js.map +2 -2
  73. package/dist/esm/createTamagui.js +8 -4
  74. package/dist/esm/createTamagui.js.map +2 -2
  75. package/dist/esm/helpers/ThemeManager.js +21 -7
  76. package/dist/esm/helpers/ThemeManager.js.map +2 -2
  77. package/dist/esm/helpers/ThemeManager.test.js +5 -5
  78. package/dist/esm/helpers/ThemeManager.test.js.map +1 -1
  79. package/dist/esm/helpers/createMediaStyle.js +1 -1
  80. package/dist/esm/helpers/createMediaStyle.js.map +2 -2
  81. package/dist/esm/helpers/createPropMapper.js +12 -3
  82. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  83. package/dist/esm/helpers/createProxy.js +1 -1
  84. package/dist/esm/helpers/createProxy.js.map +1 -1
  85. package/dist/esm/helpers/expandStyle.js +18 -3
  86. package/dist/esm/helpers/expandStyle.js.map +2 -2
  87. package/dist/esm/helpers/extendStaticConfig.js +1 -1
  88. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  89. package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
  90. package/dist/esm/helpers/getSize.js.map +2 -2
  91. package/dist/esm/helpers/getSplitStyles.js +63 -13
  92. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  93. package/dist/esm/helpers/getStylesAtomic.js +15 -13
  94. package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
  95. package/dist/esm/helpers/getThemeCSSRules.js +5 -3
  96. package/dist/esm/helpers/getThemeCSSRules.js.map +2 -2
  97. package/dist/esm/helpers/insertStyleRule.js +4 -2
  98. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  99. package/dist/esm/helpers/isTamaguiComponent.js +1 -1
  100. package/dist/esm/helpers/isTamaguiComponent.js.map +2 -2
  101. package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
  102. package/dist/esm/helpers/matchMedia.js.map +2 -2
  103. package/dist/esm/helpers/mergeTransform.js +3 -1
  104. package/dist/esm/helpers/mergeTransform.js.map +2 -2
  105. package/dist/esm/helpers/normalizeColor.js +1 -1
  106. package/dist/esm/helpers/normalizeColor.js.map +2 -2
  107. package/dist/esm/helpers/normalizeValueWithProperty.js +8 -2
  108. package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
  109. package/dist/esm/helpers/registerCSSVariable.js.map +2 -2
  110. package/dist/esm/hooks/useElementLayout.js +1 -1
  111. package/dist/esm/hooks/useElementLayout.js.map +2 -2
  112. package/dist/esm/hooks/useMedia.js +5 -4
  113. package/dist/esm/hooks/useMedia.js.map +2 -2
  114. package/dist/esm/hooks/useTheme.js +37 -10
  115. package/dist/esm/hooks/useTheme.js.map +2 -2
  116. package/dist/esm/insertFont.js.map +2 -2
  117. package/dist/esm/styled.js +3 -1
  118. package/dist/esm/styled.js.map +2 -2
  119. package/dist/esm/vendor/Pressability.native.js.map +2 -2
  120. package/dist/esm/views/FontLanguage.native.js.map +2 -2
  121. package/dist/esm/views/Slot.js +6 -1
  122. package/dist/esm/views/Slot.js.map +2 -2
  123. package/dist/esm/views/Stack.test.js +1 -1
  124. package/dist/esm/views/Stack.test.js.map +1 -1
  125. package/dist/esm/views/TamaguiProvider.js +1 -1
  126. package/dist/esm/views/TamaguiProvider.js.map +2 -2
  127. package/dist/esm/views/Theme.js +5 -2
  128. package/dist/esm/views/Theme.js.map +2 -2
  129. package/package.json +12 -11
  130. package/src/addTheme.ts +1 -1
  131. package/src/config.ts +1 -1
  132. package/src/constants/constants.ts +1 -1
  133. package/src/createComponent.tsx +133 -35
  134. package/src/createTamagui.ts +16 -6
  135. package/src/helpers/ThemeManager.test.tsx +5 -5
  136. package/src/helpers/ThemeManager.tsx +36 -14
  137. package/src/helpers/createMediaStyle.ts +4 -2
  138. package/src/helpers/createPropMapper.ts +24 -5
  139. package/src/helpers/createProxy.ts +1 -1
  140. package/src/helpers/expandStyle.ts +18 -3
  141. package/src/helpers/extendStaticConfig.ts +5 -2
  142. package/src/helpers/getExpandedShorthands.ts +3 -1
  143. package/src/helpers/getSize.ts +2 -1
  144. package/src/helpers/getSplitStyles.tsx +95 -29
  145. package/src/helpers/getStylesAtomic.ts +19 -14
  146. package/src/helpers/getThemeCSSRules.ts +10 -4
  147. package/src/helpers/insertStyleRule.tsx +15 -6
  148. package/src/helpers/isTamaguiComponent.tsx +1 -1
  149. package/src/helpers/isTamaguiElement.tsx +4 -1
  150. package/src/helpers/matchMedia.ts +2 -1
  151. package/src/helpers/mergeTransform.ts +9 -2
  152. package/src/helpers/normalizeColor.ts +1 -1
  153. package/src/helpers/normalizeValueWithProperty.ts +8 -2
  154. package/src/helpers/registerCSSVariable.ts +3 -1
  155. package/src/hooks/useElementLayout.tsx +1 -1
  156. package/src/hooks/useMedia.tsx +5 -6
  157. package/src/hooks/useTheme.tsx +59 -18
  158. package/src/insertFont.ts +4 -1
  159. package/src/styled.tsx +22 -10
  160. package/src/types.tsx +56 -26
  161. package/src/vendor/Pressability.native.tsx +2 -1
  162. package/src/views/FontLanguage.native.tsx +3 -1
  163. package/src/views/Slot.tsx +14 -3
  164. package/src/views/Stack.test.tsx +1 -1
  165. package/src/views/TamaguiProvider.tsx +1 -1
  166. package/src/views/Theme.tsx +10 -3
@@ -50,8 +50,7 @@ const useTheme = (props = emptyProps) => {
50
50
  const { name, theme, themeManager, className, isNewTheme } = useChangeThemeEffect(props);
51
51
  if (process.env.NODE_ENV === "development") {
52
52
  if (import_constants.isWeb && isNewTheme && className === ((_a = themeManager == null ? void 0 : themeManager.parentManager) == null ? void 0 : _a.state.className)) {
53
- console.error(`Should always change, duplicating ThemeMananger bug`, themeManager);
54
- debugger;
53
+ console.error("Should always change, duplicating ThemeMananger bug", themeManager);
55
54
  }
56
55
  if (props.debug === "verbose") {
57
56
  console.groupCollapsed(" \u{1F539} useTheme =>", name);
@@ -136,7 +135,7 @@ const useChangeThemeEffect = (props, root = false) => {
136
135
  } = props;
137
136
  if (disable) {
138
137
  if (!parentManager)
139
- throw new Error(`Disable topmost`);
138
+ throw new Error("Disable topmost");
140
139
  return {
141
140
  ...parentManager.state,
142
141
  isNewTheme: false,
@@ -155,7 +154,7 @@ const useChangeThemeEffect = (props, root = false) => {
155
154
  }
156
155
  activeThemeManagers.add(themeManager);
157
156
  const disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(() => {
158
- if (!isNewTheme && !import_constants.isWeb) {
157
+ if (!(isNewTheme || import_constants.isWeb)) {
159
158
  setThemeState({
160
159
  ...themeState,
161
160
  state: { ...themeManager.state },
@@ -175,9 +174,14 @@ const useChangeThemeEffect = (props, root = false) => {
175
174
  const shouldReturnParentState = (0, import_ThemeManager.hasNoThemeUpdatingProps)(props) || isInversingOnMount;
176
175
  if (shouldReturnParentState) {
177
176
  if (!parentManager)
178
- throw `impossible`;
177
+ throw "impossible";
179
178
  if (process.env.NODE_ENV === "development" && props.debug === "verbose")
180
- console.log("useTheme hasNoThemeUpdatingProps", parentManager.state.name, "isInversingOnMount", isInversingOnMount);
179
+ console.log(
180
+ "useTheme hasNoThemeUpdatingProps",
181
+ parentManager.state.name,
182
+ "isInversingOnMount",
183
+ isInversingOnMount
184
+ );
181
185
  return {
182
186
  ...parentManager.state,
183
187
  className: isInversingOnMount ? "" : parentManager.state.className,
@@ -195,8 +199,25 @@ const useChangeThemeEffect = (props, root = false) => {
195
199
  const _ = new import_ThemeManager.ThemeManager(props, root ? "root" : parentManager);
196
200
  const isNewTheme2 = _ !== parentManager;
197
201
  if (process.env.NODE_ENV === "development" && debug)
198
- [console.groupCollapsed("useTheme create() isNewTheme", isNewTheme2), console.log("parent.state.name", parentManager == null ? void 0 : parentManager.state.name, "\n", "props", props, "\n", import_constants.isClient ? parentManager : "", "getState", isNewTheme2 && import_constants.isClient ? _.getState(props) : "", "\n", "state", import_constants.isClient ? { ..._.state } : ""), console.groupEnd()];
199
- const mounted2 = !props.inverse ? true : root || (prev == null ? void 0 : prev.mounted) || false;
202
+ [
203
+ console.groupCollapsed("useTheme create() isNewTheme", isNewTheme2),
204
+ console.log(
205
+ "parent.state.name",
206
+ parentManager == null ? void 0 : parentManager.state.name,
207
+ "\n",
208
+ "props",
209
+ props,
210
+ "\n",
211
+ import_constants.isClient ? parentManager : "",
212
+ "getState",
213
+ isNewTheme2 && import_constants.isClient ? _.getState(props) : "",
214
+ "\n",
215
+ "state",
216
+ import_constants.isClient ? { ..._.state } : ""
217
+ ),
218
+ console.groupEnd()
219
+ ];
220
+ const mounted2 = !props.inverse ? true : root || (prev == null ? void 0 : prev.mounted);
200
221
  return {
201
222
  isNewTheme: isNewTheme2,
202
223
  state: { ..._.state },
@@ -206,7 +227,10 @@ const useChangeThemeEffect = (props, root = false) => {
206
227
  }
207
228
  function updateState() {
208
229
  const next = themeManager.getState(props, parentManager);
209
- const shouldChange = themeManager.getStateShouldChange(next, isNewTheme ? state : null);
230
+ const shouldChange = themeManager.getStateShouldChange(
231
+ next,
232
+ isNewTheme ? state : null
233
+ );
210
234
  if (shouldChange) {
211
235
  setThemeState(createState);
212
236
  } else {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useTheme.tsx"],
4
- "sourcesContent": ["/* eslint-disable no-console */\nimport { isClient, isRSC, isServer, isWeb } from '@tamagui/constants'\nimport { useContext, useEffect, useLayoutEffect, useMemo, useState } from 'react'\n\nimport { getConfig } from '../config'\nimport { isDevTools } from '../constants/isDevTools'\nimport { createProxy } from '../helpers/createProxy'\nimport { ThemeManager, ThemeManagerState, hasNoThemeUpdatingProps } from '../helpers/ThemeManager'\nimport { ThemeManagerContext } from '../helpers/ThemeManagerContext'\nimport { ThemeParsed, ThemeProps } from '../types'\nimport { GetThemeUnwrapped } from './getThemeUnwrapped'\n\nexport type ChangedThemeResponse = {\n themeManager: ThemeManager | null\n name: string\n isNewTheme?: boolean\n theme?: ThemeParsed | null\n className?: string\n}\n\nconst emptyProps = { name: null }\n\nfunction getDefaultThemeProxied() {\n const config = getConfig()\n const name = Object.keys(config.themes)[0]\n return getThemeProxied({\n theme: config.themes[name],\n name,\n })\n}\n\nexport const useTheme = (props: ThemeProps = emptyProps): ThemeParsed => {\n if (isRSC) {\n return getDefaultThemeProxied()\n }\n\n const { name, theme, themeManager, className, isNewTheme } = useChangeThemeEffect(props)\n\n if (process.env.NODE_ENV === 'development') {\n // ensure we aren't creating too many ThemeManagers\n if (isWeb && isNewTheme && className === themeManager?.parentManager?.state.className) {\n console.error(`Should always change, duplicating ThemeMananger bug`, themeManager)\n // eslint-disable-next-line no-debugger\n debugger\n }\n if (props.debug === 'verbose') {\n console.groupCollapsed(' \uD83D\uDD39 useTheme =>', name)\n const logs = { ...props, name, className, ...(isDevTools && { theme }) }\n for (const key in logs) {\n console.log(' ', key, logs[key])\n }\n console.groupEnd()\n }\n }\n\n if (!theme) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('No theme found', name, props, themeManager)\n }\n return getDefaultThemeProxied()\n }\n\n return useMemo(() => {\n return getThemeProxied({\n isNewTheme,\n theme,\n name,\n className,\n themeManager,\n })\n }, [theme, isNewTheme, name, className, themeManager])\n}\n\nfunction getThemeProxied({\n theme,\n name,\n className,\n themeManager,\n isNewTheme,\n}: {\n theme: any\n name: string\n className?: string\n themeManager?: ThemeManager | null\n isNewTheme?: boolean\n}) {\n return createProxy(theme, {\n has(_, key) {\n if (typeof key === 'string') {\n if (key[0] === '$') key = key.slice(1)\n return themeManager?.allKeys.has(key)\n }\n return Reflect.has(theme, key)\n },\n get(_, key) {\n if (key === GetThemeUnwrapped) {\n return theme\n } else if (key === GetThemeManager) {\n return themeManager\n } else if (key === GetIsNewTheme) {\n return isNewTheme\n } else if (key === 'name') {\n return name\n } else if (key === 'className') {\n return className\n } else if (!name || key === '__proto__' || typeof key === 'symbol' || key === '$typeof') {\n return Reflect.get(_, key)\n }\n // auto convert variables to plain\n if (key[0] === '$') key = key.slice(1)\n if (!themeManager) {\n return theme[key]\n }\n return themeManager.getValue(key)\n },\n })\n}\n\nconst GetThemeManager = Symbol()\nconst GetIsNewTheme = Symbol()\n\nexport const getThemeManager = (theme: any): ThemeManager | undefined => theme?.[GetThemeManager]\nexport const getThemeIsNewTheme = (theme: any): ThemeManager | undefined => theme?.[GetIsNewTheme]\n\nexport const activeThemeManagers = new Set<ThemeManager>()\n\nexport const useChangeThemeEffect = (props: ThemeProps, root = false): ChangedThemeResponse => {\n if (isRSC) {\n // we need context working for this to work well\n return {\n ...createState().state,\n themeManager: null,\n }\n }\n const parentManager = useContext(ThemeManagerContext)\n\n const {\n debug,\n // @ts-expect-error internal use only\n disable,\n } = props\n\n if (disable) {\n if (!parentManager) throw new Error(`Disable topmost`)\n return {\n ...parentManager.state,\n isNewTheme: false,\n themeManager: parentManager,\n }\n }\n\n type State = {\n isNewTheme: boolean\n state: ThemeManagerState\n themeManager: ThemeManager\n mounted?: boolean\n }\n\n const [themeState, setThemeState] = useState<State>(createState)\n const { isNewTheme, state, themeManager, mounted } = themeState\n\n if (!isServer) {\n useEffect(() => {\n if (disable) return\n // SSR safe inverse (because server can't know prefers scheme)\n // could be done through fancy selectors like how we do prefers-media\n // but may be a bit of explosion of selectors\n if (props.inverse && !mounted) {\n setThemeState({ ...themeState, mounted: true })\n return\n }\n activeThemeManagers.add(themeManager)\n const disposeChangeListener = parentManager?.onChangeTheme(() => {\n if (!isNewTheme && !isWeb) {\n setThemeState({\n ...themeState,\n state: { ...themeManager.state },\n isNewTheme: false,\n })\n } else {\n updateState()\n }\n })\n return () => {\n activeThemeManagers.delete(themeManager)\n disposeChangeListener?.()\n }\n }, [disable, state, isNewTheme, debug])\n }\n\n const isInversingOnMount = Boolean(!themeState.mounted && props.inverse)\n const shouldReturnParentState = hasNoThemeUpdatingProps(props) || isInversingOnMount\n\n if (shouldReturnParentState) {\n if (!parentManager) throw `impossible`\n // prettier-ignore\n if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') console.log('useTheme hasNoThemeUpdatingProps', parentManager.state.name, 'isInversingOnMount', isInversingOnMount)\n return {\n ...parentManager.state,\n className: isInversingOnMount ? '' : parentManager.state.className,\n themeManager: parentManager,\n isNewTheme: false,\n }\n }\n\n // run inline in render\n updateState()\n\n return {\n ...state,\n isNewTheme,\n themeManager,\n }\n\n function createState(prev?: State) {\n const _ = new ThemeManager(props, root ? 'root' : parentManager)\n const isNewTheme = _ !== parentManager\n // prettier-ignore\n if (process.env.NODE_ENV === 'development' && debug) [console.groupCollapsed('useTheme create() isNewTheme', isNewTheme), console.log('parent.state.name', parentManager?.state.name, '\\n', 'props', props, '\\n', isClient ? parentManager : '', 'getState', isNewTheme && isClient ? _.getState(props) : '', '\\n', 'state', isClient ? { ..._.state } : ''), console.groupEnd()]\n // only inverse relies on this for ssr\n const mounted = !props.inverse ? true : root || prev?.mounted || false\n return {\n // ThemeManager returns parentManager if no change\n isNewTheme,\n state: { ..._.state },\n themeManager: _,\n mounted,\n }\n }\n\n function updateState() {\n const next = themeManager.getState(props, parentManager)\n const shouldChange = themeManager.getStateShouldChange(next, isNewTheme ? state : null)\n if (shouldChange) {\n setThemeState(createState)\n } else {\n if (!next && parentManager?.state.name !== state.name) {\n // were changing back to parent state\n setThemeState(createState)\n }\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAiD;AACjD,mBAA0E;AAE1E,oBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,0BAAyE;AACzE,iCAAoC;AAEpC,+BAAkC;AAUlC,MAAM,aAAa,EAAE,MAAM,KAAK;AAEhC,SAAS,yBAAyB;AAChC,QAAM,aAAS,yBAAU;AACzB,QAAM,OAAO,OAAO,KAAK,OAAO,MAAM,EAAE;AACxC,SAAO,gBAAgB;AAAA,IACrB,OAAO,OAAO,OAAO;AAAA,IACrB;AA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AU,GAAG,QAAQ,IAAI,qBAAqB,+CAAe,MAAM,MAAM,MAAM,SAAS,OAAO,MAAM,4BAAW,gBAAgB,IAAI,YAAYA,eAAc,4BAAW,EAAE,SAAS,KAAK,IAAI,IAAI,MAAM,SAAS,4BAAW,EAAE,GAAG,EAAE,MAAM,IAAI,EAAE,GAAG,QAAQ,SAAS,CAAC;AAEhX,UAAMC,WAAU,CAAC,MAAM,UAAU,OAAO,SAAQ,6BAAM,YAAW;AACjE,WAAO;AAAA,MAEL,YAAAD;AAAA,MACA,OAAO,EAAE,GAAG,EAAE,MAAM;AAAA,MACpB,cAAc;AAAA,MACd,SAAAC;AAAA,IACF;AAAA,EACF;AAEA,WAAS,cAAc;AACrB,UAAM,OAAO,aAAa,SAAS,OAAO,aAAa;AACvD,UAAM,eAAe,aAAa,qBAAqB,MAAM,aAAa,QAAQ,IAAI;AACtF,QAAI,cAAc;AAChB,oBAAc,WAAW;AAAA,IAC3B,OAAO;AACL,UAAI,CAAC,SAAQ,+CAAe,MAAM,UAAS,MAAM,MAAM;AAErD,sBAAc,WAAW;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/* eslint-disable no-console */\nimport { isClient, isRSC, isServer, isWeb } from '@tamagui/constants'\nimport { useContext, useEffect, useLayoutEffect, useMemo, useState } from 'react'\n\nimport { getConfig } from '../config'\nimport { isDevTools } from '../constants/isDevTools'\nimport { createProxy } from '../helpers/createProxy'\nimport {\n ThemeManager,\n ThemeManagerState,\n hasNoThemeUpdatingProps,\n} from '../helpers/ThemeManager'\nimport { ThemeManagerContext } from '../helpers/ThemeManagerContext'\nimport { ThemeParsed, ThemeProps } from '../types'\nimport { GetThemeUnwrapped } from './getThemeUnwrapped'\n\nexport type ChangedThemeResponse = {\n themeManager: ThemeManager | null\n name: string\n isNewTheme?: boolean\n theme?: ThemeParsed | null\n className?: string\n}\n\nconst emptyProps = { name: null }\n\nfunction getDefaultThemeProxied() {\n const config = getConfig()\n const name = Object.keys(config.themes)[0]\n return getThemeProxied({\n theme: config.themes[name],\n name,\n })\n}\n\nexport const useTheme = (props: ThemeProps = emptyProps): ThemeParsed => {\n if (isRSC) {\n return getDefaultThemeProxied()\n }\n\n const { name, theme, themeManager, className, isNewTheme } = useChangeThemeEffect(props)\n\n if (process.env.NODE_ENV === 'development') {\n // ensure we aren't creating too many ThemeManagers\n if (\n isWeb &&\n isNewTheme &&\n className === themeManager?.parentManager?.state.className\n ) {\n console.error('Should always change, duplicating ThemeMananger bug', themeManager)\n }\n if (props.debug === 'verbose') {\n console.groupCollapsed(' \uD83D\uDD39 useTheme =>', name)\n const logs = { ...props, name, className, ...(isDevTools && { theme }) }\n for (const key in logs) {\n console.log(' ', key, logs[key])\n }\n console.groupEnd()\n }\n }\n\n if (!theme) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('No theme found', name, props, themeManager)\n }\n return getDefaultThemeProxied()\n }\n\n return useMemo(() => {\n return getThemeProxied({\n isNewTheme,\n theme,\n name,\n className,\n themeManager,\n })\n }, [theme, isNewTheme, name, className, themeManager])\n}\n\nfunction getThemeProxied({\n theme,\n name,\n className,\n themeManager,\n isNewTheme,\n}: {\n theme: any\n name: string\n className?: string\n themeManager?: ThemeManager | null\n isNewTheme?: boolean\n}) {\n return createProxy(theme, {\n has(_, key) {\n if (typeof key === 'string') {\n if (key[0] === '$') key = key.slice(1)\n return themeManager?.allKeys.has(key)\n }\n return Reflect.has(theme, key)\n },\n get(_, key) {\n if (key === GetThemeUnwrapped) {\n return theme\n } else if (key === GetThemeManager) {\n return themeManager\n } else if (key === GetIsNewTheme) {\n return isNewTheme\n } else if (key === 'name') {\n return name\n } else if (key === 'className') {\n return className\n } else if (\n !name ||\n key === '__proto__' ||\n typeof key === 'symbol' ||\n key === '$typeof'\n ) {\n return Reflect.get(_, key)\n }\n // auto convert variables to plain\n if (key[0] === '$') key = key.slice(1)\n if (!themeManager) {\n return theme[key]\n }\n return themeManager.getValue(key)\n },\n })\n}\n\nconst GetThemeManager = Symbol()\nconst GetIsNewTheme = Symbol()\n\nexport const getThemeManager = (theme: any): ThemeManager | undefined =>\n theme?.[GetThemeManager]\nexport const getThemeIsNewTheme = (theme: any): ThemeManager | undefined =>\n theme?.[GetIsNewTheme]\n\nexport const activeThemeManagers = new Set<ThemeManager>()\n\nexport const useChangeThemeEffect = (\n props: ThemeProps,\n root = false\n): ChangedThemeResponse => {\n if (isRSC) {\n // we need context working for this to work well\n return {\n ...createState().state,\n themeManager: null,\n }\n }\n const parentManager = useContext(ThemeManagerContext)\n\n const {\n debug,\n // @ts-expect-error internal use only\n disable,\n } = props\n\n if (disable) {\n if (!parentManager) throw new Error('Disable topmost')\n return {\n ...parentManager.state,\n isNewTheme: false,\n themeManager: parentManager,\n }\n }\n\n type State = {\n isNewTheme: boolean\n state: ThemeManagerState\n themeManager: ThemeManager\n mounted?: boolean\n }\n\n const [themeState, setThemeState] = useState<State>(createState)\n const { isNewTheme, state, themeManager, mounted } = themeState\n\n if (!isServer) {\n useEffect(() => {\n if (disable) return\n // SSR safe inverse (because server can't know prefers scheme)\n // could be done through fancy selectors like how we do prefers-media\n // but may be a bit of explosion of selectors\n if (props.inverse && !mounted) {\n setThemeState({ ...themeState, mounted: true })\n return\n }\n activeThemeManagers.add(themeManager)\n const disposeChangeListener = parentManager?.onChangeTheme(() => {\n if (!(isNewTheme || isWeb)) {\n setThemeState({\n ...themeState,\n state: { ...themeManager.state },\n isNewTheme: false,\n })\n } else {\n updateState()\n }\n })\n return () => {\n activeThemeManagers.delete(themeManager)\n disposeChangeListener?.()\n }\n }, [disable, state, isNewTheme, debug])\n }\n\n const isInversingOnMount = Boolean(!themeState.mounted && props.inverse)\n const shouldReturnParentState = hasNoThemeUpdatingProps(props) || isInversingOnMount\n\n if (shouldReturnParentState) {\n if (!parentManager) throw 'impossible'\n if (process.env.NODE_ENV === 'development' && props.debug === 'verbose')\n console.log(\n 'useTheme hasNoThemeUpdatingProps',\n parentManager.state.name,\n 'isInversingOnMount',\n isInversingOnMount\n )\n return {\n ...parentManager.state,\n className: isInversingOnMount ? '' : parentManager.state.className,\n themeManager: parentManager,\n isNewTheme: false,\n }\n }\n\n // run inline in render\n updateState()\n\n return {\n ...state,\n isNewTheme,\n themeManager,\n }\n\n function createState(prev?: State) {\n const _ = new ThemeManager(props, root ? 'root' : parentManager)\n const isNewTheme = _ !== parentManager\n if (process.env.NODE_ENV === 'development' && debug)\n [\n console.groupCollapsed('useTheme create() isNewTheme', isNewTheme),\n console.log(\n 'parent.state.name',\n parentManager?.state.name,\n '\\n',\n 'props',\n props,\n '\\n',\n isClient ? parentManager : '',\n 'getState',\n isNewTheme && isClient ? _.getState(props) : '',\n '\\n',\n 'state',\n isClient ? { ..._.state } : ''\n ),\n console.groupEnd(),\n ]\n // only inverse relies on this for ssr\n const mounted = !props.inverse ? true : root || prev?.mounted\n return {\n // ThemeManager returns parentManager if no change\n isNewTheme,\n state: { ..._.state },\n themeManager: _,\n mounted,\n }\n }\n\n function updateState() {\n const next = themeManager.getState(props, parentManager)\n const shouldChange = themeManager.getStateShouldChange(\n next,\n isNewTheme ? state : null\n )\n if (shouldChange) {\n setThemeState(createState)\n } else {\n if (!next && parentManager?.state.name !== state.name) {\n // were changing back to parent state\n setThemeState(createState)\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAiD;AACjD,mBAA0E;AAE1E,oBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,0BAIO;AACP,iCAAoC;AAEpC,+BAAkC;AAUlC,MAAM,aAAa,EAAE,MAAM,KAAK;AAEhC,SAAS,yBAAyB;AAChC,QAAM,aAAS,yBAAU;AACzB,QAAM,OAAO,OAAO,KAAK,OAAO,MAAM,EAAE;AACxC,SAAO,gBAAgB;AAAA,IACrB,OAAO,OAAO,OAAO;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAEO,M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A,UACA,+CAAe,MAAM;AAAA,UACrB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,4BAAW,gBAAgB;AAAA,UAC3B;AAAA,UACAA,eAAc,4BAAW,EAAE,SAAS,KAAK,IAAI;AAAA,UAC7C;AAAA,UACA;AAAA,UACA,4BAAW,EAAE,GAAG,EAAE,MAAM,IAAI;AAAA,QAC9B;AAAA,QACA,QAAQ,SAAS;AAAA,MACnB;AAEF,UAAMC,WAAU,CAAC,MAAM,UAAU,OAAO,SAAQ,6BAAM;AACtD,WAAO;AAAA,MAEL,YAAAD;AAAA,MACA,OAAO,EAAE,GAAG,EAAE,MAAM;AAAA,MACpB,cAAc;AAAA,MACd,SAAAC;AAAA,IACF;AAAA,EACF;AAEA,WAAS,cAAc;AACrB,UAAM,OAAO,aAAa,SAAS,OAAO,aAAa;AACvD,UAAM,eAAe,aAAa;AAAA,MAChC;AAAA,MACA,aAAa,QAAQ;AAAA,IACvB;AACA,QAAI,cAAc;AAChB,oBAAc,WAAW;AAAA,IAC3B,OAAO;AACL,UAAI,CAAC,SAAQ,+CAAe,MAAM,UAAS,MAAM,MAAM;AAErD,sBAAc,WAAW;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["isNewTheme", "mounted"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/insertFont.ts"],
4
- "sourcesContent": ["import { setConfigFont } from './config'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\n/**\n * Runtime dynamic insert font\n */\nexport function insertFont<A extends GenericFont>(name: string, fontIn: A): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const fontVars = registerFontVariables(parsed)\n const style = document.createElement('style')\n style.innerText = `:root .font_${name} {${fontVars.join(';')}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family' || attrKey === 'face') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any\n // is a theme reference\n if (val.val?.[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any) {\n const response: string[] = []\n\n for (const fkey in parsedFont) {\n if (fkey === 'face') continue\n if (fkey === 'family') {\n const val = parsedFont[fkey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = parsedFont[fkey][fskey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n }\n }\n }\n }\n return response\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8B;AAC9B,wBAA2B;AAE3B,6BAAoD;AACpD,iCAAmD;AAM5C,SAAS,WAAkC,MAAc,QAAkC;AAChG,QAAM,WAAO,8BAAW,MAAM;AAC9B,QAAM,cAAU,wCAAgB,MAAM,IAAI;AAC1C,QAAM,SAAS,UAAU,OAAO;AAChC,MAAI,QAAQ,IAAI,mBAAmB,SAAS,OAAO,aAAa,aAAa;AAC3E,UAAM,WAAW,sBAAsB,MAAM;AAC7C,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,YAAY,eAAe,SAAS,SAAS,KAAK,GAAG;AAC3D,UAAM,aAAa,qBAAqB,IAAI;AAC5C,aAAS,KAAK,YAAY,KAAK;AAAA,EACjC;AACA,mCAAc,MAAM,SAAS,MAAM;AACnC,SAAO;AACT;AAEO,SAAS,UAAiC,YAAsC;AAzBvF;AA0BE,QAAM,SAAc,CAAC;AACrB,aAAW,WAAW,YAAY;AAChC,UAAM,OAAO,WAAW;AACxB,QAAI,YAAY,YAAY,YAAY,QAAQ;AAC9C,aAAO,WAAW;AAClB;AAAA,IACF;AACA,WAAO,WAAW,CAAC;AACnB,eAAW,OAAO,MAAM;AACtB,UAAI,MAAM,KAAK;AAEf,YAAI,SAAI,QAAJ,mBAAU,QAAO,KAAK;AACxB,cAAM,IAAI;AAAA,MACZ;AACA,aAAO,SAAS,IAAI,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,sBAAsB,YAAiB;AACrD,QAAM,WAAqB,CAAC;AAE5B,aAAW,QAAQ,YAAY;AAC7B,QAAI,SAAS;AAAQ;AACrB,QAAI,SAAS,UAAU;AACrB,YAAM,MAAM,WAAW;AACvB,0DAAoB,GAAG;AACvB,eAAS,SAAK,0CAAc,GAAG,CAAC;AAAA,IAClC,OAAO;AACL,iBAAW,SAAS,WAAW,OAAO;AACpC,cAAM,OAAO,WAAW,MAAM;AAC9B,YAAI,OAAO,SAAS,UAAU;AAAA,QAE9B,OAAO;AACL,gBAAM,MAAM,WAAW,MAAM;AAC7B,8DAAoB,GAAG;AACvB,mBAAS,SAAK,0CAAc,GAAG,CAAC;AAAA,QAClC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { setConfigFont } from './config'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\n/**\n * Runtime dynamic insert font\n */\nexport function insertFont<A extends GenericFont>(\n name: string,\n fontIn: A\n): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const fontVars = registerFontVariables(parsed)\n const style = document.createElement('style')\n style.innerText = `:root .font_${name} {${fontVars.join(';')}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family' || attrKey === 'face') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any\n // is a theme reference\n if (val.val?.[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any) {\n const response: string[] = []\n\n for (const fkey in parsedFont) {\n if (fkey === 'face') continue\n if (fkey === 'family') {\n const val = parsedFont[fkey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = parsedFont[fkey][fskey] as Variable\n registerCSSVariable(val)\n response.push(variableToCSS(val))\n }\n }\n }\n }\n return response\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8B;AAC9B,wBAA2B;AAE3B,6BAAoD;AACpD,iCAAmD;AAM5C,SAAS,WACd,MACA,QACuB;AACvB,QAAM,WAAO,8BAAW,MAAM;AAC9B,QAAM,cAAU,wCAAgB,MAAM,IAAI;AAC1C,QAAM,SAAS,UAAU,OAAO;AAChC,MAAI,QAAQ,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ptions) {
43
43
  const isTamagui = !isReactNative && !!parentStaticConfig;
44
44
  const Comp = isReactNative ? (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || Component : Component;
45
45
  const nativeConf = isReactNative && import_setupReactNative.ReactNativeStaticConfigs.get(Comp) || null;
46
- const isText = Boolean((staticExtractionOptions == null ? void 0 : staticExtractionOptions.isText) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isText));
46
+ const isText = Boolean(
47
+ (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isText) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isText)
48
+ );
47
49
  const acceptsClassName = acceptsClassNameProp ?? (isTamagui || isReactNative);
48
50
  const conf = {
49
51
  ...staticExtractionOptions,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
- "sourcesContent": ["import { createComponent } from './createComponent'\nimport { ReactNativeStaticConfigs } from './setupReactNative'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\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\n// can't infer from styled(<YStack />) which would be nice\n// * excessively deep type instantiation\n\ntype GetBaseProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetBaseProps<A['type']> :\n A extends TamaguiComponent<any, any, infer P> ? P : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetVariantProps<A['type']>\n // :\n A extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // allows passing styled(<H1 bc=\"red\" />)\n // but to get types right would be tricky\n // if (isValidElement(Component) && isTamaguiComponent(Component.type)) {\n // const props = Component.props\n // if (props && typeof props === 'object') {\n // Component = Component.type as any\n // options = options ? ({ ...props, ...options } as any) : props\n // }\n // }\n\n const staticConfigProps = (() => {\n const parentStaticConfig =\n 'staticConfig' in Component ? (Component.staticConfig as StaticConfig) : null\n\n if (options) {\n const {\n variants,\n name,\n defaultVariants,\n acceptsClassName: acceptsClassNameProp,\n ...defaultProps\n } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNative = Boolean(\n ReactNativeStaticConfigs.has(Component) ||\n ReactNativeStaticConfigs.has(parentStaticConfig?.Component) ||\n parentStaticConfig?.isReactNative ||\n staticExtractionOptions?.isReactNative\n )\n const isTamagui = !isReactNative && !!parentStaticConfig\n\n const Comp = isReactNative ? parentStaticConfig?.Component || Component : (Component as any)\n const nativeConf = (isReactNative && ReactNativeStaticConfigs.get(Comp)) || null\n\n const isText = Boolean(staticExtractionOptions?.isText || parentStaticConfig?.isText)\n const acceptsClassName = acceptsClassNameProp ?? (isTamagui || isReactNative)\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\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 isReactNative,\n isText,\n acceptsClassName,\n ...nativeConf,\n }\n\n // bail on non className views as well\n if (defaultProps.children || !acceptsClassName) {\n conf.neverFlatten = true\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = GetBaseProps<ParentComponent>\n type ParentVariants = GetVariantProps<ParentComponent>\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n type StyledComponent = TamaguiComponent<\n Props,\n TamaguiElement,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n\n return component as StyledComponent\n}\n\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {}\n// }\n// },\n// disabled: {\n// true: {\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// } as const\n// })\n// type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAgC;AAChC,8BAAyC;AAmClC,SAAS,OAId,WAEA,SAOA,yBACA;AAWA,QAAM,qBAAqB,MAAM;AAC/B,UAAM,qBACJ,kBAAkB,YAAa,UAAU,eAAgC;AAE3E,QAAI,SAAS;AACX,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,WACf;AAAA,MACL,IAAI;AACJ,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,gBAAgB;AAAA,QACpB,iDAAyB,IAAI,SAAS,KACpC,iDAAyB,IAAI,yDAAoB,SAAS,MAC1D,yDAAoB,mBACpB,mEAAyB;AAAA,MAC7B;AACA,YAAM,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAEtC,YAAM,OAAO,iBAAgB,yDAAoB,cAAa,YAAa;AAC3E,YAAM,aAAc,iBAAiB,iDAAyB,IAAI,IAAI,KAAM;AAE5E,YAAM,SAAS,SAAQ,mEAAyB,YAAU,yDAAoB,OAAM;AACpF,YAAM,mBAAmB,yBAAyB,aAAa;AAE/D,YAAM,OAA8B;AAAA,QAClC,GAAG;AAAA,QACH,GAAI,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA,GAAG;AAAA,MACL;AAGA,UAAI,aAAa,YAAY,CAAC,kBAAkB;AAC9C,aAAK,eAAe;AAAA,MACtB;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,gBAAY,wCAAgB,mBAAmB,SAAS;AAkC9D,SAAO;AACT;",
4
+ "sourcesContent": ["import { createComponent } from './createComponent'\nimport { ReactNativeStaticConfigs } from './setupReactNative'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\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> =\n GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n }\n\n// can't infer from styled(<YStack />) which would be nice\n// * excessively deep type instantiation\n\ntype GetBaseProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetBaseProps<A['type']> :\n A extends TamaguiComponent<any, any, infer P> ? P : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetVariantProps<A['type']>\n // :\n A extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // allows passing styled(<H1 bc=\"red\" />)\n // but to get types right would be tricky\n // if (isValidElement(Component) && isTamaguiComponent(Component.type)) {\n // const props = Component.props\n // if (props && typeof props === 'object') {\n // Component = Component.type as any\n // options = options ? ({ ...props, ...options } as any) : props\n // }\n // }\n\n const staticConfigProps = (() => {\n const parentStaticConfig =\n 'staticConfig' in Component ? (Component.staticConfig as StaticConfig) : null\n\n if (options) {\n const {\n variants,\n name,\n defaultVariants,\n acceptsClassName: acceptsClassNameProp,\n ...defaultProps\n } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNative = Boolean(\n ReactNativeStaticConfigs.has(Component) ||\n ReactNativeStaticConfigs.has(parentStaticConfig?.Component) ||\n parentStaticConfig?.isReactNative ||\n staticExtractionOptions?.isReactNative\n )\n const isTamagui = !isReactNative && !!parentStaticConfig\n\n const Comp = isReactNative\n ? parentStaticConfig?.Component || Component\n : (Component as any)\n const nativeConf = (isReactNative && ReactNativeStaticConfigs.get(Comp)) || null\n\n const isText = Boolean(\n staticExtractionOptions?.isText || parentStaticConfig?.isText\n )\n const acceptsClassName = acceptsClassNameProp ?? (isTamagui || isReactNative)\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\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 isReactNative,\n isText,\n acceptsClassName,\n ...nativeConf,\n }\n\n // bail on non className views as well\n if (defaultProps.children || !acceptsClassName) {\n conf.neverFlatten = true\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = GetBaseProps<ParentComponent>\n type ParentVariants = GetVariantProps<ParentComponent>\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<\n any,\n infer Val\n >\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n type StyledComponent = TamaguiComponent<\n Props,\n TamaguiElement,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n\n return component as StyledComponent\n}\n\n// sanity check types\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {\n// pointerEvents: 'auto'\n// }\n// }\n// },\n// disabled: {\n// true: {\n// alignContent: 'center',\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// } as const\n// })\n// // type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAgC;AAChC,8BAAyC;AAoClC,SAAS,OAId,WAEA,SAOA,yBACA;AAWA,QAAM,qBAAqB,MAAM;AAC/B,UAAM,qBACJ,kBAAkB,YAAa,UAAU,eAAgC;AAE3E,QAAI,SAAS;AACX,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,WACf;AAAA,MACL,IAAI;AACJ,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,gBAAgB;AAAA,QACpB,iDAAyB,IAAI,SAAS,KACpC,iDAAyB,IAAI,yDAAoB,SAAS,MAC1D,yDAAoB,mBACpB,mEAAyB;AAAA,MAC7B;AACA,YAAM,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAEtC,YAAM,OAAO,iBACT,yDAAoB,cAAa,YAChC;AACL,YAAM,aAAc,iBAAiB,iDAAyB,IAAI,IAAI,KAAM;AAE5E,YAAM,SAAS;AAAA,SACb,mEAAyB,YAAU,yDAAoB;AAAA,MACzD;AACA,YAAM,mBAAmB,yBAAyB,aAAa;AAE/D,YAAM,OAA8B;AAAA,QAClC,GAAG;AAAA,QACH,GAAI,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA,GAAG;AAAA,MACL;AAGA,UAAI,aAAa,YAAY,CAAC,kBAAkB;AAC9C,aAAK,eAAe;AAAA,MACtB;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,gBAAY,wCAAgB,mBAAmB,SAAS;AAqC9D,SAAO;AACT;",
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 type { Properties } from 'csstype'\nimport type {\n ComponentType,\n ForwardRefExoticComponent,\n FunctionComponent,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react'\nimport type {\n Image,\n PressableProps,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper'\nimport type { TamaguiReactElement } from './static'\nimport type { RNWTextProps, RNWViewProps } from './types-rnw'\nimport type { FontLanguageProps } from './views/FontLanguage.types'\nimport type { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiComponentPropsBase = {\n hitSlop?: PressableProps['hitSlop']\n asChild?: boolean\n space?: SpaceTokens | null\n spaceDirection?: SpaceDirection\n separator?: ReactNode\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp | null\n animateOnly?: string[]\n children?: any | any[]\n debug?: DebugProp\n disabled?: boolean\n className?: string\n themeShallow?: boolean\n id?: string\n tag?: string\n theme?: ThemeName | null\n componentName?: string\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n // WEB ONLY\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n}\n\nexport type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<\n Props & 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 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}\n\ntype AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase\n\nexport type CreateShorthands = {\n [key: string]: AllStyleKeys\n}\n\nexport type GenericShorthands = {}\n\n// sm: { minWidth: 100 }\ntype GenericMedia = {\n [key: string]: {\n [key: string]: number | string\n }\n}\n\nexport type GenericFonts = Record<string, GenericFont>\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n | any[]\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 F extends GenericFonts = GenericFonts\n> = {\n fonts: RemoveLanguagePostfixes<F>\n fontLanguages: GetLanguagePostfixes<F> extends never ? string[] : GetLanguagePostfixes<F>[]\n tokens: A\n // parsed\n themes: {\n [Name in keyof B]: {\n [Key in keyof B[Name]]: Variable\n }\n }\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\ntype GetLanguagePostfix<Set> = Set extends string\n ? Set extends `${string}_${infer Postfix}`\n ? Postfix\n : never\n : never\n\ntype OmitLanguagePostfix<Set> = Set extends string\n ? Set extends `${infer Prefix}_${string}`\n ? Prefix\n : Set\n : never\n\ntype RemoveLanguagePostfixes<F extends GenericFonts> = {\n [Key in OmitLanguagePostfix<keyof F>]: F[Key]\n}\n\ntype GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>\n\n// test RemoveLanguagePostfixes\n// type x = CreateTamaguiConfig<any, any, any, any, any, {\n// body: any,\n// body_en: any\n// }>['fonts']\n\ntype ConfProps<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n tokens: A\n themes: B\n shorthands?: C\n media?: D\n animations?: AnimationDriver<E>\n fonts: F\n}\n\nexport type InferTamaguiConfig<Conf> = Conf extends ConfProps<\n infer A,\n infer B,\n infer C,\n infer D,\n infer E,\n infer F\n>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown\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 GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<infer Config>\n ? keyof Config\n : string\nexport type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>\n\nexport interface ThemeProps {\n className?: string\n disableThemeClass?: boolean\n name?: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n inverse?: boolean\n}\n\ntype ArrayIntersection<A extends any[]> = A[keyof A]\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\n\ntype SpacerPropsBase = {\n size?: number | SpaceTokens | null\n flex?: boolean | number\n direction?: SpaceDirection\n}\ntype SpacerOwnProps = SpacerPropsBase &\n //\n WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> &\n //\n SpacerOwnProps\n\nexport type CreateTamaguiProps = {\n reactNative?: any\n shorthands?: CreateShorthands\n media?: GenericTamaguiConfig['media']\n animations?: AnimationDriver<any>\n fonts: GenericTamaguiConfig['fonts']\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n /**\n * *Advanced use case* For all CSS extracted views, this has no effect.\n *\n * For SSR compatibility on the web, Tamagui will render once with the settings\n * from `mediaQueryDefaultActive` set for all media queries. Then, it will render\n * again after the initial render using the proper media query values. This is so that\n * hydration will match perfectly with the server.\n *\n * Setting disableSSR will avoid this second render by setting the media query state\n * to the actual browser dimensions on initial load. This is only useful for client-only\n * apps.\n *\n */\n disableSSR?: boolean\n\n /**\n * Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.\n * For custom use cases like integration with next-theme.\n */\n disableRootThemeClass?: boolean\n\n defaultProps?: Record<string, any> & {\n Stack?: StackProps\n Text?: TextProps\n Spacer?: SpacerProps\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n}\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 F extends GenericFonts = GenericFonts\n> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &\n CreateTamaguiConfig<A, B, C, D, E, F> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n inverseShorthands: Record<string, string>\n reactNative?: any\n }\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['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 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 color?: Partial<{ [key in Key]: string | Variable }>\n // for native use only, lets you map to alternative fonts\n face?: Partial<{ [key in FontWeightSteps]: { normal?: string; italic?: string } }>\n}\n\n// media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaQueryKey]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\n\nexport interface MediaQueryList {\n addListener(listener?: any): void\n removeListener(listener?: any): void\n matches: boolean\n}\n\nexport type MatchMedia = (query: string) => MediaQueryList\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// animation=\"bouncy\"\n// animation={['bouncy', { }]}\n// { all: 'name' }\n\n// TODO can override for better types\nexport type AnimationConfigType = any\n\nexport type AnimationProp =\n | AnimationKeys\n | {\n [key: string]:\n | AnimationKeys\n | {\n type: AnimationKeys\n [key: string]: any\n }\n }\n | [\n AnimationKeys,\n {\n [key: string]:\n | AnimationKeys\n | {\n type?: AnimationKeys\n [key: string]: any\n }\n }\n ]\n\ntype GetTokenFontKeysFor<\n A extends\n | 'size'\n | 'weight'\n | 'letterSpacing'\n | 'family'\n | 'lineHeight'\n | 'transform'\n | 'style'\n | 'color'\n> = keyof TamaguiConfig['fonts']['body'][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 ThemeParsed>\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 TamaguiConfig['fonts']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps\nexport type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number\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\ntype FontKeys = 'fontFamily'\ntype FontSizeKeys = 'fontSize'\ntype FontWeightKeys = 'fontWeight'\ntype FontLetterSpacingKeys = 'letterSpacing'\ntype LineHeightKeys = 'lineHeight'\ntype ZIndexKeys = 'zIndex'\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 `${`border${string | ''}Radius`}`\n ? RadiusTokens\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 PseudoPropKeys = 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, pseudos...\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 * Base style-only props (no media, pseudo):\n */\n\ntype StylePropsWebOnly = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: Properties['outlineOffset']\n outlineWidth?: Properties['outlineWidth']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n StylePropsWebOnly\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n StylePropsWebOnly & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\n//\n// Stack\n//\n\nexport type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\n\nexport type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackNonStyleProps & WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackNonStyleProps & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextNonStyleProps = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextNonStyleProps & 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 config: TamaguiInternalConfig\n disableInjectCSS?: boolean\n children?: ReactNode\n}\n\nexport type PropMapper = (\n key: string,\n value: any,\n theme: ThemeParsed,\n props: Record<string, any>,\n state: Partial<SplitStyleState>,\n languageContext?: FontLanguageProps,\n avoidDefaultProps?: boolean,\n debug?: DebugProp\n) => undefined | [string, any][]\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: PropMapper\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type GenericVariantDefinitions = {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfigPublic = {\n /**\n * (compiler) If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /**\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * (compiler) If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * (compiler) If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * (compiler) If not flattening, leave this prop as original value.\n * Only applies to style attributes\n */\n inlineWhenUnflattened?: Set<string>\n\n /**\n * (compiler) 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 * Auto-detect, but can override, passes styles properly to react-native-web\n */\n isReactNative?: boolean\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n}\n\nexport type StaticConfig = StaticConfigPublic & {\n Component?: FunctionComponent<any> & StaticComponentObject\n\n variants?: GenericVariantDefinitions\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps: Record<string, any>\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Used insternally to attach default props to names\n */\n parentNames?: string[]\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n\n /**\n * Used internally for handling focus\n */\n isInput?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n // * excessively deep type instantiation\n // | TamaguiReactElement\n | ComponentType<any>\n | ForwardRefExoticComponent<any>\n | ReactComponentWithRef<any, any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer Variants\n>\n ? Variants\n : never\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 TamaguiReactElement<infer Props>\n ? Props\n : A extends ComponentType<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 | '...space'\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 '...space'\n ? SpaceVariantSpreadFunction<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 | 'true' | 'false']?:\n | MyProps\n | 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 GenericStackVariants = VariantDefinitionFromProps<StackProps, any>\nexport type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>\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 fonts: TamaguiConfig['fonts']\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 SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SpaceTokens>\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 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 unmounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n mediaState?: Record<string, boolean>\n noClassNames?: boolean\n dynamicStylesInline?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Record<string, any>\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n\n // for animations\n isExiting?: boolean\n exitVariant?: string\n enterVariant?: string\n}\n\n// Presence\n\nexport interface PresenceContextProps {\n id: string\n isPresent: boolean\n register: (id: string) => () => void\n onExitComplete?: (id: string) => void\n initial?: false | string | string[]\n custom?: any\n exitVariant?: string | null\n enterVariant?: string | null\n}\n\ntype SafeToRemoveCallback = () => void\ntype AlwaysPresent = [true, null, null]\ntype Present = [true, undefined, PresenceContextProps]\ntype NotPresent = [false, SafeToRemoveCallback, PresenceContextProps]\n\nexport type UsePresenceResult = AlwaysPresent | Present | NotPresent\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\n// includes a very limited adapter between various impls for number => style\n// this is useful only in limited scenarios like `Sheet`, but necessary in those cases\n\nexport type AnimatedNumberStrategy =\n // only values shared between reanimated/react-native for now\n | {\n type: 'spring'\n stiffness?: number\n damping?: number\n mass?: number\n overshootClamping?: boolean\n restSpeedThreshold?: number\n restDisplacementThreshold?: number\n }\n | { type: 'timing'; duration: number }\n | { type: 'direct' }\n\nexport type UniversalAnimatedNumber<A> = {\n getInstance(): A\n getValue(): number\n setValue(next: number, config?: AnimatedNumberStrategy): void\n stop(): void\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n isReactNative?: boolean\n useAnimations: UseAnimationHook\n usePresence: () => UsePresenceResult\n useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>\n useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(\n val: V,\n getStyle: (current: any) => any\n ) => any\n useAnimatedNumberReaction: (\n val: UniversalAnimatedNumber<any>,\n onValue: (current: number) => void\n ) => void\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHook = (props: {\n style: Record<string, any>\n props: Record<string, any>\n presence?: UsePresenceResult | null\n hostRef: RefObject<HTMLElement | View>\n staticConfig: StaticConfigParsed\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n onDidAnimate?: any\n delay?: number\n}) => null | {\n style?: StackStylePropsBase | StackStylePropsBase[]\n}\n\nexport type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (\n event: infer Event\n) => void\n ? Event\n : never\n"],
4
+ "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport type { Properties } from 'csstype'\nimport type {\n ComponentType,\n ForwardRefExoticComponent,\n FunctionComponent,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react'\nimport type {\n Image,\n PressableProps,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper'\nimport type { TamaguiReactElement } from './static'\nimport type { RNWTextProps, RNWViewProps } from './types-rnw'\nimport type { FontLanguageProps } from './views/FontLanguage.types'\nimport type { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiComponentPropsBase = {\n hitSlop?: PressableProps['hitSlop']\n asChild?: boolean\n space?: SpaceTokens | null\n spaceDirection?: SpaceDirection\n separator?: ReactNode\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp | null\n animateOnly?: string[]\n children?: any | any[]\n debug?: DebugProp\n disabled?: boolean\n className?: string\n themeShallow?: boolean\n id?: string\n tag?: string\n theme?: ThemeName | null\n componentName?: string\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n // WEB ONLY\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n}\n\nexport type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<\n Props & 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 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}\n\ntype AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase\n\nexport type CreateShorthands = {\n [key: string]: AllStyleKeys\n}\n\nexport type GenericShorthands = {}\n\n// sm: { minWidth: 100 }\ntype GenericMedia = {\n [key: string]: {\n [key: string]: number | string\n }\n}\n\nexport type GenericFonts = Record<string, GenericFont>\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n | any[]\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 F extends GenericFonts = GenericFonts\n> = {\n fonts: RemoveLanguagePostfixes<F>\n fontLanguages: GetLanguagePostfixes<F> extends never\n ? string[]\n : GetLanguagePostfixes<F>[]\n tokens: A\n // parsed\n themes: {\n [Name in keyof B]: {\n [Key in keyof B[Name]]: Variable\n }\n }\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\ntype GetLanguagePostfix<Set> = Set extends string\n ? Set extends `${string}_${infer Postfix}`\n ? Postfix\n : never\n : never\n\ntype OmitLanguagePostfix<Set> = Set extends string\n ? Set extends `${infer Prefix}_${string}`\n ? Prefix\n : Set\n : never\n\ntype RemoveLanguagePostfixes<F extends GenericFonts> = {\n [Key in OmitLanguagePostfix<keyof F>]: F[Key]\n}\n\ntype GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>\n\n// test RemoveLanguagePostfixes\n// type x = CreateTamaguiConfig<any, any, any, any, any, {\n// body: any,\n// body_en: any\n// }>['fonts']\n\ntype ConfProps<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n tokens: A\n themes: B\n shorthands?: C\n media?: D\n animations?: AnimationDriver<E>\n fonts: F\n}\n\nexport type InferTamaguiConfig<Conf> = Conf extends ConfProps<\n infer A,\n infer B,\n infer C,\n infer D,\n infer E,\n infer F\n>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown\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 GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<\n infer Config\n>\n ? keyof Config\n : string\nexport type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>\n\nexport interface ThemeProps {\n className?: string\n disableThemeClass?: boolean\n name?: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n inverse?: boolean\n}\n\ntype ArrayIntersection<A extends any[]> = A[keyof A]\n\ntype GetAltThemeNames<S> =\n | (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S)\n | S\n\ntype SpacerPropsBase = {\n size?: number | SpaceTokens | null\n flex?: boolean | number\n direction?: SpaceDirection\n}\ntype SpacerOwnProps = SpacerPropsBase &\n //\n WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> &\n //\n SpacerOwnProps\n\nexport type CreateTamaguiProps = {\n reactNative?: any\n shorthands?: CreateShorthands\n media?: GenericTamaguiConfig['media']\n animations?: AnimationDriver<any>\n fonts: GenericTamaguiConfig['fonts']\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n /**\n * *Advanced use case* For all CSS extracted views, this has no effect.\n *\n * For SSR compatibility on the web, Tamagui will render once with the settings\n * from `mediaQueryDefaultActive` set for all media queries. Then, it will render\n * again after the initial render using the proper media query values. This is so that\n * hydration will match perfectly with the server.\n *\n * Setting disableSSR will avoid this second render by setting the media query state\n * to the actual browser dimensions on initial load. This is only useful for client-only\n * apps.\n *\n */\n disableSSR?: boolean\n\n /**\n * Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.\n * For custom use cases like integration with next-theme.\n */\n disableRootThemeClass?: boolean\n\n defaultProps?: Record<string, any> & {\n Stack?: StackProps\n Text?: TextProps\n Spacer?: SpacerProps\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n}\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 F extends GenericFonts = GenericFonts\n> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &\n CreateTamaguiConfig<A, B, C, D, E, F> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n inverseShorthands: Record<string, string>\n reactNative?: any\n }\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['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 FunctionComponent<\n infer Props\n>\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 color?: Partial<{ [key in Key]: string | Variable }>\n // for native use only, lets you map to alternative fonts\n face?: Partial<{\n [key in FontWeightSteps]: { normal?: string; italic?: string }\n }>\n}\n\n// media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaQueryKey]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\n\nexport interface MediaQueryList {\n addListener(listener?: any): void\n removeListener(listener?: any): void\n matches: boolean\n}\n\nexport type MatchMedia = (query: string) => MediaQueryList\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// animation=\"bouncy\"\n// animation={['bouncy', { }]}\n// { all: 'name' }\n\n// TODO can override for better types\nexport type AnimationConfigType = any\n\nexport type AnimationProp =\n | AnimationKeys\n | {\n [key: string]:\n | AnimationKeys\n | {\n type: AnimationKeys\n [key: string]: any\n }\n }\n | [\n AnimationKeys,\n {\n [key: string]:\n | AnimationKeys\n | {\n type?: AnimationKeys\n [key: string]: any\n }\n }\n ]\n\ntype GetTokenFontKeysFor<\n A extends\n | 'size'\n | 'weight'\n | 'letterSpacing'\n | 'family'\n | 'lineHeight'\n | 'transform'\n | 'style'\n | 'color'\n> = keyof TamaguiConfig['fonts']['body'][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 ThemeParsed>\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 TamaguiConfig['fonts']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps\nexport type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number\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\ntype FontKeys = 'fontFamily'\ntype FontSizeKeys = 'fontSize'\ntype FontWeightKeys = 'fontWeight'\ntype FontLetterSpacingKeys = 'letterSpacing'\ntype LineHeightKeys = 'lineHeight'\ntype ZIndexKeys = 'zIndex'\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 `${`border${string | ''}Radius`}`\n ? RadiusTokens\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 PseudoPropKeys = 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, pseudos...\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> =\n WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n/**\n * Base style-only props (no media, pseudo):\n */\n\ntype StylePropsWebOnly = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: Properties['outlineOffset']\n outlineWidth?: Properties['outlineWidth']\n}\n\nexport type StackStylePropsBase = Omit<\n ViewStyle,\n 'display' | 'backfaceVisibility' | 'elevation'\n> &\n TransformStyleProps &\n StylePropsWebOnly\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n StylePropsWebOnly & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\n//\n// Stack\n//\n\nexport type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\n\nexport type StackStyleProps =\n WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackNonStyleProps &\n WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackNonStyleProps & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextNonStyleProps = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextNonStyleProps & 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 config: TamaguiInternalConfig\n disableInjectCSS?: boolean\n children?: ReactNode\n}\n\nexport type PropMapper = (\n key: string,\n value: any,\n theme: ThemeParsed,\n props: Record<string, any>,\n state: Partial<SplitStyleState>,\n languageContext?: FontLanguageProps,\n avoidDefaultProps?: boolean,\n debug?: DebugProp\n) => undefined | [string, any][]\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: PropMapper\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type GenericVariantDefinitions = {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfigPublic = {\n /**\n * (compiler) If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /**\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * (compiler) If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * (compiler) If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * (compiler) If not flattening, leave this prop as original value.\n * Only applies to style attributes\n */\n inlineWhenUnflattened?: Set<string>\n\n /**\n * (compiler) 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 * Auto-detect, but can override, passes styles properly to react-native-web\n */\n isReactNative?: boolean\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n}\n\nexport type StaticConfig = StaticConfigPublic & {\n Component?: FunctionComponent<any> & StaticComponentObject\n\n variants?: GenericVariantDefinitions\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps: Record<string, any>\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Used insternally to attach default props to names\n */\n parentNames?: string[]\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n\n /**\n * Used internally for handling focus\n */\n isInput?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n // * excessively deep type instantiation\n // | TamaguiReactElement\n | ComponentType<any>\n | ForwardRefExoticComponent<any>\n | ReactComponentWithRef<any, any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer Variants\n>\n ? Variants\n : never\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<\n infer Props\n>\n ? Props\n : A extends TamaguiReactElement<infer Props>\n ? Props\n : A extends ComponentType<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 | '...space'\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 '...space'\n ? SpaceVariantSpreadFunction<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 | 'true' | 'false']?:\n | MyProps\n | 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 GenericStackVariants = VariantDefinitionFromProps<StackProps, any>\nexport type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>\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 fonts: TamaguiConfig['fonts']\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<\n A,\n SizeTokens\n>\nexport type SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n SpaceTokens\n>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ColorTokens\n>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLineHeightTokens>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLetterSpacingTokens>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontTransformTokens>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ZIndexTokens\n>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n RadiusTokens\n>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ThemeTokens\n>\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 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 unmounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n mediaState?: Record<string, boolean>\n noClassNames?: boolean\n dynamicStylesInline?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Record<string, any>\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n\n // for animations\n isExiting?: boolean\n exitVariant?: string\n enterVariant?: string\n}\n\n// Presence\n\nexport interface PresenceContextProps {\n id: string\n isPresent: boolean\n register: (id: string) => () => void\n onExitComplete?: (id: string) => void\n initial?: false | string | string[]\n custom?: any\n exitVariant?: string | null\n enterVariant?: string | null\n}\n\ntype SafeToRemoveCallback = () => void\ntype AlwaysPresent = [true, null, null]\ntype Present = [true, undefined, PresenceContextProps]\ntype NotPresent = [false, SafeToRemoveCallback, PresenceContextProps]\n\nexport type UsePresenceResult = AlwaysPresent | Present | NotPresent\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\n// includes a very limited adapter between various impls for number => style\n// this is useful only in limited scenarios like `Sheet`, but necessary in those cases\n\nexport type AnimatedNumberStrategy =\n // only values shared between reanimated/react-native for now\n | {\n type: 'spring'\n stiffness?: number\n damping?: number\n mass?: number\n overshootClamping?: boolean\n restSpeedThreshold?: number\n restDisplacementThreshold?: number\n }\n | { type: 'timing'; duration: number }\n | { type: 'direct' }\n\nexport type UniversalAnimatedNumber<A> = {\n getInstance(): A\n getValue(): number\n setValue(next: number, config?: AnimatedNumberStrategy): void\n stop(): void\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n isReactNative?: boolean\n useAnimations: UseAnimationHook\n usePresence: () => UsePresenceResult\n useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>\n useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(\n val: V,\n getStyle: (current: any) => any\n ) => any\n useAnimatedNumberReaction: (\n val: UniversalAnimatedNumber<any>,\n onValue: (current: number) => void\n ) => void\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHook = (props: {\n style: Record<string, any>\n props: Record<string, any>\n presence?: UsePresenceResult | null\n hostRef: RefObject<HTMLElement | View>\n staticConfig: StaticConfigParsed\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n onDidAnimate?: any\n delay?: number\n}) => null | {\n style?: StackStylePropsBase | StackStylePropsBase[]\n}\n\nexport type GestureReponderEvent = Exclude<\n View['props']['onResponderMove'],\n void\n> extends (event: infer Event) => void\n ? Event\n : never\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/vendor/Pressability.native.tsx"],
4
- "sourcesContent": ["export const Pressability = require('react-native/Libraries/Pressability/Pressability').default\nexport const usePressability =\n require('react-native/Libraries/Pressability/usePressability').default\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,QAAQ,kDAAkD,EAAE;AACjF,MAAM,kBACX,QAAQ,qDAAqD,EAAE;",
4
+ "sourcesContent": ["export const Pressability =\n require('react-native/Libraries/Pressability/Pressability').default\nexport const usePressability =\n require('react-native/Libraries/Pressability/usePressability').default\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eACX,QAAQ,kDAAkD,EAAE;AACvD,MAAM,kBACX,QAAQ,qDAAqD,EAAE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/FontLanguage.native.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\n\nimport { FontLanguageContext } from '../contexts/FontLanguageContext'\nimport { FontLanguageProps } from './FontLanguage.types'\n\nexport const FontLanguage = ({ children, ...props }: FontLanguageProps) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = useMemo(() => props, [JSON.stringify(props)])\n return <FontLanguageContext.Provider value={value}>{children}</FontLanguageContext.Provider>\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQS;AART,mBAA+B;AAE/B,iCAAoC;AAG7B,MAAM,eAAe,CAAC,EAAE,aAAa,MAAM,MAAyB;AAEzE,QAAM,YAAQ,sBAAQ,MAAM,OAAO,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAC1D,SAAO,4CAAC,+CAAoB,UAApB;AAAA,IAA6B;AAAA,IAAe;AAAA,GAAS;AAC/D;",
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\n\nimport { FontLanguageContext } from '../contexts/FontLanguageContext'\nimport { FontLanguageProps } from './FontLanguage.types'\n\nexport const FontLanguage = ({ children, ...props }: FontLanguageProps) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = useMemo(() => props, [JSON.stringify(props)])\n return (\n <FontLanguageContext.Provider value={value}>{children}</FontLanguageContext.Provider>\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASI;AATJ,mBAA+B;AAE/B,iCAAoC;AAG7B,MAAM,eAAe,CAAC,EAAE,aAAa,MAAM,MAAyB;AAEzE,QAAM,YAAQ,sBAAQ,MAAM,OAAO,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;AAC1D,SACE,4CAAC,+CAAoB,UAApB;AAAA,IAA6B;AAAA,IAAe;AAAA,GAAS;AAE1D;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Slot.tsx"],
4
- "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport { isWeb } from '@tamagui/constants'\nimport { Children, ReactElement, ReactNode, cloneElement, forwardRef, isValidElement } from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: ReactNode\n}\n\nexport const Slot = forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n const childrenArray = Children.toArray(children)\n const slottable = childrenArray.find(isSlottable)\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children as ReactNode\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (Children.count(newElement) > 1) return Children.only(null)\n return isValidElement(newElement) ? (newElement.props.children as ReactNode) : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {isValidElement(newElement) ? cloneElement(newElement, undefined, newChildren) : null}\n </SlotClone>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: ReactNode\n}\n\nconst SlotClone = forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (isValidElement(children)) {\n const childProps = {\n ...mergeSlotProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return cloneElement(children, childProps)\n }\n\n return Children.count(children) > 1 ? Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: ReactNode): child is ReactElement {\n return isValidElement(child) && child.type === Slottable\n}\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeSlotProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = handleRegex.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nconst handleRegex = /^on[A-Z]/\n\nexport function mergeEvent(a?: Function, b?: Function) {\n return (...args: unknown[]) => {\n a?.(...args)\n b?.(...args)\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCM;AAjCN,0BAA4B;AAC5B,uBAAsB;AACtB,mBAA4F;AAUrF,MAAM,WAAO,yBAAmC,CAAC,OAAO,iBAAiB;AAC9E,QAAM,EAAE,aAAa,UAAU,IAAI;AACnC,QAAM,gBAAgB,sBAAS,QAAQ,QAAQ;AAC/C,QAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,MAAI,WAAW;AAEb,UAAM,aAAa,UAAU,MAAM;AAEnC,UAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,UAAI,UAAU,WAAW;AAGvB,YAAI,sBAAS,MAAM,UAAU,IAAI;AAAG,iBAAO,sBAAS,KAAK,IAAI;AAC7D,mBAAO,6BAAe,UAAU,IAAK,WAAW,MAAM,WAAyB;AAAA,MACjF,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,WACE,4CAAC;AAAA,MAAW,GAAG;AAAA,MAAW,KAAK;AAAA,MAC5B,2CAAe,UAAU,QAAI,2BAAa,YAAY,QAAW,WAAW,IAAI;AAAA,KACnF;AAAA,EAEJ;AAEA,SACE,4CAAC;AAAA,IAAW,GAAG;AAAA,IAAW,KAAK;AAAA,I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,SAAS;AAC7B,oBAAc,YAAY,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAEA,MAAM,cAAc;AAEb,SAAS,WAAW,GAAc,GAAc;AACrD,SAAO,IAAI,SAAoB;AAC7B,2BAAI,GAAG;AACP,2BAAI,GAAG;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport { isWeb } from '@tamagui/constants'\nimport {\n Children,\n ReactElement,\n ReactNode,\n cloneElement,\n forwardRef,\n isValidElement,\n} from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: ReactNode\n}\n\nexport const Slot = forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n const childrenArray = Children.toArray(children)\n const slottable = childrenArray.find(isSlottable)\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children as ReactNode\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (Children.count(newElement) > 1) return Children.only(null)\n return isValidElement(newElement)\n ? (newElement.props.children as ReactNode)\n : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {isValidElement(newElement)\n ? cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: ReactNode\n}\n\nconst SlotClone = forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (isValidElement(children)) {\n const childProps = {\n ...mergeSlotProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return cloneElement(children, childProps)\n }\n\n return Children.count(children) > 1 ? Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: ReactNode): child is ReactElement {\n return isValidElement(child) && child.type === Slottable\n}\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeSlotProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = handleRegex.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nconst handleRegex = /^on[A-Z]/\n\nexport function mergeEvent(a?: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7
7
  }
@@ -22,7 +22,7 @@ const TestStackRenders = ({
22
22
  });
23
23
  };
24
24
  (0, import_vitest.describe)("Stack", () => {
25
- (0, import_vitest.test)(`renders once`, async () => {
25
+ (0, import_vitest.test)("renders once", async () => {
26
26
  const renderCount = { current: 0 };
27
27
  (0, import_react.render)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TestStackRenders, {
28
28
  renderCount
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Stack.test.tsx"],
4
- "sourcesContent": ["process.env.TAMAGUI_TARGET = 'web'\n\nimport { getDefaultTamaguiConfig } from '@tamagui/config-default-node'\nimport { render } from '@testing-library/react'\nimport { describe, expect, test } from 'vitest'\n\nimport { createTamagui } from '../createTamagui'\nimport { Stack } from './Stack'\nimport { TamaguiProvider } from './TamaguiProvider'\nimport { StackProps, configureMedia } from '..'\n\nconst conf = createTamagui(getDefaultTamaguiConfig())\n\nconst TestStackRenders = ({\n renderCount,\n ...props\n}: StackProps & { renderCount: { current: number } }) => {\n return (\n <TamaguiProvider config={conf} defaultTheme=\"light\">\n <Stack data-test-renders={renderCount} {...props} />\n </TamaguiProvider>\n )\n}\n\ndescribe('Stack', () => {\n test(`renders once`, async () => {\n const renderCount = { current: 0 }\n render(<TestStackRenders renderCount={renderCount} />)\n expect(renderCount.current).toBe(1)\n })\n\n // test(`doesn't re-render on media query change if CSS`, async () => {\n // const renderCount = { current: 0 }\n\n // render(\n // <TestStackRenders\n // renderCount={renderCount}\n // backgroundColor=\"blue\"\n // $sm={{ backgroundColor: 'red' }}\n // />\n // )\n\n // expect(renderCount.current).toBe(1)\n\n // // re-configuring re-runs the media queries...\n // configureMedia(conf)\n\n // expect(renderCount.current).toBe(1)\n // })\n\n // test(`does re-render on media query change if not CSS`, async () => {\n // const renderCount = { current: 0 }\n\n // render(\n // <TestStackRenders\n // renderCount={renderCount}\n // backgroundColor=\"blue\"\n // // @ts-ignore\n // $sm={{ space: '$2' }}\n // />\n // )\n\n // expect(renderCount.current).toBe(1)\n\n // // re-configuring re-runs the media queries...\n // // configureMedia({\n // // ...conf,\n // // media: {\n // // def\n // // },\n // // })\n // // expect(renderCount.current).toBe(2)\n // })\n})\n"],
4
+ "sourcesContent": ["process.env.TAMAGUI_TARGET = 'web'\n\nimport { getDefaultTamaguiConfig } from '@tamagui/config-default-node'\nimport { render } from '@testing-library/react'\nimport { describe, expect, test } from 'vitest'\n\nimport { createTamagui } from '../createTamagui'\nimport { Stack } from './Stack'\nimport { TamaguiProvider } from './TamaguiProvider'\nimport { StackProps, configureMedia } from '..'\n\nconst conf = createTamagui(getDefaultTamaguiConfig())\n\nconst TestStackRenders = ({\n renderCount,\n ...props\n}: StackProps & { renderCount: { current: number } }) => {\n return (\n <TamaguiProvider config={conf} defaultTheme=\"light\">\n <Stack data-test-renders={renderCount} {...props} />\n </TamaguiProvider>\n )\n}\n\ndescribe('Stack', () => {\n test('renders once', async () => {\n const renderCount = { current: 0 }\n render(<TestStackRenders renderCount={renderCount} />)\n expect(renderCount.current).toBe(1)\n })\n\n // test(`doesn't re-render on media query change if CSS`, async () => {\n // const renderCount = { current: 0 }\n\n // render(\n // <TestStackRenders\n // renderCount={renderCount}\n // backgroundColor=\"blue\"\n // $sm={{ backgroundColor: 'red' }}\n // />\n // )\n\n // expect(renderCount.current).toBe(1)\n\n // // re-configuring re-runs the media queries...\n // configureMedia(conf)\n\n // expect(renderCount.current).toBe(1)\n // })\n\n // test(`does re-render on media query change if not CSS`, async () => {\n // const renderCount = { current: 0 }\n\n // render(\n // <TestStackRenders\n // renderCount={renderCount}\n // backgroundColor=\"blue\"\n // // @ts-ignore\n // $sm={{ space: '$2' }}\n // />\n // )\n\n // expect(renderCount.current).toBe(1)\n\n // // re-configuring re-runs the media queries...\n // // configureMedia({\n // // ...conf,\n // // media: {\n // // def\n // // },\n // // })\n // // expect(renderCount.current).toBe(2)\n // })\n})\n"],
5
5
  "mappings": ";AAmBM;AAjBN,iCAAwC;AACxC,mBAAuB;AACvB,oBAAuC;AAEvC,2BAA8B;AAC9B,mBAAsB;AACtB,6BAAgC;AARhC,QAAQ,IAAI,iBAAiB;AAW7B,MAAM,WAAO,wCAAc,oDAAwB,CAAC;AAEpD,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,KACG;AACL,MAAyD;AACvD,SACE,4CAAC;AAAA,IAAgB,QAAQ;AAAA,IAAM,cAAa;AAAA,IAC1C,sDAAC;AAAA,MAAM,qBAAmB;AAAA,MAAc,GAAG;AAAA,KAAO;AAAA,GACpD;AAEJ;AAAA,IAEA,wBAAS,SAAS,MAAM;AACtB,0BAAK,gBAAgB,YAAY;AAC/B,UAAM,cAAc,EAAE,SAAS,EAAE;AACjC,6BAAO,4CAAC;AAAA,MAAiB;AAAA,KAA0B,CAAE;AACrD,8BAAO,YAAY,OAAO,EAAE,KAAK,CAAC;AAAA,EACpC,CAAC;AA4CH,CAAC;",
6
6
  "names": []
7
7
  }
@@ -47,7 +47,7 @@ function TamaguiProvider({
47
47
  children
48
48
  });
49
49
  }
50
- if (!import_constants.isWeb || !import_constants.isServer) {
50
+ if (!(import_constants.isWeb && import_constants.isServer)) {
51
51
  (0, import_useMedia.useMediaListeners)(config);
52
52
  }
53
53
  if (import_constants.isClient) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TamaguiProvider.tsx"],
4
- "sourcesContent": ["import { isClient, isRSC, isServer, isWeb } from '@tamagui/constants'\nimport * as React from 'react'\n\nimport { ButtonNestingContext } from '../contexts/ButtonNestingContext'\nimport { TextAncestorContext } from '../contexts/TextAncestorContext'\nimport { useMediaListeners } from '../hooks/useMedia'\nimport type { TamaguiProviderProps } from '../types'\nimport { ThemeProvider } from './ThemeProvider'\n\nexport function TamaguiProvider({\n children,\n disableInjectCSS,\n config,\n ...themePropsProvider\n}: TamaguiProviderProps) {\n if (isRSC) {\n return (\n <span\n style={{ display: 'contents' }}\n className={`t_${Object.keys(config.themes)[0] || 'light'}`}\n >\n {children}\n </span>\n )\n }\n\n if (!isWeb || !isServer) {\n useMediaListeners(config)\n }\n\n if (isClient) {\n // inject CSS if asked to (not SSR compliant)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n if (disableInjectCSS) return\n const style = document.createElement('style')\n style.appendChild(document.createTextNode(config.getCSS()))\n document.head.appendChild(style)\n return () => {\n document.head.removeChild(style)\n }\n }, [config, disableInjectCSS])\n }\n\n return (\n <ButtonNestingContext.Provider value={false}>\n <TextAncestorContext.Provider value={false}>\n <ThemeProvider\n themeClassNameOnRoot={config.themeClassNameOnRoot}\n disableRootThemeClass={config.disableRootThemeClass}\n {...themePropsProvider}\n defaultTheme={themePropsProvider.defaultTheme ?? Object.keys(config.themes)[0]}\n >\n {children}\n </ThemeProvider>\n </TextAncestorContext.Provider>\n </ButtonNestingContext.Provider>\n )\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBM;AAjBN,uBAAiD;AACjD,YAAuB;AAEvB,kCAAqC;AACrC,iCAAoC;AACpC,sBAAkC;AAElC,2BAA8B;AAEvB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACL,GAAyB;AACvB,MAAI,wBAAO;AACT,WACE,4CAAC;AAAA,MACC,OAAO,EAAE,SAAS,WAAW;AAAA,MAC7B,WAAW,KAAK,OAAO,KAAK,OAAO,MAAM,EAAE,MAAM;AAAA,MAEhD;AAAA,KACH;AAAA,EAEJ;AAEA,MAAI,CAAC,0BAAS,CAAC,2BAAU;AACvB,2CAAkB,MAAM;AAAA,EAC1B;AAEA,MAAI,2BAAU;AAGZ,UAAM,gBAAgB,MAAM;AAC1B,UAAI;AAAkB;AACtB,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,YAAY,SAAS,eAAe,OAAO,OAAO,CAAC,CAAC;AAC1D,eAAS,KAAK,YAAY,KAAK;AAC/B,aAAO,MAAM;AACX,iBAAS,KAAK,YAAY,KAAK;AAAA,MACjC;AAAA,IACF,GAAG,CAAC,QAAQ,gBAAgB,CAAC;AAAA,EAC/B;AAEA,SACE,4CAAC,iDAAqB,UAArB;AAAA,IAA8B,OAAO;AAAA,IACpC,sDAAC,+CAAoB,UAApB;AAAA,MAA6B,OAAO;AAAA,MACnC,sDAAC;AAAA,QACC,sBAAsB,OAAO;AAAA,QAC7B,uBAAuB,OAAO;AAAA,QAC7B,GAAG;AAAA,QACJ,cAAc,mBAAmB,gBAAgB,OAAO,KAAK,OAAO,MAAM,EAAE;AAAA,QAE3E;AAAA,OACH;AAAA,KACF;AAAA,GACF;AAEJ;",
4
+ "sourcesContent": ["import { isClient, isRSC, isServer, isWeb } from '@tamagui/constants'\nimport * as React from 'react'\n\nimport { ButtonNestingContext } from '../contexts/ButtonNestingContext'\nimport { TextAncestorContext } from '../contexts/TextAncestorContext'\nimport { useMediaListeners } from '../hooks/useMedia'\nimport type { TamaguiProviderProps } from '../types'\nimport { ThemeProvider } from './ThemeProvider'\n\nexport function TamaguiProvider({\n children,\n disableInjectCSS,\n config,\n ...themePropsProvider\n}: TamaguiProviderProps) {\n if (isRSC) {\n return (\n <span\n style={{ display: 'contents' }}\n className={`t_${Object.keys(config.themes)[0] || 'light'}`}\n >\n {children}\n </span>\n )\n }\n\n if (!(isWeb && isServer)) {\n useMediaListeners(config)\n }\n\n if (isClient) {\n // inject CSS if asked to (not SSR compliant)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n if (disableInjectCSS) return\n const style = document.createElement('style')\n style.appendChild(document.createTextNode(config.getCSS()))\n document.head.appendChild(style)\n return () => {\n document.head.removeChild(style)\n }\n }, [config, disableInjectCSS])\n }\n\n return (\n <ButtonNestingContext.Provider value={false}>\n <TextAncestorContext.Provider value={false}>\n <ThemeProvider\n themeClassNameOnRoot={config.themeClassNameOnRoot}\n disableRootThemeClass={config.disableRootThemeClass}\n {...themePropsProvider}\n defaultTheme={themePropsProvider.defaultTheme ?? Object.keys(config.themes)[0]}\n >\n {children}\n </ThemeProvider>\n </TextAncestorContext.Provider>\n </ButtonNestingContext.Provider>\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBM;AAjBN,uBAAiD;AACjD,YAAuB;AAEvB,kCAAqC;AACrC,iCAAoC;AACpC,sBAAkC;AAElC,2BAA8B;AAEvB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACL,GAAyB;AACvB,MAAI,wBAAO;AACT,WACE,4CAAC;AAAA,MACC,OAAO,EAAE,SAAS,WAAW;AAAA,MAC7B,WAAW,KAAK,OAAO,KAAK,OAAO,MAAM,EAAE,MAAM;AAAA,MAEhD;AAAA,KACH;AAAA,EAEJ;AAEA,MAAI,EAAE,0BAAS,4BAAW;AACxB,2CAAkB,MAAM;AAAA,EAC1B;AAEA,MAAI,2BAAU;AAGZ,UAAM,gBAAgB,MAAM;AAC1B,UAAI;AAAkB;AACtB,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,YAAY,SAAS,eAAe,OAAO,OAAO,CAAC,CAAC;AAC1D,eAAS,KAAK,YAAY,KAAK;AAC/B,aAAO,MAAM;AACX,iBAAS,KAAK,YAAY,KAAK;AAAA,MACjC;AAAA,IACF,GAAG,CAAC,QAAQ,gBAAgB,CAAC;AAAA,EAC/B;AAEA,SACE,4CAAC,iDAAqB,UAArB;AAAA,IAA8B,OAAO;AAAA,IACpC,sDAAC,+CAAoB,UAApB;AAAA,MAA6B,OAAO;AAAA,MACnC,sDAAC;AAAA,QACC,sBAAsB,OAAO;AAAA,QAC7B,uBAAuB,OAAO;AAAA,QAC7B,GAAG;AAAA,QACJ,cAAc,mBAAmB,gBAAgB,OAAO,KAAK,OAAO,MAAM,EAAE;AAAA,QAE3E;AAAA,OACH;AAAA,KACF;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }