@tamagui/tamagui-dev-config 1.125.26 → 1.125.27

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.
@@ -0,0 +1,578 @@
1
+ import * as Colors from '@tamagui/colors'
2
+ import { createThemes, defaultComponentThemes } from '@tamagui/theme-builder'
3
+ import { desaturate } from 'color2k'
4
+
5
+ const desat = (colors: Record<string, string>, amount: number) => {
6
+ return Object.fromEntries(
7
+ Object.entries(colors).map(([key, value]) => [key, desaturate(value, amount)])
8
+ )
9
+ }
10
+
11
+ const colorsGreenDark = desat(Colors.greenDark, 0.2) as typeof Colors.greenDark
12
+ const colorsGreen = desat(Colors.green, 0.2) as typeof Colors.green
13
+
14
+ // with color2k:
15
+
16
+ /**
17
+ * Default themes for the tamagui.dev site
18
+ * If you'd like to create your own themes, use `createThemes`
19
+ */
20
+
21
+ const darkPalette = [
22
+ '#040404',
23
+ '#090909',
24
+ '#111',
25
+ '#151515',
26
+ '#222',
27
+ '#282828',
28
+ '#343434',
29
+ '#424242',
30
+ '#515151',
31
+ '#626262',
32
+ '#a5a5a5',
33
+ '#fff',
34
+ ]
35
+
36
+ const lightPalette = [
37
+ '#fff',
38
+ '#f2f2f2',
39
+ 'hsl(0, 0%, 93%)',
40
+ 'hsl(0, 0%, 91%)',
41
+ 'hsl(0, 0%, 88%)',
42
+ 'hsl(0, 0%, 85%)',
43
+ 'hsl(0, 0%, 82%)',
44
+ 'hsl(0, 0%, 76%)',
45
+ 'hsl(0, 0%, 56%)',
46
+ 'hsl(0, 0%, 50%)',
47
+ 'hsl(0, 0%, 42%)',
48
+ 'hsl(0, 0%, 9%)',
49
+ ]
50
+
51
+ const lightShadows = {
52
+ shadow1: 'rgba(0,0,0,0.04)',
53
+ shadow2: 'rgba(0,0,0,0.08)',
54
+ shadow3: 'rgba(0,0,0,0.16)',
55
+ shadow4: 'rgba(0,0,0,0.24)',
56
+ shadow5: 'rgba(0,0,0,0.32)',
57
+ shadow6: 'rgba(0,0,0,0.4)',
58
+ shadow7: 'rgba(0,0,0,0.5)',
59
+ shadow8: 'rgba(0,0,0,0.6)',
60
+ shadow9: 'rgba(0,0,0,0.7)',
61
+ shadow10: 'rgba(0,0,0,0.8)',
62
+ }
63
+
64
+ const darkShadows = {
65
+ shadow1: 'rgba(0,0,0,0.2)',
66
+ shadow2: 'rgba(0,0,0,0.3)',
67
+ shadow3: 'rgba(0,0,0,0.4)',
68
+ shadow4: 'rgba(0,0,0,0.5)',
69
+ shadow5: 'rgba(0,0,0,0.6)',
70
+ shadow6: 'rgba(0,0,0,0.65)',
71
+ shadow7: 'rgba(0,0,0,0.75)',
72
+ shadow8: 'rgba(0,0,0,0.8)',
73
+ shadow9: 'rgba(0,0,0,0.85)',
74
+ shadow10: 'rgba(0,0,0,0.9)',
75
+ }
76
+
77
+ const blackColors = {
78
+ black1: darkPalette[0],
79
+ black2: darkPalette[1],
80
+ black3: darkPalette[2],
81
+ black4: darkPalette[3],
82
+ black5: darkPalette[4],
83
+ black6: darkPalette[5],
84
+ black7: darkPalette[6],
85
+ black8: darkPalette[7],
86
+ black9: darkPalette[8],
87
+ black10: darkPalette[9],
88
+ black11: darkPalette[10],
89
+ black12: darkPalette[11],
90
+ }
91
+
92
+ const whiteColors = {
93
+ white1: lightPalette[0],
94
+ white2: lightPalette[1],
95
+ white3: lightPalette[2],
96
+ white4: lightPalette[3],
97
+ white5: lightPalette[4],
98
+ white6: lightPalette[5],
99
+ white7: lightPalette[6],
100
+ white8: lightPalette[7],
101
+ white9: lightPalette[8],
102
+ white10: lightPalette[9],
103
+ white11: lightPalette[10],
104
+ white12: lightPalette[11],
105
+ }
106
+
107
+ const jadeDark = [
108
+ 'hsla(165, 100%, 4%, 1)',
109
+ 'hsla(165, 100%, 8%, 1)',
110
+ 'hsla(165, 100%, 12%, 1)',
111
+ 'hsla(165, 100%, 18%, 1)',
112
+ 'hsla(165, 100%, 25%, 1)',
113
+ 'hsla(165, 100%, 35%, 1)',
114
+ 'hsla(165, 100%, 45%, 1)',
115
+ 'hsla(165, 100%, 55%, 1)',
116
+ 'hsla(165, 100%, 65%, 1)',
117
+ 'hsla(165, 100%, 75%, 1)',
118
+ 'hsla(165, 100%, 85%, 1)',
119
+ 'hsla(165, 100%, 90%, 1)',
120
+ ]
121
+
122
+ const jadeLight = [
123
+ 'hsla(165, 100%, 90%, 1)',
124
+ 'hsla(165, 100%, 85%, 1)',
125
+ 'hsla(165, 100%, 75%, 1)',
126
+ 'hsla(165, 100%, 65%, 1)',
127
+ 'hsla(165, 100%, 55%, 1)',
128
+ 'hsla(165, 100%, 45%, 1)',
129
+ 'hsla(165, 100%, 35%, 1)',
130
+ 'hsla(165, 100%, 25%, 1)',
131
+ 'hsla(165, 100%, 18%, 1)',
132
+ 'hsla(165, 100%, 12%, 1)',
133
+ 'hsla(165, 100%, 8%, 1)',
134
+ 'hsla(165, 100%, 4%, 1)',
135
+ ]
136
+
137
+ const supremeDark = [
138
+ 'hsla(358, 100%, 35%, 1)',
139
+ 'hsla(358, 100%, 38%, 1)',
140
+ 'hsla(358, 100%, 40%, 1)',
141
+ 'hsla(358, 100%, 43%, 1)',
142
+ 'hsla(358, 100%, 45%, 1)',
143
+ 'hsla(358, 100%, 48%, 1)',
144
+ 'hsla(358, 100%, 50%, 1)',
145
+ 'hsla(358, 100%, 53%, 1)',
146
+ 'hsla(358, 100%, 55%, 1)',
147
+ 'hsla(358, 100%, 65%, 1)',
148
+ 'hsla(358, 100%, 75%, 1)',
149
+ 'hsla(358, 100%, 95%, 1)',
150
+ ]
151
+ const supremeLight = [
152
+ 'hsla(358, 100%, 50%, 1)',
153
+ 'hsla(358, 100%, 49%, 1)',
154
+ 'hsla(358, 100%, 48%, 1)',
155
+ 'hsla(358, 100%, 46%, 1)',
156
+ 'hsla(358, 100%, 45%, 1)',
157
+ 'hsla(358, 100%, 44%, 1)',
158
+ 'hsla(358, 100%, 43%, 1)',
159
+ 'hsla(358, 100%, 41%, 1)',
160
+ 'hsla(358, 100%, 40%, 1)',
161
+ 'hsla(358, 100%, 35%, 1)',
162
+ 'hsla(358, 100%, 100%, 1)',
163
+ 'hsla(358, 100%, 100%, 1)',
164
+ ]
165
+
166
+ const orangeRedDark = [
167
+ 'hsla(17, 100%, 5%, 1)',
168
+ 'hsla(17, 100%, 10%, 1)',
169
+ 'hsla(17, 100%, 15%, 1)',
170
+ 'hsla(17, 100%, 20%, 1)',
171
+ 'hsla(17, 100%, 25%, 1)',
172
+ 'hsla(17, 100%, 38%, 1)',
173
+ 'hsla(17, 100%, 45%, 1)',
174
+ 'hsla(17, 100%, 50%, 1)',
175
+ 'hsla(17, 100%, 55%, 1)',
176
+ 'hsla(17, 100%, 60%, 1)',
177
+ 'hsla(17, 100%, 65%, 1)',
178
+ 'hsla(17, 100%, 70%, 1)',
179
+ ]
180
+
181
+ const orangeRedLight = [
182
+ 'hsla(17, 100%, 70%, 1)',
183
+ 'hsla(17, 100%, 65%, 1)',
184
+ 'hsla(17, 100%, 60%, 1)',
185
+ 'hsla(17, 100%, 55%, 1)',
186
+ 'hsla(17, 100%, 50%, 1)',
187
+ 'hsla(17, 100%, 45%, 1)',
188
+ 'hsla(17, 100%, 38%, 1)',
189
+ 'hsla(17, 100%, 25%, 1)',
190
+ 'hsla(17, 100%, 20%, 1)',
191
+ 'hsla(17, 100%, 15%, 1)',
192
+ 'hsla(17, 100%, 10%, 1)',
193
+ 'hsla(17, 100%, 5%, 1)',
194
+ ]
195
+
196
+ const royalBlueDark = [
197
+ 'hsla(243, 90%, 5%, 1)',
198
+ 'hsla(243, 90%, 10%, 1)',
199
+ 'hsla(243, 90%, 15%, 1)',
200
+ 'hsla(243, 90%, 20%, 1)',
201
+ 'hsla(243, 90%, 25%, 1)',
202
+ 'hsla(243, 70%, 41%, 1)',
203
+ 'hsla(243, 90%, 45%, 1)',
204
+ 'hsla(243, 90%, 50%, 1)',
205
+ 'hsla(243, 90%, 55%, 1)',
206
+ 'hsla(243, 90%, 60%, 1)',
207
+ 'hsla(243, 90%, 65%, 1)',
208
+ 'hsla(243, 90%, 70%, 1)',
209
+ ]
210
+
211
+ const royalBlueLight = [
212
+ 'hsla(243, 90%, 70%, 1)',
213
+ 'hsla(243, 90%, 65%, 1)',
214
+ 'hsla(243, 90%, 60%, 1)',
215
+ 'hsla(243, 90%, 55%, 1)',
216
+ 'hsla(243, 90%, 50%, 1)',
217
+ 'hsla(243, 90%, 45%, 1)',
218
+ 'hsla(243, 70%, 41%, 1)',
219
+ 'hsla(243, 90%, 25%, 1)',
220
+ 'hsla(243, 90%, 20%, 1)',
221
+ 'hsla(243, 90%, 15%, 1)',
222
+ 'hsla(243, 90%, 10%, 1)',
223
+ 'hsla(243, 90%, 5%, 1)',
224
+ ]
225
+
226
+ const burgundyDark = [
227
+ 'hsla(334, 60%, 5%, 1)',
228
+ 'hsla(334, 60%, 10%, 1)',
229
+ 'hsla(334, 60%, 15%, 1)',
230
+ 'hsla(334, 60%, 20%, 1)',
231
+ 'hsla(334, 60%, 25%, 1)',
232
+ 'hsla(334, 60%, 27%, 1)',
233
+ 'hsla(334, 60%, 35%, 1)',
234
+ 'hsla(334, 60%, 40%, 1)',
235
+ 'hsla(334, 60%, 45%, 1)',
236
+ 'hsla(334, 60%, 50%, 1)',
237
+ 'hsla(334, 60%, 55%, 1)',
238
+ 'hsla(334, 60%, 60%, 1)',
239
+ ]
240
+
241
+ const burgundyLight = [
242
+ 'hsla(334, 60%, 60%, 1)',
243
+ 'hsla(334, 60%, 55%, 1)',
244
+ 'hsla(334, 60%, 50%, 1)',
245
+ 'hsla(334, 60%, 45%, 1)',
246
+ 'hsla(334, 60%, 40%, 1)',
247
+ 'hsla(334, 60%, 35%, 1)',
248
+ 'hsla(334, 60%, 27%, 1)',
249
+ 'hsla(334, 60%, 25%, 1)',
250
+ 'hsla(334, 60%, 20%, 1)',
251
+ 'hsla(334, 60%, 15%, 1)',
252
+ 'hsla(334, 60%, 10%, 1)',
253
+ 'hsla(334, 60%, 5%, 1)',
254
+ ]
255
+
256
+ const tealDark = [
257
+ 'hsla(187, 94%, 5%, 1)',
258
+ 'hsla(187, 94%, 10%, 1)',
259
+ 'hsla(187, 94%, 15%, 1)',
260
+ 'hsla(187, 94%, 20%, 1)',
261
+ 'hsla(187, 94%, 25%, 1)',
262
+ 'hsla(187, 94%, 32%, 1)',
263
+ 'hsla(187, 94%, 38%, 1)',
264
+ 'hsla(187, 94%, 43%, 1)',
265
+ 'hsla(187, 94%, 48%, 1)',
266
+ 'hsla(187, 94%, 53%, 1)',
267
+ 'hsla(187, 94%, 58%, 1)',
268
+ 'hsla(187, 94%, 63%, 1)',
269
+ ]
270
+
271
+ const tealLight = [
272
+ 'hsla(187, 94%, 63%, 1)',
273
+ 'hsla(187, 94%, 58%, 1)',
274
+ 'hsla(187, 94%, 53%, 1)',
275
+ 'hsla(187, 94%, 48%, 1)',
276
+ 'hsla(187, 94%, 43%, 1)',
277
+ 'hsla(187, 94%, 38%, 1)',
278
+ 'hsla(187, 94%, 32%, 1)',
279
+ 'hsla(187, 94%, 25%, 1)',
280
+ 'hsla(187, 94%, 20%, 1)',
281
+ 'hsla(187, 94%, 15%, 1)',
282
+ 'hsla(187, 94%, 10%, 1)',
283
+ 'hsla(187, 94%, 5%, 1)',
284
+ ]
285
+
286
+ const forestDark = [
287
+ 'hsla(162, 64%, 5%, 1)',
288
+ 'hsla(162, 64%, 10%, 1)',
289
+ 'hsla(162, 64%, 15%, 1)',
290
+ 'hsla(162, 64%, 20%, 1)',
291
+ 'hsla(162, 64%, 25%, 1)',
292
+ 'hsla(162, 64%, 30%, 1)',
293
+ 'hsla(162, 64%, 35%, 1)',
294
+ 'hsla(162, 64%, 40%, 1)',
295
+ 'hsla(162, 64%, 45%, 1)',
296
+ 'hsla(162, 64%, 50%, 1)',
297
+ 'hsla(162, 64%, 55%, 1)',
298
+ 'hsla(162, 64%, 60%, 1)',
299
+ ]
300
+
301
+ const forestLight = [
302
+ 'hsla(162, 64%, 60%, 1)',
303
+ 'hsla(162, 64%, 55%, 1)',
304
+ 'hsla(162, 64%, 50%, 1)',
305
+ 'hsla(162, 64%, 45%, 1)',
306
+ 'hsla(162, 64%, 40%, 1)',
307
+ 'hsla(162, 64%, 35%, 1)',
308
+ 'hsla(162, 64%, 30%, 1)',
309
+ 'hsla(162, 64%, 25%, 1)',
310
+ 'hsla(162, 64%, 20%, 1)',
311
+ 'hsla(162, 64%, 15%, 1)',
312
+ 'hsla(162, 64%, 10%, 1)',
313
+ 'hsla(162, 64%, 5%, 1)',
314
+ ]
315
+
316
+ const cyanDark = [
317
+ 'hsla(186, 32%, 5%, 1)',
318
+ 'hsla(186, 32%, 10%, 1)',
319
+ 'hsla(186, 32%, 15%, 1)',
320
+ 'hsla(186, 32%, 20%, 1)',
321
+ 'hsla(186, 32%, 25%, 1)',
322
+ 'hsla(186, 32%, 46%, 1)',
323
+ 'hsla(186, 32%, 50%, 1)',
324
+ 'hsla(186, 32%, 55%, 1)',
325
+ 'hsla(186, 32%, 60%, 1)',
326
+ 'hsla(186, 32%, 65%, 1)',
327
+ 'hsla(186, 32%, 70%, 1)',
328
+ 'hsla(186, 32%, 75%, 1)',
329
+ ]
330
+
331
+ const cyanLight = [
332
+ 'hsla(186, 32%, 75%, 1)',
333
+ 'hsla(186, 32%, 70%, 1)',
334
+ 'hsla(186, 32%, 65%, 1)',
335
+ 'hsla(186, 32%, 60%, 1)',
336
+ 'hsla(186, 32%, 55%, 1)',
337
+ 'hsla(186, 32%, 50%, 1)',
338
+ 'hsla(186, 32%, 46%, 1)',
339
+ 'hsla(186, 32%, 25%, 1)',
340
+ 'hsla(186, 32%, 20%, 1)',
341
+ 'hsla(186, 32%, 15%, 1)',
342
+ 'hsla(186, 32%, 10%, 1)',
343
+ 'hsla(186, 32%, 5%, 1)',
344
+ ]
345
+
346
+ const themes = createThemes({
347
+ componentThemes: defaultComponentThemes,
348
+
349
+ base: {
350
+ palette: {
351
+ dark: darkPalette,
352
+ light: lightPalette,
353
+ },
354
+
355
+ // for values we don't want being inherited onto sub-themes
356
+ extra: {
357
+ light: {
358
+ ...Colors.blue,
359
+ ...Colors.gray,
360
+ ...colorsGreen,
361
+ ...Colors.orange,
362
+ ...Colors.pink,
363
+ ...Colors.purple,
364
+ ...Colors.red,
365
+ ...Colors.yellow,
366
+ ...lightShadows,
367
+ ...blackColors,
368
+ ...whiteColors,
369
+ shadowColor: lightShadows.shadow1,
370
+ colorBg: '#fff',
371
+ },
372
+ dark: {
373
+ ...Colors.blueDark,
374
+ ...Colors.grayDark,
375
+ ...colorsGreenDark,
376
+ ...Colors.orangeDark,
377
+ ...Colors.pinkDark,
378
+ ...Colors.purpleDark,
379
+ ...Colors.redDark,
380
+ ...Colors.yellowDark,
381
+ ...darkShadows,
382
+ ...blackColors,
383
+ ...whiteColors,
384
+ shadowColor: darkShadows.shadow1,
385
+ colorBg: '#000',
386
+ },
387
+ },
388
+ },
389
+
390
+ // inverse accent theme
391
+ accent: {
392
+ palette: {
393
+ dark: lightPalette,
394
+ light: darkPalette,
395
+ },
396
+ },
397
+
398
+ childrenThemes: {
399
+ black: {
400
+ palette: {
401
+ dark: Object.values(blackColors),
402
+ light: Object.values(blackColors),
403
+ },
404
+ },
405
+ white: {
406
+ palette: {
407
+ dark: Object.values(whiteColors),
408
+ light: Object.values(whiteColors),
409
+ },
410
+ },
411
+ gray: {
412
+ palette: {
413
+ dark: Object.values(Colors.grayDark),
414
+ light: Object.values(Colors.gray),
415
+ },
416
+ },
417
+ blue: {
418
+ palette: {
419
+ dark: Object.values(Colors.blueDark),
420
+ light: Object.values(Colors.blue),
421
+ },
422
+ },
423
+ orange: {
424
+ palette: {
425
+ dark: Object.values(Colors.orangeDark),
426
+ light: Object.values(Colors.orange),
427
+ },
428
+ },
429
+ red: {
430
+ palette: {
431
+ dark: Object.values(Colors.redDark),
432
+ light: Object.values(Colors.red),
433
+ },
434
+ },
435
+ yellow: {
436
+ palette: {
437
+ dark: Object.values(Colors.yellowDark),
438
+ light: Object.values(Colors.yellow),
439
+ },
440
+ },
441
+ green: {
442
+ palette: {
443
+ dark: Object.values(colorsGreenDark),
444
+ light: Object.values(colorsGreen),
445
+ },
446
+ },
447
+ purple: {
448
+ palette: {
449
+ dark: Object.values(Colors.purpleDark),
450
+ light: Object.values(Colors.purple),
451
+ },
452
+ },
453
+ pink: {
454
+ palette: {
455
+ dark: Object.values(Colors.pinkDark),
456
+ light: Object.values(Colors.pink),
457
+ },
458
+ },
459
+ tan: {
460
+ palette: {
461
+ light: [
462
+ 'hsla(40, 30%, 98%, 1)',
463
+ 'hsla(40, 24%, 94%, 1)',
464
+ 'hsla(38, 23%, 91%, 1)',
465
+ 'hsla(36, 20%, 90%, 1)',
466
+ 'hsla(36, 20%, 88%, 1)',
467
+ 'hsla(35, 20%, 85%, 1)',
468
+ 'hsla(35, 21%, 74%, 1)',
469
+ 'hsla(34, 20%, 70%, 1)',
470
+ 'hsla(35, 20%, 67%, 1)',
471
+ 'hsla(34, 19%, 47%, 1)',
472
+ 'hsla(35, 18%, 37%, 1)',
473
+ 'hsla(35, 17%, 20%, 1)',
474
+ ],
475
+ dark: [
476
+ 'hsla(30, 9%, 10%, 1)',
477
+ 'hsla(30, 10%, 12%, 1)',
478
+ 'hsla(31, 11%, 18%, 1)',
479
+ 'hsla(30, 12%, 23%, 1)',
480
+ 'hsla(30, 14%, 28%, 1)',
481
+ 'hsla(30, 16%, 33%, 1)',
482
+ 'hsla(30, 18%, 38%, 1)',
483
+ 'hsla(30, 20%, 45%, 1)',
484
+ 'hsla(30, 21%, 50%, 1)',
485
+ 'hsla(29, 22%, 58%, 1)',
486
+ 'hsla(34, 24%, 70%, 1)',
487
+ 'hsla(11, 12%, 79%, 1)',
488
+ ],
489
+ },
490
+ },
491
+
492
+ jade: {
493
+ palette: {
494
+ dark: jadeDark,
495
+ light: jadeLight,
496
+ },
497
+ },
498
+
499
+ supreme: {
500
+ palette: {
501
+ dark: supremeDark,
502
+ light: supremeLight,
503
+ },
504
+ },
505
+
506
+ orangeRed: {
507
+ palette: {
508
+ dark: orangeRedDark,
509
+ light: orangeRedLight,
510
+ },
511
+ },
512
+
513
+ royalBlue: {
514
+ palette: {
515
+ dark: royalBlueDark,
516
+ light: royalBlueLight,
517
+ },
518
+ },
519
+
520
+ burgundy: {
521
+ palette: {
522
+ dark: burgundyDark,
523
+ light: burgundyLight,
524
+ },
525
+ },
526
+
527
+ teal: {
528
+ palette: {
529
+ dark: tealDark,
530
+ light: tealLight,
531
+ },
532
+ },
533
+
534
+ forest: {
535
+ palette: {
536
+ dark: forestDark,
537
+ light: forestLight,
538
+ },
539
+ },
540
+
541
+ cyan: {
542
+ palette: {
543
+ dark: cyanDark,
544
+ light: cyanLight,
545
+ },
546
+ },
547
+ },
548
+
549
+ grandChildrenThemes: {
550
+ alt1: {
551
+ template: 'alt1',
552
+ },
553
+ alt2: {
554
+ template: 'alt2',
555
+ },
556
+ surface1: {
557
+ template: 'surface1',
558
+ },
559
+ surface2: {
560
+ template: 'surface2',
561
+ },
562
+ surface3: {
563
+ template: 'surface3',
564
+ },
565
+ },
566
+ })
567
+
568
+ export type TamaguiThemes = typeof themes
569
+
570
+ /**
571
+ * This is an optional production optimization: themes JS can get to 20Kb or more.
572
+ * Tamagui has <1Kb of logic to hydrate themes from CSS, so you can remove the JS.
573
+ * So long as you server render your Tamagui CSS, this will save you bundle size:
574
+ */
575
+ export const themeDev: TamaguiThemes =
576
+ process.env.TAMAGUI_ENVIRONMENT === 'client' && process.env.NODE_ENV === 'production'
577
+ ? ({} as any)
578
+ : (themes as any)