@tamagui/themes 1.135.2 → 1.135.4-1761748186554

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.
Files changed (67) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/cjs/componentThemeDefinitions.native.js +103 -104
  3. package/dist/cjs/componentThemeDefinitions.native.js.map +1 -6
  4. package/dist/cjs/generated-new.native.js +2012 -42546
  5. package/dist/cjs/generated-new.native.js.map +1 -6
  6. package/dist/cjs/generated-v2.native.js +1936 -41706
  7. package/dist/cjs/generated-v2.native.js.map +1 -6
  8. package/dist/cjs/generated-v3.native.js +1090 -9622
  9. package/dist/cjs/generated-v3.native.js.map +1 -6
  10. package/dist/cjs/generated-v4-tamagui.native.js +796 -14886
  11. package/dist/cjs/generated-v4-tamagui.native.js.map +1 -6
  12. package/dist/cjs/generated-v4.native.js +396 -8281
  13. package/dist/cjs/generated-v4.native.js.map +1 -6
  14. package/dist/cjs/helpers.native.js +18 -17
  15. package/dist/cjs/helpers.native.js.map +1 -6
  16. package/dist/cjs/index.native.js +18 -24
  17. package/dist/cjs/index.native.js.map +1 -6
  18. package/dist/cjs/palettes.native.js +52 -80
  19. package/dist/cjs/palettes.native.js.map +1 -6
  20. package/dist/cjs/shadows.native.js +35 -28
  21. package/dist/cjs/shadows.native.js.map +1 -6
  22. package/dist/cjs/templates.native.js +105 -95
  23. package/dist/cjs/templates.native.js.map +1 -6
  24. package/dist/cjs/themes-new.native.js +68 -59
  25. package/dist/cjs/themes-new.native.js.map +1 -6
  26. package/dist/cjs/themes-old.native.js +244 -237
  27. package/dist/cjs/themes-old.native.js.map +1 -6
  28. package/dist/cjs/themes.native.js +18 -15
  29. package/dist/cjs/themes.native.js.map +1 -6
  30. package/dist/cjs/tokens.native.js +139 -143
  31. package/dist/cjs/tokens.native.js.map +1 -6
  32. package/dist/cjs/utils.native.js +19 -22
  33. package/dist/cjs/utils.native.js.map +1 -6
  34. package/dist/cjs/v2-themes.native.js +426 -473
  35. package/dist/cjs/v2-themes.native.js.map +1 -6
  36. package/dist/cjs/v2.native.js +27 -32
  37. package/dist/cjs/v2.native.js.map +1 -6
  38. package/dist/cjs/v3-themes.native.js +440 -476
  39. package/dist/cjs/v3-themes.native.js.map +1 -6
  40. package/dist/cjs/v3-tokens.native.js +91 -93
  41. package/dist/cjs/v3-tokens.native.js.map +1 -6
  42. package/dist/cjs/v3.native.js +27 -32
  43. package/dist/cjs/v3.native.js.map +1 -6
  44. package/dist/cjs/v4-default.cjs +1 -1
  45. package/dist/cjs/v4-default.js +1 -1
  46. package/dist/cjs/v4-default.js.map +1 -1
  47. package/dist/cjs/v4-default.native.js +139 -150
  48. package/dist/cjs/v4-default.native.js.map +1 -6
  49. package/dist/cjs/v4-tamagui.cjs +1 -1
  50. package/dist/cjs/v4-tamagui.js +1 -1
  51. package/dist/cjs/v4-tamagui.js.map +1 -1
  52. package/dist/cjs/v4-tamagui.native.js +211 -247
  53. package/dist/cjs/v4-tamagui.native.js.map +1 -6
  54. package/dist/cjs/v4-tokens.native.js +91 -93
  55. package/dist/cjs/v4-tokens.native.js.map +1 -6
  56. package/dist/cjs/v4.native.js +21 -18
  57. package/dist/cjs/v4.native.js.map +1 -6
  58. package/package.json +9 -8
  59. package/tsconfig.json +4 -4
  60. package/v2-themes.cjs +1 -0
  61. package/v3-themes.cjs +1 -0
  62. package/v3.cjs +1 -0
  63. package/v4.cjs +1 -0
  64. package/v2-themes.js +0 -1
  65. package/v3-themes.js +0 -1
  66. package/v3.js +0 -1
  67. package/v4.js +0 -1
@@ -1,18 +1,25 @@
1
1
  "use strict";
2
+
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
7
  var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
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
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
16
23
  var v3_themes_exports = {};
17
24
  __export(v3_themes_exports, {
18
25
  defaultComponentThemes: () => defaultComponentThemes,
@@ -23,501 +30,458 @@ __export(v3_themes_exports, {
23
30
  tokens: () => tokens
24
31
  });
25
32
  module.exports = __toCommonJS(v3_themes_exports);
26
- var import_colors = require("@tamagui/colors"), import_theme_builder = require("@tamagui/theme-builder"), import_web = require("@tamagui/web"), import_utils = require("./utils"), import_v3_tokens = require("./v3-tokens"), colorTokens = {
27
- light: {
28
- blue: import_colors.blue,
29
- gray: import_colors.gray,
30
- green: import_colors.green,
31
- orange: import_colors.orange,
32
- pink: import_colors.pink,
33
- purple: import_colors.purple,
34
- red: import_colors.red,
35
- yellow: import_colors.yellow
33
+ var import_colors = require("@tamagui/colors"),
34
+ import_theme_builder = require("@tamagui/theme-builder"),
35
+ import_web = require("@tamagui/web"),
36
+ import_utils = require("./utils.native.js"),
37
+ import_v3_tokens = require("./v3-tokens.native.js"),
38
+ colorTokens = {
39
+ light: {
40
+ blue: import_colors.blue,
41
+ gray: import_colors.gray,
42
+ green: import_colors.green,
43
+ orange: import_colors.orange,
44
+ pink: import_colors.pink,
45
+ purple: import_colors.purple,
46
+ red: import_colors.red,
47
+ yellow: import_colors.yellow
48
+ },
49
+ dark: {
50
+ blue: import_colors.blueDark,
51
+ gray: import_colors.grayDark,
52
+ green: import_colors.greenDark,
53
+ orange: import_colors.orangeDark,
54
+ pink: import_colors.pinkDark,
55
+ purple: import_colors.purpleDark,
56
+ red: import_colors.redDark,
57
+ yellow: import_colors.yellowDark
58
+ }
36
59
  },
37
- dark: {
38
- blue: import_colors.blueDark,
39
- gray: import_colors.grayDark,
40
- green: import_colors.greenDark,
41
- orange: import_colors.orangeDark,
42
- pink: import_colors.pinkDark,
43
- purple: import_colors.purpleDark,
44
- red: import_colors.redDark,
45
- yellow: import_colors.yellowDark
46
- }
47
- }, lightShadowColor = "rgba(0,0,0,0.04)", lightShadowColorStrong = "rgba(0,0,0,0.085)", darkShadowColor = "rgba(0,0,0,0.2)", darkShadowColorStrong = "rgba(0,0,0,0.3)", darkColors = {
48
- ...colorTokens.dark.blue,
49
- ...colorTokens.dark.gray,
50
- ...colorTokens.dark.green,
51
- ...colorTokens.dark.orange,
52
- ...colorTokens.dark.pink,
53
- ...colorTokens.dark.purple,
54
- ...colorTokens.dark.red,
55
- ...colorTokens.dark.yellow
56
- }, lightColors = {
57
- ...colorTokens.light.blue,
58
- ...colorTokens.light.gray,
59
- ...colorTokens.light.green,
60
- ...colorTokens.light.orange,
61
- ...colorTokens.light.pink,
62
- ...colorTokens.light.purple,
63
- ...colorTokens.light.red,
64
- ...colorTokens.light.yellow
65
- }, color = {
66
- white0: "rgba(255,255,255,0)",
67
- white075: "rgba(255,255,255,0.75)",
68
- white05: "rgba(255,255,255,0.5)",
69
- white025: "rgba(255,255,255,0.25)",
70
- black0: "rgba(10,10,10,0)",
71
- black075: "rgba(10,10,10,0.75)",
72
- black05: "rgba(10,10,10,0.5)",
73
- black025: "rgba(10,10,10,0.25)",
74
- white1: "#fff",
75
- white2: "#f8f8f8",
76
- white3: "hsl(0, 0%, 96.3%)",
77
- white4: "hsl(0, 0%, 94.1%)",
78
- white5: "hsl(0, 0%, 92.0%)",
79
- white6: "hsl(0, 0%, 90.0%)",
80
- white7: "hsl(0, 0%, 88.5%)",
81
- white8: "hsl(0, 0%, 81.0%)",
82
- white9: "hsl(0, 0%, 56.1%)",
83
- white10: "hsl(0, 0%, 50.3%)",
84
- white11: "hsl(0, 0%, 42.5%)",
85
- white12: "hsl(0, 0%, 9.0%)",
86
- black1: "#050505",
87
- black2: "#151515",
88
- black3: "#191919",
89
- black4: "#232323",
90
- black5: "#282828",
91
- black6: "#323232",
92
- black7: "#424242",
93
- black8: "#494949",
94
- black9: "#545454",
95
- black10: "#626262",
96
- black11: "#a5a5a5",
97
- black12: "#fff",
98
- ...(0, import_utils.postfixObjKeys)(lightColors, "Light"),
99
- ...(0, import_utils.postfixObjKeys)(darkColors, "Dark")
100
- }, defaultPalettes = function() {
101
- var transparent = function(hsl) {
102
- var opacity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
103
- return hsl.replace("%)", `%, ${opacity})`).replace("hsl(", "hsla(");
104
- }, getColorPalette = function(colors, accentColors) {
105
- var colorPalette = Object.values(colors), colorI = colorPalette.length - 4, accentPalette = Object.values(accentColors), accentBackground = accentPalette[0], accentColor = accentPalette[accentPalette.length - 1];
106
- return [
107
- accentBackground,
108
- transparent(colorPalette[0], 0),
109
- transparent(colorPalette[0], 0.25),
110
- transparent(colorPalette[0], 0.5),
111
- transparent(colorPalette[0], 0.75),
112
- ...colorPalette,
113
- transparent(colorPalette[colorI], 0.75),
114
- transparent(colorPalette[colorI], 0.5),
115
- transparent(colorPalette[colorI], 0.25),
116
- transparent(colorPalette[colorI], 0),
117
- accentColor
118
- ];
119
- }, brandColor = {
120
- light: color.blue4Light,
121
- dark: color.blue4Dark
122
- }, lightPalette = [
123
- brandColor.light,
124
- color.white0,
125
- color.white025,
126
- color.white05,
127
- color.white075,
128
- color.white1,
129
- color.white2,
130
- color.white3,
131
- color.white4,
132
- color.white5,
133
- color.white6,
134
- color.white7,
135
- color.white8,
136
- color.white9,
137
- color.white10,
138
- color.white11,
139
- color.white12,
140
- color.black075,
141
- color.black05,
142
- color.black025,
143
- color.black0,
144
- brandColor.dark
145
- ], darkPalette = [
146
- brandColor.dark,
147
- color.black0,
148
- color.black025,
149
- color.black05,
150
- color.black075,
151
- color.black1,
152
- color.black2,
153
- color.black3,
154
- color.black4,
155
- color.black5,
156
- color.black6,
157
- color.black7,
158
- color.black8,
159
- color.black9,
160
- color.black10,
161
- color.black11,
162
- color.black12,
163
- color.white075,
164
- color.white05,
165
- color.white025,
166
- color.white0,
167
- brandColor.light
168
- ], lightColorNames = (0, import_utils.objectKeys)(colorTokens.light), lightPalettes = (0, import_theme_builder.objectFromEntries)(lightColorNames.map(function(key, index) {
169
- return [
170
- `light_${key}`,
171
- getColorPalette(colorTokens.light[key], colorTokens.light[lightColorNames[(index + 1) % lightColorNames.length]])
172
- ];
173
- })), darkColorNames = (0, import_utils.objectKeys)(colorTokens.dark), darkPalettes = (0, import_theme_builder.objectFromEntries)(darkColorNames.map(function(key, index) {
174
- return [
175
- `dark_${key}`,
176
- getColorPalette(colorTokens.dark[key], colorTokens.light[darkColorNames[(index + 1) % darkColorNames.length]])
177
- ];
178
- })), colorPalettes = {
179
- ...lightPalettes,
180
- ...darkPalettes
181
- };
182
- return {
183
- light: lightPalette,
184
- dark: darkPalette,
185
- ...colorPalettes
186
- };
187
- }(), getTemplates = function() {
188
- var getBaseTemplates = function(scheme) {
189
- var isLight = scheme === "light", bgIndex = 5, lighten = isLight ? -1 : 1, darken = -lighten, borderColor = bgIndex + 3, base = {
190
- accentBackground: 0,
191
- accentColor: -0,
192
- background0: 1,
193
- background025: 2,
194
- background05: 3,
195
- background075: 4,
196
- color1: bgIndex,
197
- color2: bgIndex + 1,
198
- color3: bgIndex + 2,
199
- color4: bgIndex + 3,
200
- color5: bgIndex + 4,
201
- color6: bgIndex + 5,
202
- color7: bgIndex + 6,
203
- color8: bgIndex + 7,
204
- color9: bgIndex + 8,
205
- color10: bgIndex + 9,
206
- color11: bgIndex + 10,
207
- color12: bgIndex + 11,
208
- color0: -1,
209
- color025: -2,
210
- color05: -3,
211
- color075: -4,
212
- // the background, color, etc keys here work like generics - they make it so you
213
- // can publish components for others to use without mandating a specific color scale
214
- // the @tamagui/button Button component looks for `$background`, so you set the
215
- // dark_red_Button theme to have a stronger background than the dark_red theme.
216
- background: bgIndex,
217
- backgroundHover: bgIndex + lighten,
218
- // always lighten on hover no matter the scheme
219
- backgroundPress: bgIndex + darken,
220
- // always darken on press no matter the theme
221
- backgroundFocus: bgIndex + darken,
222
- borderColor,
223
- borderColorHover: borderColor + lighten,
224
- borderColorPress: borderColor + darken,
225
- borderColorFocus: borderColor,
226
- color: -bgIndex,
227
- colorHover: -bgIndex - 1,
228
- colorPress: -bgIndex,
229
- colorFocus: -bgIndex - 1,
230
- colorTransparent: -1,
231
- placeholderColor: -bgIndex - 3,
232
- outlineColor: -2
233
- }, surface12 = {
234
- background: base.background + 1,
235
- backgroundHover: base.backgroundHover + 1,
236
- backgroundPress: base.backgroundPress + 1,
237
- backgroundFocus: base.backgroundFocus + 1,
238
- borderColor: base.borderColor + 1,
239
- borderColorHover: base.borderColorHover + 1,
240
- borderColorFocus: base.borderColorFocus + 1,
241
- borderColorPress: base.borderColorPress + 1
242
- }, surface22 = {
243
- background: base.background + 2,
244
- backgroundHover: base.backgroundHover + 2,
245
- backgroundPress: base.backgroundPress + 2,
246
- backgroundFocus: base.backgroundFocus + 2,
247
- borderColor: base.borderColor + 2,
248
- borderColorHover: base.borderColorHover + 2,
249
- borderColorFocus: base.borderColorFocus + 2,
250
- borderColorPress: base.borderColorPress + 2
251
- }, surface32 = {
252
- background: base.background + 3,
253
- backgroundHover: base.backgroundHover + 3,
254
- backgroundPress: base.backgroundPress + 3,
255
- backgroundFocus: base.backgroundFocus + 3,
256
- borderColor: base.borderColor + 3,
257
- borderColorHover: base.borderColorHover + 3,
258
- borderColorFocus: base.borderColorFocus + 3,
259
- borderColorPress: base.borderColorPress + 3
260
- }, surfaceActiveBg = {
261
- background: base.background + 5,
262
- backgroundHover: base.background + 5,
263
- backgroundPress: base.backgroundPress + 5,
264
- backgroundFocus: base.backgroundFocus + 5
265
- }, surfaceActive = {
266
- ...surfaceActiveBg,
267
- // match border to background when active
268
- borderColor: surfaceActiveBg.background,
269
- borderColorHover: surfaceActiveBg.backgroundHover,
270
- borderColorFocus: surfaceActiveBg.backgroundFocus,
271
- borderColorPress: surfaceActiveBg.backgroundPress
272
- }, inverseSurface12 = {
273
- color: surface12.background,
274
- colorHover: surface12.backgroundHover,
275
- colorPress: surface12.backgroundPress,
276
- colorFocus: surface12.backgroundFocus,
277
- background: base.color,
278
- backgroundHover: base.colorHover,
279
- backgroundPress: base.colorPress,
280
- backgroundFocus: base.colorFocus,
281
- borderColor: base.color - 2,
282
- borderColorHover: base.color - 3,
283
- borderColorFocus: base.color - 4,
284
- borderColorPress: base.color - 5
285
- }, inverseActive = {
286
- ...inverseSurface12,
287
- background: base.color - 2,
288
- backgroundHover: base.colorHover - 2,
289
- backgroundPress: base.colorPress - 2,
290
- backgroundFocus: base.colorFocus - 2,
291
- borderColor: base.color - 2 - 2,
292
- borderColorHover: base.color - 3 - 2,
293
- borderColorFocus: base.color - 4 - 2,
294
- borderColorPress: base.color - 5 - 2
295
- }, alt1 = {
296
- color: base.color - 1,
297
- colorHover: base.colorHover - 1,
298
- colorPress: base.colorPress - 1,
299
- colorFocus: base.colorFocus - 1
300
- }, alt2 = {
301
- color: base.color - 2,
302
- colorHover: base.colorHover - 2,
303
- colorPress: base.colorPress - 2,
304
- colorFocus: base.colorFocus - 2
305
- };
60
+ lightShadowColor = "rgba(0,0,0,0.04)",
61
+ lightShadowColorStrong = "rgba(0,0,0,0.085)",
62
+ darkShadowColor = "rgba(0,0,0,0.2)",
63
+ darkShadowColorStrong = "rgba(0,0,0,0.3)",
64
+ darkColors = {
65
+ ...colorTokens.dark.blue,
66
+ ...colorTokens.dark.gray,
67
+ ...colorTokens.dark.green,
68
+ ...colorTokens.dark.orange,
69
+ ...colorTokens.dark.pink,
70
+ ...colorTokens.dark.purple,
71
+ ...colorTokens.dark.red,
72
+ ...colorTokens.dark.yellow
73
+ },
74
+ lightColors = {
75
+ ...colorTokens.light.blue,
76
+ ...colorTokens.light.gray,
77
+ ...colorTokens.light.green,
78
+ ...colorTokens.light.orange,
79
+ ...colorTokens.light.pink,
80
+ ...colorTokens.light.purple,
81
+ ...colorTokens.light.red,
82
+ ...colorTokens.light.yellow
83
+ },
84
+ color = {
85
+ white0: "rgba(255,255,255,0)",
86
+ white075: "rgba(255,255,255,0.75)",
87
+ white05: "rgba(255,255,255,0.5)",
88
+ white025: "rgba(255,255,255,0.25)",
89
+ black0: "rgba(10,10,10,0)",
90
+ black075: "rgba(10,10,10,0.75)",
91
+ black05: "rgba(10,10,10,0.5)",
92
+ black025: "rgba(10,10,10,0.25)",
93
+ white1: "#fff",
94
+ white2: "#f8f8f8",
95
+ white3: "hsl(0, 0%, 96.3%)",
96
+ white4: "hsl(0, 0%, 94.1%)",
97
+ white5: "hsl(0, 0%, 92.0%)",
98
+ white6: "hsl(0, 0%, 90.0%)",
99
+ white7: "hsl(0, 0%, 88.5%)",
100
+ white8: "hsl(0, 0%, 81.0%)",
101
+ white9: "hsl(0, 0%, 56.1%)",
102
+ white10: "hsl(0, 0%, 50.3%)",
103
+ white11: "hsl(0, 0%, 42.5%)",
104
+ white12: "hsl(0, 0%, 9.0%)",
105
+ black1: "#050505",
106
+ black2: "#151515",
107
+ black3: "#191919",
108
+ black4: "#232323",
109
+ black5: "#282828",
110
+ black6: "#323232",
111
+ black7: "#424242",
112
+ black8: "#494949",
113
+ black9: "#545454",
114
+ black10: "#626262",
115
+ black11: "#a5a5a5",
116
+ black12: "#fff",
117
+ ...(0, import_utils.postfixObjKeys)(lightColors, "Light"),
118
+ ...(0, import_utils.postfixObjKeys)(darkColors, "Dark")
119
+ },
120
+ defaultPalettes = function () {
121
+ var transparent = function (hsl) {
122
+ var opacity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
123
+ return hsl.replace("%)", `%, ${opacity})`).replace("hsl(", "hsla(");
124
+ },
125
+ getColorPalette = function (colors, accentColors) {
126
+ var colorPalette = Object.values(colors),
127
+ colorI = colorPalette.length - 4,
128
+ accentPalette = Object.values(accentColors),
129
+ accentBackground = accentPalette[0],
130
+ accentColor = accentPalette[accentPalette.length - 1];
131
+ return [accentBackground, transparent(colorPalette[0], 0), transparent(colorPalette[0], 0.25), transparent(colorPalette[0], 0.5), transparent(colorPalette[0], 0.75), ...colorPalette, transparent(colorPalette[colorI], 0.75), transparent(colorPalette[colorI], 0.5), transparent(colorPalette[colorI], 0.25), transparent(colorPalette[colorI], 0), accentColor];
132
+ },
133
+ brandColor = {
134
+ light: color.blue4Light,
135
+ dark: color.blue4Dark
136
+ },
137
+ lightPalette = [brandColor.light, color.white0, color.white025, color.white05, color.white075, color.white1, color.white2, color.white3, color.white4, color.white5, color.white6, color.white7, color.white8, color.white9, color.white10, color.white11, color.white12, color.black075, color.black05, color.black025, color.black0, brandColor.dark],
138
+ darkPalette = [brandColor.dark, color.black0, color.black025, color.black05, color.black075, color.black1, color.black2, color.black3, color.black4, color.black5, color.black6, color.black7, color.black8, color.black9, color.black10, color.black11, color.black12, color.white075, color.white05, color.white025, color.white0, brandColor.light],
139
+ lightColorNames = (0, import_utils.objectKeys)(colorTokens.light),
140
+ lightPalettes = (0, import_theme_builder.objectFromEntries)(lightColorNames.map(function (key, index) {
141
+ return [`light_${key}`, getColorPalette(colorTokens.light[key], colorTokens.light[lightColorNames[(index + 1) % lightColorNames.length]])];
142
+ })),
143
+ darkColorNames = (0, import_utils.objectKeys)(colorTokens.dark),
144
+ darkPalettes = (0, import_theme_builder.objectFromEntries)(darkColorNames.map(function (key, index) {
145
+ return [`dark_${key}`, getColorPalette(colorTokens.dark[key], colorTokens.light[darkColorNames[(index + 1) % darkColorNames.length]])];
146
+ })),
147
+ colorPalettes = {
148
+ ...lightPalettes,
149
+ ...darkPalettes
150
+ };
306
151
  return {
307
- base,
308
- alt1,
309
- alt2,
310
- surface1: surface12,
311
- surface2: surface22,
312
- surface3: surface32,
313
- inverseSurface1: inverseSurface12,
314
- inverseActive,
315
- surfaceActive
152
+ light: lightPalette,
153
+ dark: darkPalette,
154
+ ...colorPalettes
316
155
  };
317
- }, lightTemplates = getBaseTemplates("light"), darkTemplates = getBaseTemplates("dark"), templates = {
318
- ...(0, import_theme_builder.objectFromEntries)((0, import_utils.objectKeys)(lightTemplates).map(function(name) {
319
- return [
320
- `light_${name}`,
321
- lightTemplates[name]
322
- ];
323
- })),
324
- ...(0, import_theme_builder.objectFromEntries)((0, import_utils.objectKeys)(darkTemplates).map(function(name) {
325
- return [
326
- `dark_${name}`,
327
- darkTemplates[name]
328
- ];
329
- }))
330
- };
331
- return templates;
332
- }, defaultTemplates = getTemplates(), shadows = {
333
- light: {
334
- shadowColor: lightShadowColorStrong,
335
- shadowColorHover: lightShadowColorStrong,
336
- shadowColorPress: lightShadowColor,
337
- shadowColorFocus: lightShadowColor
156
+ }(),
157
+ getTemplates = function () {
158
+ var getBaseTemplates = function (scheme) {
159
+ var isLight = scheme === "light",
160
+ bgIndex = 5,
161
+ lighten = isLight ? -1 : 1,
162
+ darken = -lighten,
163
+ borderColor = bgIndex + 3,
164
+ base = {
165
+ accentBackground: 0,
166
+ accentColor: -0,
167
+ background0: 1,
168
+ background025: 2,
169
+ background05: 3,
170
+ background075: 4,
171
+ color1: bgIndex,
172
+ color2: bgIndex + 1,
173
+ color3: bgIndex + 2,
174
+ color4: bgIndex + 3,
175
+ color5: bgIndex + 4,
176
+ color6: bgIndex + 5,
177
+ color7: bgIndex + 6,
178
+ color8: bgIndex + 7,
179
+ color9: bgIndex + 8,
180
+ color10: bgIndex + 9,
181
+ color11: bgIndex + 10,
182
+ color12: bgIndex + 11,
183
+ color0: -1,
184
+ color025: -2,
185
+ color05: -3,
186
+ color075: -4,
187
+ // the background, color, etc keys here work like generics - they make it so you
188
+ // can publish components for others to use without mandating a specific color scale
189
+ // the @tamagui/button Button component looks for `$background`, so you set the
190
+ // dark_red_Button theme to have a stronger background than the dark_red theme.
191
+ background: bgIndex,
192
+ backgroundHover: bgIndex + lighten,
193
+ // always lighten on hover no matter the scheme
194
+ backgroundPress: bgIndex + darken,
195
+ // always darken on press no matter the theme
196
+ backgroundFocus: bgIndex + darken,
197
+ borderColor,
198
+ borderColorHover: borderColor + lighten,
199
+ borderColorPress: borderColor + darken,
200
+ borderColorFocus: borderColor,
201
+ color: -bgIndex,
202
+ colorHover: -bgIndex - 1,
203
+ colorPress: -bgIndex,
204
+ colorFocus: -bgIndex - 1,
205
+ colorTransparent: -1,
206
+ placeholderColor: -bgIndex - 3,
207
+ outlineColor: -2
208
+ },
209
+ surface12 = {
210
+ background: base.background + 1,
211
+ backgroundHover: base.backgroundHover + 1,
212
+ backgroundPress: base.backgroundPress + 1,
213
+ backgroundFocus: base.backgroundFocus + 1,
214
+ borderColor: base.borderColor + 1,
215
+ borderColorHover: base.borderColorHover + 1,
216
+ borderColorFocus: base.borderColorFocus + 1,
217
+ borderColorPress: base.borderColorPress + 1
218
+ },
219
+ surface22 = {
220
+ background: base.background + 2,
221
+ backgroundHover: base.backgroundHover + 2,
222
+ backgroundPress: base.backgroundPress + 2,
223
+ backgroundFocus: base.backgroundFocus + 2,
224
+ borderColor: base.borderColor + 2,
225
+ borderColorHover: base.borderColorHover + 2,
226
+ borderColorFocus: base.borderColorFocus + 2,
227
+ borderColorPress: base.borderColorPress + 2
228
+ },
229
+ surface32 = {
230
+ background: base.background + 3,
231
+ backgroundHover: base.backgroundHover + 3,
232
+ backgroundPress: base.backgroundPress + 3,
233
+ backgroundFocus: base.backgroundFocus + 3,
234
+ borderColor: base.borderColor + 3,
235
+ borderColorHover: base.borderColorHover + 3,
236
+ borderColorFocus: base.borderColorFocus + 3,
237
+ borderColorPress: base.borderColorPress + 3
238
+ },
239
+ surfaceActiveBg = {
240
+ background: base.background + 5,
241
+ backgroundHover: base.background + 5,
242
+ backgroundPress: base.backgroundPress + 5,
243
+ backgroundFocus: base.backgroundFocus + 5
244
+ },
245
+ surfaceActive = {
246
+ ...surfaceActiveBg,
247
+ // match border to background when active
248
+ borderColor: surfaceActiveBg.background,
249
+ borderColorHover: surfaceActiveBg.backgroundHover,
250
+ borderColorFocus: surfaceActiveBg.backgroundFocus,
251
+ borderColorPress: surfaceActiveBg.backgroundPress
252
+ },
253
+ inverseSurface12 = {
254
+ color: surface12.background,
255
+ colorHover: surface12.backgroundHover,
256
+ colorPress: surface12.backgroundPress,
257
+ colorFocus: surface12.backgroundFocus,
258
+ background: base.color,
259
+ backgroundHover: base.colorHover,
260
+ backgroundPress: base.colorPress,
261
+ backgroundFocus: base.colorFocus,
262
+ borderColor: base.color - 2,
263
+ borderColorHover: base.color - 3,
264
+ borderColorFocus: base.color - 4,
265
+ borderColorPress: base.color - 5
266
+ },
267
+ inverseActive = {
268
+ ...inverseSurface12,
269
+ background: base.color - 2,
270
+ backgroundHover: base.colorHover - 2,
271
+ backgroundPress: base.colorPress - 2,
272
+ backgroundFocus: base.colorFocus - 2,
273
+ borderColor: base.color - 2 - 2,
274
+ borderColorHover: base.color - 3 - 2,
275
+ borderColorFocus: base.color - 4 - 2,
276
+ borderColorPress: base.color - 5 - 2
277
+ },
278
+ alt1 = {
279
+ color: base.color - 1,
280
+ colorHover: base.colorHover - 1,
281
+ colorPress: base.colorPress - 1,
282
+ colorFocus: base.colorFocus - 1
283
+ },
284
+ alt2 = {
285
+ color: base.color - 2,
286
+ colorHover: base.colorHover - 2,
287
+ colorPress: base.colorPress - 2,
288
+ colorFocus: base.colorFocus - 2
289
+ };
290
+ return {
291
+ base,
292
+ alt1,
293
+ alt2,
294
+ surface1: surface12,
295
+ surface2: surface22,
296
+ surface3: surface32,
297
+ inverseSurface1: inverseSurface12,
298
+ inverseActive,
299
+ surfaceActive
300
+ };
301
+ },
302
+ lightTemplates = getBaseTemplates("light"),
303
+ darkTemplates = getBaseTemplates("dark"),
304
+ templates = {
305
+ ...(0, import_theme_builder.objectFromEntries)((0, import_utils.objectKeys)(lightTemplates).map(function (name) {
306
+ return [`light_${name}`, lightTemplates[name]];
307
+ })),
308
+ ...(0, import_theme_builder.objectFromEntries)((0, import_utils.objectKeys)(darkTemplates).map(function (name) {
309
+ return [`dark_${name}`, darkTemplates[name]];
310
+ }))
311
+ };
312
+ return templates;
338
313
  },
339
- dark: {
340
- shadowColor: darkShadowColorStrong,
341
- shadowColorHover: darkShadowColorStrong,
342
- shadowColorPress: darkShadowColor,
343
- shadowColorFocus: darkShadowColor
344
- }
345
- }, nonInherited = {
346
- light: {
347
- ...lightColors,
348
- ...shadows.light
314
+ defaultTemplates = getTemplates(),
315
+ shadows = {
316
+ light: {
317
+ shadowColor: lightShadowColorStrong,
318
+ shadowColorHover: lightShadowColorStrong,
319
+ shadowColorPress: lightShadowColor,
320
+ shadowColorFocus: lightShadowColor
321
+ },
322
+ dark: {
323
+ shadowColor: darkShadowColorStrong,
324
+ shadowColorHover: darkShadowColorStrong,
325
+ shadowColorPress: darkShadowColor,
326
+ shadowColorFocus: darkShadowColor
327
+ }
328
+ },
329
+ nonInherited = {
330
+ light: {
331
+ ...lightColors,
332
+ ...shadows.light
333
+ },
334
+ dark: {
335
+ ...darkColors,
336
+ ...shadows.dark
337
+ }
349
338
  },
350
- dark: {
351
- ...darkColors,
352
- ...shadows.dark
353
- }
354
- }, overlayThemeDefinitions = [
355
- {
339
+ overlayThemeDefinitions = [{
356
340
  parent: "light",
357
341
  theme: {
358
342
  background: "rgba(0,0,0,0.5)"
359
343
  }
360
- },
361
- {
344
+ }, {
362
345
  parent: "dark",
363
346
  theme: {
364
347
  background: "rgba(0,0,0,0.8)"
365
348
  }
366
- }
367
- ], inverseSurface1 = [
368
- {
349
+ }],
350
+ inverseSurface1 = [{
369
351
  parent: "active",
370
352
  template: "inverseActive"
371
- },
372
- {
353
+ }, {
373
354
  parent: "",
374
355
  template: "inverseSurface1"
375
- }
376
- ], surface1 = [
377
- {
356
+ }],
357
+ surface1 = [{
378
358
  parent: "active",
379
359
  template: "surfaceActive"
380
- },
381
- {
360
+ }, {
382
361
  parent: "",
383
362
  template: "surface1"
384
- }
385
- ], surface2 = [
386
- {
363
+ }],
364
+ surface2 = [{
387
365
  parent: "active",
388
366
  template: "surfaceActive"
389
- },
390
- {
367
+ }, {
391
368
  parent: "",
392
369
  template: "surface2"
393
- }
394
- ], surface3 = [
395
- {
370
+ }],
371
+ surface3 = [{
396
372
  parent: "active",
397
373
  template: "surfaceActive"
398
- },
399
- {
374
+ }, {
400
375
  parent: "",
401
376
  template: "surface3"
402
- }
403
- ], defaultComponentThemes = {
404
- ListItem: {
405
- template: "surface1"
406
- },
407
- SelectTrigger: surface1,
408
- Card: surface1,
409
- Button: surface3,
410
- Checkbox: surface2,
411
- Switch: surface2,
412
- SwitchThumb: inverseSurface1,
413
- TooltipContent: surface2,
414
- Progress: {
415
- template: "surface1"
416
- },
417
- RadioGroupItem: surface2,
418
- TooltipArrow: {
419
- template: "surface1"
420
- },
421
- SliderTrackActive: {
422
- template: "surface3"
377
+ }],
378
+ defaultComponentThemes = {
379
+ ListItem: {
380
+ template: "surface1"
381
+ },
382
+ SelectTrigger: surface1,
383
+ Card: surface1,
384
+ Button: surface3,
385
+ Checkbox: surface2,
386
+ Switch: surface2,
387
+ SwitchThumb: inverseSurface1,
388
+ TooltipContent: surface2,
389
+ Progress: {
390
+ template: "surface1"
391
+ },
392
+ RadioGroupItem: surface2,
393
+ TooltipArrow: {
394
+ template: "surface1"
395
+ },
396
+ SliderTrackActive: {
397
+ template: "surface3"
398
+ },
399
+ SliderTrack: {
400
+ template: "surface1"
401
+ },
402
+ SliderThumb: inverseSurface1,
403
+ Tooltip: inverseSurface1,
404
+ ProgressIndicator: inverseSurface1,
405
+ SheetOverlay: overlayThemeDefinitions,
406
+ DialogOverlay: overlayThemeDefinitions,
407
+ ModalOverlay: overlayThemeDefinitions,
408
+ Input: surface1,
409
+ TextArea: surface1
423
410
  },
424
- SliderTrack: {
425
- template: "surface1"
426
- },
427
- SliderThumb: inverseSurface1,
428
- Tooltip: inverseSurface1,
429
- ProgressIndicator: inverseSurface1,
430
- SheetOverlay: overlayThemeDefinitions,
431
- DialogOverlay: overlayThemeDefinitions,
432
- ModalOverlay: overlayThemeDefinitions,
433
- Input: surface1,
434
- TextArea: surface1
435
- }, defaultSubThemes = {
436
- alt1: {
437
- template: "alt1"
438
- },
439
- alt2: {
440
- template: "alt2"
441
- },
442
- active: {
443
- template: "surface3"
444
- },
445
- surface1: {
446
- template: "surface1"
447
- },
448
- surface2: {
449
- template: "surface2"
450
- },
451
- surface3: {
452
- template: "surface3"
453
- },
454
- surface4: {
455
- template: "surfaceActive"
456
- }
457
- }, themeBuilder = (0, import_theme_builder.createThemeBuilder)().addPalettes(defaultPalettes).addTemplates(defaultTemplates).addThemes({
458
- light: {
459
- template: "base",
460
- palette: "light",
461
- nonInheritedValues: nonInherited.light
462
- },
463
- dark: {
464
- template: "base",
465
- palette: "dark",
466
- nonInheritedValues: nonInherited.dark
467
- }
468
- }).addChildThemes({
469
- orange: {
470
- palette: "orange",
471
- template: "base"
472
- },
473
- yellow: {
474
- palette: "yellow",
475
- template: "base"
476
- },
477
- green: {
478
- palette: "green",
479
- template: "base"
480
- },
481
- blue: {
482
- palette: "blue",
483
- template: "base"
484
- },
485
- purple: {
486
- palette: "purple",
487
- template: "base"
488
- },
489
- pink: {
490
- palette: "pink",
491
- template: "base"
492
- },
493
- red: {
494
- palette: "red",
495
- template: "base"
411
+ defaultSubThemes = {
412
+ alt1: {
413
+ template: "alt1"
414
+ },
415
+ alt2: {
416
+ template: "alt2"
417
+ },
418
+ active: {
419
+ template: "surface3"
420
+ },
421
+ surface1: {
422
+ template: "surface1"
423
+ },
424
+ surface2: {
425
+ template: "surface2"
426
+ },
427
+ surface3: {
428
+ template: "surface3"
429
+ },
430
+ surface4: {
431
+ template: "surfaceActive"
432
+ }
496
433
  },
497
- gray: {
498
- palette: "gray",
499
- template: "base"
500
- }
501
- }).addChildThemes(defaultSubThemes).addComponentThemes(defaultComponentThemes, {
502
- avoidNestingWithin: [
503
- "alt1",
504
- "alt2",
505
- "surface1",
506
- "surface2",
507
- "surface3",
508
- "surface4"
509
- ]
510
- }), themesIn = themeBuilder.build(), themes = themesIn, tokens = (0, import_web.createTokens)({
511
- color,
512
- ...import_v3_tokens.tokens
513
- });
514
- // Annotate the CommonJS export names for ESM import in node:
515
- 0 && (module.exports = {
516
- defaultComponentThemes,
517
- defaultPalettes,
518
- defaultSubThemes,
519
- defaultTemplates,
520
- themes,
521
- tokens
522
- });
523
- //# sourceMappingURL=v3-themes.js.map
434
+ themeBuilder = (0, import_theme_builder.createThemeBuilder)().addPalettes(defaultPalettes).addTemplates(defaultTemplates).addThemes({
435
+ light: {
436
+ template: "base",
437
+ palette: "light",
438
+ nonInheritedValues: nonInherited.light
439
+ },
440
+ dark: {
441
+ template: "base",
442
+ palette: "dark",
443
+ nonInheritedValues: nonInherited.dark
444
+ }
445
+ }).addChildThemes({
446
+ orange: {
447
+ palette: "orange",
448
+ template: "base"
449
+ },
450
+ yellow: {
451
+ palette: "yellow",
452
+ template: "base"
453
+ },
454
+ green: {
455
+ palette: "green",
456
+ template: "base"
457
+ },
458
+ blue: {
459
+ palette: "blue",
460
+ template: "base"
461
+ },
462
+ purple: {
463
+ palette: "purple",
464
+ template: "base"
465
+ },
466
+ pink: {
467
+ palette: "pink",
468
+ template: "base"
469
+ },
470
+ red: {
471
+ palette: "red",
472
+ template: "base"
473
+ },
474
+ gray: {
475
+ palette: "gray",
476
+ template: "base"
477
+ }
478
+ }).addChildThemes(defaultSubThemes).addComponentThemes(defaultComponentThemes, {
479
+ avoidNestingWithin: ["alt1", "alt2", "surface1", "surface2", "surface3", "surface4"]
480
+ }),
481
+ themesIn = themeBuilder.build(),
482
+ themes = themesIn,
483
+ tokens = (0, import_web.createTokens)({
484
+ color,
485
+ ...import_v3_tokens.tokens
486
+ });
487
+ //# sourceMappingURL=v3-themes.native.js.map