@tamagui/ui 1.93.1 → 3.0.0-beta.643.1

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 (311) hide show
  1. package/dist/cjs/index.cjs +153 -0
  2. package/dist/cjs/index.native.cjs +155 -0
  3. package/dist/cjs/index.native.js +149 -239
  4. package/dist/cjs/index.native.js.map +1 -6
  5. package/dist/esm/index.js +110 -174
  6. package/dist/esm/index.mjs +111 -55
  7. package/dist/esm/index.native.js +111 -175
  8. package/dist/jsx/index.js +110 -174
  9. package/dist/jsx/index.mjs +111 -55
  10. package/dist/jsx/index.native.cjs +155 -0
  11. package/dist/jsx/index.native.js +156 -174
  12. package/dist/jsx/index.native.js.map +1 -6
  13. package/package.json +99 -118
  14. package/src/index.ts +76 -28
  15. package/types/index.d.ts +57 -56
  16. package/types/index.d.ts.map +11 -1
  17. package/README.md +0 -1
  18. package/dist/cjs/createTamagui.js +0 -68
  19. package/dist/cjs/createTamagui.js.map +0 -6
  20. package/dist/cjs/createTamagui.native.js +0 -80
  21. package/dist/cjs/createTamagui.native.js.map +0 -6
  22. package/dist/cjs/helpers/inputHelpers.js +0 -50
  23. package/dist/cjs/helpers/inputHelpers.js.map +0 -6
  24. package/dist/cjs/helpers/inputHelpers.native.js +0 -93
  25. package/dist/cjs/helpers/inputHelpers.native.js.map +0 -6
  26. package/dist/cjs/index.js +0 -132
  27. package/dist/cjs/index.js.map +0 -6
  28. package/dist/cjs/lib/linear-gradient.native.js +0 -20
  29. package/dist/cjs/lib/linear-gradient.native.js.map +0 -6
  30. package/dist/cjs/linear-gradient.js +0 -15
  31. package/dist/cjs/linear-gradient.js.map +0 -6
  32. package/dist/cjs/linear-gradient.native.js +0 -20
  33. package/dist/cjs/linear-gradient.native.js.map +0 -6
  34. package/dist/cjs/setup.js +0 -23
  35. package/dist/cjs/setup.js.map +0 -6
  36. package/dist/cjs/setup.native.js +0 -24
  37. package/dist/cjs/setup.native.js.map +0 -6
  38. package/dist/cjs/viewTypes.js +0 -14
  39. package/dist/cjs/viewTypes.js.map +0 -6
  40. package/dist/cjs/viewTypes.native.js +0 -15
  41. package/dist/cjs/viewTypes.native.js.map +0 -6
  42. package/dist/cjs/views/Anchor.js +0 -42
  43. package/dist/cjs/views/Anchor.js.map +0 -6
  44. package/dist/cjs/views/Anchor.native.js +0 -100
  45. package/dist/cjs/views/Anchor.native.js.map +0 -6
  46. package/dist/cjs/views/EnsureFlexed.js +0 -31
  47. package/dist/cjs/views/EnsureFlexed.js.map +0 -6
  48. package/dist/cjs/views/EnsureFlexed.native.js +0 -35
  49. package/dist/cjs/views/EnsureFlexed.native.js.map +0 -6
  50. package/dist/cjs/views/Fieldset.js +0 -33
  51. package/dist/cjs/views/Fieldset.js.map +0 -6
  52. package/dist/cjs/views/Fieldset.native.js +0 -37
  53. package/dist/cjs/views/Fieldset.native.js.map +0 -6
  54. package/dist/cjs/views/Input.js +0 -95
  55. package/dist/cjs/views/Input.js.map +0 -6
  56. package/dist/cjs/views/Input.native.js +0 -146
  57. package/dist/cjs/views/Input.native.js.map +0 -6
  58. package/dist/cjs/views/Skeleton.js +0 -1
  59. package/dist/cjs/views/Skeleton.js.map +0 -6
  60. package/dist/cjs/views/Skeleton.native.js +0 -2
  61. package/dist/cjs/views/Skeleton.native.js.map +0 -6
  62. package/dist/cjs/views/Spinner.js +0 -41
  63. package/dist/cjs/views/Spinner.js.map +0 -6
  64. package/dist/cjs/views/Spinner.native.js +0 -103
  65. package/dist/cjs/views/Spinner.native.js.map +0 -6
  66. package/dist/cjs/views/TamaguiProvider.js +0 -22
  67. package/dist/cjs/views/TamaguiProvider.js.map +0 -6
  68. package/dist/cjs/views/TamaguiProvider.native.js +0 -90
  69. package/dist/cjs/views/TamaguiProvider.native.js.map +0 -6
  70. package/dist/cjs/views/TamaguiProvider.server.js +0 -22
  71. package/dist/cjs/views/TamaguiProvider.server.js.map +0 -6
  72. package/dist/cjs/views/TamaguiProvider.server.native.js +0 -26
  73. package/dist/cjs/views/TamaguiProvider.server.native.js.map +0 -6
  74. package/dist/cjs/views/Text.js +0 -33
  75. package/dist/cjs/views/Text.js.map +0 -6
  76. package/dist/cjs/views/Text.native.js +0 -37
  77. package/dist/cjs/views/Text.native.js.map +0 -6
  78. package/dist/cjs/views/TextArea.js +0 -50
  79. package/dist/cjs/views/TextArea.js.map +0 -6
  80. package/dist/cjs/views/TextArea.native.js +0 -85
  81. package/dist/cjs/views/TextArea.native.js.map +0 -6
  82. package/dist/cjs/views/VisuallyHidden.js +0 -53
  83. package/dist/cjs/views/VisuallyHidden.js.map +0 -6
  84. package/dist/cjs/views/VisuallyHidden.native.js +0 -57
  85. package/dist/cjs/views/VisuallyHidden.native.js.map +0 -6
  86. package/dist/esm/createTamagui.js +0 -52
  87. package/dist/esm/createTamagui.js.map +0 -6
  88. package/dist/esm/createTamagui.mjs +0 -45
  89. package/dist/esm/createTamagui.native.js +0 -60
  90. package/dist/esm/createTamagui.native.js.map +0 -6
  91. package/dist/esm/helpers/inputHelpers.js +0 -37
  92. package/dist/esm/helpers/inputHelpers.js.map +0 -6
  93. package/dist/esm/helpers/inputHelpers.mjs +0 -43
  94. package/dist/esm/helpers/inputHelpers.native.js +0 -74
  95. package/dist/esm/helpers/inputHelpers.native.js.map +0 -6
  96. package/dist/esm/index.js.map +0 -6
  97. package/dist/esm/index.native.js.map +0 -6
  98. package/dist/esm/lib/linear-gradient.native.js +0 -2
  99. package/dist/esm/lib/linear-gradient.native.js.map +0 -6
  100. package/dist/esm/linear-gradient.js +0 -2
  101. package/dist/esm/linear-gradient.js.map +0 -6
  102. package/dist/esm/linear-gradient.mjs +0 -1
  103. package/dist/esm/linear-gradient.native.js +0 -2
  104. package/dist/esm/linear-gradient.native.js.map +0 -6
  105. package/dist/esm/setup.js +0 -5
  106. package/dist/esm/setup.js.map +0 -6
  107. package/dist/esm/setup.mjs +0 -3
  108. package/dist/esm/setup.native.js +0 -6
  109. package/dist/esm/setup.native.js.map +0 -6
  110. package/dist/esm/viewTypes.js +0 -1
  111. package/dist/esm/viewTypes.js.map +0 -6
  112. package/dist/esm/viewTypes.mjs +0 -0
  113. package/dist/esm/viewTypes.native.js +0 -1
  114. package/dist/esm/viewTypes.native.js.map +0 -6
  115. package/dist/esm/views/Anchor.js +0 -30
  116. package/dist/esm/views/Anchor.js.map +0 -6
  117. package/dist/esm/views/Anchor.mjs +0 -27
  118. package/dist/esm/views/Anchor.native.js +0 -83
  119. package/dist/esm/views/Anchor.native.js.map +0 -6
  120. package/dist/esm/views/EnsureFlexed.js +0 -15
  121. package/dist/esm/views/EnsureFlexed.js.map +0 -6
  122. package/dist/esm/views/EnsureFlexed.mjs +0 -12
  123. package/dist/esm/views/EnsureFlexed.native.js +0 -15
  124. package/dist/esm/views/EnsureFlexed.native.js.map +0 -6
  125. package/dist/esm/views/Fieldset.js +0 -18
  126. package/dist/esm/views/Fieldset.js.map +0 -6
  127. package/dist/esm/views/Fieldset.mjs +0 -15
  128. package/dist/esm/views/Fieldset.native.js +0 -18
  129. package/dist/esm/views/Fieldset.native.js.map +0 -6
  130. package/dist/esm/views/Input.js +0 -85
  131. package/dist/esm/views/Input.js.map +0 -6
  132. package/dist/esm/views/Input.mjs +0 -87
  133. package/dist/esm/views/Input.native.js +0 -128
  134. package/dist/esm/views/Input.native.js.map +0 -6
  135. package/dist/esm/views/Skeleton.js +0 -1
  136. package/dist/esm/views/Skeleton.js.map +0 -6
  137. package/dist/esm/views/Skeleton.mjs +0 -0
  138. package/dist/esm/views/Skeleton.native.js +0 -1
  139. package/dist/esm/views/Skeleton.native.js.map +0 -6
  140. package/dist/esm/views/Spinner.js +0 -21
  141. package/dist/esm/views/Spinner.js.map +0 -6
  142. package/dist/esm/views/Spinner.mjs +0 -25
  143. package/dist/esm/views/Spinner.native.js +0 -78
  144. package/dist/esm/views/Spinner.native.js.map +0 -6
  145. package/dist/esm/views/TamaguiProvider.js +0 -8
  146. package/dist/esm/views/TamaguiProvider.js.map +0 -6
  147. package/dist/esm/views/TamaguiProvider.mjs +0 -14
  148. package/dist/esm/views/TamaguiProvider.native.js +0 -71
  149. package/dist/esm/views/TamaguiProvider.native.js.map +0 -6
  150. package/dist/esm/views/TamaguiProvider.server.js +0 -6
  151. package/dist/esm/views/TamaguiProvider.server.js.map +0 -6
  152. package/dist/esm/views/TamaguiProvider.server.mjs +0 -3
  153. package/dist/esm/views/TamaguiProvider.server.native.js +0 -6
  154. package/dist/esm/views/TamaguiProvider.server.native.js.map +0 -6
  155. package/dist/esm/views/Text.js +0 -17
  156. package/dist/esm/views/Text.js.map +0 -6
  157. package/dist/esm/views/Text.mjs +0 -14
  158. package/dist/esm/views/Text.native.js +0 -17
  159. package/dist/esm/views/Text.native.js.map +0 -6
  160. package/dist/esm/views/TextArea.js +0 -40
  161. package/dist/esm/views/TextArea.js.map +0 -6
  162. package/dist/esm/views/TextArea.mjs +0 -40
  163. package/dist/esm/views/TextArea.native.js +0 -69
  164. package/dist/esm/views/TextArea.native.js.map +0 -6
  165. package/dist/esm/views/VisuallyHidden.js +0 -37
  166. package/dist/esm/views/VisuallyHidden.js.map +0 -6
  167. package/dist/esm/views/VisuallyHidden.mjs +0 -34
  168. package/dist/esm/views/VisuallyHidden.native.js +0 -37
  169. package/dist/esm/views/VisuallyHidden.native.js.map +0 -6
  170. package/dist/jsx/createTamagui.js +0 -52
  171. package/dist/jsx/createTamagui.js.map +0 -6
  172. package/dist/jsx/createTamagui.mjs +0 -45
  173. package/dist/jsx/createTamagui.native.js +0 -60
  174. package/dist/jsx/createTamagui.native.js.map +0 -6
  175. package/dist/jsx/helpers/inputHelpers.js +0 -37
  176. package/dist/jsx/helpers/inputHelpers.js.map +0 -6
  177. package/dist/jsx/helpers/inputHelpers.mjs +0 -43
  178. package/dist/jsx/helpers/inputHelpers.native.js +0 -74
  179. package/dist/jsx/helpers/inputHelpers.native.js.map +0 -6
  180. package/dist/jsx/index.js.map +0 -6
  181. package/dist/jsx/lib/linear-gradient.native.js +0 -2
  182. package/dist/jsx/lib/linear-gradient.native.js.map +0 -6
  183. package/dist/jsx/linear-gradient.js +0 -2
  184. package/dist/jsx/linear-gradient.js.map +0 -6
  185. package/dist/jsx/linear-gradient.mjs +0 -1
  186. package/dist/jsx/linear-gradient.native.js +0 -2
  187. package/dist/jsx/linear-gradient.native.js.map +0 -6
  188. package/dist/jsx/setup.js +0 -5
  189. package/dist/jsx/setup.js.map +0 -6
  190. package/dist/jsx/setup.mjs +0 -3
  191. package/dist/jsx/setup.native.js +0 -6
  192. package/dist/jsx/setup.native.js.map +0 -6
  193. package/dist/jsx/viewTypes.js +0 -1
  194. package/dist/jsx/viewTypes.js.map +0 -6
  195. package/dist/jsx/viewTypes.mjs +0 -0
  196. package/dist/jsx/viewTypes.native.js +0 -1
  197. package/dist/jsx/viewTypes.native.js.map +0 -6
  198. package/dist/jsx/views/Anchor.js +0 -30
  199. package/dist/jsx/views/Anchor.js.map +0 -6
  200. package/dist/jsx/views/Anchor.mjs +0 -27
  201. package/dist/jsx/views/Anchor.native.js +0 -83
  202. package/dist/jsx/views/Anchor.native.js.map +0 -6
  203. package/dist/jsx/views/EnsureFlexed.js +0 -15
  204. package/dist/jsx/views/EnsureFlexed.js.map +0 -6
  205. package/dist/jsx/views/EnsureFlexed.mjs +0 -12
  206. package/dist/jsx/views/EnsureFlexed.native.js +0 -15
  207. package/dist/jsx/views/EnsureFlexed.native.js.map +0 -6
  208. package/dist/jsx/views/Fieldset.js +0 -18
  209. package/dist/jsx/views/Fieldset.js.map +0 -6
  210. package/dist/jsx/views/Fieldset.mjs +0 -15
  211. package/dist/jsx/views/Fieldset.native.js +0 -18
  212. package/dist/jsx/views/Fieldset.native.js.map +0 -6
  213. package/dist/jsx/views/Input.js +0 -85
  214. package/dist/jsx/views/Input.js.map +0 -6
  215. package/dist/jsx/views/Input.mjs +0 -87
  216. package/dist/jsx/views/Input.native.js +0 -128
  217. package/dist/jsx/views/Input.native.js.map +0 -6
  218. package/dist/jsx/views/Skeleton.js +0 -1
  219. package/dist/jsx/views/Skeleton.js.map +0 -6
  220. package/dist/jsx/views/Skeleton.mjs +0 -0
  221. package/dist/jsx/views/Skeleton.native.js +0 -1
  222. package/dist/jsx/views/Skeleton.native.js.map +0 -6
  223. package/dist/jsx/views/Spinner.js +0 -21
  224. package/dist/jsx/views/Spinner.js.map +0 -6
  225. package/dist/jsx/views/Spinner.mjs +0 -25
  226. package/dist/jsx/views/Spinner.native.js +0 -78
  227. package/dist/jsx/views/Spinner.native.js.map +0 -6
  228. package/dist/jsx/views/TamaguiProvider.js +0 -8
  229. package/dist/jsx/views/TamaguiProvider.js.map +0 -6
  230. package/dist/jsx/views/TamaguiProvider.mjs +0 -14
  231. package/dist/jsx/views/TamaguiProvider.native.js +0 -71
  232. package/dist/jsx/views/TamaguiProvider.native.js.map +0 -6
  233. package/dist/jsx/views/TamaguiProvider.server.js +0 -6
  234. package/dist/jsx/views/TamaguiProvider.server.js.map +0 -6
  235. package/dist/jsx/views/TamaguiProvider.server.mjs +0 -3
  236. package/dist/jsx/views/TamaguiProvider.server.native.js +0 -6
  237. package/dist/jsx/views/TamaguiProvider.server.native.js.map +0 -6
  238. package/dist/jsx/views/Text.js +0 -17
  239. package/dist/jsx/views/Text.js.map +0 -6
  240. package/dist/jsx/views/Text.mjs +0 -14
  241. package/dist/jsx/views/Text.native.js +0 -17
  242. package/dist/jsx/views/Text.native.js.map +0 -6
  243. package/dist/jsx/views/TextArea.js +0 -40
  244. package/dist/jsx/views/TextArea.js.map +0 -6
  245. package/dist/jsx/views/TextArea.mjs +0 -40
  246. package/dist/jsx/views/TextArea.native.js +0 -69
  247. package/dist/jsx/views/TextArea.native.js.map +0 -6
  248. package/dist/jsx/views/VisuallyHidden.js +0 -37
  249. package/dist/jsx/views/VisuallyHidden.js.map +0 -6
  250. package/dist/jsx/views/VisuallyHidden.mjs +0 -34
  251. package/dist/jsx/views/VisuallyHidden.native.js +0 -37
  252. package/dist/jsx/views/VisuallyHidden.native.js.map +0 -6
  253. package/dist/native.js +0 -39310
  254. package/dist/native.js.map +0 -6
  255. package/dist/test.native.js +0 -38173
  256. package/dist/test.native.js.map +0 -6
  257. package/linear-gradient/index.d.ts +0 -1
  258. package/linear-gradient/index.js +0 -1
  259. package/native.d.ts +0 -1
  260. package/native.js +0 -1
  261. package/src/createTamagui.ts +0 -72
  262. package/src/helpers/inputHelpers.tsx +0 -56
  263. package/src/lib/linear-gradient.native.ts +0 -1
  264. package/src/linear-gradient.ts +0 -1
  265. package/src/setup.ts +0 -12
  266. package/src/viewTypes.tsx +0 -50
  267. package/src/views/Anchor.tsx +0 -43
  268. package/src/views/EnsureFlexed.tsx +0 -16
  269. package/src/views/Fieldset.tsx +0 -19
  270. package/src/views/Input.tsx +0 -135
  271. package/src/views/Skeleton.tsx +0 -39
  272. package/src/views/Spinner.tsx +0 -34
  273. package/src/views/TamaguiProvider.server.tsx +0 -3
  274. package/src/views/TamaguiProvider.tsx +0 -11
  275. package/src/views/Text.tsx +0 -15
  276. package/src/views/TextArea.tsx +0 -68
  277. package/src/views/VisuallyHidden.tsx +0 -38
  278. package/types/createTamagui.d.ts +0 -6
  279. package/types/createTamagui.d.ts.map +0 -1
  280. package/types/helpers/inputHelpers.d.ts +0 -4
  281. package/types/helpers/inputHelpers.d.ts.map +0 -1
  282. package/types/lib/linear-gradient.native.d.ts +0 -2
  283. package/types/lib/linear-gradient.native.d.ts.map +0 -1
  284. package/types/linear-gradient.d.ts +0 -2
  285. package/types/linear-gradient.d.ts.map +0 -1
  286. package/types/setup.d.ts +0 -2
  287. package/types/setup.d.ts.map +0 -1
  288. package/types/viewTypes.d.ts +0 -43
  289. package/types/viewTypes.d.ts.map +0 -1
  290. package/types/views/Anchor.d.ts +0 -15
  291. package/types/views/Anchor.d.ts.map +0 -1
  292. package/types/views/EnsureFlexed.d.ts +0 -2
  293. package/types/views/EnsureFlexed.d.ts.map +0 -1
  294. package/types/views/Fieldset.d.ts +0 -14
  295. package/types/views/Fieldset.d.ts.map +0 -1
  296. package/types/views/Input.d.ts +0 -689
  297. package/types/views/Input.d.ts.map +0 -1
  298. package/types/views/Skeleton.d.ts +0 -1
  299. package/types/views/Skeleton.d.ts.map +0 -1
  300. package/types/views/Spinner.d.ts +0 -9
  301. package/types/views/Spinner.d.ts.map +0 -1
  302. package/types/views/TamaguiProvider.d.ts +0 -3
  303. package/types/views/TamaguiProvider.d.ts.map +0 -1
  304. package/types/views/TamaguiProvider.server.d.ts +0 -3
  305. package/types/views/TamaguiProvider.server.d.ts.map +0 -1
  306. package/types/views/Text.d.ts +0 -4
  307. package/types/views/Text.d.ts.map +0 -1
  308. package/types/views/TextArea.d.ts +0 -41
  309. package/types/views/TextArea.d.ts.map +0 -1
  310. package/types/views/VisuallyHidden.d.ts +0 -5
  311. package/types/views/VisuallyHidden.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- export * from '../types/linear-gradient'
@@ -1 +0,0 @@
1
- export * from '../dist/esm/linear-gradient'
package/native.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './types'
package/native.js DELETED
@@ -1 +0,0 @@
1
- Object.assign(module.exports, require('./dist/native'))
@@ -1,72 +0,0 @@
1
- import { createTamagui as createTamaguiCore } from '@tamagui/core'
2
-
3
- /**
4
- * Adds some helpful validation at dev time only for `tamagui` specifically
5
- **/
6
-
7
- export const createTamagui: typeof createTamaguiCore =
8
- process.env.NODE_ENV !== 'development'
9
- ? createTamaguiCore
10
- : (conf) => {
11
- const sizeTokenKeys = ['$true']
12
-
13
- const hasKeys = (expectedKeys: string[], obj: Record<any, any>) => {
14
- return expectedKeys.every((k) => typeof obj[k] !== 'undefined')
15
- }
16
-
17
- const tamaguiConfig = createTamaguiCore(conf)
18
-
19
- // size and space should be fully defined
20
- for (const name of ['size', 'space'] as const) {
21
- const tokenSet = tamaguiConfig.tokensParsed[name]
22
- if (!tokenSet) {
23
- throw new Error(
24
- `Expected tokens for "${name}" in ${Object.keys(
25
- tamaguiConfig.tokensParsed
26
- ).join(', ')}`
27
- )
28
- }
29
- if (!hasKeys(sizeTokenKeys, tokenSet)) {
30
- throw new Error(`
31
- createTamagui() missing expected tokens.${name}:
32
-
33
- Received: ${Object.keys(tokenSet).join(', ')}
34
-
35
- Expected: ${sizeTokenKeys.join(', ')}
36
-
37
- Tamagui expects a "true" key that is the same value as your default size. This is so
38
- it can size things up or down from the defaults without assuming which keys you use.
39
-
40
- Please define a "true" or "$true" key on your size and space tokens like so (example):
41
-
42
- size: {
43
- sm: 2,
44
- md: 10,
45
- true: 10, // this means "md" is your default size
46
- lg: 20,
47
- }
48
-
49
- `)
50
- }
51
- }
52
-
53
- // others must define subset of size tokens
54
- const expected = Object.keys(tamaguiConfig.tokensParsed.size)
55
- for (const name of ['radius', 'zIndex'] as const) {
56
- const tokenSet = tamaguiConfig.tokensParsed[name]
57
- const received = Object.keys(tokenSet)
58
- const hasSomeOverlap = received.some((rk) => expected.includes(rk))
59
- if (!hasSomeOverlap) {
60
- throw new Error(`
61
- createTamagui() invalid tokens.${name}:
62
-
63
- Received: ${received.join(', ')}
64
-
65
- Expected a subset of: ${expected.join(', ')}
66
-
67
- `)
68
- }
69
- }
70
-
71
- return tamaguiConfig
72
- }
@@ -1,56 +0,0 @@
1
- import type { SizeVariantSpreadFunction } from '@tamagui/core'
2
- import { getVariableValue, isWeb } from '@tamagui/core'
3
- import { getButtonSized } from '@tamagui/get-button-sized'
4
- import { getFontSized } from '@tamagui/get-font-sized'
5
- import { getSpace } from '@tamagui/get-token'
6
-
7
- export const inputSizeVariant: SizeVariantSpreadFunction<any> = (
8
- val = '$true',
9
- extras
10
- ) => {
11
- if (extras.props.multiline || extras.props.numberOfLines > 1) {
12
- return textAreaSizeVariant(val, extras)
13
- }
14
- const buttonStyles = getButtonSized(val, extras)
15
- const paddingHorizontal = getSpace(val, {
16
- shift: -1,
17
- bounds: [2],
18
- })
19
- const fontStyle = getFontSized(val as any, extras)
20
- // lineHeight messes up input on native
21
- if (!isWeb && fontStyle) {
22
- delete fontStyle['lineHeight']
23
- }
24
- return {
25
- ...fontStyle,
26
- ...buttonStyles,
27
- paddingHorizontal,
28
- }
29
- }
30
-
31
- export const textAreaSizeVariant: SizeVariantSpreadFunction<any> = (
32
- val = '$true',
33
- extras
34
- ) => {
35
- const { props } = extras
36
- const buttonStyles = getButtonSized(val, extras)
37
- const fontStyle = getFontSized(val as any, extras)!
38
- const lines = props.rows ?? props.numberOfLines
39
- const height =
40
- typeof lines === 'number' ? lines * getVariableValue(fontStyle.lineHeight) : 'auto'
41
- const paddingVertical = getSpace(val, {
42
- shift: -2,
43
- bounds: [2],
44
- })
45
- const paddingHorizontal = getSpace(val, {
46
- shift: -1,
47
- bounds: [2],
48
- })
49
- return {
50
- ...buttonStyles,
51
- ...fontStyle,
52
- paddingVertical,
53
- paddingHorizontal,
54
- height,
55
- }
56
- }
@@ -1 +0,0 @@
1
- export * from 'expo-linear-gradient'
@@ -1 +0,0 @@
1
- export * from '@tamagui/linear-gradient'
package/src/setup.ts DELETED
@@ -1,12 +0,0 @@
1
- import '@tamagui/polyfill-dev'
2
-
3
- import * as React from 'react'
4
-
5
- // this fixes various issues people run into (storybook, etc in discord)
6
- // React doesn't really tree shake so not much danger here...
7
- globalThis['React'] ||= React
8
-
9
- // for SSR
10
- if (typeof requestAnimationFrame === 'undefined') {
11
- globalThis['requestAnimationFrame'] = setImmediate
12
- }
package/src/viewTypes.tsx DELETED
@@ -1,50 +0,0 @@
1
- import type { TextStyle, ViewStyle } from 'react-native'
2
-
3
- export type ShorthandViewStyleProps = {
4
- w?: ViewStyle['width']
5
- h?: ViewStyle['height']
6
-
7
- p?: ViewStyle['padding']
8
- pt?: ViewStyle['paddingTop']
9
- pb?: ViewStyle['paddingBottom']
10
- pl?: ViewStyle['paddingLeft']
11
- pr?: ViewStyle['paddingRight']
12
- px?: ViewStyle['paddingHorizontal']
13
- py?: ViewStyle['paddingVertical']
14
- m?: ViewStyle['margin']
15
- mt?: ViewStyle['marginTop']
16
- mb?: ViewStyle['marginBottom']
17
- ml?: ViewStyle['marginLeft']
18
- mr?: ViewStyle['marginRight']
19
- mx?: ViewStyle['marginHorizontal']
20
- my?: ViewStyle['marginVertical']
21
-
22
- f?: ViewStyle['flex']
23
- fd?: ViewStyle['flexDirection']
24
- fw?: ViewStyle['flexWrap']
25
- fg?: ViewStyle['flexGrow']
26
- fs?: ViewStyle['flexShrink']
27
- fb?: ViewStyle['flexBasis']
28
-
29
- ai?: ViewStyle['alignItems']
30
- ac?: ViewStyle['alignContent']
31
- jc?: ViewStyle['justifyContent']
32
- als?: ViewStyle['alignSelf']
33
-
34
- bc?: ViewStyle['backgroundColor']
35
-
36
- br?: ViewStyle['borderRadius']
37
- btrr?: ViewStyle['borderTopRightRadius']
38
- bbrr?: ViewStyle['borderBottomRightRadius']
39
- bblr?: ViewStyle['borderBottomLeftRadius']
40
- btlr?: ViewStyle['borderTopLeftRadius']
41
-
42
- pe?: 'box-none' | 'none' | 'box-only' | 'auto'
43
- zi?: ViewStyle['zIndex']
44
- }
45
-
46
- export type ShorthandTextStyleProps = ShorthandViewStyleProps & {
47
- ta?: TextStyle['textAlign']
48
- fs?: TextStyle['fontSize']
49
- lh?: TextStyle['lineHeight']
50
- }
@@ -1,43 +0,0 @@
1
- import { isWeb } from '@tamagui/constants'
2
- import { styled } from '@tamagui/core'
3
- import type { SizableTextProps } from '@tamagui/text'
4
- import { SizableText } from '@tamagui/text'
5
- import { Linking } from 'react-native'
6
-
7
- export interface AnchorExtraProps {
8
- href?: string
9
- target?: string
10
- rel?: string
11
- }
12
-
13
- export type AnchorProps = SizableTextProps & AnchorExtraProps
14
-
15
- const AnchorFrame = styled(SizableText, {
16
- name: 'Anchor',
17
- tag: 'a',
18
- accessibilityRole: 'link',
19
- })
20
-
21
- export const Anchor = AnchorFrame.styleable<AnchorExtraProps>(
22
- ({ href, target, ...props }, ref) => {
23
- return (
24
- <AnchorFrame
25
- {...props}
26
- {...(isWeb
27
- ? {
28
- href,
29
- target,
30
- }
31
- : {
32
- onPress: (event) => {
33
- props.onPress?.(event)
34
- if (href !== undefined) {
35
- Linking.openURL(href)
36
- }
37
- },
38
- })}
39
- ref={ref as any}
40
- />
41
- )
42
- }
43
- )
@@ -1,16 +0,0 @@
1
- import { Text, styled } from '@tamagui/core'
2
-
3
- // expands flex elements when they should push a far as they "want" naturally
4
-
5
- export const EnsureFlexed = styled(Text, {
6
- opacity: 0,
7
- lineHeight: 0,
8
- height: 0,
9
- display: 'flex',
10
- fontSize: 200,
11
- children: 'wwwwwwwwwwwwwwwwwww',
12
- pointerEvents: 'none',
13
- })
14
-
15
- // @tamgui/core checks for this in spacing
16
- EnsureFlexed['isVisuallyHidden'] = true
@@ -1,19 +0,0 @@
1
- import type { GetProps } from '@tamagui/core'
2
- import { styled } from '@tamagui/core'
3
- import { YStack } from '@tamagui/stacks'
4
-
5
- export const Fieldset = styled(YStack, {
6
- name: 'Fieldset',
7
- tag: 'fieldset',
8
-
9
- variants: {
10
- horizontal: {
11
- true: {
12
- flexDirection: 'row',
13
- alignItems: 'center',
14
- },
15
- },
16
- } as const,
17
- })
18
-
19
- export type FieldsetProps = GetProps<typeof Fieldset>
@@ -1,135 +0,0 @@
1
- import { isWeb } from '@tamagui/constants'
2
- import type { GetProps } from '@tamagui/core'
3
- import { styled, useComposedRefs, useTheme } from '@tamagui/core'
4
- import { registerFocusable, useFocusable } from '@tamagui/focusable'
5
- import { TextInput } from 'react-native'
6
-
7
- import { inputSizeVariant } from '../helpers/inputHelpers'
8
- import { useEffect, useRef } from 'react'
9
-
10
- export const defaultStyles = {
11
- size: '$true',
12
- fontFamily: '$body',
13
- borderWidth: 1,
14
- outlineWidth: 0,
15
- color: '$color',
16
-
17
- ...(isWeb
18
- ? {
19
- tabIndex: 0,
20
- }
21
- : {
22
- focusable: true,
23
- }),
24
-
25
- borderColor: '$borderColor',
26
- backgroundColor: '$background',
27
-
28
- // this fixes a flex bug where it overflows container
29
- minWidth: 0,
30
-
31
- hoverStyle: {
32
- borderColor: '$borderColorHover',
33
- },
34
-
35
- focusStyle: {
36
- borderColor: '$borderColorFocus',
37
- },
38
-
39
- focusVisibleStyle: {
40
- outlineColor: '$outlineColor',
41
- outlineWidth: 2,
42
- outlineStyle: 'solid',
43
- },
44
- } as const
45
-
46
- export const InputFrame = styled(
47
- TextInput,
48
- {
49
- name: 'Input',
50
-
51
- variants: {
52
- unstyled: {
53
- false: defaultStyles,
54
- },
55
-
56
- size: {
57
- '...size': inputSizeVariant,
58
- },
59
-
60
- disabled: {
61
- true: {},
62
- },
63
- } as const,
64
-
65
- defaultVariants: {
66
- unstyled: process.env.TAMAGUI_HEADLESS === '1' ? true : false,
67
- },
68
- },
69
- {
70
- isInput: true,
71
-
72
- accept: {
73
- placeholderTextColor: 'color',
74
- selectionColor: 'color',
75
- } as const,
76
- }
77
- )
78
-
79
- // const x = <InputFrame selectionColor="" />
80
-
81
- export type Input = TextInput
82
-
83
- export type InputFrameProps = GetProps<typeof InputFrame>
84
-
85
- export type InputExtraProps = {
86
- rows?: number
87
- }
88
-
89
- export type InputProps = InputFrameProps & InputExtraProps
90
-
91
- export const Input = InputFrame.styleable<InputExtraProps>((propsIn, forwardedRef) => {
92
- const ref = useRef<Input>(null)
93
- const composedRefs = useComposedRefs(forwardedRef, ref)
94
- const props = useInputProps(propsIn, composedRefs)
95
-
96
- if (process.env.TAMAGUI_TARGET === 'native') {
97
- useEffect(() => {
98
- if (!props.id) return
99
- if (props.disabled) return
100
-
101
- return registerFocusable(props.id, {
102
- focusAndSelect: () => {
103
- ref.current?.focus()
104
- },
105
- focus: () => {},
106
- })
107
- }, [props.id, props.disabled])
108
- }
109
-
110
- return <InputFrame {...props} />
111
- })
112
-
113
- export function useInputProps(props: InputProps, ref: any) {
114
- const theme = useTheme()
115
- const { onChangeText, ref: combinedRef } = useFocusable({
116
- // @ts-ignore
117
- props,
118
- ref,
119
- isInput: true,
120
- })
121
-
122
- const placeholderColorProp = props.placeholderTextColor
123
- const placeholderTextColor =
124
- theme[placeholderColorProp as any]?.get() ??
125
- placeholderColorProp ??
126
- theme.placeholderColor?.get()
127
-
128
- return {
129
- ref: combinedRef,
130
- readOnly: props.disabled,
131
- ...props,
132
- placeholderTextColor,
133
- onChangeText,
134
- }
135
- }
@@ -1,39 +0,0 @@
1
- // import { GetProps, TamaguiElement, styled } from '@tamagui/core'
2
- // import { LinearGradient, LinearGradientProps } from '@tamagui/linear-gradient'
3
- // import { YStack } from '@tamagui/stacks'
4
- // import { forwardRef } from 'react'
5
-
6
- // import { VisuallyHidden } from './VisuallyHidden'
7
-
8
- // export const SkeletonFrame = styled(YStack, {
9
- // name: 'Skeleton',
10
- // backgroundColor: '$backgroundHover',
11
- // overflow: 'hidden',
12
- // position: 'relative',
13
- // })
14
-
15
- // export type SkeletonProps = GetProps<typeof SkeletonFrame>
16
-
17
- // export const Skeleton = SkeletonFrame.extractable(
18
- // forwardRef<TamaguiElement>(({ children, ...props }: SkeletonProps, ref) => {
19
- // return (
20
- // <SkeletonFrame ref={ref} {...props}>
21
- // <SkeletonShine />
22
- // <VisuallyHidden preserveDimensions>{children}</VisuallyHidden>
23
- // </SkeletonFrame>
24
- // )
25
- // })
26
- // )
27
-
28
- // export const SkeletonShine = (props: LinearGradientProps) => {
29
- // return (
30
- // <LinearGradient
31
- // position="absolute"
32
- // top={0}
33
- // bottom={0}
34
- // width="25%"
35
- // colors={['$background', '$color']}
36
- // {...props}
37
- // />
38
- // )
39
- // }
@@ -1,34 +0,0 @@
1
- import type { ColorTokens, TamaguiElement, ThemeTokens } from '@tamagui/core'
2
- import { themeable, useTheme, variableToString } from '@tamagui/core'
3
- import type { YStackProps } from '@tamagui/stacks'
4
- import { YStack } from '@tamagui/stacks'
5
- import * as React from 'react'
6
- import { ActivityIndicator } from 'react-native'
7
-
8
- export type SpinnerProps = Omit<YStackProps, 'children'> & {
9
- size?: 'small' | 'large'
10
- color?: (ColorTokens | ThemeTokens | (string & {})) | null
11
- }
12
-
13
- export const Spinner: React.ForwardRefExoticComponent<
14
- SpinnerProps & React.RefAttributes<any>
15
- > = YStack.extractable(
16
- themeable(
17
- React.forwardRef<TamaguiElement>((props: SpinnerProps, ref) => {
18
- const { size, color: colorProp, ...stackProps } = props
19
- const theme = useTheme()
20
- let color = colorProp as string
21
- if (color && color[0] === '$') {
22
- color = variableToString(theme[color])
23
- }
24
- return (
25
- <YStack ref={ref} {...stackProps}>
26
- <ActivityIndicator size={size} color={color} />
27
- </YStack>
28
- )
29
- }),
30
- {
31
- componentName: 'Spinner',
32
- }
33
- )
34
- ) as any
@@ -1,3 +0,0 @@
1
- import { TamaguiProvider as OGProvider } from '@tamagui/core'
2
-
3
- export const TamaguiProvider = OGProvider
@@ -1,11 +0,0 @@
1
- import type { TamaguiProviderProps } from '@tamagui/core'
2
- import { TamaguiProvider as OGProvider } from '@tamagui/core'
3
- import { PortalProvider } from '@tamagui/portal'
4
-
5
- export const TamaguiProvider = ({ children, ...props }: TamaguiProviderProps) => {
6
- return (
7
- <OGProvider {...props}>
8
- <PortalProvider shouldAddRootHost>{children}</PortalProvider>
9
- </OGProvider>
10
- )
11
- }
@@ -1,15 +0,0 @@
1
- import { Text as TamaguiText, styled } from '@tamagui/core'
2
-
3
- export const Text = styled(TamaguiText, {
4
- variants: {
5
- unstyled: {
6
- false: {
7
- color: '$color',
8
- },
9
- },
10
- },
11
-
12
- defaultVariants: {
13
- unstyled: process.env.TAMAGUI_HEADLESS === '1' ? true : false,
14
- },
15
- })
@@ -1,68 +0,0 @@
1
- import { isWeb } from '@tamagui/constants'
2
- import { styled, useComposedRefs } from '@tamagui/core'
3
-
4
- import { textAreaSizeVariant } from '../helpers/inputHelpers'
5
- import type { Input, InputExtraProps, InputProps } from './Input'
6
- import { InputFrame, defaultStyles, useInputProps } from './Input'
7
- import { registerFocusable } from '@tamagui/focusable'
8
- import { useEffect, useRef } from 'react'
9
-
10
- /**
11
- * Is basically Input but with rows = 4 to start
12
- */
13
-
14
- export const TextAreaFrame = styled(InputFrame, {
15
- name: 'TextArea',
16
- multiline: true,
17
- // this attribute fixes firefox newline issue
18
- whiteSpace: 'pre-wrap',
19
-
20
- variants: {
21
- unstyled: {
22
- false: {
23
- height: 'auto',
24
- ...defaultStyles,
25
- },
26
- },
27
-
28
- size: {
29
- '...size': textAreaSizeVariant,
30
- },
31
- } as const,
32
-
33
- defaultVariants: {
34
- unstyled: process.env.TAMAGUI_HEADLESS === '1' ? true : false,
35
- },
36
- })
37
-
38
- export type TextAreaProps = InputProps
39
-
40
- export const TextArea = TextAreaFrame.styleable<InputExtraProps>(
41
- (propsIn, forwardedRef) => {
42
- const ref = useRef<Input>(null)
43
- const composedRefs = useComposedRefs(forwardedRef, ref)
44
-
45
- const props = useInputProps(propsIn, composedRefs)
46
- // defaults to 4 rows
47
- const linesProp = {
48
- // web uses rows now, but native not caught up :/
49
- [isWeb ? 'rows' : 'numberOfLines']: propsIn.unstyled ? undefined : 4,
50
- }
51
-
52
- if (process.env.TAMAGUI_TARGET === 'native') {
53
- useEffect(() => {
54
- if (!props.id) return
55
- if (props.disabled) return
56
-
57
- return registerFocusable(props.id, {
58
- focusAndSelect: () => {
59
- ref.current?.focus()
60
- },
61
- focus: () => {},
62
- })
63
- }, [props.id, props.disabled])
64
- }
65
-
66
- return <TextAreaFrame {...linesProp} {...props} />
67
- }
68
- ) as typeof Input
@@ -1,38 +0,0 @@
1
- import { Stack, styled } from '@tamagui/core'
2
-
3
- export const VisuallyHidden = styled(Stack, {
4
- position: 'absolute',
5
- width: 1,
6
- height: 1,
7
- margin: -1,
8
- zIndex: -10000,
9
- overflow: 'hidden',
10
- opacity: 0.00000001,
11
- pointerEvents: 'none',
12
-
13
- variants: {
14
- preserveDimensions: {
15
- true: {
16
- position: 'relative',
17
- width: 'auto',
18
- height: 'auto',
19
- },
20
- } as const,
21
-
22
- visible: {
23
- true: {
24
- position: 'relative',
25
- width: 'auto',
26
- height: 'auto',
27
- margin: 0,
28
- zIndex: 1,
29
- overflow: 'visible',
30
- opacity: 1,
31
- pointerEvents: 'auto',
32
- },
33
- } as const,
34
- },
35
- })
36
-
37
- // @tamgui/core checks for this in spacing
38
- VisuallyHidden['isVisuallyHidden'] = true
@@ -1,6 +0,0 @@
1
- import { createTamagui as createTamaguiCore } from '@tamagui/core';
2
- /**
3
- * Adds some helpful validation at dev time only for `tamagui` specifically
4
- **/
5
- export declare const createTamagui: typeof createTamaguiCore;
6
- //# sourceMappingURL=createTamagui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAElE;;IAEI;AAEJ,eAAO,MAAM,aAAa,EAAE,OAAO,iBAiE5B,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { SizeVariantSpreadFunction } from '@tamagui/core';
2
- export declare const inputSizeVariant: SizeVariantSpreadFunction<any>;
3
- export declare const textAreaSizeVariant: SizeVariantSpreadFunction<any>;
4
- //# sourceMappingURL=inputHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inputHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/inputHelpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAM9D,eAAO,MAAM,gBAAgB,EAAE,yBAAyB,CAAC,GAAG,CAsB3D,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,yBAAyB,CAAC,GAAG,CAyB9D,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from 'expo-linear-gradient';
2
- //# sourceMappingURL=linear-gradient.native.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linear-gradient.native.d.ts","sourceRoot":"","sources":["../../src/lib/linear-gradient.native.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from '@tamagui/linear-gradient';
2
- //# sourceMappingURL=linear-gradient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linear-gradient.d.ts","sourceRoot":"","sources":["../src/linear-gradient.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}