@tamagui/core 1.0.1-beta.220 → 1.0.1-beta.222

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 (285) hide show
  1. package/dist/cjs/addTheme.js +7 -10
  2. package/dist/cjs/addTheme.js.map +3 -3
  3. package/dist/cjs/config.js +8 -4
  4. package/dist/cjs/config.js.map +2 -2
  5. package/dist/cjs/{hooks/useUnmountEffect.js → contexts/ButtonNestingContext.js} +7 -9
  6. package/dist/cjs/contexts/ButtonNestingContext.js.map +7 -0
  7. package/dist/cjs/createComponent.js +63 -67
  8. package/dist/cjs/createComponent.js.map +3 -3
  9. package/dist/cjs/createTamagui.js +13 -12
  10. package/dist/cjs/createTamagui.js.map +2 -2
  11. package/dist/cjs/createTokens.js.map +2 -2
  12. package/dist/cjs/createTokens.test.js +27 -0
  13. package/dist/cjs/createTokens.test.js.map +7 -0
  14. package/dist/cjs/createVariable.js +4 -9
  15. package/dist/cjs/createVariable.js.map +2 -2
  16. package/dist/cjs/createVariable.test.js +7 -0
  17. package/dist/cjs/createVariable.test.js.map +7 -0
  18. package/dist/cjs/createVariables.js +6 -7
  19. package/dist/cjs/createVariables.js.map +2 -2
  20. package/dist/cjs/helpers/ThemeManager.js +161 -147
  21. package/dist/cjs/helpers/ThemeManager.js.map +3 -3
  22. package/dist/cjs/helpers/ThemeManager.test.js +421 -34
  23. package/dist/cjs/helpers/ThemeManager.test.js.map +2 -2
  24. package/dist/cjs/helpers/{getTokens.js → ThemeManagerContext.js} +8 -8
  25. package/dist/cjs/helpers/ThemeManagerContext.js.map +7 -0
  26. package/dist/cjs/helpers/createPropMapper.js +4 -4
  27. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  28. package/dist/cjs/helpers/extendStaticConfig.js +2 -4
  29. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  30. package/dist/cjs/helpers/{assignNativePropsToWeb.native.js → getBoundingClientRect.js} +15 -8
  31. package/dist/cjs/helpers/getBoundingClientRect.js.map +7 -0
  32. package/dist/cjs/{hooks/useConstant.js → helpers/getRect.js} +14 -17
  33. package/dist/cjs/helpers/getRect.js.map +7 -0
  34. package/dist/cjs/helpers/getSplitStyles.js +82 -85
  35. package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
  36. package/dist/cjs/helpers/getThemeCSSRules.js +6 -2
  37. package/dist/cjs/helpers/getThemeCSSRules.js.map +2 -2
  38. package/dist/cjs/helpers/insertStyleRule.js +1 -1
  39. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  40. package/dist/cjs/helpers/mergeTransform.js +11 -8
  41. package/dist/cjs/helpers/mergeTransform.js.map +2 -2
  42. package/dist/cjs/helpers/pseudoDescriptors.js +1 -0
  43. package/dist/cjs/helpers/pseudoDescriptors.js.map +2 -2
  44. package/dist/cjs/helpers/themeable.js +9 -9
  45. package/dist/cjs/helpers/themeable.js.map +2 -2
  46. package/dist/cjs/hooks/useElementLayout.js +4 -12
  47. package/dist/cjs/hooks/useElementLayout.js.map +2 -2
  48. package/dist/cjs/hooks/useMedia.js +2 -1
  49. package/dist/cjs/hooks/useMedia.js.map +2 -2
  50. package/dist/cjs/hooks/useTheme.js +114 -156
  51. package/dist/cjs/hooks/useTheme.js.map +3 -3
  52. package/dist/cjs/hooks/useThemeName.js +52 -0
  53. package/dist/cjs/hooks/useThemeName.js.map +7 -0
  54. package/dist/cjs/index.js +2 -5
  55. package/dist/cjs/index.js.map +2 -2
  56. package/dist/cjs/setupReactNative.js +20 -7
  57. package/dist/cjs/setupReactNative.js.map +2 -2
  58. package/dist/cjs/styled.js +2 -19
  59. package/dist/cjs/styled.js.map +2 -2
  60. package/dist/cjs/types.js.map +1 -1
  61. package/dist/cjs/updateTheme.js +9 -9
  62. package/dist/cjs/updateTheme.js.map +2 -2
  63. package/dist/cjs/views/TamaguiProvider.js +3 -3
  64. package/dist/cjs/views/TamaguiProvider.js.map +2 -2
  65. package/dist/cjs/views/Theme.js +39 -28
  66. package/dist/cjs/views/Theme.js.map +3 -3
  67. package/dist/cjs/views/ThemeProvider.js +8 -33
  68. package/dist/cjs/views/ThemeProvider.js.map +3 -3
  69. package/dist/esm/addTheme.js +7 -10
  70. package/dist/esm/addTheme.js.map +3 -3
  71. package/dist/esm/config.js +8 -3
  72. package/dist/esm/config.js.map +2 -2
  73. package/dist/esm/contexts/ButtonNestingContext.js +6 -0
  74. package/dist/esm/contexts/ButtonNestingContext.js.map +7 -0
  75. package/dist/esm/createComponent.js +65 -70
  76. package/dist/esm/createComponent.js.map +3 -3
  77. package/dist/esm/createTamagui.js +13 -12
  78. package/dist/esm/createTamagui.js.map +2 -2
  79. package/dist/esm/createTokens.js.map +2 -2
  80. package/dist/esm/createTokens.test.js +26 -0
  81. package/dist/esm/createTokens.test.js.map +7 -0
  82. package/dist/esm/createVariable.js +4 -9
  83. package/dist/esm/createVariable.js.map +2 -2
  84. package/dist/esm/createVariable.test.js +6 -0
  85. package/dist/esm/createVariable.test.js.map +7 -0
  86. package/dist/esm/createVariables.js +6 -7
  87. package/dist/esm/createVariables.js.map +2 -2
  88. package/dist/esm/helpers/ThemeManager.js +140 -144
  89. package/dist/esm/helpers/ThemeManager.js.map +3 -3
  90. package/dist/esm/helpers/ThemeManager.test.js +421 -34
  91. package/dist/esm/helpers/ThemeManager.test.js.map +2 -2
  92. package/dist/esm/helpers/ThemeManagerContext.js +6 -0
  93. package/dist/esm/helpers/ThemeManagerContext.js.map +7 -0
  94. package/dist/esm/helpers/createPropMapper.js +4 -4
  95. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  96. package/dist/esm/helpers/extendStaticConfig.js +2 -4
  97. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  98. package/dist/esm/helpers/getBoundingClientRect.js +13 -0
  99. package/dist/esm/helpers/getBoundingClientRect.js.map +7 -0
  100. package/dist/esm/helpers/getRect.js +12 -0
  101. package/dist/esm/helpers/getRect.js.map +7 -0
  102. package/dist/esm/helpers/getSplitStyles.js +90 -87
  103. package/dist/esm/helpers/getSplitStyles.js.map +3 -3
  104. package/dist/esm/helpers/getThemeCSSRules.js +6 -2
  105. package/dist/esm/helpers/getThemeCSSRules.js.map +2 -2
  106. package/dist/esm/helpers/insertStyleRule.js +1 -1
  107. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  108. package/dist/esm/helpers/mergeTransform.js +8 -6
  109. package/dist/esm/helpers/mergeTransform.js.map +2 -2
  110. package/dist/esm/helpers/pseudoDescriptors.js +1 -0
  111. package/dist/esm/helpers/pseudoDescriptors.js.map +2 -2
  112. package/dist/esm/helpers/themeable.js +9 -9
  113. package/dist/esm/helpers/themeable.js.map +2 -2
  114. package/dist/esm/hooks/useElementLayout.js +2 -9
  115. package/dist/esm/hooks/useElementLayout.js.map +2 -2
  116. package/dist/esm/hooks/useMedia.js +3 -2
  117. package/dist/esm/hooks/useMedia.js.map +2 -2
  118. package/dist/esm/hooks/useTheme.js +114 -159
  119. package/dist/esm/hooks/useTheme.js.map +3 -3
  120. package/dist/esm/hooks/useThemeName.js +28 -0
  121. package/dist/esm/hooks/useThemeName.js.map +7 -0
  122. package/dist/esm/index.js +3 -5
  123. package/dist/esm/index.js.map +2 -2
  124. package/dist/esm/setupReactNative.js +18 -6
  125. package/dist/esm/setupReactNative.js.map +2 -2
  126. package/dist/esm/styled.js +3 -20
  127. package/dist/esm/styled.js.map +2 -2
  128. package/dist/esm/updateTheme.js +9 -9
  129. package/dist/esm/updateTheme.js.map +2 -2
  130. package/dist/esm/views/TamaguiProvider.js +4 -4
  131. package/dist/esm/views/TamaguiProvider.js.map +2 -2
  132. package/dist/esm/views/Theme.js +40 -29
  133. package/dist/esm/views/Theme.js.map +3 -3
  134. package/dist/esm/views/ThemeProvider.js +8 -27
  135. package/dist/esm/views/ThemeProvider.js.map +2 -2
  136. package/package.json +12 -12
  137. package/src/__snapshots__/createTokens.test.ts.snap +877 -0
  138. package/src/addTheme.ts +9 -12
  139. package/src/config.ts +10 -2
  140. package/src/contexts/ButtonNestingContext.tsx +3 -0
  141. package/src/createComponent.tsx +117 -108
  142. package/src/createTamagui.ts +16 -14
  143. package/src/createTokens.test.ts +29 -0
  144. package/src/createTokens.ts +1 -1
  145. package/src/createVariable.test.ts +7 -0
  146. package/src/createVariable.ts +4 -10
  147. package/src/createVariables.ts +7 -7
  148. package/src/helpers/ThemeManager.test.tsx +480 -0
  149. package/src/helpers/ThemeManager.tsx +171 -166
  150. package/src/helpers/ThemeManagerContext.tsx +5 -0
  151. package/src/helpers/createPropMapper.ts +4 -4
  152. package/src/helpers/extendStaticConfig.ts +4 -4
  153. package/src/helpers/getBoundingClientRect.tsx +7 -0
  154. package/src/helpers/getRect.tsx +8 -0
  155. package/src/helpers/getSplitStyles.tsx +98 -93
  156. package/src/helpers/getThemeCSSRules.ts +9 -2
  157. package/src/helpers/insertStyleRule.tsx +2 -2
  158. package/src/helpers/mergeTransform.ts +13 -6
  159. package/src/helpers/pseudoDescriptors.ts +1 -0
  160. package/src/helpers/themeable.tsx +17 -9
  161. package/src/hooks/useElementLayout.tsx +3 -8
  162. package/src/hooks/useMedia.tsx +3 -3
  163. package/src/hooks/useTheme.tsx +138 -211
  164. package/src/hooks/useThemeName.tsx +27 -0
  165. package/src/index.ts +3 -4
  166. package/src/setupReactNative.ts +16 -5
  167. package/src/styled.tsx +4 -23
  168. package/src/types.tsx +53 -26
  169. package/src/updateTheme.ts +12 -9
  170. package/src/views/TamaguiProvider.tsx +5 -5
  171. package/src/views/Theme.tsx +48 -39
  172. package/src/views/ThemeProvider.tsx +11 -33
  173. package/types/Tamagui.d.ts +1 -1
  174. package/types/addTheme.d.ts +23 -2
  175. package/types/config.d.ts +0 -1
  176. package/types/contexts/ButtonNestingContext.d.ts +3 -0
  177. package/types/createTokens.test.d.ts +2 -0
  178. package/types/createVariable.d.ts +2 -2
  179. package/types/createVariable.test.d.ts +2 -0
  180. package/types/helpers/ThemeManager.d.ts +20 -30
  181. package/types/helpers/ThemeManager.test.d.ts +2 -0
  182. package/types/helpers/ThemeManagerContext.d.ts +4 -0
  183. package/types/helpers/getBoundingClientRect.d.ts +2 -0
  184. package/types/helpers/getRect.d.ts +9 -0
  185. package/types/helpers/insertStyleRule.d.ts +1 -1
  186. package/types/helpers/mergeTransform.d.ts +5 -3
  187. package/types/helpers/themeable.d.ts +3 -0
  188. package/types/hooks/useElementLayout.d.ts +0 -8
  189. package/types/hooks/useTheme.d.ts +10 -20
  190. package/types/hooks/useThemeName.d.ts +5 -0
  191. package/types/index.d.ts +3 -4
  192. package/types/setupReactNative.d.ts +4 -2
  193. package/types/types.d.ts +46 -20
  194. package/types/updateTheme.d.ts +23 -2
  195. package/types/views/Theme.d.ts +3 -4
  196. package/dist/cjs/constants/platform.js +0 -74
  197. package/dist/cjs/constants/platform.js.map +0 -7
  198. package/dist/cjs/constants/platform.native.js +0 -62
  199. package/dist/cjs/constants/platform.native.js.map +0 -7
  200. package/dist/cjs/helpers/assignNativePropsToWeb.js +0 -188
  201. package/dist/cjs/helpers/assignNativePropsToWeb.js.map +0 -7
  202. package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +0 -7
  203. package/dist/cjs/helpers/calc.js +0 -71
  204. package/dist/cjs/helpers/calc.js.map +0 -7
  205. package/dist/cjs/helpers/getFont.js +0 -66
  206. package/dist/cjs/helpers/getFont.js.map +0 -7
  207. package/dist/cjs/helpers/getStackSize.js +0 -46
  208. package/dist/cjs/helpers/getStackSize.js.map +0 -7
  209. package/dist/cjs/helpers/getTokens.js.map +0 -7
  210. package/dist/cjs/helpers/startTransition.js +0 -36
  211. package/dist/cjs/helpers/startTransition.js.map +0 -7
  212. package/dist/cjs/helpers/validate.js +0 -2
  213. package/dist/cjs/helpers/validate.js.map +0 -7
  214. package/dist/cjs/hooks/useConstant.js.map +0 -7
  215. package/dist/cjs/hooks/useIsMounted.js +0 -40
  216. package/dist/cjs/hooks/useIsMounted.js.map +0 -7
  217. package/dist/cjs/hooks/usePressable.js +0 -36
  218. package/dist/cjs/hooks/usePressable.js.map +0 -7
  219. package/dist/cjs/hooks/useUnmountEffect.js.map +0 -7
  220. package/dist/cjs/injectStyles.js +0 -40
  221. package/dist/cjs/injectStyles.js.map +0 -7
  222. package/dist/cjs/react-native.js +0 -22
  223. package/dist/cjs/react-native.js.map +0 -7
  224. package/dist/esm/constants/platform.js +0 -39
  225. package/dist/esm/constants/platform.js.map +0 -7
  226. package/dist/esm/constants/platform.native.js +0 -28
  227. package/dist/esm/constants/platform.native.js.map +0 -7
  228. package/dist/esm/helpers/assignNativePropsToWeb.js +0 -164
  229. package/dist/esm/helpers/assignNativePropsToWeb.js.map +0 -7
  230. package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -6
  231. package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +0 -7
  232. package/dist/esm/helpers/calc.js +0 -47
  233. package/dist/esm/helpers/calc.js.map +0 -7
  234. package/dist/esm/helpers/getFont.js +0 -42
  235. package/dist/esm/helpers/getFont.js.map +0 -7
  236. package/dist/esm/helpers/getStackSize.js +0 -22
  237. package/dist/esm/helpers/getStackSize.js.map +0 -7
  238. package/dist/esm/helpers/getTokens.js +0 -6
  239. package/dist/esm/helpers/getTokens.js.map +0 -7
  240. package/dist/esm/helpers/startTransition.js +0 -6
  241. package/dist/esm/helpers/startTransition.js.map +0 -7
  242. package/dist/esm/helpers/validate.js +0 -1
  243. package/dist/esm/helpers/validate.js.map +0 -7
  244. package/dist/esm/hooks/useConstant.js +0 -15
  245. package/dist/esm/hooks/useConstant.js.map +0 -7
  246. package/dist/esm/hooks/useIsMounted.js +0 -16
  247. package/dist/esm/hooks/useIsMounted.js.map +0 -7
  248. package/dist/esm/hooks/usePressable.js +0 -12
  249. package/dist/esm/hooks/usePressable.js.map +0 -7
  250. package/dist/esm/hooks/useUnmountEffect.js +0 -8
  251. package/dist/esm/hooks/useUnmountEffect.js.map +0 -7
  252. package/dist/esm/injectStyles.js +0 -16
  253. package/dist/esm/injectStyles.js.map +0 -7
  254. package/dist/esm/react-native.js +0 -3
  255. package/dist/esm/react-native.js.map +0 -7
  256. package/src/contexts/ButtonInsideButtonContext.tsx +0 -3
  257. package/src/contexts/ThemeContext.tsx +0 -5
  258. package/src/helpers/areEqualSets.tsx +0 -9
  259. package/src/views/ThemeInverse.tsx +0 -43
  260. package/src/views/ThemeReset.tsx +0 -43
  261. package/types/constants/platform.d.ts +0 -13
  262. package/types/constants/platform.native.d.ts +0 -13
  263. package/types/contexts/ButtonInsideButtonContext.d.ts +0 -3
  264. package/types/contexts/ThemeContext.d.ts +0 -7
  265. package/types/helpers/areEqualSets.d.ts +0 -2
  266. package/types/helpers/assignNativePropsToWeb.d.ts +0 -2
  267. package/types/helpers/assignNativePropsToWeb.native.d.ts +0 -2
  268. package/types/helpers/calc.d.ts +0 -1
  269. package/types/helpers/getFont.d.ts +0 -3
  270. package/types/helpers/getStackSize.d.ts +0 -8
  271. package/types/helpers/getTokens.d.ts +0 -2
  272. package/types/helpers/startTransition.d.ts +0 -3
  273. package/types/helpers/validate.d.ts +0 -1
  274. package/types/hooks/useConstant.d.ts +0 -2
  275. package/types/hooks/useIsMounted.d.ts +0 -3
  276. package/types/hooks/useMedia.test.d.ts +0 -1
  277. package/types/hooks/usePressable.d.ts +0 -3
  278. package/types/hooks/usePressablePressResponder.d.ts +0 -84
  279. package/types/hooks/useUnmountEffect.d.ts +0 -2
  280. package/types/injectStyles.d.ts +0 -7
  281. package/types/react-native.d.ts +0 -8
  282. package/types/views/AbsoluteFill.d.ts +0 -5
  283. package/types/views/AbsoluteFill.native.d.ts +0 -3
  284. package/types/views/ThemeInverse.d.ts +0 -9
  285. package/types/views/ThemeReset.d.ts +0 -4
@@ -1,26 +1,16 @@
1
1
  import { ThemeManager } from '../helpers/ThemeManager';
2
- import { ThemeName, ThemeParsed } from '../types';
3
- export interface ThemeProps {
4
- className?: string;
5
- disableThemeClass?: boolean;
6
- name: Exclude<ThemeName, number> | null;
7
- componentName?: string;
8
- children?: any;
9
- reset?: boolean;
10
- debug?: boolean | 'verbose';
11
- }
12
- export declare const useTheme: (themeName?: string | null, componentName?: string, props?: ThemeProps, forceUpdate?: any, disableTracking?: boolean) => ThemeParsed;
13
- export declare const getThemeManager: (theme: any) => ThemeManager | undefined;
14
- export declare function useThemeName(opts?: {
15
- parent?: true;
16
- }): ThemeName;
17
- export declare const useDefaultThemeName: () => string | undefined;
18
- export declare const activeThemeManagers: Set<ThemeManager>;
19
- export declare const useChangeThemeEffect: (name?: string | null, componentName?: string, props?: ThemeProps, forceUpdateProp?: any, uuid?: Object) => {
2
+ import { ThemeParsed, ThemeProps } from '../types';
3
+ export declare type ChangedThemeResponse = {
20
4
  themes: Record<string, ThemeParsed>;
21
5
  themeManager: ThemeManager | null;
22
6
  name: string;
23
- theme: ThemeParsed | null;
24
- className?: string | undefined;
7
+ isNewTheme?: boolean;
8
+ theme?: ThemeParsed | null;
9
+ className?: string;
25
10
  };
11
+ export declare const useTheme: (props?: ThemeProps) => ThemeParsed;
12
+ export declare const getThemeManager: (theme: any) => ThemeManager | undefined;
13
+ export declare const getThemeIsNewTheme: (theme: any) => ThemeManager | undefined;
14
+ export declare const activeThemeManagers: Set<ThemeManager>;
15
+ export declare const useChangeThemeEffect: (props: ThemeProps, root?: boolean) => ChangedThemeResponse;
26
16
  //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { ThemeName } from '../types';
2
+ export declare function useThemeName(opts?: {
3
+ parent?: true;
4
+ }): ThemeName;
5
+ //# sourceMappingURL=useThemeName.d.ts.map
package/types/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export * from './styled';
14
14
  export * from './types';
15
15
  export * from './setupReactNative';
16
16
  export type { RNWTextProps, RNWViewProps } from './types-rnw';
17
- export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './config';
17
+ export { getConfig, getThemes, getTokens, onConfiguredOnce } from './config';
18
18
  export * from './constants/constants';
19
19
  export * from './helpers/useShallowSetState';
20
20
  export * from './helpers/getVariantExtras';
@@ -31,20 +31,19 @@ export * from './helpers/isTamaguiComponent';
31
31
  export * from './helpers/matchMedia';
32
32
  export * from './helpers/themeable';
33
33
  export * from './helpers/withStaticProperties';
34
- export * from './contexts/ButtonInsideButtonContext';
34
+ export * from './contexts/ButtonNestingContext';
35
35
  export * from './hooks/useId';
36
36
  export * from './hooks/useIsTouchDevice';
37
37
  export { configureMedia, getMedia, mediaState, useMedia, useMediaPropsActive, mediaObjectToString, addMediaQueryListener, removeMediaQueryListener, mediaQueryConfig, } from './hooks/useMedia';
38
38
  export * from './hooks/useTheme';
39
+ export * from './hooks/useThemeName';
39
40
  export * from './hooks/useSafeRef';
40
41
  export * from './views/Slot';
41
42
  export * from './views/Stack';
42
43
  export * from './views/Text';
43
44
  export * from './contexts/TextAncestorContext';
44
45
  export * from './views/Theme';
45
- export * from './views/ThemeInverse';
46
46
  export * from './views/ThemeProvider';
47
- export * from './views/ThemeReset';
48
47
  export * from './views/FontLanguage';
49
48
  export * from './views/TamaguiProvider';
50
49
  export * from '@tamagui/use-force-update';
@@ -1,3 +1,5 @@
1
- export declare function getReactNative(): any;
2
- export declare function setupReactNative(_: any): void;
1
+ import { StaticConfig } from './types';
2
+ export declare const ReactNativeStaticConfigs: WeakMap<any, Partial<StaticConfig> | null>;
3
+ export declare function getReactNativeConfig(Component: any): Partial<StaticConfig> | null | undefined;
4
+ export declare function setupReactNative(rnExports: Record<string, any>): void;
3
5
  //# sourceMappingURL=setupReactNative.d.ts.map
package/types/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { GestureResponderEvent, Image, PressableProps, TextProps as ReactTextProps, Text, TextInput, TextStyle, View, ViewProps, ViewStyle } from '@tamagui/types-react-native';
1
+ import type { Image, PressableProps, TextProps as ReactTextProps, Text, TextInput, TextStyle, View, ViewProps, ViewStyle } from '@tamagui/types-react-native';
2
2
  import type { Properties } from 'csstype';
3
- import type { Component, ForwardRefExoticComponent, FunctionComponent, ReactNode, RefAttributes, RefObject } from 'react';
3
+ import type { Component, ForwardRefExoticComponent, FunctionComponent, HTMLAttributes, ReactNode, RefAttributes, RefObject } from 'react';
4
4
  import type { Variable } from './createVariable';
5
5
  import type { ResolveVariableTypes } from './helpers/createPropMapper';
6
6
  import type { TamaguiReactElement } from './static';
@@ -10,6 +10,7 @@ import type { ThemeProviderProps } from './views/ThemeProvider';
10
10
  export declare type SpaceDirection = 'vertical' | 'horizontal' | 'both';
11
11
  export declare type TamaguiElement = HTMLElement | View;
12
12
  export declare type DebugProp = boolean | 'break' | 'verbose';
13
+ declare type DivAttributes = HTMLAttributes<HTMLDivElement>;
13
14
  export declare type TamaguiComponentPropsBase = {
14
15
  hitSlop?: PressableProps['hitSlop'];
15
16
  asChild?: boolean;
@@ -34,14 +35,14 @@ export declare type TamaguiComponentPropsBase = {
34
35
  * Forces the pseudo style state to be on
35
36
  */
36
37
  forceStyle?: 'hover' | 'press' | 'focus';
37
- onHoverIn?: (e: MouseEvent) => any;
38
- onHoverOut?: (e: MouseEvent) => any;
39
- onPress?: (e: GestureResponderEvent) => any;
40
- onPressIn?: (e: GestureResponderEvent) => any;
41
- onPressOut?: (e: GestureResponderEvent) => any;
42
- onMouseEnter?: (e: MouseEvent) => any;
43
- onMouseLeave?: (e: MouseEvent) => any;
44
- onMouseDown?: (e: MouseEvent) => any;
38
+ onHoverIn?: DivAttributes['onMouseEnter'];
39
+ onHoverOut?: DivAttributes['onMouseLeave'];
40
+ onPress?: PressableProps['onPress'];
41
+ onPressIn?: PressableProps['onPress'];
42
+ onPressOut?: PressableProps['onPress'];
43
+ onMouseEnter?: DivAttributes['onMouseEnter'];
44
+ onMouseLeave?: DivAttributes['onMouseLeave'];
45
+ onMouseDown?: DivAttributes['onMouseDown'];
45
46
  };
46
47
  export declare type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<Props & RefAttributes<Ref>>;
47
48
  export declare type ConfigListener = (conf: TamaguiInternalConfig) => void;
@@ -151,6 +152,16 @@ export declare type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>;
151
152
  export declare type ThemeTokens = `$${ThemeKeys}`;
152
153
  export declare type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<infer Config> ? keyof Config : string;
153
154
  export declare type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>;
155
+ export interface ThemeProps {
156
+ className?: string;
157
+ disableThemeClass?: boolean;
158
+ name?: Exclude<ThemeName, number> | null;
159
+ componentName?: string;
160
+ children?: any;
161
+ reset?: boolean;
162
+ debug?: boolean | 'verbose';
163
+ inverse?: boolean;
164
+ }
154
165
  declare type ArrayIntersection<A extends any[]> = A[keyof A];
155
166
  declare type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S;
156
167
  declare type SpacerPropsBase = {
@@ -571,7 +582,25 @@ export declare type SplitStyleState = TamaguiComponentState & {
571
582
  fallbackProps?: Record<string, any>;
572
583
  keepVariantsAsProps?: boolean;
573
584
  hasTextAncestor?: boolean;
574
- };
585
+ isExiting?: boolean;
586
+ exitVariant?: string;
587
+ enterVariant?: string;
588
+ };
589
+ export interface PresenceContextProps {
590
+ id: string;
591
+ isPresent: boolean;
592
+ register: (id: string) => () => void;
593
+ onExitComplete?: (id: string) => void;
594
+ initial?: false | string | string[];
595
+ custom?: any;
596
+ exitVariant?: string | null;
597
+ enterVariant?: string | null;
598
+ }
599
+ declare type SafeToRemoveCallback = () => void;
600
+ declare type AlwaysPresent = [true, null, null];
601
+ declare type Present = [true, undefined, PresenceContextProps];
602
+ declare type NotPresent = [false, SafeToRemoveCallback, PresenceContextProps];
603
+ export declare type UsePresenceResult = AlwaysPresent | Present | NotPresent;
575
604
  declare type AnimationConfig = {
576
605
  [key: string]: any;
577
606
  };
@@ -598,6 +627,7 @@ export declare type UniversalAnimatedNumber<A> = {
598
627
  export declare type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
599
628
  isReactNative?: boolean;
600
629
  useAnimations: UseAnimationHook;
630
+ usePresence: () => UsePresenceResult;
601
631
  useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>;
602
632
  useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(val: V, getStyle: (current: any) => any) => any;
603
633
  useAnimatedNumberReaction: (val: UniversalAnimatedNumber<any>, onValue: (current: number) => void) => void;
@@ -606,21 +636,17 @@ export declare type AnimationDriver<A extends AnimationConfig = AnimationConfig>
606
636
  Text?: any;
607
637
  };
608
638
  export declare type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>;
609
- export declare type UseAnimationHelpers = {
639
+ export declare type UseAnimationHook = (props: {
640
+ style: Record<string, any>;
641
+ props: Record<string, any>;
642
+ presence?: UsePresenceResult | null;
610
643
  hostRef: RefObject<HTMLElement | View>;
611
644
  staticConfig: StaticConfigParsed;
612
- getStyle: (props?: {
613
- isEntering?: boolean;
614
- isExiting?: boolean;
615
- exitVariant?: string | null;
616
- enterVariant?: string | null;
617
- }) => ViewStyle;
618
645
  state: SplitStyleState;
619
646
  pseudos: PseudoProps<ViewStyle>;
620
647
  onDidAnimate?: any;
621
648
  delay?: number;
622
- };
623
- export declare type UseAnimationHook = (props: UseAnimationProps, helpers: UseAnimationHelpers) => null | {
649
+ }) => null | {
624
650
  style?: StackStylePropsBase | StackStylePropsBase[];
625
651
  };
626
652
  export declare type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (event: infer Event) => void ? Event : never;
@@ -1,8 +1,29 @@
1
1
  import { ThemeDefinition } from './types';
2
- export declare function updateTheme({ name, theme }: {
2
+ export declare function updateTheme({ name, theme, }: {
3
3
  name: string;
4
- theme: ThemeDefinition;
4
+ theme: Partial<Record<keyof ThemeDefinition, any>>;
5
5
  }): {
6
+ theme: {
7
+ [x: string]: import("./createVariable").Variable<any>;
8
+ background?: import("./createVariable").Variable<any> | undefined;
9
+ backgroundHover?: import("./createVariable").Variable<any> | undefined;
10
+ backgroundPress?: import("./createVariable").Variable<any> | undefined;
11
+ backgroundFocus?: import("./createVariable").Variable<any> | undefined;
12
+ color?: import("./createVariable").Variable<any> | undefined;
13
+ colorHover?: import("./createVariable").Variable<any> | undefined;
14
+ colorPress?: import("./createVariable").Variable<any> | undefined;
15
+ colorFocus?: import("./createVariable").Variable<any> | undefined;
16
+ borderColor?: import("./createVariable").Variable<any> | undefined;
17
+ borderColorHover?: import("./createVariable").Variable<any> | undefined;
18
+ borderColorPress?: import("./createVariable").Variable<any> | undefined;
19
+ borderColorFocus?: import("./createVariable").Variable<any> | undefined;
20
+ shadowColor?: import("./createVariable").Variable<any> | undefined;
21
+ shadowColorHover?: import("./createVariable").Variable<any> | undefined;
22
+ shadowColorPress?: import("./createVariable").Variable<any> | undefined;
23
+ shadowColorFocus?: import("./createVariable").Variable<any> | undefined;
24
+ };
25
+ cssRules?: undefined;
26
+ } | {
6
27
  theme: any;
7
28
  cssRules: string[];
8
29
  };
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import { ThemeManager } from '../helpers/ThemeManager';
3
- import { ThemeProps } from '../hooks/useTheme';
4
- export declare const Theme: React.NamedExoticComponent<ThemeProps>;
5
- export declare function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null, shouldSetChildrenThemeToParent?: boolean): any;
2
+ import { ThemeProps } from '../types';
3
+ export declare function Theme(props: ThemeProps): any;
4
+ export declare function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null, shouldReset?: boolean): any;
6
5
  //# sourceMappingURL=Theme.d.ts.map
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var platform_exports = {};
20
- __export(platform_exports, {
21
- isAndroid: () => isAndroid,
22
- isChrome: () => isChrome,
23
- isClient: () => isClient,
24
- isIOS: () => isIOS,
25
- isRSC: () => isRSC,
26
- isServer: () => isServer,
27
- isTouchable: () => isTouchable,
28
- isWeb: () => isWeb,
29
- isWebTouchable: () => isWebTouchable,
30
- isWindowDefined: () => isWindowDefined,
31
- useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
32
- });
33
- module.exports = __toCommonJS(platform_exports);
34
- var import_react = require("react");
35
- var import_react_native = require("react-native");
36
- const import_meta = {};
37
- var _a, _b;
38
- const isAndroid = ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "android";
39
- const isIOS = ((_b = import_react_native.Platform) == null ? void 0 : _b.OS) === "ios";
40
- const isWeb = process.env.TAMAGUI_TARGET === "web";
41
- const isWindowDefined = typeof window !== "undefined";
42
- const isServer = isWeb && !isWindowDefined;
43
- const isClient = isWeb && isWindowDefined;
44
- const isRSC = process.env.ENABLE_RSC ? import_meta.env ? import_meta.env.SSR : false : false;
45
- const idFn = () => {
46
- };
47
- const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? import_react.useEffect : import_react.useLayoutEffect;
48
- const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
49
- const isWebTouchable = isClient && "ontouchstart" in window;
50
- const isTouchable = !isWeb || isWebTouchable;
51
- if (process.env.NODE_ENV === "development") {
52
- if (!process.env.TAMAGUI_TARGET) {
53
- console.warn(`Must set TAMAGUI_TARGET to "web" or "native"`);
54
- } else if (isClient && process.env.TAMAGUI_TARGET !== "web" && process.env.TAMAGUI_IGNORE_TARGET !== "1") {
55
- console.warn(
56
- `Must set TAMAGUI_TARGET to "web" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`
57
- );
58
- }
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- isAndroid,
63
- isChrome,
64
- isClient,
65
- isIOS,
66
- isRSC,
67
- isServer,
68
- isTouchable,
69
- isWeb,
70
- isWebTouchable,
71
- isWindowDefined,
72
- useIsomorphicLayoutEffect
73
- });
74
- //# sourceMappingURL=platform.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/constants/platform.ts"],
4
- "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isServer = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\n\n// may want to move to VITE_RSC_BUILD\nexport const isRSC = process.env.ENABLE_RSC\n ? // note this is statically analyzed so no funny business, just access it without optional chaining\n // @ts-ignore\n import.meta.env\n ? // @ts-ignore\n import.meta.env.SSR\n : false\n : false\n\nconst idFn = () => {}\nexport const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = isClient && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\n\nif (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.warn(`Must set TAMAGUI_TARGET to \"web\" or \"native\"`)\n } else if (\n isClient &&\n process.env.TAMAGUI_TARGET !== 'web' &&\n process.env.TAMAGUI_IGNORE_TARGET !== '1'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Must set TAMAGUI_TARGET to \"web\" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`\n )\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAAA;AAGO,MAAM,cAAY,yDAAU,QAAO;AACnC,MAAM,UAAQ,yDAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI,aAG7B,YAAY,MAEV,YAAY,IAAI,MAChB,QACF;AAEJ,MAAM,OAAO,MAAM;AAAC;AACb,MAAM,4BAA4B,QAAQ,OAAO,WAAW,yBAAY;AACxE,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,YAAY,kBAAkB;AACrD,MAAM,cAAc,CAAC,SAAS;AAErC,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,MAAI,CAAC,QAAQ,IAAI,gBAAgB;AAE/B,YAAQ,KAAK,8CAA8C;AAAA,EAC7D,WACE,YACA,QAAQ,IAAI,mBAAmB,SAC/B,QAAQ,IAAI,0BAA0B,KACtC;AAEA,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var platform_native_exports = {};
20
- __export(platform_native_exports, {
21
- isAndroid: () => isAndroid,
22
- isChrome: () => isChrome,
23
- isClient: () => isClient,
24
- isIOS: () => isIOS,
25
- isRSC: () => isRSC,
26
- isServer: () => isServer,
27
- isTouchable: () => isTouchable,
28
- isWeb: () => isWeb,
29
- isWebTouchable: () => isWebTouchable,
30
- isWindowDefined: () => isWindowDefined,
31
- useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
32
- });
33
- module.exports = __toCommonJS(platform_native_exports);
34
- var import_react = require("react");
35
- var import_react_native = require("react-native");
36
- var _a, _b;
37
- const isAndroid = ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "android";
38
- const isIOS = ((_b = import_react_native.Platform) == null ? void 0 : _b.OS) === "ios";
39
- const isWeb = false;
40
- const isWindowDefined = false;
41
- const isServer = false;
42
- const isClient = false;
43
- const isRSC = false;
44
- const useIsomorphicLayoutEffect = import_react.useLayoutEffect;
45
- const isChrome = false;
46
- const isWebTouchable = false;
47
- const isTouchable = true;
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- isAndroid,
51
- isChrome,
52
- isClient,
53
- isIOS,
54
- isRSC,
55
- isServer,
56
- isTouchable,
57
- isWeb,
58
- isWebTouchable,
59
- isWindowDefined,
60
- useIsomorphicLayoutEffect
61
- });
62
- //# sourceMappingURL=platform.native.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/constants/platform.native.ts"],
4
- "sourcesContent": ["import { useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = false\nexport const isWindowDefined = false\nexport const isServer = false\nexport const isClient = false\nexport const isRSC = false\nexport const useIsomorphicLayoutEffect = useLayoutEffect\nexport const isChrome = false\nexport const isWebTouchable = false\nexport const isTouchable = true\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgC;AAChC,0BAAyB;AADzB;AAGO,MAAM,cAAY,yDAAU,QAAO;AACnC,MAAM,UAAQ,yDAAU,QAAO;AAC/B,MAAM,QAAQ;AACd,MAAM,kBAAkB;AACxB,MAAM,WAAW;AACjB,MAAM,WAAW;AACjB,MAAM,QAAQ;AACd,MAAM,4BAA4B;AAClC,MAAM,WAAW;AACjB,MAAM,iBAAiB;AACvB,MAAM,cAAc;",
6
- "names": []
7
- }
@@ -1,188 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var assignNativePropsToWeb_exports = {};
20
- __export(assignNativePropsToWeb_exports, {
21
- assignNativePropsToWeb: () => assignNativePropsToWeb
22
- });
23
- module.exports = __toCommonJS(assignNativePropsToWeb_exports);
24
- var import_createComponent = require("../createComponent");
25
- function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
26
- if (!viewProps.role && nativeProps.accessibilityRole) {
27
- if (nativeProps.accessibilityRole === "none") {
28
- viewProps.role = "presentation";
29
- } else {
30
- const webRole = import_createComponent.accessibilityRoleToWebRole[nativeProps.accessibilityRole];
31
- if (webRole != null) {
32
- viewProps.role = webRole || nativeProps.accessibilityRole;
33
- }
34
- }
35
- }
36
- if (nativeProps.accessibilityActiveDescendant != null) {
37
- viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
38
- }
39
- if (nativeProps.accessibilityAtomic != null) {
40
- viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
41
- }
42
- if (nativeProps.accessibilityAutoComplete != null) {
43
- viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
44
- }
45
- if (nativeProps.accessibilityBusy != null) {
46
- viewProps["aria-busy"] = nativeProps.accessibilityBusy;
47
- }
48
- if (nativeProps.accessibilityChecked != null) {
49
- viewProps["aria-checked"] = nativeProps.accessibilityChecked;
50
- }
51
- if (nativeProps.accessibilityColumnCount != null) {
52
- viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
53
- }
54
- if (nativeProps.accessibilityColumnIndex != null) {
55
- viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
56
- }
57
- if (nativeProps.accessibilityColumnSpan != null) {
58
- viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
59
- }
60
- if (nativeProps.accessibilityControls != null) {
61
- viewProps["aria-controls"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityControls);
62
- }
63
- if (nativeProps.accessibilityCurrent != null) {
64
- viewProps["aria-current"] = nativeProps.accessibilityCurrent;
65
- }
66
- if (nativeProps.accessibilityDescribedBy != null) {
67
- viewProps["aria-describedby"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityDescribedBy);
68
- }
69
- if (nativeProps.accessibilityDetails != null) {
70
- viewProps["aria-details"] = nativeProps.accessibilityDetails;
71
- }
72
- if (nativeProps.disabled === true) {
73
- viewProps["aria-disabled"] = true;
74
- if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
75
- viewProps.disabled = true;
76
- }
77
- }
78
- if (nativeProps.accessibilityErrorMessage != null) {
79
- viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
80
- }
81
- if (nativeProps.accessibilityExpanded != null) {
82
- viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
83
- }
84
- if (nativeProps.accessibilityFlowTo != null) {
85
- viewProps["aria-flowto"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityFlowTo);
86
- }
87
- if (nativeProps.accessibilityHasPopup != null) {
88
- viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
89
- }
90
- if (nativeProps.accessibilityHidden === true) {
91
- viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
92
- }
93
- if (nativeProps.accessibilityInvalid != null) {
94
- viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
95
- }
96
- if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
97
- viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
98
- }
99
- if (nativeProps.accessibilityLabel != null) {
100
- viewProps["aria-label"] = nativeProps.accessibilityLabel;
101
- }
102
- if (nativeProps.accessibilityLabelledBy != null) {
103
- viewProps["aria-labelledby"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityLabelledBy);
104
- }
105
- if (nativeProps.accessibilityLevel != null) {
106
- viewProps["aria-level"] = nativeProps.accessibilityLevel;
107
- }
108
- if (nativeProps.accessibilityLiveRegion != null) {
109
- viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
110
- }
111
- if (nativeProps.accessibilityModal != null) {
112
- viewProps["aria-modal"] = nativeProps.accessibilityModal;
113
- }
114
- if (nativeProps.accessibilityMultiline != null) {
115
- viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
116
- }
117
- if (nativeProps.accessibilityMultiSelectable != null) {
118
- viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
119
- }
120
- if (nativeProps.accessibilityOrientation != null) {
121
- viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
122
- }
123
- if (nativeProps.accessibilityOwns != null) {
124
- viewProps["aria-owns"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityOwns);
125
- }
126
- if (nativeProps.accessibilityPlaceholder != null) {
127
- viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
128
- }
129
- if (nativeProps.accessibilityPosInSet != null) {
130
- viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
131
- }
132
- if (nativeProps.accessibilityPressed != null) {
133
- viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
134
- }
135
- if (nativeProps.accessibilityReadOnly != null) {
136
- viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
137
- if (elementType === "input" || elementType === "select" || elementType === "textarea") {
138
- viewProps.readOnly = true;
139
- }
140
- }
141
- if (nativeProps.accessibilityRequired != null) {
142
- viewProps["aria-required"] = nativeProps.accessibilityRequired;
143
- if (elementType === "input" || elementType === "select" || elementType === "textarea") {
144
- viewProps.required = true;
145
- }
146
- }
147
- if (nativeProps.accessibilityRoleDescription != null) {
148
- viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
149
- }
150
- if (nativeProps.accessibilityRowCount != null) {
151
- viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
152
- }
153
- if (nativeProps.accessibilityRowIndex != null) {
154
- viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
155
- }
156
- if (nativeProps.accessibilityRowSpan != null) {
157
- viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
158
- }
159
- if (nativeProps.accessibilitySelected != null) {
160
- viewProps["aria-selected"] = nativeProps.accessibilitySelected;
161
- }
162
- if (nativeProps.accessibilitySetSize != null) {
163
- viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
164
- }
165
- if (nativeProps.accessibilitySort != null) {
166
- viewProps["aria-sort"] = nativeProps.accessibilitySort;
167
- }
168
- if (nativeProps.accessibilityValueMax != null) {
169
- viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
170
- }
171
- if (nativeProps.accessibilityValueMin != null) {
172
- viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
173
- }
174
- if (nativeProps.accessibilityValueNow != null) {
175
- viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
176
- }
177
- if (nativeProps.accessibilityValueText != null) {
178
- viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
179
- }
180
- if (nativeProps.nativeID) {
181
- viewProps.id = nativeProps.nativeID;
182
- }
183
- }
184
- // Annotate the CommonJS export names for ESM import in node:
185
- 0 && (module.exports = {
186
- assignNativePropsToWeb
187
- });
188
- //# sourceMappingURL=assignNativePropsToWeb.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/assignNativePropsToWeb.tsx"],
4
- "sourcesContent": ["import { accessibilityRoleToWebRole, processIDRefList } from '../createComponent'\n\n// adapted from react-native-web\n\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA6D;AAItD,SAAS,uBAAuB,aAAqB,WAAgB,aAAkB;AAC5F,MAAI,CAAC,UAAU,QAAQ,YAAY,mBAAmB;AACpD,QAAI,YAAY,sBAAsB,QAAQ;AAC5C,gBAAU,OAAO;AAAA,IACnB,OAAO;AACL,YAAM,UAAU,kDAA2B,YAAY;AACvD,UAAI,WAAW,MAAM;AACnB,kBAAU,OAAO,WAAW,YAAY;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AAEA,MAAI,YAAY,iCAAiC,MAAM;AACrD,c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0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/assignNativePropsToWeb.native.tsx"],
4
- "sourcesContent": ["export function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,uBAAuB,aAAqB,WAAgB,aAAkB;AAAC;",
6
- "names": []
7
- }