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