@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,164 +0,0 @@
1
- import { accessibilityRoleToWebRole, processIDRefList } from "../createComponent";
2
- function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
3
- if (!viewProps.role && nativeProps.accessibilityRole) {
4
- if (nativeProps.accessibilityRole === "none") {
5
- viewProps.role = "presentation";
6
- } else {
7
- const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
8
- if (webRole != null) {
9
- viewProps.role = webRole || nativeProps.accessibilityRole;
10
- }
11
- }
12
- }
13
- if (nativeProps.accessibilityActiveDescendant != null) {
14
- viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
15
- }
16
- if (nativeProps.accessibilityAtomic != null) {
17
- viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
18
- }
19
- if (nativeProps.accessibilityAutoComplete != null) {
20
- viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
21
- }
22
- if (nativeProps.accessibilityBusy != null) {
23
- viewProps["aria-busy"] = nativeProps.accessibilityBusy;
24
- }
25
- if (nativeProps.accessibilityChecked != null) {
26
- viewProps["aria-checked"] = nativeProps.accessibilityChecked;
27
- }
28
- if (nativeProps.accessibilityColumnCount != null) {
29
- viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
30
- }
31
- if (nativeProps.accessibilityColumnIndex != null) {
32
- viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
33
- }
34
- if (nativeProps.accessibilityColumnSpan != null) {
35
- viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
36
- }
37
- if (nativeProps.accessibilityControls != null) {
38
- viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
39
- }
40
- if (nativeProps.accessibilityCurrent != null) {
41
- viewProps["aria-current"] = nativeProps.accessibilityCurrent;
42
- }
43
- if (nativeProps.accessibilityDescribedBy != null) {
44
- viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
45
- }
46
- if (nativeProps.accessibilityDetails != null) {
47
- viewProps["aria-details"] = nativeProps.accessibilityDetails;
48
- }
49
- if (nativeProps.disabled === true) {
50
- viewProps["aria-disabled"] = true;
51
- if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
52
- viewProps.disabled = true;
53
- }
54
- }
55
- if (nativeProps.accessibilityErrorMessage != null) {
56
- viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
57
- }
58
- if (nativeProps.accessibilityExpanded != null) {
59
- viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
60
- }
61
- if (nativeProps.accessibilityFlowTo != null) {
62
- viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
63
- }
64
- if (nativeProps.accessibilityHasPopup != null) {
65
- viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
66
- }
67
- if (nativeProps.accessibilityHidden === true) {
68
- viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
69
- }
70
- if (nativeProps.accessibilityInvalid != null) {
71
- viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
72
- }
73
- if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
74
- viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
75
- }
76
- if (nativeProps.accessibilityLabel != null) {
77
- viewProps["aria-label"] = nativeProps.accessibilityLabel;
78
- }
79
- if (nativeProps.accessibilityLabelledBy != null) {
80
- viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
81
- }
82
- if (nativeProps.accessibilityLevel != null) {
83
- viewProps["aria-level"] = nativeProps.accessibilityLevel;
84
- }
85
- if (nativeProps.accessibilityLiveRegion != null) {
86
- viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
87
- }
88
- if (nativeProps.accessibilityModal != null) {
89
- viewProps["aria-modal"] = nativeProps.accessibilityModal;
90
- }
91
- if (nativeProps.accessibilityMultiline != null) {
92
- viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
93
- }
94
- if (nativeProps.accessibilityMultiSelectable != null) {
95
- viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
96
- }
97
- if (nativeProps.accessibilityOrientation != null) {
98
- viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
99
- }
100
- if (nativeProps.accessibilityOwns != null) {
101
- viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
102
- }
103
- if (nativeProps.accessibilityPlaceholder != null) {
104
- viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
105
- }
106
- if (nativeProps.accessibilityPosInSet != null) {
107
- viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
108
- }
109
- if (nativeProps.accessibilityPressed != null) {
110
- viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
111
- }
112
- if (nativeProps.accessibilityReadOnly != null) {
113
- viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
114
- if (elementType === "input" || elementType === "select" || elementType === "textarea") {
115
- viewProps.readOnly = true;
116
- }
117
- }
118
- if (nativeProps.accessibilityRequired != null) {
119
- viewProps["aria-required"] = nativeProps.accessibilityRequired;
120
- if (elementType === "input" || elementType === "select" || elementType === "textarea") {
121
- viewProps.required = true;
122
- }
123
- }
124
- if (nativeProps.accessibilityRoleDescription != null) {
125
- viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
126
- }
127
- if (nativeProps.accessibilityRowCount != null) {
128
- viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
129
- }
130
- if (nativeProps.accessibilityRowIndex != null) {
131
- viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
132
- }
133
- if (nativeProps.accessibilityRowSpan != null) {
134
- viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
135
- }
136
- if (nativeProps.accessibilitySelected != null) {
137
- viewProps["aria-selected"] = nativeProps.accessibilitySelected;
138
- }
139
- if (nativeProps.accessibilitySetSize != null) {
140
- viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
141
- }
142
- if (nativeProps.accessibilitySort != null) {
143
- viewProps["aria-sort"] = nativeProps.accessibilitySort;
144
- }
145
- if (nativeProps.accessibilityValueMax != null) {
146
- viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
147
- }
148
- if (nativeProps.accessibilityValueMin != null) {
149
- viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
150
- }
151
- if (nativeProps.accessibilityValueNow != null) {
152
- viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
153
- }
154
- if (nativeProps.accessibilityValueText != null) {
155
- viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
156
- }
157
- if (nativeProps.nativeID) {
158
- viewProps.id = nativeProps.nativeID;
159
- }
160
- }
161
- export {
162
- assignNativePropsToWeb
163
- };
164
- //# 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": "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",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
2
- }
3
- export {
4
- assignNativePropsToWeb
5
- };
6
- //# sourceMappingURL=assignNativePropsToWeb.native.js.map
@@ -1,7 +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": "AAAO,SAAS,uBAAuB,aAAqB,WAAgB,aAAkB;AAAC;",
6
- "names": []
7
- }
@@ -1,47 +0,0 @@
1
- import { isWeb } from "@tamagui/constants";
2
- import { getVariableVariable } from "../createVariable";
3
- const operators = {
4
- "+": (a, b) => a + b,
5
- "-": (a, b) => a - b,
6
- "/": (a, b) => a / b,
7
- "*": (a, b) => a * b
8
- };
9
- const calc = (...valuesAndOperators) => {
10
- if (isWeb) {
11
- let res2 = "calc(";
12
- for (const cur of valuesAndOperators) {
13
- if (operators[cur]) {
14
- res2 += " " + cur + " ";
15
- } else {
16
- res2 += convertToVariableOrNumber(cur);
17
- }
18
- }
19
- return res2 + ")";
20
- }
21
- let res = 0;
22
- let nextOp = null;
23
- for (const cur of valuesAndOperators) {
24
- if (operators[cur]) {
25
- nextOp = operators[cur];
26
- } else {
27
- if (nextOp) {
28
- res = nextOp(res, cur);
29
- nextOp = null;
30
- } else {
31
- res = +cur;
32
- }
33
- }
34
- }
35
- return res;
36
- };
37
- const convertToVariableOrNumber = (v) => {
38
- const varOrVal = getVariableVariable(v);
39
- if (typeof varOrVal === "number") {
40
- return `${varOrVal}px`;
41
- }
42
- return varOrVal;
43
- };
44
- export {
45
- calc
46
- };
47
- //# sourceMappingURL=calc.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/calc.ts"],
4
- "sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n// unused code - not exported\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
5
- "mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,2BAA2B;AAmBpC,MAAM,YAAY;AAAA,EAChB,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AACrC;AAIO,MAAM,OAAO,IAAI,uBAA+C;AACrE,MAAI,OAAO;AACT,QAAIA,OAAM;AACV,eAAW,OAAO,oBAAoB;AACpC,UAAI,UAAU,MAAa;AAEzB,QAAAA,QAAO,MAAM,MAAM;AAAA,MACrB,OAAO;AACL,QAAAA,QAAO,0BAA0B,GAAG;AAAA,MACtC;AAAA,IACF;AACA,WAAOA,OAAM;AAAA,EACf;AAEA,MAAI,MAAM;AACV,MAAI,SAAc;AAClB,aAAW,OAAO,oBAAoB;AACpC,QAAI,UAAU,MAAa;AACzB,eAAS,UAAU;AAAA,IACrB,OAAO;AACL,UAAI,QAAQ;AACV,cAAM,OAAO,KAAK,GAAG;AACrB,iBAAS;AAAA,MACX,OAAO;AACL,cAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,4BAA4B,CAAC,MAAW;AAC5C,QAAM,WAAW,oBAAoB,CAAC;AACtC,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,GAAG;AAAA,EACZ;AACA,SAAO;AACT;",
6
- "names": ["res"]
7
- }
@@ -1,42 +0,0 @@
1
- import { getVariableValue } from "../createVariable";
2
- const getFont = (val = "$4", { fonts, theme, props }) => {
3
- var _a, _b, _c;
4
- const family = getVariableValue(props.fontFamily) || "$body";
5
- const font = fonts[family] || fonts["$body"];
6
- if (!font) {
7
- if (process.env.NODE_ENV === "development") {
8
- console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
9
- }
10
- return {};
11
- }
12
- const fontFamily = font.family;
13
- const fontSize = props.fontSize || font.size[val];
14
- const lineHeight = props.lineHeight || font.lineHeight[val];
15
- const fontWeight = props.fontWeight || font.weight[val];
16
- const letterSpacing = props.letterSpacing || font.letterSpacing[val];
17
- const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
18
- const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
19
- const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
20
- const style = {
21
- color,
22
- fontStyle,
23
- textTransform,
24
- fontFamily,
25
- fontWeight,
26
- letterSpacing,
27
- fontSize,
28
- lineHeight
29
- };
30
- if (process.env.NODE_ENV === "development") {
31
- if (props["debug"]) {
32
- console.groupCollapsed(" \u{1F539} getFont", val, props["fontWeight"], props["fow"]);
33
- console.log({ style, props, font });
34
- console.groupEnd();
35
- }
36
- }
37
- return style;
38
- };
39
- export {
40
- getFont
41
- };
42
- //# sourceMappingURL=getFont.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/getFont.tsx"],
4
- "sourcesContent": ["/* eslint-disable no-console */\nimport { getVariableValue } from '../createVariable'\nimport { FontSizeTokens, TextProps, VariantSpreadFunction } from '../types'\n\nexport const getFont: VariantSpreadFunction<TextProps, FontSizeTokens> = (\n val = '$4',\n { fonts, theme, props }\n) => {\n const family = getVariableValue(props.fontFamily) || '$body'\n const font = fonts[family] || fonts['$body']\n if (!font) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('\u26A0\uFE0F no font found', { family, fontTokens: Object.keys(fonts), val })\n }\n return {} as any\n }\n const fontFamily = font.family\n const fontSize = props.fontSize || font.size[val]\n const lineHeight = props.lineHeight || font.lineHeight[val]\n const fontWeight = props.fontWeight || font.weight[val]\n const letterSpacing = props.letterSpacing || font.letterSpacing[val]\n const fontStyle = props.fontStyle || font.style?.[val]\n const textTransform = props.textTransform || font.transform?.[val]\n const color = props.color || font.color?.[val] || theme.color\n const style = {\n color,\n fontStyle,\n textTransform,\n fontFamily,\n fontWeight,\n letterSpacing,\n fontSize,\n lineHeight,\n }\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.groupCollapsed(' \uD83D\uDD39 getFont', val, props['fontWeight'], props['fow'])\n console.log({ style, props, font })\n console.groupEnd()\n }\n }\n return style\n}\n"],
5
- "mappings": "AACA,SAAS,wBAAwB;AAG1B,MAAM,UAA4D,CACvE,MAAM,MACN,EAAE,OAAO,OAAO,MAAM,MACnB;AAPL;AAQE,QAAM,SAAS,iBAAiB,MAAM,UAAU,KAAK;AACrD,QAAM,OAAO,MAAM,WAAW,MAAM;AACpC,MAAI,CAAC,MAAM;AACT,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAQ,KAAK,8BAAoB,EAAE,QAAQ,YAAY,OAAO,KAAK,KAAK,GAAG,IAAI,CAAC;AAAA,IAClF;AACA,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAa,KAAK;AACxB,QAAM,WAAW,MAAM,YAAY,KAAK,KAAK;AAC7C,QAAM,aAAa,MAAM,cAAc,KAAK,WAAW;AACvD,QAAM,aAAa,MAAM,cAAc,KAAK,OAAO;AACnD,QAAM,gBAAgB,MAAM,iBAAiB,KAAK,cAAc;AAChE,QAAM,YAAY,MAAM,eAAa,UAAK,UAAL,mBAAa;AAClD,QAAM,gBAAgB,MAAM,mBAAiB,UAAK,cAAL,mBAAiB;AAC9D,QAAM,QAAQ,MAAM,WAAS,UAAK,UAAL,mBAAa,SAAQ,MAAM;AACxD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,MAAM,UAAU;AAClB,cAAQ,eAAe,uBAAgB,KAAK,MAAM,eAAe,MAAM,MAAM;AAC7E,cAAQ,IAAI,EAAE,OAAO,OAAO,KAAK,CAAC;AAClC,cAAQ,SAAS;AAAA,IACnB;AAAA,EACF;AACA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- import { getSize, stepTokenUpOrDown } from "./getSize";
2
- const getButtonSize = (val, { tokens }) => {
3
- if (typeof val === "number") {
4
- return {
5
- paddingHorizontal: val * 0.25,
6
- height: val,
7
- borderRadius: val * 0.2
8
- };
9
- }
10
- const ySize = getSize(val, 0);
11
- const xSize = stepTokenUpOrDown(tokens.space, val);
12
- const radiusToken = tokens.radius[val] ?? tokens.radius["$4"];
13
- return {
14
- paddingHorizontal: xSize,
15
- height: ySize,
16
- borderRadius: radiusToken
17
- };
18
- };
19
- export {
20
- getButtonSize
21
- };
22
- //# sourceMappingURL=getStackSize.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/getStackSize.ts"],
4
- "sourcesContent": ["import { SizeTokens, VariantSpreadExtras } from '../types'\nimport { getSize, stepTokenUpOrDown } from './getSize'\n\nexport type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens' | 'props' | 'fonts'>\n\nexport const getButtonSize = (val: SizeTokens | number, { tokens }: VariantSpreadExtras<any>) => {\n if (typeof val === 'number') {\n return {\n paddingHorizontal: val * 0.25,\n height: val,\n borderRadius: val * 0.2,\n }\n }\n const ySize = getSize(val, 0)\n const xSize = stepTokenUpOrDown(tokens.space, val)\n const radiusToken = tokens.radius[val] ?? tokens.radius['$4']\n return {\n paddingHorizontal: xSize,\n height: ySize,\n borderRadius: radiusToken,\n }\n}\n"],
5
- "mappings": "AACA,SAAS,SAAS,yBAAyB;AAIpC,MAAM,gBAAgB,CAAC,KAA0B,EAAE,OAAO,MAAgC;AAC/F,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;AAAA,MACL,mBAAmB,MAAM;AAAA,MACzB,QAAQ;AAAA,MACR,cAAc,MAAM;AAAA,IACtB;AAAA,EACF;AACA,QAAM,QAAQ,QAAQ,KAAK,CAAC;AAC5B,QAAM,QAAQ,kBAAkB,OAAO,OAAO,GAAG;AACjD,QAAM,cAAc,OAAO,OAAO,QAAQ,OAAO,OAAO;AACxD,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AACF;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- import { getConfig } from "../config";
2
- const getTokens = () => getConfig().tokensParsed;
3
- export {
4
- getTokens
5
- };
6
- //# sourceMappingURL=getTokens.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/getTokens.tsx"],
4
- "sourcesContent": ["import { getConfig } from '../config'\nimport { Tokens } from '../types'\n\nexport const getTokens = () => getConfig().tokensParsed as Tokens\n"],
5
- "mappings": "AAAA,SAAS,iBAAiB;AAGnB,MAAM,YAAY,MAAM,UAAU,EAAE;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- const startTransition = React.startTransition || ((cb) => cb());
3
- export {
4
- startTransition
5
- };
6
- //# sourceMappingURL=startTransition.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/helpers/startTransition.ts"],
4
- "sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAGX,MAAM,kBAAkB,MAAM,oBAAoB,CAAC,OAAO,GAAG;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=validate.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,15 +0,0 @@
1
- import { useMemo, useRef } from "react";
2
- function useConstant(fn) {
3
- if (typeof document === "undefined") {
4
- return useMemo(() => fn(), []);
5
- }
6
- const ref = useRef();
7
- if (!ref.current) {
8
- ref.current = { v: fn() };
9
- }
10
- return ref.current.v;
11
- }
12
- export {
13
- useConstant
14
- };
15
- //# sourceMappingURL=useConstant.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useConstant.tsx"],
4
- "sourcesContent": ["import { useMemo, useRef } from 'react'\n\ntype ResultBox<T> = { v: T }\n\nexport function useConstant<T>(fn: () => T): T {\n // RSC compat\n if (typeof document === 'undefined') {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => fn(), [])\n }\n\n const ref = useRef<ResultBox<T>>()\n\n if (!ref.current) {\n ref.current = { v: fn() }\n }\n\n return ref.current.v\n}\n"],
5
- "mappings": "AAAA,SAAS,SAAS,cAAc;AAIzB,SAAS,YAAe,IAAgB;AAE7C,MAAI,OAAO,aAAa,aAAa;AAEnC,WAAO,QAAQ,MAAM,GAAG,GAAG,CAAC,CAAC;AAAA,EAC/B;AAEA,QAAM,MAAM,OAAqB;AAEjC,MAAI,CAAC,IAAI,SAAS;AAChB,QAAI,UAAU,EAAE,GAAG,GAAG,EAAE;AAAA,EAC1B;AAEA,SAAO,IAAI,QAAQ;AACrB;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { useRef } from "react";
3
- function useIsMounted() {
4
- const isMounted = useRef(false);
5
- useIsomorphicLayoutEffect(() => {
6
- isMounted.current = true;
7
- return () => {
8
- isMounted.current = false;
9
- };
10
- }, []);
11
- return isMounted;
12
- }
13
- export {
14
- useIsMounted
15
- };
16
- //# sourceMappingURL=useIsMounted.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useIsMounted.ts"],
4
- "sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useRef } from 'react'\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n"],
5
- "mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,cAAc;AAEhB,SAAS,eAAe;AAC7B,QAAM,YAAY,OAAO,KAAK;AAE9B,4BAA0B,MAAM;AAC9B,cAAU,UAAU;AAEpB,WAAO,MAAM;AACX,gBAAU,UAAU;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,12 +0,0 @@
1
- var _a, _b;
2
- import { Pressable } from "react-native";
3
- const getPressable = (_b = (_a = Pressable) == null ? void 0 : _a["type"]) == null ? void 0 : _b["render"];
4
- const usePressable = (props) => {
5
- const out = getPressable(props);
6
- const { children, style, ...pressableProps } = out.props;
7
- return [pressableProps, style];
8
- };
9
- export {
10
- usePressable
11
- };
12
- //# sourceMappingURL=usePressable.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/usePressable.tsx"],
4
- "sourcesContent": ["import { Pressable, PressableProps } from 'react-native'\n\nconst getPressable = Pressable?.['type']?.['render']\n\nexport const usePressable = (props: PressableProps) => {\n const out = getPressable(props)\n const { children, style, ...pressableProps } = out.props\n return [pressableProps, style] as const\n}\n"],
5
- "mappings": "AAAA;AAAA,SAAS,iBAAiC;AAE1C,MAAM,gBAAe,4CAAY,YAAZ,mBAAsB;AAEpC,MAAM,eAAe,CAAC,UAA0B;AACrD,QAAM,MAAM,aAAa,KAAK;AAC9B,QAAM,EAAE,UAAU,UAAU,eAAe,IAAI,IAAI;AACnD,SAAO,CAAC,gBAAgB,KAAK;AAC/B;",
6
- "names": []
7
- }
@@ -1,8 +0,0 @@
1
- import { useEffect } from "react";
2
- function useUnmountEffect(callback) {
3
- return useEffect(() => () => callback(), []);
4
- }
5
- export {
6
- useUnmountEffect
7
- };
8
- //# sourceMappingURL=useUnmountEffect.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useUnmountEffect.ts"],
4
- "sourcesContent": ["import { useEffect } from 'react'\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],
5
- "mappings": "AAAA,SAAS,iBAAiB;AAEnB,SAAS,iBAAiB,UAAsB;AACrD,SAAO,UAAU,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC;AAC7C;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- const stylesheets = {};
2
- const injectStyles = ({ filePath, css }) => {
3
- let stylesheet = stylesheets[filePath];
4
- if (!stylesheet) {
5
- const styleEl = document.createElement("style");
6
- styleEl.setAttribute("data-file", filePath);
7
- styleEl.setAttribute("type", "text/css");
8
- stylesheet = stylesheets[filePath] = styleEl;
9
- document.head.appendChild(styleEl);
10
- }
11
- stylesheet.innerHTML = css;
12
- };
13
- export {
14
- injectStyles
15
- };
16
- //# sourceMappingURL=injectStyles.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/injectStyles.ts"],
4
- "sourcesContent": ["// for vite dev mode\n\nconst stylesheets: Record<string, HTMLElement> = {}\n\ninterface InjectStylesOptions {\n filePath: string\n css: string\n}\n\nexport const injectStyles = ({ filePath, css }: InjectStylesOptions) => {\n let stylesheet = stylesheets[filePath]\n if (!stylesheet) {\n const styleEl = document.createElement('style')\n styleEl.setAttribute('data-file', filePath)\n styleEl.setAttribute('type', 'text/css')\n stylesheet = stylesheets[filePath] = styleEl\n document.head.appendChild(styleEl)\n }\n stylesheet.innerHTML = css\n}\n"],
5
- "mappings": "AAEA,MAAM,cAA2C,CAAC;AAO3C,MAAM,eAAe,CAAC,EAAE,UAAU,IAAI,MAA2B;AACtE,MAAI,aAAa,YAAY;AAC7B,MAAI,CAAC,YAAY;AACf,UAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,YAAQ,aAAa,aAAa,QAAQ;AAC1C,YAAQ,aAAa,QAAQ,UAAU;AACvC,iBAAa,YAAY,YAAY;AACrC,aAAS,KAAK,YAAY,OAAO;AAAA,EACnC;AACA,aAAW,YAAY;AACzB;",
6
- "names": []
7
- }
@@ -1,3 +0,0 @@
1
- import * as ReactNative from "react-native";
2
- globalThis["_TamaguiReactNative"] = ReactNative;
3
- //# sourceMappingURL=react-native.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/react-native.ts"],
4
- "sourcesContent": ["/**\n * `@tamagui/core/react-native`\n *\n * Only import for easier React Native detection\n *\n */\n\nimport * as ReactNative from 'react-native'\nglobalThis['_TamaguiReactNative'] = ReactNative\n"],
5
- "mappings": "AAOA,YAAY,iBAAiB;AAC7B,WAAW,yBAAyB;",
6
- "names": []
7
- }
@@ -1,3 +0,0 @@
1
- import { createContext } from 'react'
2
-
3
- export const ButtonInsideButtonContext = createContext(false)
@@ -1,5 +0,0 @@
1
- import { createContext } from 'react'
2
-
3
- import { ThemeName, Themes } from '../types'
4
-
5
- export const ThemeContext = createContext<{ themes: Themes; defaultTheme: ThemeName } | null>(null)
@@ -1,9 +0,0 @@
1
- export const areEqualSets = (a: Set<string>, b: Set<string>) => {
2
- if (a.size !== b.size) return false
3
- for (const val in a) {
4
- if (!b.has(val)) {
5
- return false
6
- }
7
- }
8
- return true
9
- }
@@ -1,43 +0,0 @@
1
- import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
2
- import React, { useState } from 'react'
3
-
4
- import { useDefaultThemeName, useThemeName } from '../hooks/useTheme'
5
- import { Theme } from './Theme'
6
-
7
- export type ThemeInverseProps = {
8
- disable?: boolean
9
- }
10
-
11
- const toggleTheme = (themeName: string) => {
12
- return themeName.startsWith('light') ? 'dark' : 'light'
13
- }
14
-
15
- export const useThemeInverse = (props: ThemeInverseProps = {}) => {
16
- const themeName = useThemeName()
17
- const defaultTheme = useDefaultThemeName()
18
- const [name, setName] = useState<null | string>(null)
19
- const curName = themeName || defaultTheme || ''
20
-
21
- if (isWeb) {
22
- // for SSR must be in effect
23
- useIsomorphicLayoutEffect(() => {
24
- setName(toggleTheme(curName))
25
- }, [defaultTheme, themeName])
26
-
27
- return props.disable ? null : name
28
- }
29
-
30
- return props.disable ? null : toggleTheme(curName)
31
- }
32
-
33
- export const ThemeInverse = ({
34
- children,
35
- disable,
36
- }: ThemeInverseProps & {
37
- children: React.ReactNode
38
- }) => {
39
- const inverseTheme = useThemeInverse({
40
- disable,
41
- })
42
- return <Theme name={inverseTheme}>{children}</Theme>
43
- }