@tamagui/static 1.0.1-beta.105 → 1.0.1-beta.108
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/dist/cjs/extractor/defaultTamaguiConfig.js +136 -136
- package/dist/cjs/extractor/defaultTamaguiConfig.js.map +2 -2
- package/dist/cjs/extractor/loadTamagui.js +1 -2
- package/dist/cjs/extractor/loadTamagui.js.map +2 -2
- package/dist/esm/extractor/defaultTamaguiConfig.js +135 -134
- package/dist/esm/extractor/defaultTamaguiConfig.js.map +2 -2
- package/dist/esm/extractor/loadTamagui.js +2 -3
- package/dist/esm/extractor/loadTamagui.js.map +2 -2
- package/dist/jsx/extractor/defaultTamaguiConfig.js +138 -137
- package/dist/jsx/extractor/defaultTamaguiConfig.js.map +2 -2
- package/dist/jsx/extractor/loadTamagui.js +2 -3
- package/dist/jsx/extractor/loadTamagui.js.map +2 -2
- package/package.json +9 -9
- package/src/extractor/defaultTamaguiConfig.ts +136 -135
- package/src/extractor/loadTamagui.ts +2 -4
- package/types/extractor/defaultTamaguiConfig.d.ts +1 -69
- package/types/extractor/defaultTamaguiConfig.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
|
@@ -2,148 +2,149 @@ import { TamaguiInternalConfig, createFont, createTamagui, createTokens } from '
|
|
|
2
2
|
import { shorthands } from '@tamagui/shorthands'
|
|
3
3
|
|
|
4
4
|
// basic fallback theme just to have compiler load in decent tate
|
|
5
|
+
export function getDefaultTamaguiConfig() {
|
|
6
|
+
const font = createFont({
|
|
7
|
+
family: 'System',
|
|
8
|
+
size: {
|
|
9
|
+
1: 15,
|
|
10
|
+
},
|
|
11
|
+
lineHeight: {
|
|
12
|
+
1: 15,
|
|
13
|
+
},
|
|
14
|
+
transform: {},
|
|
15
|
+
weight: {
|
|
16
|
+
1: '400',
|
|
17
|
+
},
|
|
18
|
+
color: {
|
|
19
|
+
1: '$color',
|
|
20
|
+
},
|
|
21
|
+
letterSpacing: {
|
|
22
|
+
1: 0,
|
|
23
|
+
},
|
|
24
|
+
})
|
|
5
25
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
1:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
const size = {
|
|
27
|
+
0: 0,
|
|
28
|
+
0.25: 2,
|
|
29
|
+
0.5: 4,
|
|
30
|
+
0.75: 8,
|
|
31
|
+
1: 20,
|
|
32
|
+
1.5: 24,
|
|
33
|
+
2: 28,
|
|
34
|
+
2.5: 32,
|
|
35
|
+
3: 36,
|
|
36
|
+
3.5: 40,
|
|
37
|
+
4: 44,
|
|
38
|
+
true: 44,
|
|
39
|
+
4.5: 48,
|
|
40
|
+
5: 52,
|
|
41
|
+
5.5: 59,
|
|
42
|
+
6: 64,
|
|
43
|
+
6.5: 69,
|
|
44
|
+
7: 74,
|
|
45
|
+
7.6: 79,
|
|
46
|
+
8: 84,
|
|
47
|
+
8.5: 89,
|
|
48
|
+
9: 94,
|
|
49
|
+
9.5: 99,
|
|
50
|
+
10: 104,
|
|
51
|
+
11: 124,
|
|
52
|
+
12: 144,
|
|
53
|
+
13: 164,
|
|
54
|
+
14: 184,
|
|
55
|
+
15: 204,
|
|
56
|
+
16: 224,
|
|
57
|
+
17: 224,
|
|
58
|
+
18: 244,
|
|
59
|
+
19: 264,
|
|
60
|
+
20: 284,
|
|
61
|
+
}
|
|
25
62
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
0.75: 8,
|
|
31
|
-
1: 20,
|
|
32
|
-
1.5: 24,
|
|
33
|
-
2: 28,
|
|
34
|
-
2.5: 32,
|
|
35
|
-
3: 36,
|
|
36
|
-
3.5: 40,
|
|
37
|
-
4: 44,
|
|
38
|
-
true: 44,
|
|
39
|
-
4.5: 48,
|
|
40
|
-
5: 52,
|
|
41
|
-
5.5: 59,
|
|
42
|
-
6: 64,
|
|
43
|
-
6.5: 69,
|
|
44
|
-
7: 74,
|
|
45
|
-
7.6: 79,
|
|
46
|
-
8: 84,
|
|
47
|
-
8.5: 89,
|
|
48
|
-
9: 94,
|
|
49
|
-
9.5: 99,
|
|
50
|
-
10: 104,
|
|
51
|
-
11: 124,
|
|
52
|
-
12: 144,
|
|
53
|
-
13: 164,
|
|
54
|
-
14: 184,
|
|
55
|
-
15: 204,
|
|
56
|
-
16: 224,
|
|
57
|
-
17: 224,
|
|
58
|
-
18: 244,
|
|
59
|
-
19: 264,
|
|
60
|
-
20: 284,
|
|
61
|
-
}
|
|
63
|
+
const spaces = Object.entries(size).map(([k, v]) => [
|
|
64
|
+
k,
|
|
65
|
+
Math.max(0, v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12)),
|
|
66
|
+
])
|
|
62
67
|
|
|
63
|
-
const
|
|
64
|
-
k,
|
|
65
|
-
Math.max(0, v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12)),
|
|
66
|
-
])
|
|
68
|
+
const spacesNegative = spaces.map(([k, v]) => [`-${k}`, -v])
|
|
67
69
|
|
|
68
|
-
const
|
|
70
|
+
const space = {
|
|
71
|
+
...Object.fromEntries(spaces),
|
|
72
|
+
...Object.fromEntries(spacesNegative),
|
|
73
|
+
} as any
|
|
69
74
|
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
const zIndex = {
|
|
76
|
+
0: 0,
|
|
77
|
+
1: 100,
|
|
78
|
+
2: 200,
|
|
79
|
+
3: 300,
|
|
80
|
+
4: 400,
|
|
81
|
+
5: 500,
|
|
82
|
+
}
|
|
74
83
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
const radius = {
|
|
85
|
+
0: 0,
|
|
86
|
+
1: 3,
|
|
87
|
+
2: 5,
|
|
88
|
+
3: 7,
|
|
89
|
+
4: 9,
|
|
90
|
+
5: 10,
|
|
91
|
+
6: 16,
|
|
92
|
+
7: 19,
|
|
93
|
+
8: 22,
|
|
94
|
+
9: 26,
|
|
95
|
+
10: 34,
|
|
96
|
+
11: 42,
|
|
97
|
+
12: 50,
|
|
98
|
+
}
|
|
83
99
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
9: 26,
|
|
95
|
-
10: 34,
|
|
96
|
-
11: 42,
|
|
97
|
-
12: 50,
|
|
98
|
-
}
|
|
100
|
+
const tokens = createTokens({
|
|
101
|
+
color: {
|
|
102
|
+
white: '#fff',
|
|
103
|
+
black: '#000',
|
|
104
|
+
},
|
|
105
|
+
radius,
|
|
106
|
+
zIndex,
|
|
107
|
+
space,
|
|
108
|
+
size,
|
|
109
|
+
})
|
|
99
110
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
111
|
+
const themes = {
|
|
112
|
+
light: {
|
|
113
|
+
background: tokens.color.white,
|
|
114
|
+
color: tokens.color.black,
|
|
115
|
+
},
|
|
116
|
+
dark: {
|
|
117
|
+
background: tokens.color.black,
|
|
118
|
+
color: tokens.color.white,
|
|
119
|
+
},
|
|
120
|
+
}
|
|
110
121
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
return createTamagui({
|
|
123
|
+
defaultTheme: 'light',
|
|
124
|
+
shouldAddPrefersColorThemes: true,
|
|
125
|
+
themeClassNameOnRoot: true,
|
|
126
|
+
shorthands,
|
|
127
|
+
fonts: {
|
|
128
|
+
heading: font,
|
|
129
|
+
body: font,
|
|
130
|
+
},
|
|
131
|
+
themes,
|
|
132
|
+
tokens,
|
|
133
|
+
media: {
|
|
134
|
+
xs: { maxWidth: 660 },
|
|
135
|
+
sm: { maxWidth: 800 },
|
|
136
|
+
md: { maxWidth: 1020 },
|
|
137
|
+
lg: { maxWidth: 1280 },
|
|
138
|
+
xl: { maxWidth: 1420 },
|
|
139
|
+
xxl: { maxWidth: 1600 },
|
|
140
|
+
gtXs: { minWidth: 660 + 1 },
|
|
141
|
+
gtSm: { minWidth: 800 + 1 },
|
|
142
|
+
gtMd: { minWidth: 1020 + 1 },
|
|
143
|
+
gtLg: { minWidth: 1280 + 1 },
|
|
144
|
+
short: { maxHeight: 820 },
|
|
145
|
+
tall: { minHeight: 820 },
|
|
146
|
+
hoverNone: { hover: 'none' },
|
|
147
|
+
pointerCoarse: { pointer: 'coarse' },
|
|
148
|
+
},
|
|
149
|
+
}) as TamaguiInternalConfig
|
|
120
150
|
}
|
|
121
|
-
|
|
122
|
-
export const config = createTamagui({
|
|
123
|
-
defaultTheme: 'light',
|
|
124
|
-
shouldAddPrefersColorThemes: true,
|
|
125
|
-
themeClassNameOnRoot: true,
|
|
126
|
-
shorthands,
|
|
127
|
-
fonts: {
|
|
128
|
-
heading: font,
|
|
129
|
-
body: font,
|
|
130
|
-
},
|
|
131
|
-
themes,
|
|
132
|
-
tokens,
|
|
133
|
-
media: {
|
|
134
|
-
xs: { maxWidth: 660 },
|
|
135
|
-
sm: { maxWidth: 800 },
|
|
136
|
-
md: { maxWidth: 1020 },
|
|
137
|
-
lg: { maxWidth: 1280 },
|
|
138
|
-
xl: { maxWidth: 1420 },
|
|
139
|
-
xxl: { maxWidth: 1600 },
|
|
140
|
-
gtXs: { minWidth: 660 + 1 },
|
|
141
|
-
gtSm: { minWidth: 800 + 1 },
|
|
142
|
-
gtMd: { minWidth: 1020 + 1 },
|
|
143
|
-
gtLg: { minWidth: 1280 + 1 },
|
|
144
|
-
short: { maxHeight: 820 },
|
|
145
|
-
tall: { minHeight: 820 },
|
|
146
|
-
hoverNone: { hover: 'none' },
|
|
147
|
-
pointerCoarse: { pointer: 'coarse' },
|
|
148
|
-
},
|
|
149
|
-
}) as TamaguiInternalConfig
|
|
@@ -5,7 +5,7 @@ import { createTamagui } from '@tamagui/core-node'
|
|
|
5
5
|
|
|
6
6
|
import { SHOULD_DEBUG } from '../constants'
|
|
7
7
|
import { getNameToPaths, registerRequire, unregisterRequire } from '../require'
|
|
8
|
-
import {
|
|
8
|
+
import { getDefaultTamaguiConfig } from './defaultTamaguiConfig'
|
|
9
9
|
|
|
10
10
|
let loadedTamagui: any = null
|
|
11
11
|
|
|
@@ -20,8 +20,6 @@ export type TamaguiProjectInfo = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function loadTamagui(props: { components: string[]; config: string }): TamaguiProjectInfo {
|
|
23
|
-
console.trace('load', !!loadedTamagui)
|
|
24
|
-
|
|
25
23
|
if (loadedTamagui) {
|
|
26
24
|
return loadedTamagui
|
|
27
25
|
}
|
|
@@ -96,7 +94,7 @@ export function loadTamagui(props: { components: string[]; config: string }): Ta
|
|
|
96
94
|
}
|
|
97
95
|
return {
|
|
98
96
|
components: {},
|
|
99
|
-
tamaguiConfig:
|
|
97
|
+
tamaguiConfig: getDefaultTamaguiConfig(),
|
|
100
98
|
nameToPaths: {},
|
|
101
99
|
}
|
|
102
100
|
}
|
|
@@ -1,73 +1,5 @@
|
|
|
1
1
|
import { TamaguiInternalConfig } from '@tamagui/core-node';
|
|
2
|
-
export declare
|
|
3
|
-
color: {
|
|
4
|
-
white: import("@tamagui/core-node").Variable<any>;
|
|
5
|
-
black: import("@tamagui/core-node").Variable<any>;
|
|
6
|
-
};
|
|
7
|
-
space: {
|
|
8
|
-
[x: string]: import("@tamagui/core-node").Variable<any>;
|
|
9
|
-
};
|
|
10
|
-
size: {
|
|
11
|
-
0: import("@tamagui/core-node").Variable<any>;
|
|
12
|
-
0.25: import("@tamagui/core-node").Variable<any>;
|
|
13
|
-
0.5: import("@tamagui/core-node").Variable<any>;
|
|
14
|
-
0.75: import("@tamagui/core-node").Variable<any>;
|
|
15
|
-
1: import("@tamagui/core-node").Variable<any>;
|
|
16
|
-
1.5: import("@tamagui/core-node").Variable<any>;
|
|
17
|
-
2: import("@tamagui/core-node").Variable<any>;
|
|
18
|
-
2.5: import("@tamagui/core-node").Variable<any>;
|
|
19
|
-
3: import("@tamagui/core-node").Variable<any>;
|
|
20
|
-
3.5: import("@tamagui/core-node").Variable<any>;
|
|
21
|
-
4: import("@tamagui/core-node").Variable<any>;
|
|
22
|
-
true: import("@tamagui/core-node").Variable<any>;
|
|
23
|
-
4.5: import("@tamagui/core-node").Variable<any>;
|
|
24
|
-
5: import("@tamagui/core-node").Variable<any>;
|
|
25
|
-
5.5: import("@tamagui/core-node").Variable<any>;
|
|
26
|
-
6: import("@tamagui/core-node").Variable<any>;
|
|
27
|
-
6.5: import("@tamagui/core-node").Variable<any>;
|
|
28
|
-
7: import("@tamagui/core-node").Variable<any>;
|
|
29
|
-
7.6: import("@tamagui/core-node").Variable<any>;
|
|
30
|
-
8: import("@tamagui/core-node").Variable<any>;
|
|
31
|
-
8.5: import("@tamagui/core-node").Variable<any>;
|
|
32
|
-
9: import("@tamagui/core-node").Variable<any>;
|
|
33
|
-
9.5: import("@tamagui/core-node").Variable<any>;
|
|
34
|
-
10: import("@tamagui/core-node").Variable<any>;
|
|
35
|
-
11: import("@tamagui/core-node").Variable<any>;
|
|
36
|
-
12: import("@tamagui/core-node").Variable<any>;
|
|
37
|
-
13: import("@tamagui/core-node").Variable<any>;
|
|
38
|
-
14: import("@tamagui/core-node").Variable<any>;
|
|
39
|
-
15: import("@tamagui/core-node").Variable<any>;
|
|
40
|
-
16: import("@tamagui/core-node").Variable<any>;
|
|
41
|
-
17: import("@tamagui/core-node").Variable<any>;
|
|
42
|
-
18: import("@tamagui/core-node").Variable<any>;
|
|
43
|
-
19: import("@tamagui/core-node").Variable<any>;
|
|
44
|
-
20: import("@tamagui/core-node").Variable<any>;
|
|
45
|
-
};
|
|
46
|
-
radius: {
|
|
47
|
-
0: import("@tamagui/core-node").Variable<any>;
|
|
48
|
-
1: import("@tamagui/core-node").Variable<any>;
|
|
49
|
-
2: import("@tamagui/core-node").Variable<any>;
|
|
50
|
-
3: import("@tamagui/core-node").Variable<any>;
|
|
51
|
-
4: import("@tamagui/core-node").Variable<any>;
|
|
52
|
-
5: import("@tamagui/core-node").Variable<any>;
|
|
53
|
-
6: import("@tamagui/core-node").Variable<any>;
|
|
54
|
-
7: import("@tamagui/core-node").Variable<any>;
|
|
55
|
-
8: import("@tamagui/core-node").Variable<any>;
|
|
56
|
-
9: import("@tamagui/core-node").Variable<any>;
|
|
57
|
-
10: import("@tamagui/core-node").Variable<any>;
|
|
58
|
-
11: import("@tamagui/core-node").Variable<any>;
|
|
59
|
-
12: import("@tamagui/core-node").Variable<any>;
|
|
60
|
-
};
|
|
61
|
-
zIndex: {
|
|
62
|
-
0: import("@tamagui/core-node").Variable<any>;
|
|
63
|
-
1: import("@tamagui/core-node").Variable<any>;
|
|
64
|
-
2: import("@tamagui/core-node").Variable<any>;
|
|
65
|
-
3: import("@tamagui/core-node").Variable<any>;
|
|
66
|
-
4: import("@tamagui/core-node").Variable<any>;
|
|
67
|
-
5: import("@tamagui/core-node").Variable<any>;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export declare const config: TamaguiInternalConfig<import("@tamagui/core-node").CreateTokens<import("@tamagui/core-node").VariableVal>, {
|
|
2
|
+
export declare function getDefaultTamaguiConfig(): TamaguiInternalConfig<import("@tamagui/core-node").CreateTokens<import("@tamagui/core-node").VariableVal>, {
|
|
71
3
|
[key: string]: Partial<import("@tamagui/core-node").TamaguiBaseTheme> & {
|
|
72
4
|
[key: string]: import("@tamagui/core-node").VariableVal;
|
|
73
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTamaguiConfig.d.ts","sourceRoot":"","sources":["../../src/extractor/defaultTamaguiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"defaultTamaguiConfig.d.ts","sourceRoot":"","sources":["../../src/extractor/defaultTamaguiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAA;AAInG,wBAAgB,uBAAuB;;;;;;;;;;;;8CAiJtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAS/F,aAAK,WAAW,GAAG;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAA;AAED,oBAAY,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC5C,aAAa,EAAE,qBAAqB,CAAA;IACpC,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAS/F,aAAK,WAAW,GAAG;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAA;AAED,oBAAY,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC5C,aAAa,EAAE,qBAAqB,CAAA;IACpC,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAwF/F"}
|