@tamagui/themes 1.125.6 → 1.125.7

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