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