@advui/theme 0.1.0
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.
- package/LICENSE +49 -0
- package/README.md +23 -0
- package/dist/animations.d.ts +18 -0
- package/dist/animations.d.ts.map +1 -0
- package/dist/animations.js +25 -0
- package/dist/animations.js.map +1 -0
- package/dist/animations.native.d.ts +75 -0
- package/dist/animations.native.d.ts.map +1 -0
- package/dist/animations.native.js +21 -0
- package/dist/animations.native.js.map +1 -0
- package/dist/config.d.ts +427 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +39 -0
- package/dist/config.js.map +1 -0
- package/dist/fonts.d.ts +80 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +54 -0
- package/dist/fonts.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/media.d.ts +59 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +48 -0
- package/dist/media.js.map +1 -0
- package/dist/palettes.d.ts +46 -0
- package/dist/palettes.d.ts.map +1 -0
- package/dist/palettes.js +64 -0
- package/dist/palettes.js.map +1 -0
- package/dist/presets.d.ts +91 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +54 -0
- package/dist/presets.js.map +1 -0
- package/dist/shadows.d.ts +60 -0
- package/dist/shadows.d.ts.map +1 -0
- package/dist/shadows.js +44 -0
- package/dist/shadows.js.map +1 -0
- package/dist/shorthands.d.ts +37 -0
- package/dist/shorthands.d.ts.map +1 -0
- package/dist/shorthands.js +37 -0
- package/dist/shorthands.js.map +1 -0
- package/dist/themes.d.ts +129 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +169 -0
- package/dist/themes.js.map +1 -0
- package/dist/tokens.d.ts +359 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +109 -0
- package/dist/tokens.js.map +1 -0
- package/package.json +63 -0
- package/src/animations.native.ts +21 -0
- package/src/animations.ts +26 -0
- package/src/config.ts +55 -0
- package/src/fonts.ts +89 -0
- package/src/index.ts +37 -0
- package/src/media.ts +55 -0
- package/src/palettes.ts +123 -0
- package/src/presets.ts +64 -0
- package/src/shadows.ts +45 -0
- package/src/shorthands.ts +36 -0
- package/src/themes.ts +324 -0
- package/src/tokens.ts +123 -0
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
export declare const space: {
|
|
2
|
+
[-20]: number;
|
|
3
|
+
[-1]: number;
|
|
4
|
+
[-10]: number;
|
|
5
|
+
[-12]: number;
|
|
6
|
+
[-14]: number;
|
|
7
|
+
[-16]: number;
|
|
8
|
+
[-24]: number;
|
|
9
|
+
[-2]: number;
|
|
10
|
+
[-3]: number;
|
|
11
|
+
[-4]: number;
|
|
12
|
+
[-5]: number;
|
|
13
|
+
[-6]: number;
|
|
14
|
+
[-7]: number;
|
|
15
|
+
[-8]: number;
|
|
16
|
+
[-9]: number;
|
|
17
|
+
[-1.5]: number;
|
|
18
|
+
[-0.5]: number;
|
|
19
|
+
[-11]: number;
|
|
20
|
+
[-32]: number;
|
|
21
|
+
[-2.5]: number;
|
|
22
|
+
[-3.5]: number;
|
|
23
|
+
true: number;
|
|
24
|
+
0: 0;
|
|
25
|
+
0.5: 2;
|
|
26
|
+
1: 4;
|
|
27
|
+
1.5: 6;
|
|
28
|
+
2: 8;
|
|
29
|
+
2.5: 10;
|
|
30
|
+
3: 12;
|
|
31
|
+
3.5: 14;
|
|
32
|
+
4: 16;
|
|
33
|
+
5: 20;
|
|
34
|
+
6: 24;
|
|
35
|
+
7: 28;
|
|
36
|
+
8: 32;
|
|
37
|
+
9: 36;
|
|
38
|
+
10: 40;
|
|
39
|
+
11: 44;
|
|
40
|
+
12: 48;
|
|
41
|
+
14: 56;
|
|
42
|
+
16: 64;
|
|
43
|
+
20: 80;
|
|
44
|
+
24: 96;
|
|
45
|
+
32: 128;
|
|
46
|
+
};
|
|
47
|
+
/** Sizes share the spacing scale and extend it for larger layout boxes. */
|
|
48
|
+
export declare const size: {
|
|
49
|
+
readonly 40: 160;
|
|
50
|
+
readonly 48: 192;
|
|
51
|
+
readonly 56: 224;
|
|
52
|
+
readonly 64: 256;
|
|
53
|
+
readonly 72: 288;
|
|
54
|
+
readonly 80: 320;
|
|
55
|
+
readonly 96: 384;
|
|
56
|
+
readonly 112: 448;
|
|
57
|
+
readonly 128: 512;
|
|
58
|
+
readonly 144: 576;
|
|
59
|
+
readonly 168: 672;
|
|
60
|
+
readonly 192: 768;
|
|
61
|
+
readonly 224: 896;
|
|
62
|
+
readonly true: 40;
|
|
63
|
+
readonly 0: 0;
|
|
64
|
+
readonly 0.5: 2;
|
|
65
|
+
readonly 1: 4;
|
|
66
|
+
readonly 1.5: 6;
|
|
67
|
+
readonly 2: 8;
|
|
68
|
+
readonly 2.5: 10;
|
|
69
|
+
readonly 3: 12;
|
|
70
|
+
readonly 3.5: 14;
|
|
71
|
+
readonly 4: 16;
|
|
72
|
+
readonly 5: 20;
|
|
73
|
+
readonly 6: 24;
|
|
74
|
+
readonly 7: 28;
|
|
75
|
+
readonly 8: 32;
|
|
76
|
+
readonly 9: 36;
|
|
77
|
+
readonly 10: 40;
|
|
78
|
+
readonly 11: 44;
|
|
79
|
+
readonly 12: 48;
|
|
80
|
+
readonly 14: 56;
|
|
81
|
+
readonly 16: 64;
|
|
82
|
+
readonly 20: 80;
|
|
83
|
+
readonly 24: 96;
|
|
84
|
+
readonly 32: 128;
|
|
85
|
+
};
|
|
86
|
+
export declare const radiusScales: {
|
|
87
|
+
readonly none: 0;
|
|
88
|
+
readonly sm: 4;
|
|
89
|
+
readonly md: 8;
|
|
90
|
+
readonly lg: 12;
|
|
91
|
+
readonly xl: 16;
|
|
92
|
+
};
|
|
93
|
+
export type RadiusScale = keyof typeof radiusScales;
|
|
94
|
+
/**
|
|
95
|
+
* Radius tokens derived from a single base value so the whole library can be
|
|
96
|
+
* made sharper or rounder at once. Components pick semantic steps:
|
|
97
|
+
* controls `$md`, menus/popovers `$lg`, cards/dialogs `$xl`, pills `$full`.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createRadius(scale?: RadiusScale | number): {
|
|
100
|
+
0: number;
|
|
101
|
+
xs: number;
|
|
102
|
+
sm: number;
|
|
103
|
+
md: number;
|
|
104
|
+
lg: number;
|
|
105
|
+
xl: number;
|
|
106
|
+
'2xl': number;
|
|
107
|
+
'3xl': number;
|
|
108
|
+
full: number;
|
|
109
|
+
true: number;
|
|
110
|
+
};
|
|
111
|
+
export declare const zIndex: {
|
|
112
|
+
readonly 0: 0;
|
|
113
|
+
readonly 1: 1;
|
|
114
|
+
readonly base: 0;
|
|
115
|
+
readonly dropdown: 1000;
|
|
116
|
+
readonly sticky: 1100;
|
|
117
|
+
readonly overlay: 1200;
|
|
118
|
+
readonly modal: 1300;
|
|
119
|
+
readonly popover: 1400;
|
|
120
|
+
readonly toast: 1500;
|
|
121
|
+
readonly tooltip: 1600;
|
|
122
|
+
};
|
|
123
|
+
export declare const colorTokens: {
|
|
124
|
+
readonly white: "#ffffff";
|
|
125
|
+
readonly black: "#000000";
|
|
126
|
+
readonly transparent: "rgba(0, 0, 0, 0)";
|
|
127
|
+
};
|
|
128
|
+
export declare function createUniversalTokens({ radius }?: {
|
|
129
|
+
radius?: RadiusScale | number;
|
|
130
|
+
}): {
|
|
131
|
+
color: {
|
|
132
|
+
readonly white: import("tamagui").Variable<string>;
|
|
133
|
+
readonly black: import("tamagui").Variable<string>;
|
|
134
|
+
readonly transparent: import("tamagui").Variable<string>;
|
|
135
|
+
};
|
|
136
|
+
space: {
|
|
137
|
+
[-20]: import("tamagui").Variable<number>;
|
|
138
|
+
[-1]: import("tamagui").Variable<number>;
|
|
139
|
+
[-10]: import("tamagui").Variable<number>;
|
|
140
|
+
[-12]: import("tamagui").Variable<number>;
|
|
141
|
+
[-14]: import("tamagui").Variable<number>;
|
|
142
|
+
[-16]: import("tamagui").Variable<number>;
|
|
143
|
+
[-24]: import("tamagui").Variable<number>;
|
|
144
|
+
[-2]: import("tamagui").Variable<number>;
|
|
145
|
+
[-3]: import("tamagui").Variable<number>;
|
|
146
|
+
[-4]: import("tamagui").Variable<number>;
|
|
147
|
+
[-5]: import("tamagui").Variable<number>;
|
|
148
|
+
[-6]: import("tamagui").Variable<number>;
|
|
149
|
+
[-7]: import("tamagui").Variable<number>;
|
|
150
|
+
[-8]: import("tamagui").Variable<number>;
|
|
151
|
+
[-9]: import("tamagui").Variable<number>;
|
|
152
|
+
[-1.5]: import("tamagui").Variable<number>;
|
|
153
|
+
[-0.5]: import("tamagui").Variable<number>;
|
|
154
|
+
[-11]: import("tamagui").Variable<number>;
|
|
155
|
+
[-32]: import("tamagui").Variable<number>;
|
|
156
|
+
[-2.5]: import("tamagui").Variable<number>;
|
|
157
|
+
[-3.5]: import("tamagui").Variable<number>;
|
|
158
|
+
true: import("tamagui").Variable<number>;
|
|
159
|
+
0: import("tamagui").Variable<number>;
|
|
160
|
+
0.5: import("tamagui").Variable<number>;
|
|
161
|
+
1: import("tamagui").Variable<number>;
|
|
162
|
+
1.5: import("tamagui").Variable<number>;
|
|
163
|
+
2: import("tamagui").Variable<number>;
|
|
164
|
+
2.5: import("tamagui").Variable<number>;
|
|
165
|
+
3: import("tamagui").Variable<number>;
|
|
166
|
+
3.5: import("tamagui").Variable<number>;
|
|
167
|
+
4: import("tamagui").Variable<number>;
|
|
168
|
+
5: import("tamagui").Variable<number>;
|
|
169
|
+
6: import("tamagui").Variable<number>;
|
|
170
|
+
7: import("tamagui").Variable<number>;
|
|
171
|
+
8: import("tamagui").Variable<number>;
|
|
172
|
+
9: import("tamagui").Variable<number>;
|
|
173
|
+
10: import("tamagui").Variable<number>;
|
|
174
|
+
11: import("tamagui").Variable<number>;
|
|
175
|
+
12: import("tamagui").Variable<number>;
|
|
176
|
+
14: import("tamagui").Variable<number>;
|
|
177
|
+
16: import("tamagui").Variable<number>;
|
|
178
|
+
20: import("tamagui").Variable<number>;
|
|
179
|
+
24: import("tamagui").Variable<number>;
|
|
180
|
+
32: import("tamagui").Variable<number>;
|
|
181
|
+
};
|
|
182
|
+
size: {
|
|
183
|
+
readonly 40: import("tamagui").Variable<number>;
|
|
184
|
+
readonly 48: import("tamagui").Variable<number>;
|
|
185
|
+
readonly 56: import("tamagui").Variable<number>;
|
|
186
|
+
readonly 64: import("tamagui").Variable<number>;
|
|
187
|
+
readonly 72: import("tamagui").Variable<number>;
|
|
188
|
+
readonly 80: import("tamagui").Variable<number>;
|
|
189
|
+
readonly 96: import("tamagui").Variable<number>;
|
|
190
|
+
readonly 112: import("tamagui").Variable<number>;
|
|
191
|
+
readonly 128: import("tamagui").Variable<number>;
|
|
192
|
+
readonly 144: import("tamagui").Variable<number>;
|
|
193
|
+
readonly 168: import("tamagui").Variable<number>;
|
|
194
|
+
readonly 192: import("tamagui").Variable<number>;
|
|
195
|
+
readonly 224: import("tamagui").Variable<number>;
|
|
196
|
+
readonly true: import("tamagui").Variable<number>;
|
|
197
|
+
readonly 0: import("tamagui").Variable<number>;
|
|
198
|
+
readonly 0.5: import("tamagui").Variable<number>;
|
|
199
|
+
readonly 1: import("tamagui").Variable<number>;
|
|
200
|
+
readonly 1.5: import("tamagui").Variable<number>;
|
|
201
|
+
readonly 2: import("tamagui").Variable<number>;
|
|
202
|
+
readonly 2.5: import("tamagui").Variable<number>;
|
|
203
|
+
readonly 3: import("tamagui").Variable<number>;
|
|
204
|
+
readonly 3.5: import("tamagui").Variable<number>;
|
|
205
|
+
readonly 4: import("tamagui").Variable<number>;
|
|
206
|
+
readonly 5: import("tamagui").Variable<number>;
|
|
207
|
+
readonly 6: import("tamagui").Variable<number>;
|
|
208
|
+
readonly 7: import("tamagui").Variable<number>;
|
|
209
|
+
readonly 8: import("tamagui").Variable<number>;
|
|
210
|
+
readonly 9: import("tamagui").Variable<number>;
|
|
211
|
+
readonly 10: import("tamagui").Variable<number>;
|
|
212
|
+
readonly 11: import("tamagui").Variable<number>;
|
|
213
|
+
readonly 12: import("tamagui").Variable<number>;
|
|
214
|
+
readonly 14: import("tamagui").Variable<number>;
|
|
215
|
+
readonly 16: import("tamagui").Variable<number>;
|
|
216
|
+
readonly 20: import("tamagui").Variable<number>;
|
|
217
|
+
readonly 24: import("tamagui").Variable<number>;
|
|
218
|
+
readonly 32: import("tamagui").Variable<number>;
|
|
219
|
+
};
|
|
220
|
+
radius: {
|
|
221
|
+
0: import("tamagui").Variable<number>;
|
|
222
|
+
xs: import("tamagui").Variable<number>;
|
|
223
|
+
sm: import("tamagui").Variable<number>;
|
|
224
|
+
md: import("tamagui").Variable<number>;
|
|
225
|
+
lg: import("tamagui").Variable<number>;
|
|
226
|
+
xl: import("tamagui").Variable<number>;
|
|
227
|
+
"2xl": import("tamagui").Variable<number>;
|
|
228
|
+
"3xl": import("tamagui").Variable<number>;
|
|
229
|
+
full: import("tamagui").Variable<number>;
|
|
230
|
+
true: import("tamagui").Variable<number>;
|
|
231
|
+
};
|
|
232
|
+
zIndex: {
|
|
233
|
+
readonly 0: import("tamagui").Variable<number>;
|
|
234
|
+
readonly 1: import("tamagui").Variable<number>;
|
|
235
|
+
readonly base: import("tamagui").Variable<number>;
|
|
236
|
+
readonly dropdown: import("tamagui").Variable<number>;
|
|
237
|
+
readonly sticky: import("tamagui").Variable<number>;
|
|
238
|
+
readonly overlay: import("tamagui").Variable<number>;
|
|
239
|
+
readonly modal: import("tamagui").Variable<number>;
|
|
240
|
+
readonly popover: import("tamagui").Variable<number>;
|
|
241
|
+
readonly toast: import("tamagui").Variable<number>;
|
|
242
|
+
readonly tooltip: import("tamagui").Variable<number>;
|
|
243
|
+
};
|
|
244
|
+
} & Omit<{
|
|
245
|
+
space: {
|
|
246
|
+
[-20]: import("tamagui").Variable<number>;
|
|
247
|
+
[-1]: import("tamagui").Variable<number>;
|
|
248
|
+
[-10]: import("tamagui").Variable<number>;
|
|
249
|
+
[-12]: import("tamagui").Variable<number>;
|
|
250
|
+
[-14]: import("tamagui").Variable<number>;
|
|
251
|
+
[-16]: import("tamagui").Variable<number>;
|
|
252
|
+
[-24]: import("tamagui").Variable<number>;
|
|
253
|
+
[-2]: import("tamagui").Variable<number>;
|
|
254
|
+
[-3]: import("tamagui").Variable<number>;
|
|
255
|
+
[-4]: import("tamagui").Variable<number>;
|
|
256
|
+
[-5]: import("tamagui").Variable<number>;
|
|
257
|
+
[-6]: import("tamagui").Variable<number>;
|
|
258
|
+
[-7]: import("tamagui").Variable<number>;
|
|
259
|
+
[-8]: import("tamagui").Variable<number>;
|
|
260
|
+
[-9]: import("tamagui").Variable<number>;
|
|
261
|
+
[-1.5]: import("tamagui").Variable<number>;
|
|
262
|
+
[-0.5]: import("tamagui").Variable<number>;
|
|
263
|
+
[-11]: import("tamagui").Variable<number>;
|
|
264
|
+
[-32]: import("tamagui").Variable<number>;
|
|
265
|
+
[-2.5]: import("tamagui").Variable<number>;
|
|
266
|
+
[-3.5]: import("tamagui").Variable<number>;
|
|
267
|
+
true: import("tamagui").Variable<number>;
|
|
268
|
+
0: import("tamagui").Variable<number>;
|
|
269
|
+
0.5: import("tamagui").Variable<number>;
|
|
270
|
+
1: import("tamagui").Variable<number>;
|
|
271
|
+
1.5: import("tamagui").Variable<number>;
|
|
272
|
+
2: import("tamagui").Variable<number>;
|
|
273
|
+
2.5: import("tamagui").Variable<number>;
|
|
274
|
+
3: import("tamagui").Variable<number>;
|
|
275
|
+
3.5: import("tamagui").Variable<number>;
|
|
276
|
+
4: import("tamagui").Variable<number>;
|
|
277
|
+
5: import("tamagui").Variable<number>;
|
|
278
|
+
6: import("tamagui").Variable<number>;
|
|
279
|
+
7: import("tamagui").Variable<number>;
|
|
280
|
+
8: import("tamagui").Variable<number>;
|
|
281
|
+
9: import("tamagui").Variable<number>;
|
|
282
|
+
10: import("tamagui").Variable<number>;
|
|
283
|
+
11: import("tamagui").Variable<number>;
|
|
284
|
+
12: import("tamagui").Variable<number>;
|
|
285
|
+
14: import("tamagui").Variable<number>;
|
|
286
|
+
16: import("tamagui").Variable<number>;
|
|
287
|
+
20: import("tamagui").Variable<number>;
|
|
288
|
+
24: import("tamagui").Variable<number>;
|
|
289
|
+
32: import("tamagui").Variable<number>;
|
|
290
|
+
};
|
|
291
|
+
size: {
|
|
292
|
+
readonly 40: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
293
|
+
readonly 48: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
294
|
+
readonly 56: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
295
|
+
readonly 64: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
296
|
+
readonly 72: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
297
|
+
readonly 80: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
298
|
+
readonly 96: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
299
|
+
readonly 112: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
300
|
+
readonly 128: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
301
|
+
readonly 144: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
302
|
+
readonly 168: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
303
|
+
readonly 192: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
304
|
+
readonly 224: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
305
|
+
readonly true: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
306
|
+
readonly 0: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
307
|
+
readonly 0.5: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
308
|
+
readonly 1: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
309
|
+
readonly 1.5: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
310
|
+
readonly 2: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
311
|
+
readonly 2.5: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
312
|
+
readonly 3: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
313
|
+
readonly 3.5: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
314
|
+
readonly 4: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
315
|
+
readonly 5: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
316
|
+
readonly 6: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
317
|
+
readonly 7: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
318
|
+
readonly 8: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
319
|
+
readonly 9: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
320
|
+
readonly 10: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
321
|
+
readonly 11: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
322
|
+
readonly 12: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
323
|
+
readonly 14: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
324
|
+
readonly 16: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
325
|
+
readonly 20: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
326
|
+
readonly 24: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
327
|
+
readonly 32: import("tamagui").Variable<0 | 20 | 10 | 12 | 14 | 16 | 24 | 36 | 48 | 2 | 4 | 6 | 8 | 768 | 28 | 32 | 40 | 44 | 56 | 64 | 80 | 96 | 128 | 160 | 192 | 224 | 256 | 288 | 320 | 384 | 448 | 512 | 576 | 672 | 896>;
|
|
328
|
+
};
|
|
329
|
+
radius: {
|
|
330
|
+
0: import("tamagui").Variable<number>;
|
|
331
|
+
xs: import("tamagui").Variable<number>;
|
|
332
|
+
sm: import("tamagui").Variable<number>;
|
|
333
|
+
md: import("tamagui").Variable<number>;
|
|
334
|
+
lg: import("tamagui").Variable<number>;
|
|
335
|
+
xl: import("tamagui").Variable<number>;
|
|
336
|
+
"2xl": import("tamagui").Variable<number>;
|
|
337
|
+
"3xl": import("tamagui").Variable<number>;
|
|
338
|
+
full: import("tamagui").Variable<number>;
|
|
339
|
+
true: import("tamagui").Variable<number>;
|
|
340
|
+
};
|
|
341
|
+
zIndex: {
|
|
342
|
+
readonly 0: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
343
|
+
readonly 1: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
344
|
+
readonly base: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
345
|
+
readonly dropdown: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
346
|
+
readonly sticky: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
347
|
+
readonly overlay: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
348
|
+
readonly modal: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
349
|
+
readonly popover: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
350
|
+
readonly toast: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
351
|
+
readonly tooltip: import("tamagui").Variable<0 | 1 | 1000 | 1100 | 1200 | 1300 | 1400 | 1500 | 1600>;
|
|
352
|
+
};
|
|
353
|
+
color: {
|
|
354
|
+
readonly white: import("tamagui").Variable<"#ffffff" | "#000000" | "rgba(0, 0, 0, 0)">;
|
|
355
|
+
readonly black: import("tamagui").Variable<"#ffffff" | "#000000" | "rgba(0, 0, 0, 0)">;
|
|
356
|
+
readonly transparent: import("tamagui").Variable<"#ffffff" | "#000000" | "rgba(0, 0, 0, 0)">;
|
|
357
|
+
};
|
|
358
|
+
}, "color" | "zIndex" | "radius" | "space" | "size">;
|
|
359
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQjB,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBP,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;CAMf,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,YAAY,CAAA;AAEnD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,WAAW,GAAG,MAAa;;;;;;;;;;;EAe9D;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;CAWT,CAAA;AAEV,eAAO,MAAM,WAAW;;;;CAId,CAAA;AAEV,wBAAgB,qBAAqB,CAAC,EAAE,MAAa,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAQ9F"}
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createTokens } from 'tamagui';
|
|
2
|
+
/**
|
|
3
|
+
* 4px-based spacing scale: `$1` = 4px, `$4` = 16px, `$10` = 40px.
|
|
4
|
+
* Negative keys (`$-2`) exist for margins.
|
|
5
|
+
*/
|
|
6
|
+
const spaceScale = {
|
|
7
|
+
0: 0,
|
|
8
|
+
0.5: 2,
|
|
9
|
+
1: 4,
|
|
10
|
+
1.5: 6,
|
|
11
|
+
2: 8,
|
|
12
|
+
2.5: 10,
|
|
13
|
+
3: 12,
|
|
14
|
+
3.5: 14,
|
|
15
|
+
4: 16,
|
|
16
|
+
5: 20,
|
|
17
|
+
6: 24,
|
|
18
|
+
7: 28,
|
|
19
|
+
8: 32,
|
|
20
|
+
9: 36,
|
|
21
|
+
10: 40,
|
|
22
|
+
11: 44,
|
|
23
|
+
12: 48,
|
|
24
|
+
14: 56,
|
|
25
|
+
16: 64,
|
|
26
|
+
20: 80,
|
|
27
|
+
24: 96,
|
|
28
|
+
32: 128,
|
|
29
|
+
};
|
|
30
|
+
export const space = {
|
|
31
|
+
...spaceScale,
|
|
32
|
+
true: 16,
|
|
33
|
+
...Object.fromEntries(Object.entries(spaceScale)
|
|
34
|
+
.filter(([key]) => key !== '0')
|
|
35
|
+
.map(([key, value]) => [`-${key}`, -value])),
|
|
36
|
+
};
|
|
37
|
+
/** Sizes share the spacing scale and extend it for larger layout boxes. */
|
|
38
|
+
export const size = {
|
|
39
|
+
...spaceScale,
|
|
40
|
+
40: 160,
|
|
41
|
+
48: 192,
|
|
42
|
+
56: 224,
|
|
43
|
+
64: 256,
|
|
44
|
+
72: 288,
|
|
45
|
+
80: 320,
|
|
46
|
+
96: 384,
|
|
47
|
+
112: 448,
|
|
48
|
+
128: 512,
|
|
49
|
+
144: 576,
|
|
50
|
+
168: 672,
|
|
51
|
+
192: 768,
|
|
52
|
+
224: 896,
|
|
53
|
+
true: 40,
|
|
54
|
+
};
|
|
55
|
+
export const radiusScales = {
|
|
56
|
+
none: 0,
|
|
57
|
+
sm: 4,
|
|
58
|
+
md: 8,
|
|
59
|
+
lg: 12,
|
|
60
|
+
xl: 16,
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Radius tokens derived from a single base value so the whole library can be
|
|
64
|
+
* made sharper or rounder at once. Components pick semantic steps:
|
|
65
|
+
* controls `$md`, menus/popovers `$lg`, cards/dialogs `$xl`, pills `$full`.
|
|
66
|
+
*/
|
|
67
|
+
export function createRadius(scale = 'md') {
|
|
68
|
+
const base = typeof scale === 'number' ? scale : radiusScales[scale];
|
|
69
|
+
const r = (factor) => Math.round(base * factor);
|
|
70
|
+
return {
|
|
71
|
+
0: 0,
|
|
72
|
+
xs: r(0.25),
|
|
73
|
+
sm: r(0.5),
|
|
74
|
+
md: r(0.75),
|
|
75
|
+
lg: r(1),
|
|
76
|
+
xl: r(1.5),
|
|
77
|
+
'2xl': r(2),
|
|
78
|
+
'3xl': r(3),
|
|
79
|
+
full: 9999,
|
|
80
|
+
true: r(0.75),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export const zIndex = {
|
|
84
|
+
0: 0,
|
|
85
|
+
1: 1,
|
|
86
|
+
base: 0,
|
|
87
|
+
dropdown: 1000,
|
|
88
|
+
sticky: 1100,
|
|
89
|
+
overlay: 1200,
|
|
90
|
+
modal: 1300,
|
|
91
|
+
popover: 1400,
|
|
92
|
+
toast: 1500,
|
|
93
|
+
tooltip: 1600,
|
|
94
|
+
};
|
|
95
|
+
export const colorTokens = {
|
|
96
|
+
white: '#ffffff',
|
|
97
|
+
black: '#000000',
|
|
98
|
+
transparent: 'rgba(0, 0, 0, 0)',
|
|
99
|
+
};
|
|
100
|
+
export function createUniversalTokens({ radius = 'md' } = {}) {
|
|
101
|
+
return createTokens({
|
|
102
|
+
space,
|
|
103
|
+
size,
|
|
104
|
+
radius: createRadius(radius),
|
|
105
|
+
zIndex,
|
|
106
|
+
color: colorTokens,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@advui/theme",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Design tokens, color presets and the Tamagui config factory for Adv UI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/zinmin232/advui.git",
|
|
9
|
+
"directory": "packages/theme"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/zinmin232/advui/tree/main/packages/theme#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/zinmin232/advui/issues"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"src",
|
|
28
|
+
"!src/**/*.test.*"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@tamagui/animations-css": "2.7.7",
|
|
35
|
+
"@tamagui/animations-react-native": "2.7.7",
|
|
36
|
+
"@tamagui/colors": "2.7.7",
|
|
37
|
+
"@tamagui/web": "2.7.7",
|
|
38
|
+
"@advui/utils": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": ">=19",
|
|
42
|
+
"react-native": "*",
|
|
43
|
+
"tamagui": "^2.7.7"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/react": "~19.2.2",
|
|
47
|
+
"@advui/eslint-config": "0.1.0",
|
|
48
|
+
"@advui/tsconfig": "0.1.0",
|
|
49
|
+
"react": "19.2.3",
|
|
50
|
+
"react-dom": "19.2.3",
|
|
51
|
+
"react-native": "0.86.3",
|
|
52
|
+
"react-native-web": "~0.21.0",
|
|
53
|
+
"tamagui": "2.7.7",
|
|
54
|
+
"vitest": "^5.0.2"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc -p tsconfig.build.json",
|
|
58
|
+
"typecheck": "tsc --noEmit",
|
|
59
|
+
"lint": "eslint .",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createAnimations } from '@tamagui/animations-react-native'
|
|
2
|
+
|
|
3
|
+
// Native: React Native Animated driver — no extra native modules, works in Expo Go.
|
|
4
|
+
// Keep the key set identical to animations.ts (Tamagui primitives use the ms names).
|
|
5
|
+
export const animations = createAnimations({
|
|
6
|
+
'0ms': { type: 'timing', duration: 0 },
|
|
7
|
+
'50ms': { type: 'timing', duration: 50 },
|
|
8
|
+
'75ms': { type: 'timing', duration: 75 },
|
|
9
|
+
'100ms': { type: 'timing', duration: 100 },
|
|
10
|
+
'200ms': { type: 'timing', duration: 200 },
|
|
11
|
+
'250ms': { type: 'timing', duration: 250 },
|
|
12
|
+
'300ms': { type: 'timing', duration: 300 },
|
|
13
|
+
'400ms': { type: 'timing', duration: 400 },
|
|
14
|
+
'500ms': { type: 'timing', duration: 500 },
|
|
15
|
+
quicker: { type: 'spring', damping: 20, mass: 0.6, stiffness: 600 },
|
|
16
|
+
quick: { type: 'spring', damping: 22, mass: 1, stiffness: 500 },
|
|
17
|
+
medium: { type: 'spring', damping: 18, mass: 0.9, stiffness: 180 },
|
|
18
|
+
slow: { type: 'spring', damping: 30, mass: 1, stiffness: 90 },
|
|
19
|
+
bouncy: { type: 'spring', damping: 10, mass: 0.9, stiffness: 120 },
|
|
20
|
+
lazy: { type: 'spring', damping: 18, mass: 1, stiffness: 50 },
|
|
21
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createAnimations } from '@tamagui/animations-css'
|
|
2
|
+
|
|
3
|
+
// Web: CSS transitions — no JS animation runtime. Reduced motion is honored
|
|
4
|
+
// globally by the provider's `prefers-reduced-motion` stylesheet.
|
|
5
|
+
//
|
|
6
|
+
// The millisecond names match Tamagui's v5 config: Tamagui primitives (Toast,
|
|
7
|
+
// Sheet…) reference them internally, so they must exist in every config.
|
|
8
|
+
const ease = 'cubic-bezier(0.22, 1, 0.36, 1)'
|
|
9
|
+
|
|
10
|
+
export const animations = createAnimations({
|
|
11
|
+
'0ms': '0ms linear',
|
|
12
|
+
'50ms': '50ms linear',
|
|
13
|
+
'75ms': '75ms linear',
|
|
14
|
+
'100ms': '100ms ease-out',
|
|
15
|
+
'200ms': '200ms ease-out',
|
|
16
|
+
'250ms': '250ms ease-out',
|
|
17
|
+
'300ms': '300ms ease-out',
|
|
18
|
+
'400ms': '400ms ease-out',
|
|
19
|
+
'500ms': '500ms ease-out',
|
|
20
|
+
quicker: `120ms ${ease}`,
|
|
21
|
+
quick: `160ms ${ease}`,
|
|
22
|
+
medium: `240ms ${ease}`,
|
|
23
|
+
slow: `360ms ${ease}`,
|
|
24
|
+
bouncy: '300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)',
|
|
25
|
+
lazy: `480ms ${ease}`,
|
|
26
|
+
})
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createTamagui } from 'tamagui'
|
|
2
|
+
import { animations } from './animations'
|
|
3
|
+
import { type FontFamilies, type FontScale, createUniversalFonts } from './fonts'
|
|
4
|
+
import { media, mediaQueryDefaultActive } from './media'
|
|
5
|
+
import { type ThemePresetName, themePresets } from './presets'
|
|
6
|
+
import { shorthands } from './shorthands'
|
|
7
|
+
import { type ThemeColorsInput, createThemeColors } from './themes'
|
|
8
|
+
import { type RadiusScale, createUniversalTokens } from './tokens'
|
|
9
|
+
|
|
10
|
+
export interface UniversalConfigOptions {
|
|
11
|
+
/** Starting color preset. Individual `colors` win over the preset. Default: `indigo`. */
|
|
12
|
+
preset?: ThemePresetName
|
|
13
|
+
/** Brand and intent colors — scale names (`'violet'`) or any color string (`'#6366f1'`). */
|
|
14
|
+
colors?: ThemeColorsInput
|
|
15
|
+
/** Corner roundness for every component. Default: `md` (8px base). */
|
|
16
|
+
radius?: RadiusScale | number
|
|
17
|
+
/** Global type scale. Default: `default`. */
|
|
18
|
+
fontScale?: FontScale | number
|
|
19
|
+
fonts?: FontFamilies
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builds a complete Tamagui config (tokens, light/dark themes, fonts, media
|
|
24
|
+
* queries, animations). Call once at app startup and pass to `UniversalProvider`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* export const config = createUniversalConfig({ preset: 'violet', radius: 'lg' })
|
|
28
|
+
*/
|
|
29
|
+
export function createUniversalConfig(options: UniversalConfigOptions = {}) {
|
|
30
|
+
const { preset = 'indigo', colors, radius = 'md', fontScale = 'default', fonts } = options
|
|
31
|
+
const themes = createThemeColors({ ...themePresets[preset].colors, ...colors })
|
|
32
|
+
|
|
33
|
+
return createTamagui({
|
|
34
|
+
tokens: createUniversalTokens({ radius }),
|
|
35
|
+
themes,
|
|
36
|
+
fonts: createUniversalFonts({ scale: fontScale, families: fonts }),
|
|
37
|
+
media,
|
|
38
|
+
shorthands,
|
|
39
|
+
animations,
|
|
40
|
+
selectionStyles: (theme) =>
|
|
41
|
+
theme.primarySoft ? { backgroundColor: theme.primarySoft, color: theme.foreground } : null,
|
|
42
|
+
settings: {
|
|
43
|
+
defaultFont: 'body',
|
|
44
|
+
mediaQueryDefaultActive,
|
|
45
|
+
fastSchemeChange: true,
|
|
46
|
+
shouldAddPrefersColorThemes: true,
|
|
47
|
+
addThemeClassName: 'html',
|
|
48
|
+
allowedStyleValues: 'somewhat-strict-web',
|
|
49
|
+
onlyAllowShorthands: false,
|
|
50
|
+
styleCompat: 'web',
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type UniversalConfig = ReturnType<typeof createUniversalConfig>
|