@tamagui/themes 2.7.7 → 3.0.0-beta.1097.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 (426) hide show
  1. package/dist/cjs/builder.cjs +313 -0
  2. package/dist/cjs/builder.native.cjs +331 -0
  3. package/dist/cjs/builder.native.js +333 -0
  4. package/dist/cjs/builder.native.js.map +1 -0
  5. package/dist/cjs/generated-v5-subtle.cjs +7186 -538
  6. package/dist/cjs/generated-v5-subtle.native.cjs +7220 -0
  7. package/dist/cjs/generated-v5-subtle.native.js +7203 -556
  8. package/dist/cjs/generated-v5-subtle.native.js.map +1 -1
  9. package/dist/cjs/generated-v5.cjs +7204 -538
  10. package/dist/cjs/generated-v5.native.cjs +7238 -0
  11. package/dist/cjs/generated-v5.native.js +7221 -556
  12. package/dist/cjs/generated-v5.native.js.map +1 -1
  13. package/dist/cjs/generated.cjs +1333 -0
  14. package/dist/cjs/generated.native.cjs +1352 -0
  15. package/dist/cjs/generated.native.js +1354 -0
  16. package/dist/cjs/generated.native.js.map +1 -0
  17. package/dist/cjs/index.cjs +22 -19
  18. package/dist/cjs/index.native.cjs +32 -0
  19. package/dist/cjs/index.native.js +23 -19
  20. package/dist/cjs/index.native.js.map +1 -1
  21. package/dist/cjs/tailwind-colors.cjs +313 -0
  22. package/dist/cjs/tailwind-colors.native.cjs +315 -0
  23. package/dist/cjs/tailwind-colors.native.js +317 -0
  24. package/dist/cjs/tailwind-colors.native.js.map +1 -0
  25. package/dist/cjs/themes.generate.cjs +24 -0
  26. package/dist/cjs/themes.generate.native.cjs +26 -0
  27. package/dist/cjs/themes.generate.native.js +28 -0
  28. package/dist/cjs/themes.generate.native.js.map +1 -0
  29. package/dist/cjs/tokens.cjs +38 -152
  30. package/dist/cjs/tokens.native.cjs +52 -0
  31. package/dist/cjs/tokens.native.js +39 -159
  32. package/dist/cjs/tokens.native.js.map +1 -1
  33. package/dist/cjs/utils.cjs +19 -35
  34. package/dist/cjs/utils.native.cjs +33 -0
  35. package/dist/cjs/utils.native.js +20 -38
  36. package/dist/cjs/utils.native.js.map +1 -1
  37. package/dist/cjs/v5-color-scales.cjs +24 -0
  38. package/dist/cjs/v5-color-scales.generated.cjs +385 -0
  39. package/dist/cjs/v5-color-scales.generated.native.cjs +387 -0
  40. package/dist/cjs/v5-color-scales.generated.native.js +389 -0
  41. package/dist/cjs/v5-color-scales.generated.native.js.map +1 -0
  42. package/dist/cjs/v5-color-scales.native.cjs +26 -0
  43. package/dist/cjs/v5-color-scales.native.js +28 -0
  44. package/dist/cjs/v5-color-scales.native.js.map +1 -0
  45. package/dist/cjs/v5-subtle.cjs +15 -26
  46. package/dist/cjs/v5-subtle.native.cjs +30 -0
  47. package/dist/cjs/v5-subtle.native.js +15 -25
  48. package/dist/cjs/v5-subtle.native.js.map +1 -1
  49. package/dist/cjs/v5-tokens.cjs +75 -79
  50. package/dist/cjs/v5-tokens.native.cjs +105 -0
  51. package/dist/cjs/v5-tokens.native.js +79 -82
  52. package/dist/cjs/v5-tokens.native.js.map +1 -1
  53. package/dist/cjs/v5.cjs +15 -23
  54. package/dist/cjs/v5.native.cjs +30 -0
  55. package/dist/cjs/v5.native.js +15 -22
  56. package/dist/cjs/v5.native.js.map +1 -1
  57. package/dist/esm/builder.mjs +277 -0
  58. package/dist/esm/builder.mjs.map +1 -0
  59. package/dist/esm/builder.native.js +293 -0
  60. package/dist/esm/builder.native.js.map +1 -0
  61. package/dist/esm/generated-v5-subtle.mjs +7172 -521
  62. package/dist/esm/generated-v5-subtle.mjs.map +1 -1
  63. package/dist/esm/generated-v5-subtle.native.js +7189 -540
  64. package/dist/esm/generated-v5-subtle.native.js.map +1 -1
  65. package/dist/esm/generated-v5.mjs +7190 -521
  66. package/dist/esm/generated-v5.mjs.map +1 -1
  67. package/dist/esm/generated-v5.native.js +7207 -540
  68. package/dist/esm/generated-v5.native.js.map +1 -1
  69. package/dist/esm/generated.mjs +1310 -0
  70. package/dist/esm/generated.mjs.map +1 -0
  71. package/dist/esm/generated.native.js +1327 -0
  72. package/dist/esm/generated.native.js.map +1 -0
  73. package/dist/esm/index.mjs +4 -9
  74. package/dist/esm/index.native.js +4 -9
  75. package/dist/esm/tailwind-colors.mjs +293 -0
  76. package/dist/esm/tailwind-colors.mjs.map +1 -0
  77. package/dist/esm/tailwind-colors.native.js +293 -0
  78. package/dist/esm/tailwind-colors.native.js.map +1 -0
  79. package/dist/esm/themes.generate.mjs +3 -0
  80. package/dist/esm/themes.generate.native.js +3 -0
  81. package/dist/esm/tokens.mjs +25 -129
  82. package/dist/esm/tokens.mjs.map +1 -1
  83. package/dist/esm/tokens.native.js +25 -136
  84. package/dist/esm/tokens.native.js.map +1 -1
  85. package/dist/esm/utils.mjs +9 -17
  86. package/dist/esm/utils.mjs.map +1 -1
  87. package/dist/esm/utils.native.js +9 -20
  88. package/dist/esm/utils.native.js.map +1 -1
  89. package/dist/esm/v5-color-scales.generated.mjs +365 -0
  90. package/dist/esm/v5-color-scales.generated.mjs.map +1 -0
  91. package/dist/esm/v5-color-scales.generated.native.js +365 -0
  92. package/dist/esm/v5-color-scales.generated.native.js.map +1 -0
  93. package/dist/esm/v5-color-scales.mjs +3 -0
  94. package/dist/esm/v5-color-scales.native.js +3 -0
  95. package/dist/esm/v5-subtle.mjs +2 -6
  96. package/dist/esm/v5-subtle.native.js +2 -6
  97. package/dist/esm/v5-tokens.mjs +57 -57
  98. package/dist/esm/v5-tokens.mjs.map +1 -1
  99. package/dist/esm/v5-tokens.native.js +61 -61
  100. package/dist/esm/v5-tokens.native.js.map +1 -1
  101. package/dist/esm/v5.mjs +2 -5
  102. package/dist/esm/v5.native.js +2 -5
  103. package/package.json +54 -44
  104. package/src/builder.ts +344 -0
  105. package/src/generated-v5-subtle.ts +6062 -705
  106. package/src/generated-v5.ts +6062 -705
  107. package/src/generated.ts +1474 -0
  108. package/src/index.ts +3 -0
  109. package/src/tailwind-colors.ts +292 -0
  110. package/src/themes.generate.ts +1 -0
  111. package/src/tokens.ts +29 -0
  112. package/src/utils.ts +0 -42
  113. package/src/v5-color-scales.generated.ts +366 -0
  114. package/src/v5-color-scales.ts +1 -0
  115. package/src/v5-subtle.tsx +2 -4
  116. package/src/v5-tokens.ts +32 -38
  117. package/src/v5.tsx +2 -3
  118. package/types/builder.d.ts +398 -0
  119. package/types/builder.d.ts.map +1 -0
  120. package/types/generated-v5-subtle.d.ts.map +1 -1
  121. package/types/generated-v5.d.ts.map +1 -1
  122. package/types/generated.d.ts +35 -0
  123. package/types/generated.d.ts.map +1 -0
  124. package/types/index.d.ts +3 -8
  125. package/types/index.d.ts.map +1 -1
  126. package/types/tailwind-colors.d.ts +291 -0
  127. package/types/tailwind-colors.d.ts.map +1 -0
  128. package/types/themes.generate.d.ts +2 -0
  129. package/types/themes.generate.d.ts.map +1 -0
  130. package/types/tokens.d.ts +617 -1303
  131. package/types/tokens.d.ts.map +1 -1
  132. package/types/utils.d.ts +0 -19
  133. package/types/utils.d.ts.map +1 -1
  134. package/types/v5-color-scales.d.ts +2 -0
  135. package/types/v5-color-scales.d.ts.map +1 -0
  136. package/types/v5-color-scales.generated.d.ts +51 -0
  137. package/types/v5-color-scales.generated.d.ts.map +1 -0
  138. package/types/v5-subtle.d.ts +0 -4
  139. package/types/v5-subtle.d.ts.map +1 -1
  140. package/types/v5-tokens.d.ts +95 -101
  141. package/types/v5-tokens.d.ts.map +1 -1
  142. package/types/v5.d.ts +0 -3
  143. package/types/v5.d.ts.map +1 -1
  144. package/.turbo/turbo-build.log +0 -2
  145. package/dist/cjs/componentThemeDefinitions.cjs +0 -126
  146. package/dist/cjs/componentThemeDefinitions.native.js +0 -129
  147. package/dist/cjs/componentThemeDefinitions.native.js.map +0 -1
  148. package/dist/cjs/generated-new.cjs +0 -2025
  149. package/dist/cjs/generated-new.native.js +0 -2047
  150. package/dist/cjs/generated-new.native.js.map +0 -1
  151. package/dist/cjs/generated-v3.cjs +0 -1103
  152. package/dist/cjs/generated-v3.native.js +0 -1125
  153. package/dist/cjs/generated-v3.native.js.map +0 -1
  154. package/dist/cjs/generated-v4-tamagui.cjs +0 -937
  155. package/dist/cjs/generated-v4-tamagui.native.js +0 -959
  156. package/dist/cjs/generated-v4-tamagui.native.js.map +0 -1
  157. package/dist/cjs/generated-v4.cjs +0 -395
  158. package/dist/cjs/generated-v4.native.js +0 -417
  159. package/dist/cjs/generated-v4.native.js.map +0 -1
  160. package/dist/cjs/helpers.cjs +0 -36
  161. package/dist/cjs/helpers.native.js +0 -41
  162. package/dist/cjs/helpers.native.js.map +0 -1
  163. package/dist/cjs/opacify.cjs +0 -121
  164. package/dist/cjs/opacify.native.js +0 -129
  165. package/dist/cjs/opacify.native.js.map +0 -1
  166. package/dist/cjs/palettes.cjs +0 -54
  167. package/dist/cjs/palettes.native.js +0 -65
  168. package/dist/cjs/palettes.native.js.map +0 -1
  169. package/dist/cjs/shadows.cjs +0 -45
  170. package/dist/cjs/shadows.native.js +0 -48
  171. package/dist/cjs/shadows.native.js.map +0 -1
  172. package/dist/cjs/subtleChildrenThemes.cjs +0 -68
  173. package/dist/cjs/subtleChildrenThemes.native.js +0 -76
  174. package/dist/cjs/subtleChildrenThemes.native.js.map +0 -1
  175. package/dist/cjs/templates.cjs +0 -120
  176. package/dist/cjs/templates.native.js +0 -123
  177. package/dist/cjs/templates.native.js.map +0 -1
  178. package/dist/cjs/themes-new.cjs +0 -88
  179. package/dist/cjs/themes-new.native.js +0 -90
  180. package/dist/cjs/themes-new.native.js.map +0 -1
  181. package/dist/cjs/themes-old.cjs +0 -292
  182. package/dist/cjs/themes-old.native.js +0 -305
  183. package/dist/cjs/themes-old.native.js.map +0 -1
  184. package/dist/cjs/themes.cjs +0 -28
  185. package/dist/cjs/themes.native.js +0 -31
  186. package/dist/cjs/themes.native.js.map +0 -1
  187. package/dist/cjs/v3-themes.cjs +0 -475
  188. package/dist/cjs/v3-themes.native.js +0 -489
  189. package/dist/cjs/v3-themes.native.js.map +0 -1
  190. package/dist/cjs/v3-tokens.cjs +0 -103
  191. package/dist/cjs/v3-tokens.native.js +0 -110
  192. package/dist/cjs/v3-tokens.native.js.map +0 -1
  193. package/dist/cjs/v3.cjs +0 -54
  194. package/dist/cjs/v3.native.js +0 -57
  195. package/dist/cjs/v3.native.js.map +0 -1
  196. package/dist/cjs/v4-default.cjs +0 -169
  197. package/dist/cjs/v4-default.native.js +0 -172
  198. package/dist/cjs/v4-default.native.js.map +0 -1
  199. package/dist/cjs/v4-tamagui.cjs +0 -239
  200. package/dist/cjs/v4-tamagui.native.js +0 -245
  201. package/dist/cjs/v4-tamagui.native.js.map +0 -1
  202. package/dist/cjs/v4-tokens.cjs +0 -103
  203. package/dist/cjs/v4-tokens.native.js +0 -110
  204. package/dist/cjs/v4-tokens.native.js.map +0 -1
  205. package/dist/cjs/v4.cjs +0 -34
  206. package/dist/cjs/v4.native.js +0 -37
  207. package/dist/cjs/v4.native.js.map +0 -1
  208. package/dist/cjs/v5-templates.cjs +0 -119
  209. package/dist/cjs/v5-templates.native.js +0 -128
  210. package/dist/cjs/v5-templates.native.js.map +0 -1
  211. package/dist/cjs/v5-themes-subtle.cjs +0 -39
  212. package/dist/cjs/v5-themes-subtle.native.js +0 -42
  213. package/dist/cjs/v5-themes-subtle.native.js.map +0 -1
  214. package/dist/cjs/v5-themes.cjs +0 -415
  215. package/dist/cjs/v5-themes.native.js +0 -470
  216. package/dist/cjs/v5-themes.native.js.map +0 -1
  217. package/dist/esm/componentThemeDefinitions.mjs +0 -100
  218. package/dist/esm/componentThemeDefinitions.mjs.map +0 -1
  219. package/dist/esm/componentThemeDefinitions.native.js +0 -100
  220. package/dist/esm/componentThemeDefinitions.native.js.map +0 -1
  221. package/dist/esm/generated-new.mjs +0 -1999
  222. package/dist/esm/generated-new.mjs.map +0 -1
  223. package/dist/esm/generated-new.native.js +0 -2018
  224. package/dist/esm/generated-new.native.js.map +0 -1
  225. package/dist/esm/generated-v3.mjs +0 -1077
  226. package/dist/esm/generated-v3.mjs.map +0 -1
  227. package/dist/esm/generated-v3.native.js +0 -1096
  228. package/dist/esm/generated-v3.native.js.map +0 -1
  229. package/dist/esm/generated-v4-tamagui.mjs +0 -911
  230. package/dist/esm/generated-v4-tamagui.mjs.map +0 -1
  231. package/dist/esm/generated-v4-tamagui.native.js +0 -930
  232. package/dist/esm/generated-v4-tamagui.native.js.map +0 -1
  233. package/dist/esm/generated-v4.mjs +0 -369
  234. package/dist/esm/generated-v4.mjs.map +0 -1
  235. package/dist/esm/generated-v4.native.js +0 -388
  236. package/dist/esm/generated-v4.native.js.map +0 -1
  237. package/dist/esm/helpers.mjs +0 -9
  238. package/dist/esm/helpers.mjs.map +0 -1
  239. package/dist/esm/helpers.native.js +0 -11
  240. package/dist/esm/helpers.native.js.map +0 -1
  241. package/dist/esm/index.js +0 -9
  242. package/dist/esm/index.js.map +0 -1
  243. package/dist/esm/index.mjs.map +0 -1
  244. package/dist/esm/index.native.js.map +0 -1
  245. package/dist/esm/opacify.mjs +0 -95
  246. package/dist/esm/opacify.mjs.map +0 -1
  247. package/dist/esm/opacify.native.js +0 -100
  248. package/dist/esm/opacify.native.js.map +0 -1
  249. package/dist/esm/palettes.mjs +0 -29
  250. package/dist/esm/palettes.mjs.map +0 -1
  251. package/dist/esm/palettes.native.js +0 -37
  252. package/dist/esm/palettes.native.js.map +0 -1
  253. package/dist/esm/shadows.mjs +0 -20
  254. package/dist/esm/shadows.mjs.map +0 -1
  255. package/dist/esm/shadows.native.js +0 -20
  256. package/dist/esm/shadows.native.js.map +0 -1
  257. package/dist/esm/subtleChildrenThemes.mjs +0 -42
  258. package/dist/esm/subtleChildrenThemes.mjs.map +0 -1
  259. package/dist/esm/subtleChildrenThemes.native.js +0 -47
  260. package/dist/esm/subtleChildrenThemes.native.js.map +0 -1
  261. package/dist/esm/templates.mjs +0 -94
  262. package/dist/esm/templates.mjs.map +0 -1
  263. package/dist/esm/templates.native.js +0 -94
  264. package/dist/esm/templates.native.js.map +0 -1
  265. package/dist/esm/themes-new.mjs +0 -63
  266. package/dist/esm/themes-new.mjs.map +0 -1
  267. package/dist/esm/themes-new.native.js +0 -62
  268. package/dist/esm/themes-new.native.js.map +0 -1
  269. package/dist/esm/themes-old.mjs +0 -267
  270. package/dist/esm/themes-old.mjs.map +0 -1
  271. package/dist/esm/themes-old.native.js +0 -277
  272. package/dist/esm/themes-old.native.js.map +0 -1
  273. package/dist/esm/themes.mjs +0 -3
  274. package/dist/esm/themes.mjs.map +0 -1
  275. package/dist/esm/themes.native.js +0 -3
  276. package/dist/esm/themes.native.js.map +0 -1
  277. package/dist/esm/v3-themes.mjs +0 -445
  278. package/dist/esm/v3-themes.mjs.map +0 -1
  279. package/dist/esm/v3-themes.native.js +0 -456
  280. package/dist/esm/v3-themes.native.js.map +0 -1
  281. package/dist/esm/v3-tokens.mjs +0 -72
  282. package/dist/esm/v3-tokens.mjs.map +0 -1
  283. package/dist/esm/v3-tokens.native.js +0 -76
  284. package/dist/esm/v3-tokens.native.js.map +0 -1
  285. package/dist/esm/v3.mjs +0 -12
  286. package/dist/esm/v3.mjs.map +0 -1
  287. package/dist/esm/v3.native.js +0 -12
  288. package/dist/esm/v3.native.js.map +0 -1
  289. package/dist/esm/v4-default.mjs +0 -133
  290. package/dist/esm/v4-default.mjs.map +0 -1
  291. package/dist/esm/v4-default.native.js +0 -133
  292. package/dist/esm/v4-default.native.js.map +0 -1
  293. package/dist/esm/v4-tamagui.mjs +0 -203
  294. package/dist/esm/v4-tamagui.mjs.map +0 -1
  295. package/dist/esm/v4-tamagui.native.js +0 -206
  296. package/dist/esm/v4-tamagui.native.js.map +0 -1
  297. package/dist/esm/v4-tokens.mjs +0 -72
  298. package/dist/esm/v4-tokens.mjs.map +0 -1
  299. package/dist/esm/v4-tokens.native.js +0 -76
  300. package/dist/esm/v4-tokens.native.js.map +0 -1
  301. package/dist/esm/v4.mjs +0 -6
  302. package/dist/esm/v4.mjs.map +0 -1
  303. package/dist/esm/v4.native.js +0 -6
  304. package/dist/esm/v4.native.js.map +0 -1
  305. package/dist/esm/v5-subtle.mjs.map +0 -1
  306. package/dist/esm/v5-subtle.native.js.map +0 -1
  307. package/dist/esm/v5-templates.mjs +0 -94
  308. package/dist/esm/v5-templates.mjs.map +0 -1
  309. package/dist/esm/v5-templates.native.js +0 -100
  310. package/dist/esm/v5-templates.native.js.map +0 -1
  311. package/dist/esm/v5-themes-subtle.mjs +0 -13
  312. package/dist/esm/v5-themes-subtle.mjs.map +0 -1
  313. package/dist/esm/v5-themes-subtle.native.js +0 -13
  314. package/dist/esm/v5-themes-subtle.native.js.map +0 -1
  315. package/dist/esm/v5-themes.mjs +0 -374
  316. package/dist/esm/v5-themes.mjs.map +0 -1
  317. package/dist/esm/v5-themes.native.js +0 -426
  318. package/dist/esm/v5-themes.native.js.map +0 -1
  319. package/dist/esm/v5.mjs.map +0 -1
  320. package/dist/esm/v5.native.js.map +0 -1
  321. package/src/componentThemeDefinitions.tsx +0 -129
  322. package/src/generated-new.ts +0 -2571
  323. package/src/generated-v3.ts +0 -1826
  324. package/src/generated-v4-tamagui.ts +0 -2200
  325. package/src/generated-v4.ts +0 -1004
  326. package/src/helpers.ts +0 -44
  327. package/src/index.tsx +0 -8
  328. package/src/opacify.ts +0 -125
  329. package/src/palettes.tsx +0 -91
  330. package/src/shadows.tsx +0 -19
  331. package/src/subtleChildrenThemes.ts +0 -54
  332. package/src/templates.tsx +0 -104
  333. package/src/themes-new.ts +0 -74
  334. package/src/themes-old.tsx +0 -378
  335. package/src/themes.tsx +0 -1
  336. package/src/tokens.tsx +0 -199
  337. package/src/v3-themes.ts +0 -650
  338. package/src/v3-tokens.ts +0 -103
  339. package/src/v3.tsx +0 -12
  340. package/src/v4-default.ts +0 -191
  341. package/src/v4-tamagui.ts +0 -287
  342. package/src/v4-tokens.ts +0 -105
  343. package/src/v4.tsx +0 -4
  344. package/src/v5-templates.ts +0 -126
  345. package/src/v5-themes-subtle.ts +0 -18
  346. package/src/v5-themes.ts +0 -626
  347. package/tests/v5-themes.test.ts +0 -215
  348. package/tsconfig.json +0 -43
  349. package/types/componentThemeDefinitions.d.ts +0 -771
  350. package/types/componentThemeDefinitions.d.ts.map +0 -1
  351. package/types/generated-new.d.ts +0 -135
  352. package/types/generated-new.d.ts.map +0 -1
  353. package/types/generated-v3.d.ts +0 -144
  354. package/types/generated-v3.d.ts.map +0 -1
  355. package/types/generated-v4-tamagui.d.ts +0 -190
  356. package/types/generated-v4-tamagui.d.ts.map +0 -1
  357. package/types/generated-v4.d.ts +0 -137
  358. package/types/generated-v4.d.ts.map +0 -1
  359. package/types/helpers.d.ts +0 -24
  360. package/types/helpers.d.ts.map +0 -1
  361. package/types/opacify.d.ts +0 -9
  362. package/types/opacify.d.ts.map +0 -1
  363. package/types/palettes.d.ts +0 -21
  364. package/types/palettes.d.ts.map +0 -1
  365. package/types/shadows.d.ts +0 -15
  366. package/types/shadows.d.ts.map +0 -1
  367. package/types/subtleChildrenThemes.d.ts +0 -305
  368. package/types/subtleChildrenThemes.d.ts.map +0 -1
  369. package/types/templates.d.ts +0 -155
  370. package/types/templates.d.ts.map +0 -1
  371. package/types/themes-new.d.ts +0 -42243
  372. package/types/themes-new.d.ts.map +0 -1
  373. package/types/themes-old.d.ts +0 -51411
  374. package/types/themes-old.d.ts.map +0 -1
  375. package/types/themes.d.ts +0 -2
  376. package/types/themes.d.ts.map +0 -1
  377. package/types/v3-themes.d.ts +0 -16304
  378. package/types/v3-themes.d.ts.map +0 -1
  379. package/types/v3-tokens.d.ts +0 -184
  380. package/types/v3-tokens.d.ts.map +0 -1
  381. package/types/v3.d.ts +0 -11
  382. package/types/v3.d.ts.map +0 -1
  383. package/types/v4-default.d.ts +0 -274
  384. package/types/v4-default.d.ts.map +0 -1
  385. package/types/v4-tamagui.d.ts +0 -195
  386. package/types/v4-tamagui.d.ts.map +0 -1
  387. package/types/v4-tokens.d.ts +0 -184
  388. package/types/v4-tokens.d.ts.map +0 -1
  389. package/types/v4.d.ts +0 -5
  390. package/types/v4.d.ts.map +0 -1
  391. package/types/v5-templates.d.ts +0 -42
  392. package/types/v5-templates.d.ts.map +0 -1
  393. package/types/v5-themes-subtle.d.ts +0 -250
  394. package/types/v5-themes-subtle.d.ts.map +0 -1
  395. package/types/v5-themes.d.ts +0 -752
  396. package/types/v5-themes.d.ts.map +0 -1
  397. package/v3/index.cjs +0 -2
  398. package/v3/index.js +0 -2
  399. package/v3/index.native.cjs +0 -2
  400. package/v3/index.native.js +0 -2
  401. package/v3-themes/index.cjs +0 -2
  402. package/v3-themes/index.js +0 -2
  403. package/v3-themes/index.native.cjs +0 -2
  404. package/v3-themes/index.native.js +0 -2
  405. package/v3-themes.cjs +0 -1
  406. package/v3-themes.d.ts +0 -1
  407. package/v3.cjs +0 -1
  408. package/v3.d.ts +0 -1
  409. package/v4/index.cjs +0 -2
  410. package/v4/index.js +0 -2
  411. package/v4/index.native.cjs +0 -2
  412. package/v4/index.native.js +0 -2
  413. package/v4.cjs +0 -1
  414. package/v4.d.ts +0 -1
  415. package/v5/index.cjs +0 -2
  416. package/v5/index.js +0 -2
  417. package/v5/index.native.cjs +0 -2
  418. package/v5/index.native.js +0 -2
  419. package/v5-subtle/index.cjs +0 -2
  420. package/v5-subtle/index.js +0 -2
  421. package/v5-subtle/index.native.cjs +0 -2
  422. package/v5-subtle/index.native.js +0 -2
  423. package/v5-subtle.cjs +0 -1
  424. package/v5-subtle.d.ts +0 -1
  425. package/v5.cjs +0 -1
  426. package/v5.d.ts +0 -1
@@ -1,378 +0,0 @@
1
- import type { MaskOptions } from '@tamagui/create-theme'
2
- import {
3
- addChildren,
4
- applyMask,
5
- createStrengthenMask,
6
- createTheme,
7
- createWeakenMask,
8
- skipMask,
9
- } from '@tamagui/create-theme'
10
-
11
- import { colorTokens, darkColors, lightColors } from './tokens'
12
-
13
- type ColorName = keyof typeof colorTokens.dark
14
-
15
- const lightTransparent = 'rgba(255,255,255,0)'
16
- const darkTransparent = 'rgba(10,10,10,0)'
17
-
18
- // background => foreground
19
- const palettes = {
20
- dark: [
21
- darkTransparent,
22
- '#050505',
23
- '#151515',
24
- '#191919',
25
- '#232323',
26
- '#282828',
27
- '#323232',
28
- '#424242',
29
- '#494949',
30
- '#545454',
31
- '#626262',
32
- '#a5a5a5',
33
- '#fff',
34
- lightTransparent,
35
- ],
36
- light: [
37
- lightTransparent,
38
- '#fff',
39
- '#f9f9f9',
40
- 'hsl(0, 0%, 97.3%)',
41
- 'hsl(0, 0%, 95.1%)',
42
- 'hsl(0, 0%, 94.0%)',
43
- 'hsl(0, 0%, 92.0%)',
44
- 'hsl(0, 0%, 89.5%)',
45
- 'hsl(0, 0%, 81.0%)',
46
- 'hsl(0, 0%, 56.1%)',
47
- 'hsl(0, 0%, 50.3%)',
48
- 'hsl(0, 0%, 42.5%)',
49
- 'hsl(0, 0%, 9.0%)',
50
- darkTransparent,
51
- ],
52
- }
53
-
54
- const templateColors = {
55
- color1: 1,
56
- color2: 2,
57
- color3: 3,
58
- color4: 4,
59
- color5: 5,
60
- color6: 6,
61
- color7: 7,
62
- color8: 8,
63
- color9: 9,
64
- color10: 10,
65
- color11: 11,
66
- color12: 12,
67
- }
68
-
69
- const templateShadows = {
70
- shadowColor: 1,
71
- shadowColorHover: 1,
72
- shadowColorPress: 2,
73
- shadowColorFocus: 2,
74
- }
75
-
76
- // we can use subset of our template as a "override" so it doesn't get adjusted with masks
77
- // we want to skip over templateColor + templateShadows
78
- const toSkip = {
79
- ...templateShadows,
80
- }
81
-
82
- const override = Object.fromEntries(Object.entries(toSkip).map(([k]) => [k, 0]))
83
- const overrideShadows = Object.fromEntries(
84
- Object.entries(templateShadows).map(([k]) => [k, 0])
85
- )
86
- const overrideWithColors = {
87
- ...override,
88
- color: 0,
89
- colorHover: 0,
90
- colorFocus: 0,
91
- colorPress: 0,
92
- }
93
-
94
- // templates use the palette and specify index
95
- // negative goes backwards from end so -1 is the last item
96
- const template = {
97
- ...templateColors,
98
- ...toSkip,
99
- // the background, color, etc keys here work like generics - they make it so you
100
- // can publish components for others to use without mandating a specific color scale
101
- // the @tamagui/button Button component looks for `$background`, so you set the
102
- // dark_red_Button theme to have a stronger background than the dark_red theme.
103
- background: 2,
104
- backgroundHover: 3,
105
- backgroundPress: 4,
106
- backgroundFocus: 5,
107
- backgroundStrong: 1,
108
- backgroundTransparent: 0,
109
- color: -1,
110
- colorHover: -2,
111
- colorPress: -1,
112
- colorFocus: -2,
113
- colorTransparent: -0,
114
- borderColor: 4,
115
- borderColorHover: 5,
116
- borderColorPress: 3,
117
- borderColorFocus: 4,
118
- placeholderColor: -4,
119
- }
120
-
121
- const lightShadowColor = 'rgba(0,0,0,0.02)'
122
- const lightShadowColorStrong = 'rgba(0,0,0,0.066)'
123
- const darkShadowColor = 'rgba(0,0,0,0.2)'
124
- const darkShadowColorStrong = 'rgba(0,0,0,0.3)'
125
-
126
- const lightShadows = {
127
- shadowColor: lightShadowColorStrong,
128
- shadowColorHover: lightShadowColorStrong,
129
- shadowColorPress: lightShadowColor,
130
- shadowColorFocus: lightShadowColor,
131
- }
132
-
133
- const darkShadows = {
134
- shadowColor: darkShadowColorStrong,
135
- shadowColorHover: darkShadowColorStrong,
136
- shadowColorPress: darkShadowColor,
137
- shadowColorFocus: darkShadowColor,
138
- }
139
-
140
- const lightTemplate = {
141
- ...template,
142
-
143
- background: 2,
144
- backgroundHover: 3,
145
- backgroundPress: 4,
146
-
147
- // our light color palette is... a bit unique
148
- borderColor: 6,
149
- borderColorHover: 7,
150
- borderColorFocus: 5,
151
- borderColorPress: 6,
152
- ...lightShadows,
153
- }
154
-
155
- const darkTemplate = { ...template, ...darkShadows }
156
-
157
- const light = createTheme(palettes.light, lightTemplate)
158
- const dark = createTheme(palettes.dark, darkTemplate)
159
-
160
- type SubTheme = typeof light
161
-
162
- const baseThemes: {
163
- light: SubTheme
164
- dark: SubTheme
165
- } = {
166
- light,
167
- dark,
168
- }
169
-
170
- const masks = {
171
- skip: skipMask,
172
- weaker: createWeakenMask(),
173
- stronger: createStrengthenMask(),
174
- }
175
-
176
- // default mask options for most uses
177
- const maskOptions: MaskOptions = {
178
- override,
179
- skip: toSkip,
180
- // avoids the transparent ends
181
- max: palettes.light.length - 2,
182
- min: 1,
183
- }
184
-
185
- const transparent = (hsl: string, opacity = 0) =>
186
- hsl.replace(`%)`, `%, ${opacity})`).replace(`hsl(`, `hsla(`)
187
-
188
- // setup colorThemes and their inverses
189
- const [lightColorThemes, darkColorThemes] = [colorTokens.light, colorTokens.dark].map(
190
- (colorSet, i) => {
191
- const isLight = i === 0
192
- const theme = baseThemes[isLight ? 'light' : 'dark']
193
-
194
- return Object.fromEntries(
195
- Object.keys(colorSet).map((color) => {
196
- const colorPalette = Object.values(colorSet[color]) as string[]
197
- // were re-ordering these
198
- const [head, tail] = [
199
- colorPalette.slice(0, 6),
200
- colorPalette.slice(colorPalette.length - 5),
201
- ]
202
- // add our transparent colors first/last
203
- // and make sure the last (foreground) color is white/black rather than colorful
204
- // this is mostly for consistency with the older theme-base
205
- const palette = [
206
- transparent(colorPalette[0]),
207
- ...head,
208
- ...tail,
209
- theme.color,
210
- transparent(colorPalette[colorPalette.length - 1]),
211
- ]
212
-
213
- const colorTheme = createTheme(
214
- palette,
215
- isLight
216
- ? {
217
- ...lightTemplate,
218
- // light color themes are a bit less sensitive
219
- borderColor: 4,
220
- borderColorHover: 5,
221
- borderColorFocus: 4,
222
- borderColorPress: 4,
223
- }
224
- : darkTemplate
225
- )
226
-
227
- return [color, colorTheme]
228
- })
229
- ) as Record<ColorName, SubTheme>
230
- }
231
- )
232
-
233
- const allThemes = addChildren(baseThemes, (name, theme) => {
234
- const isLight = name === 'light'
235
- const inverseName = isLight ? 'dark' : 'light'
236
- const inverseTheme = baseThemes[inverseName]
237
- const colorThemes = isLight ? lightColorThemes : darkColorThemes
238
- const inverseColorThemes = isLight ? darkColorThemes : lightColorThemes
239
-
240
- const allColorThemes = addChildren(colorThemes, (colorName, colorTheme) => {
241
- const inverse = inverseColorThemes[colorName]
242
- return {
243
- ...getAltThemes({
244
- theme: colorTheme,
245
- inverse,
246
- isLight,
247
- }),
248
- ...getComponentThemes(colorTheme, inverse, isLight),
249
- }
250
- })
251
-
252
- const baseSubThemes = {
253
- ...getAltThemes({ theme, inverse: inverseTheme, isLight }),
254
- ...getComponentThemes(theme, inverseTheme, isLight),
255
- }
256
-
257
- return {
258
- ...baseSubThemes,
259
- ...allColorThemes,
260
- }
261
- })
262
-
263
- function getAltThemes({
264
- theme,
265
- inverse,
266
- isLight,
267
- activeTheme,
268
- }: {
269
- theme: SubTheme
270
- inverse: SubTheme
271
- isLight: boolean
272
- activeTheme?: SubTheme
273
- }) {
274
- const maskOptionsAlt = {
275
- ...maskOptions,
276
- override: overrideShadows,
277
- }
278
- const alt1 = applyMask(theme, masks.weaker, maskOptionsAlt)
279
- const alt2 = applyMask(alt1, masks.weaker, maskOptionsAlt)
280
-
281
- const active =
282
- activeTheme ??
283
- (process.env.ACTIVE_THEME_INVERSE
284
- ? inverse
285
- : (() => {
286
- return applyMask(theme, masks.weaker, {
287
- ...maskOptions,
288
- strength: 3,
289
- skip: {
290
- ...maskOptions.skip,
291
- color: 1,
292
- },
293
- })
294
- })())
295
-
296
- return addChildren({ alt1, alt2, active }, (_, subTheme) => {
297
- return getComponentThemes(subTheme, subTheme === inverse ? theme : inverse, isLight)
298
- })
299
- }
300
-
301
- function getComponentThemes(theme: SubTheme, inverse: SubTheme, isLight: boolean) {
302
- const componentMaskOptions: MaskOptions = {
303
- ...maskOptions,
304
- override: overrideWithColors,
305
- skip: {
306
- ...maskOptions.skip,
307
- // skip colors too just for component sub themes
308
- ...templateColors,
309
- },
310
- }
311
- const weaker1 = applyMask(theme, masks.weaker, componentMaskOptions)
312
- const base = applyMask(weaker1, masks.stronger, componentMaskOptions)
313
- const weaker2 = applyMask(weaker1, masks.weaker, componentMaskOptions)
314
- const stronger1 = applyMask(theme, masks.stronger, componentMaskOptions)
315
- const inverse1 = applyMask(inverse, masks.weaker, componentMaskOptions)
316
- const inverse2 = applyMask(inverse1, masks.weaker, componentMaskOptions)
317
- const strongerBorderLighterBackground: SubTheme = isLight
318
- ? {
319
- ...stronger1,
320
- borderColor: weaker1.borderColor,
321
- borderColorHover: weaker1.borderColorHover,
322
- borderColorPress: weaker1.borderColorPress,
323
- borderColorFocus: weaker1.borderColorFocus,
324
- }
325
- : {
326
- ...applyMask(theme, masks.skip, componentMaskOptions),
327
- borderColor: weaker1.borderColor,
328
- borderColorHover: weaker1.borderColorHover,
329
- borderColorPress: weaker1.borderColorPress,
330
- borderColorFocus: weaker1.borderColorFocus,
331
- }
332
-
333
- const overlayTheme = {
334
- background: isLight ? 'rgba(0,0,0,0.5)' : 'rgba(0,0,0,0.9)',
335
- } as SubTheme
336
-
337
- const weaker2WithoutBorder = {
338
- ...weaker2,
339
- borderColor: 'transparent',
340
- borderColorHover: 'transparent',
341
- }
342
-
343
- return {
344
- ListItem: isLight ? stronger1 : base,
345
- Card: weaker1,
346
- Button: weaker2WithoutBorder,
347
- Checkbox: weaker2,
348
- DrawerFrame: weaker1,
349
- SliderTrack: stronger1,
350
- SliderTrackActive: weaker2,
351
- SliderThumb: inverse1,
352
- Progress: weaker1,
353
- ProgressIndicator: inverse,
354
- Switch: weaker2,
355
- SwitchThumb: inverse2,
356
- TooltipArrow: weaker1,
357
- TooltipContent: weaker2,
358
- Input: strongerBorderLighterBackground,
359
- TextArea: strongerBorderLighterBackground,
360
- Tooltip: inverse1,
361
- // make overlays always dark
362
- SheetOverlay: overlayTheme,
363
- DialogOverlay: overlayTheme,
364
- ModalOverlay: overlayTheme,
365
- }
366
- }
367
-
368
- export const themes = {
369
- ...allThemes,
370
- // bring back the full type, the rest use a subset to avoid clogging up ts,
371
- // tamagui will be smart and use the top level themes as the type for useTheme() etc
372
- light: createTheme(palettes.light, lightTemplate, { nonInheritedValues: lightColors }),
373
- dark: createTheme(palettes.dark, darkTemplate, { nonInheritedValues: darkColors }),
374
- }
375
-
376
- // if (process.env.NODE_ENV === 'development') {
377
- // console.log(JSON.stringify(themes).length)
378
- // }
package/src/themes.tsx DELETED
@@ -1 +0,0 @@
1
- export { themes } from './generated-new'
package/src/tokens.tsx DELETED
@@ -1,199 +0,0 @@
1
- import {
2
- blue,
3
- blueDark,
4
- gray,
5
- grayDark,
6
- green,
7
- greenDark,
8
- orange,
9
- orangeDark,
10
- pink,
11
- pinkDark,
12
- purple,
13
- purpleDark,
14
- red,
15
- redDark,
16
- yellow,
17
- yellowDark,
18
- } from '@tamagui/colors/legacy'
19
- import type { Variable } from '@tamagui/web'
20
- import { createTokens } from '@tamagui/web'
21
-
22
- // should roughly map to button/input etc height at each level
23
- // fonts should match that height/lineHeight at each stop
24
- // so these are really non-linear on purpose
25
- // why?
26
- // - at sizes <1, used for fine grained things (borders, smallest paddingY)
27
- // - so smallest padY should be roughly 1-4px so it can join with lineHeight
28
- // - at sizes >=1, have to consider "pressability" (jumps up)
29
- // - after that it should go upwards somewhat naturally
30
- // - H1 / headings top out at 10 naturally, so after 10 we can go upwards faster
31
- // but also one more wrinkle...
32
- // space is used in conjunction with size
33
- // i'm setting space to generally just a fixed fraction of size (~1/3-2/3 still fine tuning)
34
- export const size = {
35
- $0: 0,
36
- '$0.25': 2,
37
- '$0.5': 4,
38
- '$0.75': 8,
39
- $1: 20,
40
- '$1.5': 24,
41
- $2: 28,
42
- '$2.5': 32,
43
- $3: 36,
44
- '$3.5': 40,
45
- $4: 44,
46
- $true: 44,
47
- '$4.5': 48,
48
- $5: 52,
49
- $6: 64,
50
- $7: 74,
51
- $8: 84,
52
- $9: 94,
53
- $10: 104,
54
- $11: 124,
55
- $12: 144,
56
- $13: 164,
57
- $14: 184,
58
- $15: 204,
59
- $16: 224,
60
- $17: 224,
61
- $18: 244,
62
- $19: 264,
63
- $20: 284,
64
- }
65
-
66
- type SizeKeysIn = keyof typeof size
67
- type Sizes = {
68
- [Key in SizeKeysIn extends `$${infer Key}` ? Key : SizeKeysIn]: number
69
- }
70
- type SizeKeys = `${keyof Sizes extends `${infer K}` ? K : never}`
71
-
72
- const spaces = Object.entries(size).map(([k, v]) => {
73
- return [k, sizeToSpace(v)] as const
74
- })
75
-
76
- // a bit odd but keeping backward compat for values >8 while fixing below
77
- function sizeToSpace(v: number) {
78
- if (v === 0) return 0
79
- if (v === 2) return 0.5
80
- if (v === 4) return 1
81
- if (v === 8) return 1.5
82
- if (v <= 16) return Math.round(v * 0.333)
83
- return Math.floor(v * 0.7 - 12)
84
- }
85
-
86
- const spacesNegative = spaces.slice(1).map(([k, v]) => [`-${k.slice(1)}`, -v])
87
-
88
- type SizeKeysWithNegatives =
89
- | Exclude<`-${SizeKeys extends `$${infer Key}` ? Key : SizeKeys}`, '-0'>
90
- | SizeKeys
91
-
92
- type SizeKeysWithNegativesString = `$${SizeKeysWithNegatives}`
93
-
94
- export const space: {
95
- [Key in SizeKeysWithNegativesString]: Key extends keyof Sizes ? Sizes[Key] : number
96
- } = {
97
- ...Object.fromEntries(spaces),
98
- ...Object.fromEntries(spacesNegative),
99
- } as any
100
-
101
- export const zIndex = {
102
- 0: 0,
103
- 1: 100,
104
- 2: 200,
105
- 3: 300,
106
- 4: 400,
107
- 5: 500,
108
- }
109
-
110
- export const colorTokens = {
111
- light: {
112
- blue: blue,
113
- gray: gray,
114
- green: green,
115
- orange: orange,
116
- pink: pink,
117
- purple: purple,
118
- red: red,
119
- yellow: yellow,
120
- },
121
- dark: {
122
- blue: blueDark,
123
- gray: grayDark,
124
- green: greenDark,
125
- orange: orangeDark,
126
- pink: pinkDark,
127
- purple: purpleDark,
128
- red: redDark,
129
- yellow: yellowDark,
130
- },
131
- }
132
-
133
- export const darkColors = {
134
- ...colorTokens.dark.blue,
135
- ...colorTokens.dark.gray,
136
- ...colorTokens.dark.green,
137
- ...colorTokens.dark.orange,
138
- ...colorTokens.dark.pink,
139
- ...colorTokens.dark.purple,
140
- ...colorTokens.dark.red,
141
- ...colorTokens.dark.yellow,
142
- }
143
-
144
- export const lightColors = {
145
- ...colorTokens.light.blue,
146
- ...colorTokens.light.gray,
147
- ...colorTokens.light.green,
148
- ...colorTokens.light.orange,
149
- ...colorTokens.light.pink,
150
- ...colorTokens.light.purple,
151
- ...colorTokens.light.red,
152
- ...colorTokens.light.yellow,
153
- }
154
-
155
- export const color = {
156
- ...postfixObjKeys(lightColors, 'Light'),
157
- ...postfixObjKeys(darkColors, 'Dark'),
158
- }
159
-
160
- function postfixObjKeys<
161
- A extends { [key: string]: Variable<string> | string },
162
- B extends string,
163
- >(
164
- obj: A,
165
- postfix: B
166
- ): {
167
- [Key in `${keyof A extends string ? keyof A : never}${B}`]: Variable<string> | string
168
- } {
169
- return Object.fromEntries(
170
- Object.entries(obj).map(([k, v]) => [`${k}${postfix}`, v])
171
- ) as any
172
- }
173
-
174
- export const radius = {
175
- 0: 0,
176
- 1: 3,
177
- 2: 5,
178
- 3: 7,
179
- 4: 9,
180
- true: 9,
181
- 5: 10,
182
- 6: 16,
183
- 7: 19,
184
- 8: 22,
185
- 9: 26,
186
- 10: 34,
187
- 11: 42,
188
- 12: 50,
189
- }
190
-
191
- export const tokens = createTokens({
192
- color,
193
- radius,
194
- zIndex,
195
- space,
196
- size,
197
- })
198
-
199
- export type hello = 'asdad'