@tamagui/themes 1.111.8 → 1.111.10

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