@tamagui/theme-builder 2.0.0-rc.4 → 2.0.0-rc.40
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/ThemeBuilder.cjs +131 -68
- package/dist/cjs/ThemeBuilder.native.js +208 -132
- package/dist/cjs/ThemeBuilder.native.js.map +1 -1
- package/dist/cjs/createStudioThemes.cjs +19 -17
- package/dist/cjs/createStudioThemes.native.js +19 -17
- package/dist/cjs/createStudioThemes.native.js.map +1 -1
- package/dist/cjs/createThemes.cjs +173 -123
- package/dist/cjs/createThemes.native.js +287 -248
- package/dist/cjs/createThemes.native.js.map +1 -1
- package/dist/cjs/defaultComponentThemes.cjs +12 -10
- package/dist/cjs/defaultComponentThemes.native.js +12 -10
- package/dist/cjs/defaultComponentThemes.native.js.map +1 -1
- package/dist/cjs/defaultTemplates.cjs +137 -132
- package/dist/cjs/defaultTemplates.native.js +144 -142
- package/dist/cjs/defaultTemplates.native.js.map +1 -1
- package/dist/cjs/defaultTemplatesStronger.cjs +135 -130
- package/dist/cjs/defaultTemplatesStronger.native.js +142 -140
- package/dist/cjs/defaultTemplatesStronger.native.js.map +1 -1
- package/dist/cjs/defaultTemplatesStrongest.cjs +135 -130
- package/dist/cjs/defaultTemplatesStrongest.native.js +142 -140
- package/dist/cjs/defaultTemplatesStrongest.native.js.map +1 -1
- package/dist/cjs/getThemeSuitePalettes.cjs +61 -50
- package/dist/cjs/getThemeSuitePalettes.native.js +79 -55
- package/dist/cjs/getThemeSuitePalettes.native.js.map +1 -1
- package/dist/cjs/helpers.cjs +12 -10
- package/dist/cjs/helpers.native.js +12 -10
- package/dist/cjs/helpers.native.js.map +1 -1
- package/dist/cjs/index.cjs +19 -17
- package/dist/cjs/index.native.js +19 -17
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/masks.cjs +29 -26
- package/dist/cjs/masks.native.js +98 -96
- package/dist/cjs/masks.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/ThemeBuilder.mjs +119 -58
- package/dist/esm/ThemeBuilder.mjs.map +1 -1
- package/dist/esm/ThemeBuilder.native.js +196 -122
- package/dist/esm/ThemeBuilder.native.js.map +1 -1
- package/dist/esm/createStudioThemes.mjs +2 -2
- package/dist/esm/createStudioThemes.mjs.map +1 -1
- package/dist/esm/createStudioThemes.native.js +2 -2
- package/dist/esm/createStudioThemes.native.js.map +1 -1
- package/dist/esm/createThemes.mjs +156 -108
- package/dist/esm/createThemes.mjs.map +1 -1
- package/dist/esm/createThemes.native.js +270 -233
- package/dist/esm/createThemes.native.js.map +1 -1
- package/dist/esm/defaultTemplates.mjs +125 -122
- package/dist/esm/defaultTemplates.mjs.map +1 -1
- package/dist/esm/defaultTemplates.native.js +130 -130
- package/dist/esm/defaultTemplates.native.js.map +1 -1
- package/dist/esm/defaultTemplatesStronger.mjs +123 -120
- package/dist/esm/defaultTemplatesStronger.mjs.map +1 -1
- package/dist/esm/defaultTemplatesStronger.native.js +128 -128
- package/dist/esm/defaultTemplatesStronger.native.js.map +1 -1
- package/dist/esm/defaultTemplatesStrongest.mjs +123 -120
- package/dist/esm/defaultTemplatesStrongest.mjs.map +1 -1
- package/dist/esm/defaultTemplatesStrongest.native.js +128 -128
- package/dist/esm/defaultTemplatesStrongest.native.js.map +1 -1
- package/dist/esm/getThemeSuitePalettes.mjs +49 -40
- package/dist/esm/getThemeSuitePalettes.mjs.map +1 -1
- package/dist/esm/getThemeSuitePalettes.native.js +66 -44
- package/dist/esm/getThemeSuitePalettes.native.js.map +1 -1
- package/dist/esm/index.js +8 -24
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/masks.mjs +17 -16
- package/dist/esm/masks.mjs.map +1 -1
- package/dist/esm/masks.native.js +18 -18
- package/dist/esm/masks.native.js.map +1 -1
- package/package.json +8 -10
- package/src/ThemeBuilder.ts +6 -0
- package/types/ThemeBuilder.d.ts.map +1 -1
- package/dist/cjs/ThemeBuilder.js +0 -184
- package/dist/cjs/ThemeBuilder.js.map +0 -6
- package/dist/cjs/createStudioThemes.js +0 -30
- package/dist/cjs/createStudioThemes.js.map +0 -6
- package/dist/cjs/createThemes.js +0 -356
- package/dist/cjs/createThemes.js.map +0 -6
- package/dist/cjs/defaultComponentThemes.js +0 -41
- package/dist/cjs/defaultComponentThemes.js.map +0 -6
- package/dist/cjs/defaultTemplates.js +0 -138
- package/dist/cjs/defaultTemplates.js.map +0 -6
- package/dist/cjs/defaultTemplatesStronger.js +0 -137
- package/dist/cjs/defaultTemplatesStronger.js.map +0 -6
- package/dist/cjs/defaultTemplatesStrongest.js +0 -137
- package/dist/cjs/defaultTemplatesStrongest.js.map +0 -6
- package/dist/cjs/getThemeSuitePalettes.js +0 -69
- package/dist/cjs/getThemeSuitePalettes.js.map +0 -6
- package/dist/cjs/helpers.js +0 -29
- package/dist/cjs/helpers.js.map +0 -6
- package/dist/cjs/index.js +0 -32
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/masks.js +0 -86
- package/dist/cjs/masks.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/esm/ThemeBuilder.js +0 -174
- package/dist/esm/ThemeBuilder.js.map +0 -6
- package/dist/esm/createStudioThemes.js +0 -18
- package/dist/esm/createStudioThemes.js.map +0 -6
- package/dist/esm/createThemes.js +0 -344
- package/dist/esm/createThemes.js.map +0 -6
- package/dist/esm/defaultComponentThemes.js +0 -25
- package/dist/esm/defaultComponentThemes.js.map +0 -6
- package/dist/esm/defaultTemplates.js +0 -122
- package/dist/esm/defaultTemplates.js.map +0 -6
- package/dist/esm/defaultTemplatesStronger.js +0 -121
- package/dist/esm/defaultTemplatesStronger.js.map +0 -6
- package/dist/esm/defaultTemplatesStrongest.js +0 -121
- package/dist/esm/defaultTemplatesStrongest.js.map +0 -6
- package/dist/esm/getThemeSuitePalettes.js +0 -53
- package/dist/esm/getThemeSuitePalettes.js.map +0 -6
- package/dist/esm/helpers.js +0 -13
- package/dist/esm/helpers.js.map +0 -6
- package/dist/esm/masks.js +0 -78
- package/dist/esm/masks.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
|
@@ -5,156 +5,158 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var defaultTemplates_exports = {};
|
|
24
26
|
__export(defaultTemplates_exports, {
|
|
25
27
|
defaultTemplates: () => defaultTemplates
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(defaultTemplates_exports);
|
|
28
|
-
var import_helpers = require("./helpers.native.js")
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
30
|
+
var import_helpers = require("./helpers.native.js");
|
|
31
|
+
var getTemplates = function () {
|
|
32
|
+
var lightTemplates = getBaseTemplates("light");
|
|
33
|
+
var darkTemplates = getBaseTemplates("dark");
|
|
34
|
+
var templates = {
|
|
35
|
+
...(0, import_helpers.objectFromEntries)((0, import_helpers.objectKeys)(lightTemplates).map(function (name) {
|
|
36
|
+
return [`light_${name}`, lightTemplates[name]];
|
|
37
|
+
})),
|
|
38
|
+
...(0, import_helpers.objectFromEntries)((0, import_helpers.objectKeys)(darkTemplates).map(function (name) {
|
|
39
|
+
return [`dark_${name}`, darkTemplates[name]];
|
|
40
|
+
}))
|
|
41
|
+
};
|
|
42
|
+
return templates;
|
|
43
|
+
};
|
|
44
|
+
var getBaseTemplates = function (scheme) {
|
|
45
|
+
var isLight = scheme === "light";
|
|
46
|
+
var bgIndex = 6;
|
|
47
|
+
var lighten = isLight ? -1 : 1;
|
|
48
|
+
var darken = -lighten;
|
|
49
|
+
var increaseContrast = 1;
|
|
50
|
+
var borderColor = bgIndex + 3;
|
|
51
|
+
var baseColors = {
|
|
52
|
+
color: -bgIndex,
|
|
53
|
+
colorHover: -bgIndex - 1,
|
|
54
|
+
colorPress: -bgIndex,
|
|
55
|
+
colorFocus: -bgIndex - 1,
|
|
56
|
+
placeholderColor: -bgIndex - 3,
|
|
57
|
+
outlineColor: -2
|
|
58
|
+
};
|
|
59
|
+
var base = {
|
|
60
|
+
accentBackground: 0,
|
|
61
|
+
accentColor: -0,
|
|
62
|
+
background0: 1,
|
|
63
|
+
background02: 2,
|
|
64
|
+
background04: 3,
|
|
65
|
+
background06: 4,
|
|
66
|
+
background08: 5,
|
|
67
|
+
color1: bgIndex,
|
|
68
|
+
color2: bgIndex + 1,
|
|
69
|
+
color3: bgIndex + 2,
|
|
70
|
+
color4: bgIndex + 3,
|
|
71
|
+
color5: bgIndex + 4,
|
|
72
|
+
color6: bgIndex + 5,
|
|
73
|
+
color7: bgIndex + 6,
|
|
74
|
+
color8: bgIndex + 7,
|
|
75
|
+
color9: bgIndex + 8,
|
|
76
|
+
color10: bgIndex + 9,
|
|
77
|
+
color11: bgIndex + 10,
|
|
78
|
+
color12: bgIndex + 11,
|
|
79
|
+
color0: -1,
|
|
80
|
+
color02: -2,
|
|
81
|
+
color04: -3,
|
|
82
|
+
color06: -4,
|
|
83
|
+
color08: -5,
|
|
84
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
85
|
+
// can publish components for others to use without mandating a specific color scale
|
|
86
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
87
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
88
|
+
background: bgIndex,
|
|
89
|
+
backgroundHover: bgIndex + increaseContrast * 2,
|
|
90
|
+
backgroundPress: bgIndex + increaseContrast * 3,
|
|
91
|
+
backgroundFocus: bgIndex + increaseContrast * 2,
|
|
92
|
+
borderColor,
|
|
93
|
+
borderColorHover: borderColor + lighten,
|
|
94
|
+
borderColorPress: borderColor + darken,
|
|
95
|
+
borderColorFocus: borderColor,
|
|
96
|
+
...baseColors,
|
|
97
|
+
colorTransparent: -1
|
|
98
|
+
};
|
|
99
|
+
var surface1 = {
|
|
100
|
+
...baseColors,
|
|
101
|
+
background: base.background + 1,
|
|
102
|
+
backgroundHover: base.backgroundHover + 1,
|
|
103
|
+
backgroundPress: base.backgroundPress + 1,
|
|
104
|
+
backgroundFocus: base.backgroundFocus + 1,
|
|
105
|
+
backgroundActive: base.background + 1,
|
|
106
|
+
borderColor: base.borderColor + 1,
|
|
107
|
+
borderColorHover: base.borderColorHover + 1,
|
|
108
|
+
borderColorFocus: base.borderColorFocus + 1,
|
|
109
|
+
borderColorPress: base.borderColorPress + 1
|
|
110
|
+
};
|
|
111
|
+
var surface2 = {
|
|
112
|
+
...baseColors,
|
|
113
|
+
background: base.background + 2,
|
|
114
|
+
backgroundHover: base.backgroundHover + 2,
|
|
115
|
+
backgroundPress: base.backgroundPress + 2,
|
|
116
|
+
backgroundFocus: base.backgroundFocus + 2,
|
|
117
|
+
backgroundActive: base.background + 2,
|
|
118
|
+
borderColor: base.borderColor + 2,
|
|
119
|
+
borderColorHover: base.borderColorHover + 2,
|
|
120
|
+
borderColorFocus: base.borderColorFocus + 2,
|
|
121
|
+
borderColorPress: base.borderColorPress + 2
|
|
122
|
+
};
|
|
123
|
+
var surface3 = {
|
|
124
|
+
...baseColors,
|
|
125
|
+
background: base.background + 3,
|
|
126
|
+
backgroundHover: base.backgroundHover + 3,
|
|
127
|
+
backgroundPress: base.backgroundPress + 3,
|
|
128
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
129
|
+
backgroundActive: base.background + 3,
|
|
130
|
+
borderColor: base.borderColor + 3,
|
|
131
|
+
borderColorHover: base.borderColorHover + 3,
|
|
132
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
133
|
+
borderColorPress: base.borderColorPress + 3
|
|
134
|
+
};
|
|
135
|
+
var alt1 = {
|
|
136
|
+
color: base.color - 1,
|
|
137
|
+
colorHover: base.colorHover - 1,
|
|
138
|
+
colorPress: base.colorPress - 1,
|
|
139
|
+
colorFocus: base.colorFocus - 1
|
|
140
|
+
};
|
|
141
|
+
var alt2 = {
|
|
142
|
+
color: base.color - 2,
|
|
143
|
+
colorHover: base.colorHover - 2,
|
|
144
|
+
colorPress: base.colorPress - 2,
|
|
145
|
+
colorFocus: base.colorFocus - 2
|
|
146
|
+
};
|
|
147
|
+
var inverse = Object.fromEntries(Object.entries(base).map(function (param) {
|
|
148
|
+
var [key, index] = param;
|
|
149
|
+
return [key, -index];
|
|
150
|
+
}));
|
|
151
|
+
return {
|
|
152
|
+
base,
|
|
153
|
+
surface1,
|
|
154
|
+
surface2,
|
|
155
|
+
surface3,
|
|
156
|
+
alt1,
|
|
157
|
+
alt2,
|
|
158
|
+
inverse
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
var defaultTemplates = getTemplates();
|
|
160
162
|
//# sourceMappingURL=defaultTemplates.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","defaultTemplates_exports","__export","defaultTemplates","module","exports","import_helpers","require","getTemplates","lightTemplates","getBaseTemplates","darkTemplates","templates","objectFromEntries","objectKeys","map","name","scheme","isLight","bgIndex","lighten","darken","increaseContrast","borderColor","baseColors","color","colorHover","colorPress","colorFocus","placeholderColor","outlineColor","base","accentBackground","accentColor","background0","background02","background04","background06","background08","color1","color2","color3","color4","color5","color6","color7","color8","color9","color10","color11","color12","color0","color02","color04","color06","color08","background","backgroundHover","backgroundPress","backgroundFocus","borderColorHover","borderColorPress","borderColorFocus","colorTransparent","surface1","backgroundActive","surface2","surface3","alt1","alt2","inverse","Object","fromEntries","entries","param","key","index"],"sources":["../../src/defaultTemplates.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","defaultTemplates_exports","__export","defaultTemplates","module","exports","import_helpers","require","getTemplates","lightTemplates","getBaseTemplates","darkTemplates","templates","objectFromEntries","objectKeys","map","name","scheme","isLight","bgIndex","lighten","darken","increaseContrast","borderColor","baseColors","color","colorHover","colorPress","colorFocus","placeholderColor","outlineColor","base","accentBackground","accentColor","background0","background02","background04","background06","background08","color1","color2","color3","color4","color5","color6","color7","color8","color9","color10","color11","color12","color0","color02","color04","color06","color08","background","backgroundHover","backgroundPress","backgroundFocus","borderColorHover","borderColorPress","borderColorFocus","colorTransparent","surface1","backgroundActive","surface2","surface3","alt1","alt2","inverse","Object","fromEntries","entries","param","key","index"],"sources":["../../src/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IAAA;IACA5C,KAAA,EAAAM,IAAA,CAAYN,KAAK;IACnBC,UAAA,EAAAK,IAAA,CAAAL,UAAA;IAEAC,UAAM,EAAAI,IAAU,CAAAJ,UAAO;IACrBC,UAAO,EAAAG,IAAQ,CAAAH,UAAY;EACzB;EAAmB,IACpB0C,OAAA,GAAAC,MAAA,CAAAC,WAAA,CAAAD,MAAA,CAAAE,OAAA,CAAA1C,IAAA,EAAAhB,GAAA,WAAA2D,KAAA;IACH,KAAAC,GAAA,EAAAC,KAAA,IAAAF,KAAA;IAEA,OAAO,CACLC,GAAA,EACA,CAAAC,KAAA,CACA;EAAA,EACA;EAAA,OACA;IACA7C,IAAA;IACAiC,QAAA;IACFE,QAAA;IACFC,QAAA;IAEOC,IAAM","ignoreList":[]}
|
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var defaultTemplatesStronger_exports = {};
|
|
22
24
|
__export(defaultTemplatesStronger_exports, {
|
|
@@ -25,123 +27,126 @@ __export(defaultTemplatesStronger_exports, {
|
|
|
25
27
|
module.exports = __toCommonJS(defaultTemplatesStronger_exports);
|
|
26
28
|
var import_helpers = require("./helpers.cjs");
|
|
27
29
|
const getTemplates = () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
30
|
+
const lightTemplates = getBaseTemplates("light");
|
|
31
|
+
const darkTemplates = getBaseTemplates("dark");
|
|
32
|
+
const templates = {
|
|
33
|
+
...(0, import_helpers.objectFromEntries)((0, import_helpers.objectKeys)(lightTemplates).map(name => [`light_${name}`, lightTemplates[name]])),
|
|
34
|
+
...(0, import_helpers.objectFromEntries)((0, import_helpers.objectKeys)(darkTemplates).map(name => [`dark_${name}`, darkTemplates[name]]))
|
|
35
|
+
};
|
|
36
|
+
return templates;
|
|
37
|
+
};
|
|
38
|
+
const getBaseTemplates = scheme => {
|
|
39
|
+
const isLight = scheme === "light";
|
|
40
|
+
const bgIndex = 6;
|
|
41
|
+
const lighten = isLight ? -1 : 1;
|
|
42
|
+
const darken = -lighten;
|
|
43
|
+
const borderColor = bgIndex + 3;
|
|
44
|
+
const baseColors = {
|
|
45
|
+
color: -bgIndex,
|
|
46
|
+
colorHover: -bgIndex - 1,
|
|
47
|
+
colorPress: -bgIndex,
|
|
48
|
+
colorFocus: -bgIndex - 1,
|
|
49
|
+
placeholderColor: -bgIndex - 3,
|
|
50
|
+
outlineColor: -2
|
|
51
|
+
};
|
|
52
|
+
const base = {
|
|
53
|
+
accentBackground: 0,
|
|
54
|
+
accentColor: -0,
|
|
55
|
+
background0: 1,
|
|
56
|
+
background02: 2,
|
|
57
|
+
background04: 3,
|
|
58
|
+
background06: 4,
|
|
59
|
+
background08: 5,
|
|
60
|
+
color1: bgIndex,
|
|
61
|
+
color2: bgIndex + 1,
|
|
62
|
+
color3: bgIndex + 2,
|
|
63
|
+
color4: bgIndex + 3,
|
|
64
|
+
color5: bgIndex + 4,
|
|
65
|
+
color6: bgIndex + 5,
|
|
66
|
+
color7: bgIndex + 6,
|
|
67
|
+
color8: bgIndex + 7,
|
|
68
|
+
color9: bgIndex + 8,
|
|
69
|
+
color10: bgIndex + 9,
|
|
70
|
+
color11: bgIndex + 10,
|
|
71
|
+
color12: bgIndex + 11,
|
|
72
|
+
color0: -1,
|
|
73
|
+
color02: -2,
|
|
74
|
+
color04: -3,
|
|
75
|
+
color06: -4,
|
|
76
|
+
color08: -5,
|
|
77
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
78
|
+
// can publish components for others to use without mandating a specific color scale
|
|
79
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
80
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
81
|
+
background: bgIndex,
|
|
82
|
+
backgroundHover: bgIndex + lighten,
|
|
83
|
+
// always lighten on hover no matter the scheme
|
|
84
|
+
backgroundPress: bgIndex + darken,
|
|
85
|
+
// always darken on press no matter the theme
|
|
86
|
+
backgroundFocus: bgIndex + darken,
|
|
87
|
+
borderColor,
|
|
88
|
+
borderColorHover: borderColor + lighten,
|
|
89
|
+
borderColorPress: borderColor + darken,
|
|
90
|
+
borderColorFocus: borderColor,
|
|
91
|
+
...baseColors,
|
|
92
|
+
colorTransparent: -1
|
|
93
|
+
};
|
|
94
|
+
const surface1 = {
|
|
95
|
+
...baseColors,
|
|
96
|
+
background: base.background + 2,
|
|
97
|
+
backgroundHover: base.backgroundHover + 2,
|
|
98
|
+
backgroundPress: base.backgroundPress + 2,
|
|
99
|
+
backgroundFocus: base.backgroundFocus + 2,
|
|
100
|
+
borderColor: base.borderColor + 2,
|
|
101
|
+
borderColorHover: base.borderColorHover + 2,
|
|
102
|
+
borderColorFocus: base.borderColorFocus + 2,
|
|
103
|
+
borderColorPress: base.borderColorPress + 2
|
|
104
|
+
};
|
|
105
|
+
const surface2 = {
|
|
106
|
+
...baseColors,
|
|
107
|
+
background: base.background + 3,
|
|
108
|
+
backgroundHover: base.backgroundHover + 3,
|
|
109
|
+
backgroundPress: base.backgroundPress + 3,
|
|
110
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
111
|
+
borderColor: base.borderColor + 3,
|
|
112
|
+
borderColorHover: base.borderColorHover + 3,
|
|
113
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
114
|
+
borderColorPress: base.borderColorPress + 3
|
|
115
|
+
};
|
|
116
|
+
const surface3 = {
|
|
117
|
+
...baseColors,
|
|
118
|
+
background: base.background + 4,
|
|
119
|
+
backgroundHover: base.backgroundHover + 4,
|
|
120
|
+
backgroundPress: base.backgroundPress + 4,
|
|
121
|
+
backgroundFocus: base.backgroundFocus + 4,
|
|
122
|
+
borderColor: base.borderColor + 4,
|
|
123
|
+
borderColorHover: base.borderColorHover + 4,
|
|
124
|
+
borderColorFocus: base.borderColorFocus + 4,
|
|
125
|
+
borderColorPress: base.borderColorPress + 4
|
|
126
|
+
};
|
|
127
|
+
const alt1 = {
|
|
128
|
+
color: base.color - 1,
|
|
129
|
+
colorHover: base.colorHover - 1,
|
|
130
|
+
colorPress: base.colorPress - 1,
|
|
131
|
+
colorFocus: base.colorFocus - 1
|
|
132
|
+
};
|
|
133
|
+
const alt2 = {
|
|
134
|
+
color: base.color - 2,
|
|
135
|
+
colorHover: base.colorHover - 2,
|
|
136
|
+
colorPress: base.colorPress - 2,
|
|
137
|
+
colorFocus: base.colorFocus - 2
|
|
138
|
+
};
|
|
139
|
+
const inverse = Object.fromEntries(Object.entries(base).map(([key, index]) => {
|
|
140
|
+
return [key, -index];
|
|
141
|
+
}));
|
|
142
|
+
return {
|
|
143
|
+
base,
|
|
144
|
+
surface1,
|
|
145
|
+
surface2,
|
|
146
|
+
surface3,
|
|
147
|
+
alt1,
|
|
148
|
+
alt2,
|
|
149
|
+
inverse
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const defaultTemplatesStronger = getTemplates();
|