@tamagui/config-default 2.7.6 → 3.0.0-beta.637.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.
package/dist/index.cjs CHANGED
@@ -1,265 +1,224 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var index_exports = {};
24
- __export(index_exports, {
25
- getDefaultTamaguiConfig: () => getDefaultTamaguiConfig
26
- });
23
+ __export(index_exports, { getDefaultTamaguiConfig: () => getDefaultTamaguiConfig });
27
24
  module.exports = __toCommonJS(index_exports);
28
25
  var import_shorthands = require("@tamagui/shorthands");
29
26
  var import_web = require("@tamagui/web");
30
27
  var import_animations = require("./animations.cjs");
31
- var import_animations2 = require("./animations.native");
28
+ var import_animations2 = require("./animations.native.cjs");
32
29
  function getDefaultTamaguiConfig(platform = "web") {
33
- const headingFont = (0, import_web.createFont)({
34
- family: "Heading",
35
- size: {
36
- 1: 15
37
- },
38
- lineHeight: {
39
- 1: 15
40
- },
41
- transform: {},
42
- weight: {
43
- 1: "400"
44
- },
45
- color: {
46
- 1: "$color"
47
- },
48
- letterSpacing: {
49
- 1: 0
50
- }
51
- });
52
- const font = (0, import_web.createFont)({
53
- family: "System",
54
- size: {
55
- 1: 15
56
- },
57
- lineHeight: {
58
- 1: 15
59
- },
60
- transform: {},
61
- weight: {
62
- 1: "400"
63
- },
64
- color: {
65
- 1: "$color"
66
- },
67
- letterSpacing: {
68
- 1: 0
69
- }
70
- });
71
- const size = {
72
- 0: 0,
73
- 0.25: 2,
74
- 0.5: 4,
75
- 0.75: 8,
76
- 1: 20,
77
- 1.5: 24,
78
- 2: 28,
79
- 2.5: 32,
80
- 3: 36,
81
- 3.5: 40,
82
- 4: 44,
83
- true: 44,
84
- 4.5: 48,
85
- 5: 52,
86
- 5.5: 59,
87
- 6: 64,
88
- 6.5: 69,
89
- 7: 74,
90
- 7.6: 79,
91
- 8: 84,
92
- 8.5: 89,
93
- 9: 94,
94
- 9.5: 99,
95
- 10: 104,
96
- 11: 124,
97
- 12: 144,
98
- 13: 164,
99
- 14: 184,
100
- 15: 204,
101
- 16: 224,
102
- 17: 224,
103
- 18: 244,
104
- 19: 264,
105
- 20: 284
106
- };
107
- const spaces = Object.entries(size).map(([k, v]) => [k, Math.max(0, v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12))]);
108
- const spacesNegative = spaces.slice(1).map(([k, v]) => [`-${k}`, -v]);
109
- const space = {
110
- ...Object.fromEntries(spaces),
111
- ...Object.fromEntries(spacesNegative)
112
- };
113
- const zIndex = {
114
- 0: 0,
115
- 1: 100,
116
- 2: 200,
117
- 3: 300,
118
- 4: 400,
119
- 5: 500
120
- };
121
- const radius = {
122
- 0: 0,
123
- 1: 3,
124
- 2: 5,
125
- 3: 7,
126
- 4: 9,
127
- 5: 10,
128
- 6: 16,
129
- 7: 19,
130
- 8: 22,
131
- 9: 26,
132
- 10: 34,
133
- 11: 42,
134
- 12: 50
135
- };
136
- const tokens = (0, import_web.createTokens)({
137
- color: {
138
- white: "#fff",
139
- black: "#000"
140
- },
141
- radius,
142
- zIndex,
143
- space,
144
- size
145
- });
146
- const themes = {
147
- light: {
148
- background: tokens.color.white,
149
- color: tokens.color.black
150
- },
151
- dark: {
152
- background: tokens.color.black,
153
- color: tokens.color.white
154
- },
155
- // most of these used for testing:
156
- dark_blue: {
157
- background: "blue",
158
- color: "white"
159
- },
160
- dark_Card: {
161
- background: "dark",
162
- color: "card"
163
- },
164
- dark_Button: {
165
- background: "dark",
166
- color: "button"
167
- },
168
- dark_blue_Button: {
169
- background: "blue",
170
- color: "white"
171
- },
172
- dark_red: {
173
- background: "darkred",
174
- color: "white"
175
- },
176
- dark_red_alt1: {
177
- background: "darkred",
178
- color: "white"
179
- },
180
- dark_red_Button: {
181
- background: "darkred",
182
- color: "#ccc"
183
- },
184
- dark_yellow_Button: {
185
- background: "brown",
186
- color: "#ccc"
187
- },
188
- dark_red_active_ListItem: {
189
- background: "darkred",
190
- color: "red"
191
- },
192
- dark_red_alt2: {
193
- background: "darkred",
194
- color: "#555"
195
- },
196
- dark_red_alt2_Button: {
197
- background: "darkred",
198
- color: "#444"
199
- },
200
- red: {
201
- background: "red",
202
- color: "red"
203
- }
204
- };
205
- const fonts = {
206
- heading: headingFont,
207
- body: font
208
- };
209
- const media = {
210
- xs: {
211
- maxWidth: 660
212
- },
213
- sm: {
214
- maxWidth: 800
215
- },
216
- md: {
217
- maxWidth: 1020
218
- },
219
- lg: {
220
- maxWidth: 1280
221
- },
222
- xl: {
223
- maxWidth: 1420
224
- },
225
- xxl: {
226
- maxWidth: 1600
227
- },
228
- gtXs: {
229
- minWidth: 660 + 1
230
- },
231
- gtSm: {
232
- minWidth: 800 + 1
233
- },
234
- gtMd: {
235
- minWidth: 1020 + 1
236
- },
237
- gtLg: {
238
- minWidth: 1280 + 1
239
- },
240
- short: {
241
- maxHeight: 820
242
- },
243
- tall: {
244
- minHeight: 820
245
- },
246
- hoverNone: {
247
- hover: "none"
248
- },
249
- pointerCoarse: {
250
- pointer: "coarse"
251
- }
252
- };
253
- return {
254
- animations: platform === "web" ? import_animations.animations : import_animations2.animations,
255
- shorthands: import_shorthands.shorthands,
256
- fonts,
257
- themes,
258
- tokens,
259
- media,
260
- settings: {
261
- shouldAddPrefersColorThemes: true,
262
- defaultFont: "body"
263
- }
264
- };
265
- }
30
+ const headingFont = (0, import_web.createFont)({
31
+ family: "Heading",
32
+ size: {
33
+ 1: 15,
34
+ 4: 15
35
+ },
36
+ lineHeight: {
37
+ 1: 15,
38
+ 4: 15
39
+ },
40
+ transform: {},
41
+ weight: { 1: "400" },
42
+ color: { 1: "color" },
43
+ letterSpacing: { 1: 0 }
44
+ });
45
+ const font = (0, import_web.createFont)({
46
+ family: "System",
47
+ size: {
48
+ 1: 15,
49
+ 4: 15
50
+ },
51
+ lineHeight: {
52
+ 1: 15,
53
+ 4: 15
54
+ },
55
+ transform: {},
56
+ weight: { 1: "400" },
57
+ color: { 1: "color" },
58
+ letterSpacing: { 1: 0 }
59
+ });
60
+ const size = {
61
+ 0: 0,
62
+ .25: 2,
63
+ .5: 4,
64
+ .75: 8,
65
+ 1: 20,
66
+ 1.5: 24,
67
+ 2: 28,
68
+ 2.5: 32,
69
+ 3: 36,
70
+ 3.5: 40,
71
+ 4: 44,
72
+ 4.5: 48,
73
+ 5: 52,
74
+ 5.5: 59,
75
+ 6: 64,
76
+ 6.5: 69,
77
+ 7: 74,
78
+ 7.6: 79,
79
+ 8: 84,
80
+ 8.5: 89,
81
+ 9: 94,
82
+ 9.5: 99,
83
+ 10: 104,
84
+ 11: 124,
85
+ 12: 144,
86
+ 13: 164,
87
+ 14: 184,
88
+ 15: 204,
89
+ 16: 224,
90
+ 17: 224,
91
+ 18: 244,
92
+ 19: 264,
93
+ 20: 284
94
+ };
95
+ const spaces = Object.entries(size).map(([k, v]) => [k, Math.max(0, v <= 16 ? Math.round(v * .333) : Math.floor(v * .7 - 12))]);
96
+ const spacesNegative = spaces.slice(1).map(([k, v]) => [`-${k}`, -v]);
97
+ const space = {
98
+ ...Object.fromEntries(spaces),
99
+ ...Object.fromEntries(spacesNegative)
100
+ };
101
+ const zIndex = {
102
+ 0: 0,
103
+ 1: 100,
104
+ 2: 200,
105
+ 3: 300,
106
+ 4: 400,
107
+ 5: 500
108
+ };
109
+ const radius = {
110
+ 0: 0,
111
+ 1: 3,
112
+ 2: 5,
113
+ 3: 7,
114
+ 4: 9,
115
+ 5: 10,
116
+ 6: 16,
117
+ 7: 19,
118
+ 8: 22,
119
+ 9: 26,
120
+ 10: 34,
121
+ 11: 42,
122
+ 12: 50
123
+ };
124
+ const tokens = (0, import_web.createTokens)({
125
+ color: {
126
+ white: "#fff",
127
+ black: "#000"
128
+ },
129
+ radius,
130
+ zIndex,
131
+ space,
132
+ size
133
+ });
134
+ const themes = {
135
+ light: {
136
+ background: tokens.color.white,
137
+ color: tokens.color.black
138
+ },
139
+ dark: {
140
+ background: tokens.color.black,
141
+ color: tokens.color.white
142
+ },
143
+ dark_blue: {
144
+ background: "blue",
145
+ color: "white"
146
+ },
147
+ dark_Card: {
148
+ background: "dark",
149
+ color: "card"
150
+ },
151
+ dark_Button: {
152
+ background: "dark",
153
+ color: "button"
154
+ },
155
+ dark_blue_Button: {
156
+ background: "blue",
157
+ color: "white"
158
+ },
159
+ dark_red: {
160
+ background: "darkred",
161
+ color: "white"
162
+ },
163
+ dark_red_alt1: {
164
+ background: "darkred",
165
+ color: "white"
166
+ },
167
+ dark_red_Button: {
168
+ background: "darkred",
169
+ color: "#ccc"
170
+ },
171
+ dark_yellow_Button: {
172
+ background: "brown",
173
+ color: "#ccc"
174
+ },
175
+ dark_red_active_ListItem: {
176
+ background: "darkred",
177
+ color: "red"
178
+ },
179
+ dark_red_alt2: {
180
+ background: "darkred",
181
+ color: "#555"
182
+ },
183
+ dark_red_alt2_Button: {
184
+ background: "darkred",
185
+ color: "#444"
186
+ },
187
+ red: {
188
+ background: "red",
189
+ color: "red"
190
+ }
191
+ };
192
+ const fonts = {
193
+ heading: headingFont,
194
+ body: font
195
+ };
196
+ const media = {
197
+ xs: { maxWidth: 660 },
198
+ sm: { maxWidth: 800 },
199
+ md: { maxWidth: 1020 },
200
+ lg: { maxWidth: 1280 },
201
+ xl: { maxWidth: 1420 },
202
+ xxl: { maxWidth: 1600 },
203
+ gtXs: { minWidth: 660 + 1 },
204
+ gtSm: { minWidth: 800 + 1 },
205
+ gtMd: { minWidth: 1020 + 1 },
206
+ gtLg: { minWidth: 1280 + 1 },
207
+ short: { maxHeight: 820 },
208
+ tall: { minHeight: 820 },
209
+ hoverNone: { hover: "none" },
210
+ pointerCoarse: { pointer: "coarse" }
211
+ };
212
+ return {
213
+ animations: platform === "web" ? import_animations.animations : import_animations2.animations,
214
+ shorthands: import_shorthands.shorthands,
215
+ fonts,
216
+ themes,
217
+ tokens,
218
+ media,
219
+ settings: {
220
+ shouldAddPrefersColorThemes: true,
221
+ defaultFont: "body"
222
+ }
223
+ };
224
+ }