@tamagui/theme-base 1.0.0-beta.193 → 1.0.0-beta.2

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.
@@ -35,7 +35,9 @@ __name(createThemesFrom, "createThemesFrom");
35
35
  const createTheme = /* @__PURE__ */ __name((str = 1, {
36
36
  backgrounds,
37
37
  isLight = true,
38
+ isBase = false,
38
39
  colors = [...backgrounds].reverse(),
40
+ borderColors = isLight ? colors : backgrounds,
39
41
  offsets: offsetsProp
40
42
  }) => {
41
43
  var _a, _b, _c, _d;
@@ -52,7 +54,7 @@ const createTheme = /* @__PURE__ */ __name((str = 1, {
52
54
  return arr[Math.max(0, Math.min(index + (offsets[name][str] || 0), arr.length - 1))];
53
55
  }, "get");
54
56
  const colorTranslucent = setColorAlpha(getVariableValue(get(colors, 0 + str, "color")), 0.5);
55
- return {
57
+ let theme = {
56
58
  background: get(backgrounds, str),
57
59
  backgroundStronger: get(backgrounds, str + strongerDir),
58
60
  backgroundSoft: get(backgrounds, str + 3),
@@ -60,10 +62,6 @@ const createTheme = /* @__PURE__ */ __name((str = 1, {
60
62
  backgroundPress: get(backgrounds, str + darkerDir * 1),
61
63
  backgroundFocus: get(backgrounds, str + darkerDir * 2),
62
64
  backgroundTransparent: color.grayA1,
63
- borderColor: isLight ? get(colors, 8 - str, "borderColor") : get(backgrounds, 2 + str, "borderColor"),
64
- borderColorHover: isLight ? get(colors, 6 - str, "borderColor") : get(backgrounds, 3 + str, "borderColor"),
65
- borderColorPress: isLight ? get(colors, 5 - str, "borderColor") : get(backgrounds, 1 + str, "borderColor"),
66
- borderColorFocus: isLight ? get(colors, 4 - str, "borderColor") : get(backgrounds, 3 + str, "borderColor"),
67
65
  color: get(colors, 0 + str, "color"),
68
66
  colorHover: get(colors, 1 + str, "color"),
69
67
  colorPress: get(colors, 2 + str, "color"),
@@ -73,8 +71,28 @@ const createTheme = /* @__PURE__ */ __name((str = 1, {
73
71
  shadowColor: isLight ? color.grayA3 : color.grayA8,
74
72
  shadowColorHover: darkColors[!isLight ? 1 : 8],
75
73
  shadowColorPress: darkColors[!isLight ? 1 : 8],
76
- shadowColorFocus: darkColors[!isLight ? 1 : 8]
74
+ shadowColorFocus: darkColors[!isLight ? 1 : 8],
75
+ borderColor: null,
76
+ borderColorHover: null,
77
+ borderColorPress: null,
78
+ borderColorFocus: null
77
79
  };
80
+ if (isBase) {
81
+ Object.assign(theme, {
82
+ borderColor: isLight ? get(colors, 8 - str, "borderColor") : get(backgrounds, 2 + str, "borderColor"),
83
+ borderColorHover: isLight ? get(colors, 6 - str, "borderColor") : get(backgrounds, 3 + str, "borderColor"),
84
+ borderColorPress: isLight ? get(colors, 5 - str, "borderColor") : get(backgrounds, 1 + str, "borderColor"),
85
+ borderColorFocus: isLight ? get(colors, 4 - str, "borderColor") : get(backgrounds, 3 + str, "borderColor")
86
+ });
87
+ } else {
88
+ Object.assign(theme, {
89
+ borderColor: get(borderColors, 1 + strongerDir, "borderColor"),
90
+ borderColorHover: get(borderColors, 2 + strongerDir, "borderColor"),
91
+ borderColorPress: get(borderColors, 3 + strongerDir, "borderColor"),
92
+ borderColorFocus: get(borderColors, 4 + strongerDir, "borderColor")
93
+ });
94
+ }
95
+ return theme;
78
96
  }, "createTheme");
79
97
  const colorSchemes = [
80
98
  { name: "blue", colors: Colors.blue, darkColors: Colors.blueDark },
@@ -123,11 +141,13 @@ const darkGradient = [
123
141
  ];
124
142
  const lightThemes = createThemesFrom("light", createTheme, {
125
143
  backgrounds: lightGradient,
144
+ borderColors: lightGradient.slice(2),
126
145
  isLight: true
127
146
  });
128
147
  const darkThemes = createThemesFrom("dark", createTheme, {
129
148
  backgrounds: darkGradient,
130
149
  colors: lightGradient.slice(2),
150
+ isBase: true,
131
151
  isLight: false,
132
152
  shift: 1,
133
153
  offsets: {
@@ -142,7 +162,7 @@ const baseThemes = {
142
162
  },
143
163
  light_active: makeActiveTheme(lightThemes.light),
144
164
  light_Card: lightThemes.light,
145
- light_Drawer: lightThemes.light_alt1,
165
+ light_DrawerFrame: lightThemes.light_alt1,
146
166
  light_Button: lightThemes.light_alt1,
147
167
  ...darkThemes,
148
168
  dark: {
@@ -151,7 +171,7 @@ const baseThemes = {
151
171
  },
152
172
  dark_active: makeActiveTheme(darkThemes.dark),
153
173
  dark_Card: darkThemes.dark_alt1,
154
- dark_Drawer: darkThemes.dark_alt2,
174
+ dark_DrawerFrame: darkThemes.dark_alt2,
155
175
  dark_Button: darkThemes.dark_alt1
156
176
  };
157
177
  function makeActiveTheme(theme) {
@@ -171,7 +191,7 @@ const colorThemeEntries = colorSchemes.flatMap(({ name, colors, darkColors }) =>
171
191
  const isLight = i === 0;
172
192
  const [backgrounds, colors2] = [
173
193
  Object.values(props.backgrounds),
174
- Object.values(props.colors).slice(isLight ? 0 : 2)
194
+ Object.values(props.colors).slice(isLight ? 2 : 2)
175
195
  ];
176
196
  const scheme = isLight ? "light" : "dark";
177
197
  const shift = isLight ? 0 : 1;
@@ -182,12 +202,13 @@ const colorThemeEntries = colorSchemes.flatMap(({ name, colors, darkColors }) =>
182
202
  const themeWithAlts = createThemesFrom(name, createTheme, {
183
203
  colors: colors2,
184
204
  backgrounds,
205
+ borderColors: backgrounds,
185
206
  isLight,
186
207
  shift,
187
208
  isBase: false,
188
209
  offsets: {
189
- background: isLight ? [1, 1, 1, 0, 0, 0] : null,
190
- borderColor: isLight ? [0, 1, 1, 2, 2, -2] : null,
210
+ background: isLight ? [0, 0, 0, 0, 0, 0] : null,
211
+ borderColor: isLight ? [3, 3, 3, 3, 2] : null,
191
212
  color: isLight ? [0, 0, -1, -2, -3, -3, -4] : [-1, -1, -1, -1, -1, -1]
192
213
  }
193
214
  });
@@ -199,41 +220,17 @@ const colorThemeEntries = colorSchemes.flatMap(({ name, colors, darkColors }) =>
199
220
  ...altLightThemes,
200
221
  [`${lightButtonTheme[0]}_Button`, altLightThemes[2][1]],
201
222
  [`${lightButtonTheme[0]}_Card`, altLightThemes[2][1]],
202
- [`${lightButtonTheme[0]}_Drawer`, altLightThemes[2][1]],
223
+ [`${lightButtonTheme[0]}_DrawerFrame`, altLightThemes[2][1]],
203
224
  ...altDarkThemes,
204
225
  [`${darkButtonTheme[0]}_Button`, altDarkThemes[2][1]],
205
226
  [`${darkButtonTheme[0]}_Card`, altDarkThemes[2][1]],
206
- [`${darkButtonTheme[0]}_Drawer`, altDarkThemes[2][1]]
227
+ [`${darkButtonTheme[0]}_DrawerFrame`, altDarkThemes[2][1]]
207
228
  ];
208
229
  });
209
- const transparent = {
210
- background: "transparent",
211
- backgroundSoft: "transparent",
212
- backgroundHover: "transparent",
213
- backgroundPress: "transparent",
214
- backgroundFocus: "transparent",
215
- backgroundTransparent: "transparent",
216
- shadowColor: "transparent",
217
- shadowColorHover: "transparent",
218
- shadowColorPress: "transparent",
219
- shadowColorFocus: "transparent"
220
- };
221
- const dark_outline = {
222
- ...baseThemes.dark,
223
- borderColor: "#fff",
224
- ...transparent
225
- };
226
- const light_outline = {
227
- ...baseThemes.light,
228
- borderColor: "#000",
229
- ...transparent
230
- };
231
230
  const colorThemes = Object.fromEntries(colorThemeEntries);
232
231
  const allThemes = {
233
232
  ...baseThemes,
234
- ...colorThemes,
235
- dark_outline,
236
- light_outline
233
+ ...colorThemes
237
234
  };
238
235
  const themes = allThemes;
239
236
  export {
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/theme-base",
3
- "version": "1.0.0-beta.193+14c13acd",
3
+ "version": "1.0.0-beta.2",
4
4
  "typings": "types",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -16,12 +16,12 @@
16
16
  "clean:build": "tamagui-build clean:build"
17
17
  },
18
18
  "devDependencies": {
19
- "@tamagui/build": "^1.0.0-beta.193+14c13acd",
20
- "@tamagui/colors": "^1.0.0-beta.193+14c13acd",
21
- "@tamagui/core": "^1.0.0-beta.193+14c13acd"
19
+ "@tamagui/build": "^1.0.0-beta.2",
20
+ "@tamagui/colors": "^1.0.0-beta.2",
21
+ "@tamagui/core": "^1.0.0-beta.2"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
- "gitHead": "14c13acd9143e76d975e7a6c311d4a5f3a00bced"
26
+ "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
27
27
  }