@tamagui/themes 1.114.3 → 1.115.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/cjs/componentThemeDefinitions.cjs +124 -0
- package/dist/cjs/generated-new.cjs +3425 -0
- package/dist/cjs/generated-v2.cjs +3327 -0
- package/dist/cjs/generated-v3.cjs +1995 -0
- package/dist/cjs/helpers.cjs +34 -0
- package/dist/cjs/index.cjs +25 -0
- package/dist/cjs/{masks.js → masks.cjs} +54 -26
- package/dist/cjs/palettes.cjs +52 -0
- package/dist/cjs/shadows.cjs +43 -0
- package/dist/cjs/templates.cjs +118 -0
- package/dist/cjs/themes-new.cjs +86 -0
- package/dist/cjs/themes-old.cjs +284 -0
- package/dist/cjs/{themes.js → themes.cjs} +22 -14
- package/dist/cjs/tokens.cjs +155 -0
- package/dist/cjs/v2-themes.cjs +466 -0
- package/dist/cjs/{v2.js → v2.cjs} +32 -15
- package/dist/cjs/v3-themes.cjs +556 -0
- package/dist/cjs/{v3.js → v3.cjs} +32 -15
- package/package.json +13 -12
- package/dist/cjs/componentThemeDefinitions.js +0 -123
- package/dist/cjs/generated-new.js +0 -1806
- package/dist/cjs/generated-v2.js +0 -1788
- package/dist/cjs/generated-v3.js +0 -3564
- package/dist/cjs/helpers.js +0 -29
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/palettes.js +0 -82
- package/dist/cjs/shadows.js +0 -34
- package/dist/cjs/templates.js +0 -106
- package/dist/cjs/themes-new.js +0 -76
- package/dist/cjs/themes-old.js +0 -266
- package/dist/cjs/tokens.js +0 -143
- package/dist/cjs/v2-themes.js +0 -479
- package/dist/cjs/v3-themes.js +0 -594
- /package/dist/cjs/{componentThemeDefinitions.js.map → componentThemeDefinitions.cjs.map} +0 -0
- /package/dist/cjs/{generated-new.js.map → generated-new.cjs.map} +0 -0
- /package/dist/cjs/{generated-v2.js.map → generated-v2.cjs.map} +0 -0
- /package/dist/cjs/{generated-v3.js.map → generated-v3.cjs.map} +0 -0
- /package/dist/cjs/{helpers.js.map → helpers.cjs.map} +0 -0
- /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/{masks.js.map → masks.cjs.map} +0 -0
- /package/dist/cjs/{palettes.js.map → palettes.cjs.map} +0 -0
- /package/dist/cjs/{shadows.js.map → shadows.cjs.map} +0 -0
- /package/dist/cjs/{templates.js.map → templates.cjs.map} +0 -0
- /package/dist/cjs/{themes-new.js.map → themes-new.cjs.map} +0 -0
- /package/dist/cjs/{themes-old.js.map → themes-old.cjs.map} +0 -0
- /package/dist/cjs/{themes.js.map → themes.cjs.map} +0 -0
- /package/dist/cjs/{tokens.js.map → tokens.cjs.map} +0 -0
- /package/dist/cjs/{v2-themes.js.map → v2-themes.cjs.map} +0 -0
- /package/dist/cjs/{v2.js.map → v2.cjs.map} +0 -0
- /package/dist/cjs/{v3-themes.js.map → v3-themes.cjs.map} +0 -0
- /package/dist/cjs/{v3.js.map → v3.cjs.map} +0 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var themes_old_exports = {};
|
|
22
|
+
__export(themes_old_exports, {
|
|
23
|
+
themes: () => themes
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(themes_old_exports);
|
|
26
|
+
var import_create_theme = require("@tamagui/create-theme"),
|
|
27
|
+
import_tokens = require("./tokens.cjs");
|
|
28
|
+
const lightTransparent = "rgba(255,255,255,0)",
|
|
29
|
+
darkTransparent = "rgba(10,10,10,0)",
|
|
30
|
+
palettes = {
|
|
31
|
+
dark: [darkTransparent, "#050505", "#151515", "#191919", "#232323", "#282828", "#323232", "#424242", "#494949", "#545454", "#626262", "#a5a5a5", "#fff", lightTransparent],
|
|
32
|
+
light: [lightTransparent, "#fff", "#f9f9f9", "hsl(0, 0%, 97.3%)", "hsl(0, 0%, 95.1%)", "hsl(0, 0%, 94.0%)", "hsl(0, 0%, 92.0%)", "hsl(0, 0%, 89.5%)", "hsl(0, 0%, 81.0%)", "hsl(0, 0%, 56.1%)", "hsl(0, 0%, 50.3%)", "hsl(0, 0%, 42.5%)", "hsl(0, 0%, 9.0%)", darkTransparent]
|
|
33
|
+
},
|
|
34
|
+
templateColors = {
|
|
35
|
+
color1: 1,
|
|
36
|
+
color2: 2,
|
|
37
|
+
color3: 3,
|
|
38
|
+
color4: 4,
|
|
39
|
+
color5: 5,
|
|
40
|
+
color6: 6,
|
|
41
|
+
color7: 7,
|
|
42
|
+
color8: 8,
|
|
43
|
+
color9: 9,
|
|
44
|
+
color10: 10,
|
|
45
|
+
color11: 11,
|
|
46
|
+
color12: 12
|
|
47
|
+
},
|
|
48
|
+
templateShadows = {
|
|
49
|
+
shadowColor: 1,
|
|
50
|
+
shadowColorHover: 1,
|
|
51
|
+
shadowColorPress: 2,
|
|
52
|
+
shadowColorFocus: 2
|
|
53
|
+
},
|
|
54
|
+
toSkip = {
|
|
55
|
+
...templateShadows
|
|
56
|
+
},
|
|
57
|
+
override = Object.fromEntries(Object.entries(toSkip).map(([k]) => [k, 0])),
|
|
58
|
+
overrideShadows = Object.fromEntries(Object.entries(templateShadows).map(([k]) => [k, 0])),
|
|
59
|
+
overrideWithColors = {
|
|
60
|
+
...override,
|
|
61
|
+
color: 0,
|
|
62
|
+
colorHover: 0,
|
|
63
|
+
colorFocus: 0,
|
|
64
|
+
colorPress: 0
|
|
65
|
+
},
|
|
66
|
+
template = {
|
|
67
|
+
...templateColors,
|
|
68
|
+
...toSkip,
|
|
69
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
70
|
+
// can publish components for others to use without mandating a specific color scale
|
|
71
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
72
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
73
|
+
background: 2,
|
|
74
|
+
backgroundHover: 3,
|
|
75
|
+
backgroundPress: 4,
|
|
76
|
+
backgroundFocus: 5,
|
|
77
|
+
backgroundStrong: 1,
|
|
78
|
+
backgroundTransparent: 0,
|
|
79
|
+
color: -1,
|
|
80
|
+
colorHover: -2,
|
|
81
|
+
colorPress: -1,
|
|
82
|
+
colorFocus: -2,
|
|
83
|
+
colorTransparent: -0,
|
|
84
|
+
borderColor: 4,
|
|
85
|
+
borderColorHover: 5,
|
|
86
|
+
borderColorPress: 3,
|
|
87
|
+
borderColorFocus: 4,
|
|
88
|
+
placeholderColor: -4
|
|
89
|
+
},
|
|
90
|
+
lightShadowColor = "rgba(0,0,0,0.02)",
|
|
91
|
+
lightShadowColorStrong = "rgba(0,0,0,0.066)",
|
|
92
|
+
darkShadowColor = "rgba(0,0,0,0.2)",
|
|
93
|
+
darkShadowColorStrong = "rgba(0,0,0,0.3)",
|
|
94
|
+
lightShadows = {
|
|
95
|
+
shadowColor: lightShadowColorStrong,
|
|
96
|
+
shadowColorHover: lightShadowColorStrong,
|
|
97
|
+
shadowColorPress: lightShadowColor,
|
|
98
|
+
shadowColorFocus: lightShadowColor
|
|
99
|
+
},
|
|
100
|
+
darkShadows = {
|
|
101
|
+
shadowColor: darkShadowColorStrong,
|
|
102
|
+
shadowColorHover: darkShadowColorStrong,
|
|
103
|
+
shadowColorPress: darkShadowColor,
|
|
104
|
+
shadowColorFocus: darkShadowColor
|
|
105
|
+
},
|
|
106
|
+
lightTemplate = {
|
|
107
|
+
...template,
|
|
108
|
+
background: 2,
|
|
109
|
+
backgroundHover: 3,
|
|
110
|
+
backgroundPress: 4,
|
|
111
|
+
// our light color palette is... a bit unique
|
|
112
|
+
borderColor: 6,
|
|
113
|
+
borderColorHover: 7,
|
|
114
|
+
borderColorFocus: 5,
|
|
115
|
+
borderColorPress: 6,
|
|
116
|
+
...lightShadows
|
|
117
|
+
},
|
|
118
|
+
darkTemplate = {
|
|
119
|
+
...template,
|
|
120
|
+
...darkShadows
|
|
121
|
+
},
|
|
122
|
+
light = (0, import_create_theme.createTheme)(palettes.light, lightTemplate),
|
|
123
|
+
dark = (0, import_create_theme.createTheme)(palettes.dark, darkTemplate),
|
|
124
|
+
baseThemes = {
|
|
125
|
+
light,
|
|
126
|
+
dark
|
|
127
|
+
},
|
|
128
|
+
masks = {
|
|
129
|
+
skip: import_create_theme.skipMask,
|
|
130
|
+
weaker: (0, import_create_theme.createWeakenMask)(),
|
|
131
|
+
stronger: (0, import_create_theme.createStrengthenMask)()
|
|
132
|
+
},
|
|
133
|
+
maskOptions = {
|
|
134
|
+
override,
|
|
135
|
+
skip: toSkip,
|
|
136
|
+
// avoids the transparent ends
|
|
137
|
+
max: palettes.light.length - 2,
|
|
138
|
+
min: 1
|
|
139
|
+
},
|
|
140
|
+
transparent = (hsl, opacity = 0) => hsl.replace("%)", `%, ${opacity})`).replace("hsl(", "hsla("),
|
|
141
|
+
[lightColorThemes, darkColorThemes] = [import_tokens.colorTokens.light, import_tokens.colorTokens.dark].map((colorSet, i) => {
|
|
142
|
+
const isLight = i === 0,
|
|
143
|
+
theme = baseThemes[isLight ? "light" : "dark"];
|
|
144
|
+
return Object.fromEntries(Object.keys(colorSet).map(color => {
|
|
145
|
+
const colorPalette = Object.values(colorSet[color]),
|
|
146
|
+
[head, tail] = [colorPalette.slice(0, 6), colorPalette.slice(colorPalette.length - 5)],
|
|
147
|
+
palette = [transparent(colorPalette[0]), ...head, ...tail, theme.color, transparent(colorPalette[colorPalette.length - 1])],
|
|
148
|
+
colorTheme = (0, import_create_theme.createTheme)(palette, isLight ? {
|
|
149
|
+
...lightTemplate,
|
|
150
|
+
// light color themes are a bit less sensitive
|
|
151
|
+
borderColor: 4,
|
|
152
|
+
borderColorHover: 5,
|
|
153
|
+
borderColorFocus: 4,
|
|
154
|
+
borderColorPress: 4
|
|
155
|
+
} : darkTemplate);
|
|
156
|
+
return [color, colorTheme];
|
|
157
|
+
}));
|
|
158
|
+
}),
|
|
159
|
+
allThemes = (0, import_create_theme.addChildren)(baseThemes, (name, theme) => {
|
|
160
|
+
const isLight = name === "light",
|
|
161
|
+
inverseTheme = baseThemes[isLight ? "dark" : "light"],
|
|
162
|
+
colorThemes = isLight ? lightColorThemes : darkColorThemes,
|
|
163
|
+
inverseColorThemes = isLight ? darkColorThemes : lightColorThemes,
|
|
164
|
+
allColorThemes = (0, import_create_theme.addChildren)(colorThemes, (colorName, colorTheme) => {
|
|
165
|
+
const inverse = inverseColorThemes[colorName];
|
|
166
|
+
return {
|
|
167
|
+
...getAltThemes({
|
|
168
|
+
theme: colorTheme,
|
|
169
|
+
inverse,
|
|
170
|
+
isLight
|
|
171
|
+
}),
|
|
172
|
+
...getComponentThemes(colorTheme, inverse, isLight)
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
return {
|
|
176
|
+
...{
|
|
177
|
+
...getAltThemes({
|
|
178
|
+
theme,
|
|
179
|
+
inverse: inverseTheme,
|
|
180
|
+
isLight
|
|
181
|
+
}),
|
|
182
|
+
...getComponentThemes(theme, inverseTheme, isLight)
|
|
183
|
+
},
|
|
184
|
+
...allColorThemes
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
function getAltThemes({
|
|
188
|
+
theme,
|
|
189
|
+
inverse,
|
|
190
|
+
isLight,
|
|
191
|
+
activeTheme
|
|
192
|
+
}) {
|
|
193
|
+
const maskOptionsAlt = {
|
|
194
|
+
...maskOptions,
|
|
195
|
+
override: overrideShadows
|
|
196
|
+
},
|
|
197
|
+
alt1 = (0, import_create_theme.applyMask)(theme, masks.weaker, maskOptionsAlt),
|
|
198
|
+
alt2 = (0, import_create_theme.applyMask)(alt1, masks.weaker, maskOptionsAlt),
|
|
199
|
+
active = activeTheme ?? (process.env.ACTIVE_THEME_INVERSE ? inverse : (0, import_create_theme.applyMask)(theme, masks.weaker, {
|
|
200
|
+
...maskOptions,
|
|
201
|
+
strength: 3,
|
|
202
|
+
skip: {
|
|
203
|
+
...maskOptions.skip,
|
|
204
|
+
color: 1
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
return (0, import_create_theme.addChildren)({
|
|
208
|
+
alt1,
|
|
209
|
+
alt2,
|
|
210
|
+
active
|
|
211
|
+
}, (_, subTheme) => getComponentThemes(subTheme, subTheme === inverse ? theme : inverse, isLight));
|
|
212
|
+
}
|
|
213
|
+
function getComponentThemes(theme, inverse, isLight) {
|
|
214
|
+
const componentMaskOptions = {
|
|
215
|
+
...maskOptions,
|
|
216
|
+
override: overrideWithColors,
|
|
217
|
+
skip: {
|
|
218
|
+
...maskOptions.skip,
|
|
219
|
+
// skip colors too just for component sub themes
|
|
220
|
+
...templateColors
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
weaker1 = (0, import_create_theme.applyMask)(theme, masks.weaker, componentMaskOptions),
|
|
224
|
+
base = (0, import_create_theme.applyMask)(weaker1, masks.stronger, componentMaskOptions),
|
|
225
|
+
weaker2 = (0, import_create_theme.applyMask)(weaker1, masks.weaker, componentMaskOptions),
|
|
226
|
+
stronger1 = (0, import_create_theme.applyMask)(theme, masks.stronger, componentMaskOptions),
|
|
227
|
+
inverse1 = (0, import_create_theme.applyMask)(inverse, masks.weaker, componentMaskOptions),
|
|
228
|
+
inverse2 = (0, import_create_theme.applyMask)(inverse1, masks.weaker, componentMaskOptions),
|
|
229
|
+
strongerBorderLighterBackground = isLight ? {
|
|
230
|
+
...stronger1,
|
|
231
|
+
borderColor: weaker1.borderColor,
|
|
232
|
+
borderColorHover: weaker1.borderColorHover,
|
|
233
|
+
borderColorPress: weaker1.borderColorPress,
|
|
234
|
+
borderColorFocus: weaker1.borderColorFocus
|
|
235
|
+
} : {
|
|
236
|
+
...(0, import_create_theme.applyMask)(theme, masks.skip, componentMaskOptions),
|
|
237
|
+
borderColor: weaker1.borderColor,
|
|
238
|
+
borderColorHover: weaker1.borderColorHover,
|
|
239
|
+
borderColorPress: weaker1.borderColorPress,
|
|
240
|
+
borderColorFocus: weaker1.borderColorFocus
|
|
241
|
+
},
|
|
242
|
+
overlayTheme = {
|
|
243
|
+
background: isLight ? "rgba(0,0,0,0.5)" : "rgba(0,0,0,0.9)"
|
|
244
|
+
},
|
|
245
|
+
weaker2WithoutBorder = {
|
|
246
|
+
...weaker2,
|
|
247
|
+
borderColor: "transparent",
|
|
248
|
+
borderColorHover: "transparent"
|
|
249
|
+
};
|
|
250
|
+
return {
|
|
251
|
+
ListItem: isLight ? stronger1 : base,
|
|
252
|
+
Card: weaker1,
|
|
253
|
+
Button: weaker2WithoutBorder,
|
|
254
|
+
Checkbox: weaker2,
|
|
255
|
+
DrawerFrame: weaker1,
|
|
256
|
+
SliderTrack: stronger1,
|
|
257
|
+
SliderTrackActive: weaker2,
|
|
258
|
+
SliderThumb: inverse1,
|
|
259
|
+
Progress: weaker1,
|
|
260
|
+
ProgressIndicator: inverse,
|
|
261
|
+
Switch: weaker2,
|
|
262
|
+
SwitchThumb: inverse2,
|
|
263
|
+
TooltipArrow: weaker1,
|
|
264
|
+
TooltipContent: weaker2,
|
|
265
|
+
Input: strongerBorderLighterBackground,
|
|
266
|
+
TextArea: strongerBorderLighterBackground,
|
|
267
|
+
Tooltip: inverse1,
|
|
268
|
+
// make overlays always dark
|
|
269
|
+
SheetOverlay: overlayTheme,
|
|
270
|
+
DialogOverlay: overlayTheme,
|
|
271
|
+
ModalOverlay: overlayTheme
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const themes = {
|
|
275
|
+
...allThemes,
|
|
276
|
+
// bring back the full type, the rest use a subset to avoid clogging up ts,
|
|
277
|
+
// tamagui will be smart and use the top level themes as the type for useTheme() etc
|
|
278
|
+
light: (0, import_create_theme.createTheme)(palettes.light, lightTemplate, {
|
|
279
|
+
nonInheritedValues: import_tokens.lightColors
|
|
280
|
+
}),
|
|
281
|
+
dark: (0, import_create_theme.createTheme)(palettes.dark, darkTemplate, {
|
|
282
|
+
nonInheritedValues: import_tokens.darkColors
|
|
283
|
+
})
|
|
284
|
+
};
|
|
@@ -2,28 +2,36 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var themes_exports = {};
|
|
24
33
|
__export(themes_exports, {
|
|
25
34
|
themes: () => themes
|
|
26
35
|
});
|
|
27
36
|
module.exports = __toCommonJS(themes_exports);
|
|
28
|
-
var themes = __toESM(require("./generated-new"));
|
|
29
|
-
//# sourceMappingURL=themes.js.map
|
|
37
|
+
var themes = __toESM(require("./generated-new.cjs"));
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var tokens_exports = {};
|
|
22
|
+
__export(tokens_exports, {
|
|
23
|
+
color: () => color,
|
|
24
|
+
colorTokens: () => colorTokens,
|
|
25
|
+
darkColors: () => darkColors,
|
|
26
|
+
lightColors: () => lightColors,
|
|
27
|
+
radius: () => radius,
|
|
28
|
+
size: () => size,
|
|
29
|
+
space: () => space,
|
|
30
|
+
tokens: () => tokens,
|
|
31
|
+
zIndex: () => zIndex
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(tokens_exports);
|
|
34
|
+
var import_colors = require("@tamagui/colors"),
|
|
35
|
+
import_web = require("@tamagui/web");
|
|
36
|
+
const size = {
|
|
37
|
+
$0: 0,
|
|
38
|
+
"$0.25": 2,
|
|
39
|
+
"$0.5": 4,
|
|
40
|
+
"$0.75": 8,
|
|
41
|
+
$1: 20,
|
|
42
|
+
"$1.5": 24,
|
|
43
|
+
$2: 28,
|
|
44
|
+
"$2.5": 32,
|
|
45
|
+
$3: 36,
|
|
46
|
+
"$3.5": 40,
|
|
47
|
+
$4: 44,
|
|
48
|
+
$true: 44,
|
|
49
|
+
"$4.5": 48,
|
|
50
|
+
$5: 52,
|
|
51
|
+
$6: 64,
|
|
52
|
+
$7: 74,
|
|
53
|
+
$8: 84,
|
|
54
|
+
$9: 94,
|
|
55
|
+
$10: 104,
|
|
56
|
+
$11: 124,
|
|
57
|
+
$12: 144,
|
|
58
|
+
$13: 164,
|
|
59
|
+
$14: 184,
|
|
60
|
+
$15: 204,
|
|
61
|
+
$16: 224,
|
|
62
|
+
$17: 224,
|
|
63
|
+
$18: 244,
|
|
64
|
+
$19: 264,
|
|
65
|
+
$20: 284
|
|
66
|
+
},
|
|
67
|
+
spaces = Object.entries(size).map(([k, v]) => [k, sizeToSpace(v)]);
|
|
68
|
+
function sizeToSpace(v) {
|
|
69
|
+
return v === 0 ? 0 : v === 2 ? 0.5 : v === 4 ? 1 : v === 8 ? 1.5 : v <= 16 ? Math.round(v * 0.333) : Math.floor(v * 0.7 - 12);
|
|
70
|
+
}
|
|
71
|
+
const spacesNegative = spaces.slice(1).map(([k, v]) => [`-${k.slice(1)}`, -v]),
|
|
72
|
+
space = {
|
|
73
|
+
...Object.fromEntries(spaces),
|
|
74
|
+
...Object.fromEntries(spacesNegative)
|
|
75
|
+
},
|
|
76
|
+
zIndex = {
|
|
77
|
+
0: 0,
|
|
78
|
+
1: 100,
|
|
79
|
+
2: 200,
|
|
80
|
+
3: 300,
|
|
81
|
+
4: 400,
|
|
82
|
+
5: 500
|
|
83
|
+
},
|
|
84
|
+
colorTokens = {
|
|
85
|
+
light: {
|
|
86
|
+
blue: import_colors.blue,
|
|
87
|
+
gray: import_colors.gray,
|
|
88
|
+
green: import_colors.green,
|
|
89
|
+
orange: import_colors.orange,
|
|
90
|
+
pink: import_colors.pink,
|
|
91
|
+
purple: import_colors.purple,
|
|
92
|
+
red: import_colors.red,
|
|
93
|
+
yellow: import_colors.yellow
|
|
94
|
+
},
|
|
95
|
+
dark: {
|
|
96
|
+
blue: import_colors.blueDark,
|
|
97
|
+
gray: import_colors.grayDark,
|
|
98
|
+
green: import_colors.greenDark,
|
|
99
|
+
orange: import_colors.orangeDark,
|
|
100
|
+
pink: import_colors.pinkDark,
|
|
101
|
+
purple: import_colors.purpleDark,
|
|
102
|
+
red: import_colors.redDark,
|
|
103
|
+
yellow: import_colors.yellowDark
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
darkColors = {
|
|
107
|
+
...colorTokens.dark.blue,
|
|
108
|
+
...colorTokens.dark.gray,
|
|
109
|
+
...colorTokens.dark.green,
|
|
110
|
+
...colorTokens.dark.orange,
|
|
111
|
+
...colorTokens.dark.pink,
|
|
112
|
+
...colorTokens.dark.purple,
|
|
113
|
+
...colorTokens.dark.red,
|
|
114
|
+
...colorTokens.dark.yellow
|
|
115
|
+
},
|
|
116
|
+
lightColors = {
|
|
117
|
+
...colorTokens.light.blue,
|
|
118
|
+
...colorTokens.light.gray,
|
|
119
|
+
...colorTokens.light.green,
|
|
120
|
+
...colorTokens.light.orange,
|
|
121
|
+
...colorTokens.light.pink,
|
|
122
|
+
...colorTokens.light.purple,
|
|
123
|
+
...colorTokens.light.red,
|
|
124
|
+
...colorTokens.light.yellow
|
|
125
|
+
},
|
|
126
|
+
color = {
|
|
127
|
+
...postfixObjKeys(lightColors, "Light"),
|
|
128
|
+
...postfixObjKeys(darkColors, "Dark")
|
|
129
|
+
};
|
|
130
|
+
function postfixObjKeys(obj, postfix) {
|
|
131
|
+
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [`${k}${postfix}`, v]));
|
|
132
|
+
}
|
|
133
|
+
const radius = {
|
|
134
|
+
0: 0,
|
|
135
|
+
1: 3,
|
|
136
|
+
2: 5,
|
|
137
|
+
3: 7,
|
|
138
|
+
4: 9,
|
|
139
|
+
true: 9,
|
|
140
|
+
5: 10,
|
|
141
|
+
6: 16,
|
|
142
|
+
7: 19,
|
|
143
|
+
8: 22,
|
|
144
|
+
9: 26,
|
|
145
|
+
10: 34,
|
|
146
|
+
11: 42,
|
|
147
|
+
12: 50
|
|
148
|
+
},
|
|
149
|
+
tokens = (0, import_web.createTokens)({
|
|
150
|
+
color,
|
|
151
|
+
radius,
|
|
152
|
+
zIndex,
|
|
153
|
+
space,
|
|
154
|
+
size
|
|
155
|
+
});
|