@tamagui/config-default 1.0.4

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.js ADDED
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var src_exports = {};
20
+ __export(src_exports, {
21
+ getDefaultTamaguiConfig: () => getDefaultTamaguiConfig
22
+ });
23
+ module.exports = __toCommonJS(src_exports);
24
+ var import_core = require("@tamagui/core");
25
+ var import_shorthands = require("@tamagui/shorthands");
26
+ function getDefaultTamaguiConfig() {
27
+ const font = (0, import_core.createFont)({
28
+ family: "System",
29
+ size: {
30
+ 1: 15
31
+ },
32
+ lineHeight: {
33
+ 1: 15
34
+ },
35
+ transform: {},
36
+ weight: {
37
+ 1: "400"
38
+ },
39
+ color: {
40
+ 1: "$color"
41
+ },
42
+ letterSpacing: {
43
+ 1: 0
44
+ }
45
+ });
46
+ const size = {
47
+ 0: 0,
48
+ 0.25: 2,
49
+ 0.5: 4,
50
+ 0.75: 8,
51
+ 1: 20,
52
+ 1.5: 24,
53
+ 2: 28,
54
+ 2.5: 32,
55
+ 3: 36,
56
+ 3.5: 40,
57
+ 4: 44,
58
+ true: 44,
59
+ 4.5: 48,
60
+ 5: 52,
61
+ 5.5: 59,
62
+ 6: 64,
63
+ 6.5: 69,
64
+ 7: 74,
65
+ 7.6: 79,
66
+ 8: 84,
67
+ 8.5: 89,
68
+ 9: 94,
69
+ 9.5: 99,
70
+ 10: 104,
71
+ 11: 124,
72
+ 12: 144,
73
+ 13: 164,
74
+ 14: 184,
75
+ 15: 204,
76
+ 16: 224,
77
+ 17: 224,
78
+ 18: 244,
79
+ 19: 264,
80
+ 20: 284
81
+ };
82
+ const spaces = Object.entries(size).map(([k, v]) => [
83
+ k,
84
+ Math.max(0, v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12))
85
+ ]);
86
+ const spacesNegative = spaces.map(([k, v]) => [`-${k}`, -v]);
87
+ const space = {
88
+ ...Object.fromEntries(spaces),
89
+ ...Object.fromEntries(spacesNegative)
90
+ };
91
+ const zIndex = {
92
+ 0: 0,
93
+ 1: 100,
94
+ 2: 200,
95
+ 3: 300,
96
+ 4: 400,
97
+ 5: 500
98
+ };
99
+ const radius = {
100
+ 0: 0,
101
+ 1: 3,
102
+ 2: 5,
103
+ 3: 7,
104
+ 4: 9,
105
+ 5: 10,
106
+ 6: 16,
107
+ 7: 19,
108
+ 8: 22,
109
+ 9: 26,
110
+ 10: 34,
111
+ 11: 42,
112
+ 12: 50
113
+ };
114
+ const tokens = (0, import_core.createTokens)({
115
+ color: {
116
+ white: "#fff",
117
+ black: "#000"
118
+ },
119
+ radius,
120
+ zIndex,
121
+ space,
122
+ size
123
+ });
124
+ const themes = {
125
+ light: {
126
+ background: tokens.color.white,
127
+ color: tokens.color.black
128
+ },
129
+ dark: {
130
+ background: tokens.color.black,
131
+ color: tokens.color.white
132
+ },
133
+ dark_blue: {
134
+ background: "blue",
135
+ color: "white"
136
+ },
137
+ dark_Card: {
138
+ background: "dark",
139
+ color: "card"
140
+ },
141
+ dark_blue_Button: {
142
+ background: "blue",
143
+ color: "white"
144
+ },
145
+ dark_red: {
146
+ background: "darkred",
147
+ color: "white"
148
+ },
149
+ dark_red_alt1: {
150
+ background: "darkred",
151
+ color: "white"
152
+ },
153
+ dark_red_Button: {
154
+ background: "darkred",
155
+ color: "#ccc"
156
+ },
157
+ dark_yellow_Button: {
158
+ background: "brown",
159
+ color: "#ccc"
160
+ },
161
+ dark_red_alt2: {
162
+ background: "darkred",
163
+ color: "#555"
164
+ },
165
+ dark_red_alt2_Button: {
166
+ background: "darkred",
167
+ color: "#444"
168
+ },
169
+ red: {
170
+ background: "red",
171
+ color: "red"
172
+ }
173
+ };
174
+ return (0, import_core.createTamagui)({
175
+ shouldAddPrefersColorThemes: true,
176
+ themeClassNameOnRoot: true,
177
+ shorthands: import_shorthands.shorthands,
178
+ fonts: {
179
+ heading: font,
180
+ body: font
181
+ },
182
+ themes,
183
+ tokens,
184
+ media: {
185
+ xs: { maxWidth: 660 },
186
+ sm: { maxWidth: 800 },
187
+ md: { maxWidth: 1020 },
188
+ lg: { maxWidth: 1280 },
189
+ xl: { maxWidth: 1420 },
190
+ xxl: { maxWidth: 1600 },
191
+ gtXs: { minWidth: 660 + 1 },
192
+ gtSm: { minWidth: 800 + 1 },
193
+ gtMd: { minWidth: 1020 + 1 },
194
+ gtLg: { minWidth: 1280 + 1 },
195
+ short: { maxHeight: 820 },
196
+ tall: { minHeight: 820 },
197
+ hoverNone: { hover: "none" },
198
+ pointerCoarse: { pointer: "coarse" }
199
+ }
200
+ });
201
+ }
202
+ // Annotate the CommonJS export names for ESM import in node:
203
+ 0 && (module.exports = {
204
+ getDefaultTamaguiConfig
205
+ });
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["// SEE config-default-node\n\nimport {\n TamaguiInternalConfig,\n createFont,\n createTamagui,\n createTokens,\n} from '@tamagui/core'\nimport { shorthands } from '@tamagui/shorthands'\n\n// basic fallback theme just to have compiler load in decent tate\nexport function getDefaultTamaguiConfig() {\n const font = createFont({\n family: 'System',\n size: {\n 1: 15,\n },\n lineHeight: {\n 1: 15,\n },\n transform: {},\n weight: {\n 1: '400',\n },\n color: {\n 1: '$color',\n },\n letterSpacing: {\n 1: 0,\n },\n })\n\n const size = {\n 0: 0,\n 0.25: 2,\n 0.5: 4,\n 0.75: 8,\n 1: 20,\n 1.5: 24,\n 2: 28,\n 2.5: 32,\n 3: 36,\n 3.5: 40,\n 4: 44,\n true: 44,\n 4.5: 48,\n 5: 52,\n 5.5: 59,\n 6: 64,\n 6.5: 69,\n 7: 74,\n 7.6: 79,\n 8: 84,\n 8.5: 89,\n 9: 94,\n 9.5: 99,\n 10: 104,\n 11: 124,\n 12: 144,\n 13: 164,\n 14: 184,\n 15: 204,\n 16: 224,\n 17: 224,\n 18: 244,\n 19: 264,\n 20: 284,\n }\n\n const spaces = Object.entries(size).map(([k, v]) => [\n k,\n Math.max(0, v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12)),\n ])\n\n const spacesNegative = spaces.map(([k, v]) => [`-${k}`, -v])\n\n const space = {\n ...Object.fromEntries(spaces),\n ...Object.fromEntries(spacesNegative),\n } as any\n\n const zIndex = {\n 0: 0,\n 1: 100,\n 2: 200,\n 3: 300,\n 4: 400,\n 5: 500,\n }\n\n const radius = {\n 0: 0,\n 1: 3,\n 2: 5,\n 3: 7,\n 4: 9,\n 5: 10,\n 6: 16,\n 7: 19,\n 8: 22,\n 9: 26,\n 10: 34,\n 11: 42,\n 12: 50,\n }\n\n const tokens = createTokens({\n color: {\n white: '#fff',\n black: '#000',\n },\n radius,\n zIndex,\n space,\n size,\n })\n\n const themes = {\n light: {\n background: tokens.color.white,\n color: tokens.color.black,\n },\n dark: {\n background: tokens.color.black,\n color: tokens.color.white,\n },\n // most of these used for testing:\n dark_blue: {\n background: 'blue',\n color: 'white',\n },\n dark_Card: {\n background: 'dark',\n color: 'card',\n },\n dark_blue_Button: {\n background: 'blue',\n color: 'white',\n },\n dark_red: {\n background: 'darkred',\n color: 'white',\n },\n dark_red_alt1: {\n background: 'darkred',\n color: 'white',\n },\n dark_red_Button: {\n background: 'darkred',\n color: '#ccc',\n },\n dark_yellow_Button: {\n background: 'brown',\n color: '#ccc',\n },\n dark_red_alt2: {\n background: 'darkred',\n color: '#555',\n },\n dark_red_alt2_Button: {\n background: 'darkred',\n color: '#444',\n },\n red: {\n background: 'red',\n color: 'red',\n },\n }\n\n return createTamagui({\n shouldAddPrefersColorThemes: true,\n themeClassNameOnRoot: true,\n shorthands,\n fonts: {\n heading: font,\n body: font,\n },\n themes,\n tokens,\n media: {\n xs: { maxWidth: 660 },\n sm: { maxWidth: 800 },\n md: { maxWidth: 1020 },\n lg: { maxWidth: 1280 },\n xl: { maxWidth: 1420 },\n xxl: { maxWidth: 1600 },\n gtXs: { minWidth: 660 + 1 },\n gtSm: { minWidth: 800 + 1 },\n gtMd: { minWidth: 1020 + 1 },\n gtLg: { minWidth: 1280 + 1 },\n short: { maxHeight: 820 },\n tall: { minHeight: 820 },\n hoverNone: { hover: 'none' },\n pointerCoarse: { pointer: 'coarse' },\n },\n }) as TamaguiInternalConfig\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAKO;AACP,wBAA2B;AAGpB,SAAS,0BAA0B;AACxC,QAAM,WAAO,wBAAW;AAAA,IACtB,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,GAAG;AAAA,IACL;AAAA,IACA,YAAY;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IACA,WAAW,CAAC;AAAA,IACZ,QAAQ;AAAA,MACN,GAAG;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,GAAG;AAAA,IACL;AAAA,IACA,eAAe;AAAA,MACb,GAAG;AAAA,IACL;AAAA,EACF,CAAC;AAED,QAAM,OAAO;AAAA,IACX,GAAG;AAAA,IACH,MAAM;AAAA,IACN,KAAK;AAAA,IACL,MAAM;AAAA,IACN,GAAG;AAAA,IACH,KAAK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AAA,MACL,IAAI,EAAE,UAAU,IAAI;AAAA,MACpB,IAAI,EAAE,UAAU,IAAI;AAAA,MACpB,IAAI,EAAE,UAAU,KAAK;AAAA,MACrB,IAAI,EAAE,UAAU,KAAK;AAAA,MACrB,IAAI,EAAE,UAAU,KAAK;AAAA,MACrB,KAAK,EAAE,UAAU,KAAK;AAAA,MACtB,MAAM,EAAE,UAAU,MAAM,EAAE;AAAA,MAC1B,MAAM,EAAE,UAAU,MAAM,EAAE;AAAA,MAC1B,MAAM,EAAE,UAAU,OAAO,EAAE;AAAA,MAC3B,MAAM,EAAE,UAAU,OAAO,EAAE;AAAA,MAC3B,OAAO,EAAE,WAAW,IAAI;AAAA,MACxB,MAAM,EAAE,WAAW,IAAI;AAAA,MACvB,WAAW,EAAE,OAAO,OAAO;AAAA,MAC3B,eAAe,EAAE,SAAS,SAAS;AAAA,IACrC;AAAA,EACF,CAAC;AACH;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@tamagui/config-default",
3
+ "version": "1.0.4",
4
+ "source": "src/index.ts",
5
+ "main": "dist",
6
+ "types": "./types/index.d.ts",
7
+ "scripts": {
8
+ "build": "tamagui-build",
9
+ "watch": "tamagui-build --watch",
10
+ "clean": "tamagui-build clean",
11
+ "clean:build": "tamagui-build clean:build"
12
+ },
13
+ "files": [
14
+ "types",
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@tamagui/core": "^1.0.4",
19
+ "@tamagui/shorthands": "^1.0.4"
20
+ },
21
+ "devDependencies": {
22
+ "@tamagui/build": "^1.0.4"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ import { TamaguiInternalConfig } from '@tamagui/core';
2
+ export declare function getDefaultTamaguiConfig(): TamaguiInternalConfig<import("@tamagui/core").CreateTokens<import("@tamagui/core").VariableVal>, {
3
+ [key: string]: Partial<import("@tamagui/core").TamaguiBaseTheme> & {
4
+ [key: string]: import("@tamagui/core").VariableVal;
5
+ };
6
+ }, import("@tamagui/core").GenericShorthands, {
7
+ [key: string]: {
8
+ [key: string]: string | number;
9
+ };
10
+ }, {
11
+ [key: string]: string | any[] | {
12
+ [key: string]: any;
13
+ };
14
+ }, import("@tamagui/core").GenericFonts>;
15
+ //# sourceMappingURL=index.d.ts.map