@tamagui/tamagui-dev-config 2.7.7 → 3.0.0-beta.1091.1

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.
@@ -1,79 +1,52 @@
1
- import { animationsCSS } from "@tamagui/config/v5-css";
2
- import { animationsMotion } from "@tamagui/config/v5-motion";
3
- import { createV5Theme, defaultConfig, subtleChildrenThemes } from "@tamagui/config/v5-subtle";
1
+ import { animationsCSS } from "@tamagui/config/animations-css";
2
+ import { animationsMotion } from "@tamagui/config/animations-motion";
3
+ import { selectionStyles, settings, sizes } from "@tamagui/config/settings";
4
4
  import { setupDev } from "@tamagui/core";
5
- import { bodyFont, cherryBombFont, headingFont, monoFont, silkscreenFont } from "./fonts.mjs";
5
+ import { shorthands } from "@tamagui/shorthands/v4";
6
+ import { tokens } from "@tamagui/themes/v5";
7
+ import { bodyFont, cherryBombFont, headingFont, monoFont } from "./fonts.mjs";
6
8
  import { media, mediaQueryDefaultActive } from "./media.mjs";
7
- const {
8
- gray,
9
- blue,
10
- red,
11
- yellow,
12
- green
13
- } = subtleChildrenThemes;
14
- const themes = createV5Theme({
15
- childrenThemes: {
16
- gray,
17
- blue,
18
- red,
19
- yellow,
20
- green
21
- }
22
- });
23
- setupDev({
24
- visualizer: true
25
- });
9
+ import { clientThemes } from "./themeMetadata.mjs";
10
+ import { themes } from "./themes.mjs";
11
+
12
+ setupDev({ visualizer: true });
26
13
  const fonts = {
27
- heading: headingFont,
28
- body: bodyFont,
29
- mono: monoFont,
30
- silkscreen: silkscreenFont,
31
- cherryBomb: cherryBombFont
14
+ heading: headingFont,
15
+ body: bodyFont,
16
+ mono: monoFont,
17
+ cherryBomb: cherryBombFont
32
18
  };
33
19
  const animations = {
34
- default: animationsMotion,
35
- css: animationsCSS
20
+ default: animationsMotion,
21
+ css: animationsCSS
36
22
  };
23
+ const configuredThemes = process.env.VITE_ENVIRONMENT === "client" ? clientThemes : themes;
37
24
  const config = {
38
- ...defaultConfig,
39
- themes: process.env.VITE_ENVIRONMENT === "client" ? {} : themes,
40
- fonts,
41
- animations,
42
- media,
43
- settings: {
44
- ...defaultConfig.settings,
45
- mediaQueryDefaultActive,
46
- allowedStyleValues: "somewhat-strict-web",
47
- autocompleteSpecificTokens: "except-special",
48
- // Allow both shorthands and longhand names for flexibility
49
- onlyAllowShorthands: false
50
- }
25
+ shorthands,
26
+ tokens,
27
+ selectionStyles,
28
+ sizes,
29
+ themes: configuredThemes,
30
+ fonts,
31
+ animations,
32
+ media,
33
+ settings: {
34
+ ...settings,
35
+ mediaQueryDefaultActive,
36
+ allowedStyleValues: "somewhat-strict-web",
37
+ onlyAllowShorthands: false
38
+ }
51
39
  };
52
40
  Object.assign(config.media, {
53
- tiny: {
54
- maxWidth: 500
55
- },
56
- gtTiny: {
57
- minWidth: 500 + 1
58
- },
59
- small: {
60
- maxWidth: 620
61
- },
62
- gtSmall: {
63
- minWidth: 620 + 1
64
- },
65
- medium: {
66
- maxWidth: 780
67
- },
68
- gtMedium: {
69
- minWidth: 780 + 1
70
- },
71
- large: {
72
- maxWidth: 900
73
- },
74
- gtLarge: {
75
- minWidth: 900 + 1
76
- }
41
+ tiny: { maxWidth: 500 },
42
+ gtTiny: { minWidth: 500 + 1 },
43
+ small: { maxWidth: 620 },
44
+ gtSmall: { minWidth: 620 + 1 },
45
+ medium: { maxWidth: 780 },
46
+ gtMedium: { minWidth: 780 + 1 },
47
+ large: { maxWidth: 900 },
48
+ gtLarge: { minWidth: 900 + 1 }
77
49
  });
50
+
78
51
  export { animations, config };
79
52
  //# sourceMappingURL=tamagui.dev.config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["animationsCSS","animationsMotion","createV5Theme","defaultConfig","subtleChildrenThemes","setupDev","bodyFont","cherryBombFont","headingFont","monoFont","silkscreenFont","media","mediaQueryDefaultActive","gray","blue","red","yellow","green","themes","childrenThemes","visualizer","fonts","heading","body","mono","silkscreen","cherryBomb","animations","default","css","config","process","env","VITE_ENVIRONMENT","settings","allowedStyleValues","autocompleteSpecificTokens","onlyAllowShorthands","Object","assign","tiny","maxWidth","gtTiny","minWidth","small","gtSmall","medium","gtMedium","large","gtLarge"],"sources":["../../src/tamagui.dev.config.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAC9B,SAASC,gBAAA,QAAwB;AACjC,SACEC,aAAA,EACAC,aAAA,EACAC,oBAAA,QACK;AAcP,SAASC,QAAA,QAAgB;AACzB,SAASC,QAAA,EAAUC,cAAA,EAAgBC,WAAA,EAAaC,QAAA,EAAUC,cAAA,QAAsB;AAChF,SAASC,KAAA,EAAOC,uBAAA,QAA+B;AAP/C,MAAM;EAAEC,IAAA;EAAMC,IAAA;EAAMC,GAAA;EAAKC,MAAA;EAAQC;AAAM,IAAIb,oBAAA;AAC3C,MAAMc,MAAA,GAAShB,aAAA,CAAc;EAC3BiB,cAAA,EAAgB;IAAEN,IAAA;IAAMC,IAAA;IAAMC,GAAA;IAAKC,MAAA;IAAQC;EAAM;AACnD,CAAC;AAMDZ,QAAA,CAAS;EACPe,UAAA,EAAY;AACd,CAAC;AAED,MAAMC,KAAA,GAAQ;EACZC,OAAA,EAASd,WAAA;EACTe,IAAA,EAAMjB,QAAA;EACNkB,IAAA,EAAMf,QAAA;EACNgB,UAAA,EAAYf,cAAA;EACZgB,UAAA,EAAYnB;AACd;AAEO,MAAMoB,UAAA,GAAa;EACxBC,OAAA,EAAS3B,gBAAA;EACT4B,GAAA,EAAK7B;AACP;AAGO,MAAM8B,MAAA,GAAS;EACpB,GAAG3B,aAAA;EACHe,MAAA,EAAQa,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB,WAAY,CAAC,IAAsBf,MAAA;EAC5EG,KAAA;EACAM,UAAA;EACAhB,KAAA;EACAuB,QAAA,EAAU;IACR,GAAG/B,aAAA,CAAc+B,QAAA;IACjBtB,uBAAA;IACAuB,kBAAA,EAAoB;IACpBC,0BAAA,EAA4B;IAAA;IAE5BC,mBAAA,EAAqB;EACvB;AACF;AAGAC,MAAA,CAAOC,MAAA,CAAOT,MAAA,CAAOnB,KAAA,EAAO;EAC1B6B,IAAA,EAAM;IAAEC,QAAA,EAAU;EAAI;EACtBC,MAAA,EAAQ;IAAEC,QAAA,EAAU,MAAM;EAAE;EAC5BC,KAAA,EAAO;IAAEH,QAAA,EAAU;EAAI;EACvBI,OAAA,EAAS;IAAEF,QAAA,EAAU,MAAM;EAAE;EAC7BG,MAAA,EAAQ;IAAEL,QAAA,EAAU;EAAI;EACxBM,QAAA,EAAU;IAAEJ,QAAA,EAAU,MAAM;EAAE;EAC9BK,KAAA,EAAO;IAAEP,QAAA,EAAU;EAAI;EACvBQ,OAAA,EAAS;IAAEN,QAAA,EAAU,MAAM;EAAE;AAC/B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"tamagui.dev.config.js","names":["defaultSettings"],"sources":["esm/tamagui.dev.config.js"],"sourcesContent":["import { animationsCSS } from \"@tamagui/config/animations-css\";\nimport { animationsMotion } from \"@tamagui/config/animations-motion\";\nimport {\n selectionStyles,\n settings as defaultSettings,\n sizes\n} from \"@tamagui/config/settings\";\nimport { setupDev } from \"@tamagui/core\";\nimport { shorthands } from \"@tamagui/shorthands/v4\";\nimport { tokens } from \"@tamagui/themes/v5\";\nimport { bodyFont, cherryBombFont, headingFont, monoFont } from \"./fonts\";\nimport { media, mediaQueryDefaultActive } from \"./media\";\nimport { clientThemes } from \"./themeMetadata\";\nimport { themes } from \"./themes\";\nsetupDev({\n visualizer: true\n});\nconst fonts = {\n heading: headingFont,\n body: bodyFont,\n mono: monoFont,\n cherryBomb: cherryBombFont\n};\nconst animations = {\n default: animationsMotion,\n css: animationsCSS\n};\nconst configuredThemes = process.env.VITE_ENVIRONMENT === \"client\" ? clientThemes : themes;\nconst config = {\n shorthands,\n tokens,\n selectionStyles,\n sizes,\n themes: configuredThemes,\n fonts,\n animations,\n media,\n settings: {\n ...defaultSettings,\n mediaQueryDefaultActive,\n allowedStyleValues: \"somewhat-strict-web\",\n // allow both shorthands and longhand names for flexibility\n onlyAllowShorthands: false\n }\n};\nObject.assign(config.media, {\n tiny: { maxWidth: 500 },\n gtTiny: { minWidth: 500 + 1 },\n small: { maxWidth: 620 },\n gtSmall: { minWidth: 620 + 1 },\n medium: { maxWidth: 780 },\n gtMedium: { minWidth: 780 + 1 },\n large: { maxWidth: 900 },\n gtLarge: { minWidth: 900 + 1 }\n});\nexport {\n animations,\n config\n};\n//# sourceMappingURL=tamagui.dev.config.js.map\n"],"mappings":";;;;;;;;;;;;AAcA,SAAS,EACP,YAAY,KACd,CAAC;AACD,MAAM,QAAQ;CACZ,SAAS;CACT,MAAM;CACN,MAAM;CACN,YAAY;AACd;AACA,MAAM,aAAa;CACjB,SAAS;CACT,KAAK;AACP;AACA,MAAM,mBAAmB,QAAQ,IAAI,qBAAqB,WAAW,eAAe;AACpF,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA,QAAQ;CACR;CACA;CACA;CACA,UAAU;EACR,GAAGA;EACH;EACA,oBAAoB;EAEpB,qBAAqB;CACvB;AACF;AACA,OAAO,OAAO,OAAO,OAAO;CAC1B,MAAM,EAAE,UAAU,IAAI;CACtB,QAAQ,EAAE,UAAU,MAAM,EAAE;CAC5B,OAAO,EAAE,UAAU,IAAI;CACvB,SAAS,EAAE,UAAU,MAAM,EAAE;CAC7B,QAAQ,EAAE,UAAU,IAAI;CACxB,UAAU,EAAE,UAAU,MAAM,EAAE;CAC9B,OAAO,EAAE,UAAU,IAAI;CACvB,SAAS,EAAE,UAAU,MAAM,EAAE;AAC/B,CAAC"}
@@ -0,0 +1,107 @@
1
+ const schemes = ["light", "dark"];
2
+ const colors = [
3
+ "gray",
4
+ "blue",
5
+ "red",
6
+ "yellow",
7
+ "green"
8
+ ];
9
+ const paletteColors = [
10
+ "blue",
11
+ "gray",
12
+ "green",
13
+ "neutral",
14
+ "orange",
15
+ "pink",
16
+ "purple",
17
+ "red",
18
+ "teal",
19
+ "yellow"
20
+ ];
21
+ const componentThemes = [
22
+ "Button",
23
+ "Input",
24
+ "Progress",
25
+ "ProgressIndicator",
26
+ "Slider",
27
+ "SliderActive",
28
+ "SliderThumb",
29
+ "Switch",
30
+ "TextArea",
31
+ "Tooltip",
32
+ "SwitchThumb"
33
+ ];
34
+ const numbered = (prefix, count) => Array.from({ length: count }, (_, index) => `${prefix}${index + 1}`);
35
+ const baseThemeNames = schemes.flatMap((scheme) => [
36
+ scheme,
37
+ `${scheme}_accent`,
38
+ `${scheme}_surface1`,
39
+ `${scheme}_surface2`,
40
+ ...colors.flatMap((color) => [
41
+ `${scheme}_${color}`,
42
+ `${scheme}_${color}_accent`,
43
+ `${scheme}_${color}_surface1`,
44
+ `${scheme}_${color}_surface2`
45
+ ])
46
+ ]);
47
+ const levelThemeNames = baseThemeNames.flatMap((themeName) => themeName.endsWith("_surface1") ? [themeName.replace(/_surface1$/, "_level2")] : themeName.endsWith("_surface2") ? [themeName.replace(/_surface2$/, "_level3")] : themeName.endsWith("_accent") ? [`${themeName}_level2`, `${themeName}_level3`] : []);
48
+ const componentThemeNames = [...baseThemeNames, ...levelThemeNames].flatMap((parent) => componentThemes.map((component) => `${parent}_${component}`));
49
+ const themeNames = [
50
+ ...baseThemeNames,
51
+ ...levelThemeNames,
52
+ ...componentThemeNames
53
+ ];
54
+ const alphaSteps = [
55
+ "0",
56
+ "01",
57
+ "02",
58
+ "04",
59
+ "06",
60
+ "08",
61
+ "001",
62
+ "002",
63
+ "0025",
64
+ "005",
65
+ "0075"
66
+ ];
67
+ const themeVariableNames = [
68
+ "accent-background",
69
+ "accent-color",
70
+ ...numbered("accent", 12),
71
+ "background",
72
+ "background-focus",
73
+ "background-hover",
74
+ "background-press",
75
+ ...alphaSteps.map((step) => `background${step}`),
76
+ "border-color",
77
+ "border-color-focus",
78
+ "border-color-hover",
79
+ "border-color-press",
80
+ "color",
81
+ "color-focus",
82
+ "color-hover",
83
+ "color-press",
84
+ "color-transparent",
85
+ ...alphaSteps.map((step) => `color${step}`),
86
+ ...numbered("color", 12),
87
+ "outline-color",
88
+ "placeholder-color",
89
+ "shadow-color",
90
+ ...["black", "white"].flatMap((color) => [
91
+ color,
92
+ `${color}0`,
93
+ `${color}02`,
94
+ `${color}04`,
95
+ `${color}06`,
96
+ `${color}08`,
97
+ ...numbered(color, 12)
98
+ ]),
99
+ ...paletteColors.flatMap((color) => numbered(color, 12)),
100
+ ...numbered("highlight", 8),
101
+ ...numbered("shadow", 8)
102
+ ];
103
+ const variableShape = Object.fromEntries(themeVariableNames.map((name) => [name, `var(--${name})`]));
104
+ const clientThemes = Object.fromEntries(themeNames.map((name) => [name, variableShape]));
105
+
106
+ export { clientThemes, componentThemes, themeNames, themeVariableNames };
107
+ //# sourceMappingURL=themeMetadata.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeMetadata.js","names":[],"sources":["esm/themeMetadata.js"],"sourcesContent":["const schemes = [\"light\", \"dark\"];\nconst colors = [\"gray\", \"blue\", \"red\", \"yellow\", \"green\"];\nconst paletteColors = [\n \"blue\",\n \"gray\",\n \"green\",\n \"neutral\",\n \"orange\",\n \"pink\",\n \"purple\",\n \"red\",\n \"teal\",\n \"yellow\"\n];\nconst componentThemes = [\n \"Button\",\n \"Input\",\n \"Progress\",\n \"ProgressIndicator\",\n \"Slider\",\n \"SliderActive\",\n \"SliderThumb\",\n \"Switch\",\n \"TextArea\",\n \"Tooltip\",\n \"SwitchThumb\"\n];\nconst numbered = (prefix, count) => Array.from({ length: count }, (_, index) => `${prefix}${index + 1}`);\nconst baseThemeNames = schemes.flatMap((scheme) => [\n scheme,\n `${scheme}_accent`,\n `${scheme}_surface1`,\n `${scheme}_surface2`,\n ...colors.flatMap((color) => [\n `${scheme}_${color}`,\n `${scheme}_${color}_accent`,\n `${scheme}_${color}_surface1`,\n `${scheme}_${color}_surface2`\n ])\n]);\nconst levelThemeNames = baseThemeNames.flatMap(\n (themeName) => themeName.endsWith(\"_surface1\") ? [themeName.replace(/_surface1$/, \"_level2\")] : themeName.endsWith(\"_surface2\") ? [themeName.replace(/_surface2$/, \"_level3\")] : themeName.endsWith(\"_accent\") ? [`${themeName}_level2`, `${themeName}_level3`] : []\n);\nconst componentThemeNames = [...baseThemeNames, ...levelThemeNames].flatMap(\n (parent) => componentThemes.map((component) => `${parent}_${component}`)\n);\nconst themeNames = [...baseThemeNames, ...levelThemeNames, ...componentThemeNames];\nconst alphaSteps = [\n \"0\",\n \"01\",\n \"02\",\n \"04\",\n \"06\",\n \"08\",\n \"001\",\n \"002\",\n \"0025\",\n \"005\",\n \"0075\"\n];\nconst themeVariableNames = [\n \"accent-background\",\n \"accent-color\",\n ...numbered(\"accent\", 12),\n \"background\",\n \"background-focus\",\n \"background-hover\",\n \"background-press\",\n ...alphaSteps.map((step) => `background${step}`),\n \"border-color\",\n \"border-color-focus\",\n \"border-color-hover\",\n \"border-color-press\",\n \"color\",\n \"color-focus\",\n \"color-hover\",\n \"color-press\",\n \"color-transparent\",\n ...alphaSteps.map((step) => `color${step}`),\n ...numbered(\"color\", 12),\n \"outline-color\",\n \"placeholder-color\",\n \"shadow-color\",\n ...[\"black\", \"white\"].flatMap((color) => [\n color,\n `${color}0`,\n `${color}02`,\n `${color}04`,\n `${color}06`,\n `${color}08`,\n ...numbered(color, 12)\n ]),\n ...paletteColors.flatMap((color) => numbered(color, 12)),\n ...numbered(\"highlight\", 8),\n ...numbered(\"shadow\", 8)\n];\nconst variableShape = Object.fromEntries(\n themeVariableNames.map((name) => [name, `var(--${name})`])\n);\nconst clientThemes = Object.fromEntries(\n themeNames.map((name) => [name, variableShape])\n);\nexport {\n clientThemes,\n componentThemes,\n themeNames,\n themeVariableNames\n};\n//# sourceMappingURL=themeMetadata.js.map\n"],"mappings":";AAAA,MAAM,UAAU,CAAC,SAAS,MAAM;AAChC,MAAM,SAAS;CAAC;CAAQ;CAAQ;CAAO;CAAU;AAAO;AACxD,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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A;CACA,GAAG,CAAC,SAAS,OAAO,CAAC,CAAC,SAAS,UAAU;EACvC;EACA,GAAG,MAAM;EACT,GAAG,MAAM;EACT,GAAG,MAAM;EACT,GAAG,MAAM;EACT,GAAG,MAAM;EACT,GAAG,SAAS,OAAO,EAAE;CACvB,CAAC;CACD,GAAG,cAAc,SAAS,UAAU,SAAS,OAAO,EAAE,CAAC;CACvD,GAAG,SAAS,aAAa,CAAC;CAC1B,GAAG,SAAS,UAAU,CAAC;AACzB;AACA,MAAM,gBAAgB,OAAO,YAC3B,mBAAmB,KAAK,SAAS,CAAC,MAAM,SAAS,KAAK,EAAE,CAAC,CAC3D;AACA,MAAM,eAAe,OAAO,YAC1B,WAAW,KAAK,SAAS,CAAC,MAAM,aAAa,CAAC,CAChD"}
@@ -0,0 +1,54 @@
1
+ import { toV6Themes } from "@tamagui/config/v6-base";
2
+ import { themes as themes$1 } from "@tamagui/themes/v5-subtle";
3
+ import { componentThemes, themeNames } from "./themeMetadata.mjs";
4
+
5
+ const themeNameSet = new Set(themeNames);
6
+ const selectedThemes = Object.fromEntries(Object.entries(themes$1).filter(([themeName]) => themeNameSet.has(themeName)));
7
+ for (const [themeName, theme] of Object.entries(selectedThemes)) {
8
+ if (themeName.endsWith("_surface1")) {
9
+ selectedThemes[themeName.replace(/_surface1$/, "_level2")] = theme;
10
+ } else if (themeName.endsWith("_surface2")) {
11
+ selectedThemes[themeName.replace(/_surface2$/, "_level3")] = theme;
12
+ } else if (themeName.endsWith("_accent")) {
13
+ selectedThemes[`${themeName}_level2`] = theme;
14
+ selectedThemes[`${themeName}_level3`] = theme;
15
+ }
16
+ }
17
+ for (const themeName of themeNames) {
18
+ const component = componentThemes.find((name) => themeName.endsWith(`_${name}`));
19
+ if (!component || selectedThemes[themeName]) continue;
20
+ const parentName = themeName.slice(0, -(component.length + 1));
21
+ if (selectedThemes[parentName]) {
22
+ selectedThemes[themeName] = selectedThemes[parentName];
23
+ }
24
+ }
25
+ const MAX_LIGHT_BORDER_GAP = 8;
26
+ const hsla = /^hsla\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*,\s*([\d.]+)\s*\)$/;
27
+ const softenLightBorder = (theme) => {
28
+ const background = hsla.exec(theme.background);
29
+ const border = hsla.exec(theme["border-color"]);
30
+ if (!background || !border) return theme;
31
+ const backgroundLightness = Number(background[3]);
32
+ const borderLightness = Number(border[3]);
33
+ if (backgroundLightness <= 50) return theme;
34
+ const gap = backgroundLightness - borderLightness;
35
+ if (gap <= MAX_LIGHT_BORDER_GAP) return theme;
36
+ const lightness = backgroundLightness - MAX_LIGHT_BORDER_GAP;
37
+ return {
38
+ ...theme,
39
+ "border-color": `hsla(${border[1]}, ${border[2]}%, ${lightness}%, ${border[4]})`
40
+ };
41
+ };
42
+ const v6Themes = toV6Themes(selectedThemes);
43
+ const softened = /* @__PURE__ */ new Map();
44
+ const themes = Object.fromEntries(Object.entries(v6Themes).map(([themeName, theme]) => {
45
+ let next = softened.get(theme);
46
+ if (!next) {
47
+ next = softenLightBorder(theme);
48
+ softened.set(theme, next);
49
+ }
50
+ return [themeName, next];
51
+ }));
52
+
53
+ export { themes };
54
+ //# sourceMappingURL=themes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","names":["v5Themes"],"sources":["esm/themes.js"],"sourcesContent":["import { toV6Themes } from \"@tamagui/config/v6-base\";\nimport { themes as v5Themes } from \"@tamagui/themes/v5-subtle\";\nimport { componentThemes, themeNames } from \"./themeMetadata\";\nconst themeNameSet = new Set(themeNames);\nconst selectedThemes = Object.fromEntries(\n Object.entries(v5Themes).filter(([themeName]) => themeNameSet.has(themeName))\n);\nfor (const [themeName, theme] of Object.entries(selectedThemes)) {\n if (themeName.endsWith(\"_surface1\")) {\n selectedThemes[themeName.replace(/_surface1$/, \"_level2\")] = theme;\n } else if (themeName.endsWith(\"_surface2\")) {\n selectedThemes[themeName.replace(/_surface2$/, \"_level3\")] = theme;\n } else if (themeName.endsWith(\"_accent\")) {\n selectedThemes[`${themeName}_level2`] = theme;\n selectedThemes[`${themeName}_level3`] = theme;\n }\n}\nfor (const themeName of themeNames) {\n const component = componentThemes.find((name) => themeName.endsWith(`_${name}`));\n if (!component || selectedThemes[themeName]) continue;\n const parentName = themeName.slice(0, -(component.length + 1));\n if (selectedThemes[parentName]) {\n selectedThemes[themeName] = selectedThemes[parentName];\n }\n}\nconst MAX_LIGHT_BORDER_GAP = 8;\nconst hsla = /^hsla\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)\\s*\\)$/;\nconst softenLightBorder = (theme) => {\n const background = hsla.exec(theme.background);\n const border = hsla.exec(theme[\"border-color\"]);\n if (!background || !border) return theme;\n const backgroundLightness = Number(background[3]);\n const borderLightness = Number(border[3]);\n if (backgroundLightness <= 50) return theme;\n const gap = backgroundLightness - borderLightness;\n if (gap <= MAX_LIGHT_BORDER_GAP) return theme;\n const lightness = backgroundLightness - MAX_LIGHT_BORDER_GAP;\n return {\n ...theme,\n \"border-color\": `hsla(${border[1]}, ${border[2]}%, ${lightness}%, ${border[4]})`\n };\n};\nconst v6Themes = toV6Themes(selectedThemes);\nconst softened = /* @__PURE__ */ new Map();\nconst themes = Object.fromEntries(\n Object.entries(v6Themes).map(([themeName, theme]) => {\n let next = softened.get(theme);\n if (!next) {\n next = softenLightBorder(theme);\n softened.set(theme, next);\n }\n return [themeName, next];\n })\n);\nexport {\n themes\n};\n//# sourceMappingURL=themes.js.map\n"],"mappings":";;;;;AAGA,MAAM,eAAe,IAAI,IAAI,UAAU;AACvC,MAAM,iBAAiB,OAAO,YAC5B,OAAO,QAAQA,QAAQ,CAAC,CAAC,QAAQ,CAAC,eAAe,aAAa,IAAI,SAAS,CAAC,CAC9E;AACA,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,cAAc,GAAG;CAC/D,IAAI,UAAU,SAAS,WAAW,GAAG;EACnC,eAAe,UAAU,QAA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AS,IAAI,OAAO,IAAI;CAC1B;CACA,OAAO,CAAC,WAAW,IAAI;AACzB,CAAC,CACH"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@tamagui/tamagui-dev-config",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.1091.1",
4
+ "sideEffects": false,
5
+ "license": "MIT",
4
6
  "source": "src/index.ts",
5
7
  "files": [
6
8
  "src",
7
9
  "types",
8
- "dist",
9
- "motion.cjs"
10
+ "dist"
10
11
  ],
11
12
  "type": "module",
12
13
  "main": "dist/cjs",
@@ -21,13 +22,6 @@
21
22
  "import": "./dist/esm/index.mjs",
22
23
  "require": "./dist/cjs/index.cjs",
23
24
  "default": "./dist/esm/index.mjs"
24
- },
25
- "./motion": {
26
- "types": "./src/animations.motion.ts",
27
- "browser": "./dist/esm/animations.motion.mjs",
28
- "module": "./dist/esm/animations.motion.mjs",
29
- "import": "./dist/esm/animations.motion.mjs",
30
- "require": "./dist/cjs/animations.motion.cjs"
31
25
  }
32
26
  },
33
27
  "publishConfig": {
@@ -40,24 +34,20 @@
40
34
  "clean:build": "tamagui-build clean:build"
41
35
  },
42
36
  "dependencies": {
43
- "@tamagui/animations-css": "2.7.7",
44
- "@tamagui/animations-moti": "2.7.7",
45
- "@tamagui/animations-motion": "2.7.7",
46
- "@tamagui/animations-reanimated": "2.7.7",
47
- "@tamagui/colors": "2.7.7",
48
- "@tamagui/config": "2.7.7",
49
- "@tamagui/core": "2.7.7",
50
- "@tamagui/font-cherry-bomb": "2.7.7",
51
- "@tamagui/font-inter": "2.7.7",
52
- "@tamagui/font-silkscreen": "2.7.7",
53
- "@tamagui/shorthands": "2.7.7",
54
- "@tamagui/theme-builder": "2.7.7",
55
- "@tamagui/themes": "2.7.7",
56
- "color2k": "^2.0.2"
37
+ "@tamagui/animations-css": "3.0.0-beta.1091.1",
38
+ "@tamagui/animations-motion": "3.0.0-beta.1091.1",
39
+ "@tamagui/animations-reanimated": "3.0.0-beta.1091.1",
40
+ "@tamagui/colors": "3.0.0-beta.1091.1",
41
+ "@tamagui/config": "3.0.0-beta.1091.1",
42
+ "@tamagui/core": "3.0.0-beta.1091.1",
43
+ "@tamagui/font-cherry-bomb": "3.0.0-beta.1091.1",
44
+ "@tamagui/font-inter": "3.0.0-beta.1091.1",
45
+ "@tamagui/shorthands": "3.0.0-beta.1091.1",
46
+ "@tamagui/themes": "3.0.0-beta.1091.1"
57
47
  },
58
48
  "devDependencies": {
59
- "@tamagui/build": "2.7.7",
60
- "react": ">=19"
49
+ "@tamagui/build": "3.0.0-beta.1091.1",
50
+ "react": "19.2.3"
61
51
  },
62
52
  "peerDependencies": {
63
53
  "react": ">=19"
@@ -20,15 +20,15 @@ const genericFontSizes = {
20
20
  16: 124,
21
21
  } as const
22
22
 
23
- export function createGenericFont<A extends GenericFont<keyof typeof genericFontSizes>>(
23
+ export function createGenericFont(
24
24
  family: string,
25
- font: Partial<A> = {},
25
+ font: Partial<GenericFont<keyof typeof genericFontSizes>> = {},
26
26
  {
27
27
  sizeLineHeight = (val) => val * 1.35,
28
28
  }: {
29
29
  sizeLineHeight?: (val: number) => number
30
30
  } = {}
31
- ): A {
31
+ ) {
32
32
  const size = font.size || genericFontSizes
33
33
  return createFont({
34
34
  family,
@@ -38,6 +38,6 @@ export function createGenericFont<A extends GenericFont<keyof typeof genericFont
38
38
  ) as typeof size,
39
39
  weight: { 0: '300' },
40
40
  letterSpacing: { 4: 0 },
41
- ...(font as any),
41
+ ...font,
42
42
  })
43
43
  }
package/src/fonts.ts CHANGED
@@ -1,25 +1,43 @@
1
1
  import { createCherryBombFont } from '@tamagui/font-cherry-bomb'
2
2
  import { createInterFont } from '@tamagui/font-inter'
3
- import { createSilkscreenFont } from '@tamagui/font-silkscreen'
4
3
  import { createGenericFont } from './createGenericFont'
5
4
 
5
+ const isWeb = process.env.TAMAGUI_TARGET === 'web'
6
+
7
+ // Inter 4.1, subset to latin + latin-1 + punctuation as a variable font (~54kb),
8
+ // covering weights 200-900 from one file. it's font-display: swap behind the OS
9
+ // UI face, so first paint never waits on it.
10
+ const interFamily = isWeb
11
+ ? '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
12
+ : 'System'
13
+
14
+ // JetBrains Mono, subset to latin + punctuation as a variable font (~19kb), is
15
+ // the only webfont left. it covers every weight from one file.
16
+ const monoFamily = isWeb
17
+ ? '"JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'
18
+ : 'JetBrains Mono'
19
+
6
20
  export const cherryBombFont = createCherryBombFont({
7
- // Cherry Bomb is a heavy rounded display face; fall back to on-brand Inter,
8
- // then heavy web-safe faces, so the brief pre-load flash looks close to the
9
- // real thing instead of thin default Arial.
10
- family:
11
- '"Cherry Bomb", "Inter", "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif',
21
+ // Cherry Bomb is a heavy rounded display face; fall back to heavy web-safe
22
+ // faces so the brief pre-load flash looks close to the real thing instead of
23
+ // thin default Arial.
24
+ family: `"Cherry Bomb", "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif`,
12
25
  // Cherry Bomb only ships weight 400 (so this doesn't change its look), but a
13
- // heavy weight makes the Inter fallback render at ExtraBold (already preloaded)
14
- // instead of thin, much closer to Cherry Bomb during the load flash.
26
+ // heavy weight makes the system fallback render bold instead of thin, much
27
+ // closer to Cherry Bomb during the load flash.
15
28
  weight: {
16
29
  4: '800',
17
30
  },
31
+ size: {
32
+ true: 22.4,
33
+ },
18
34
  })
19
- export const silkscreenFont = createSilkscreenFont()
35
+
20
36
  export const headingFont = createInterFont(
21
37
  {
38
+ family: interFamily,
22
39
  size: {
40
+ true: 14,
23
41
  5: 13,
24
42
  6: 15,
25
43
  9: 30,
@@ -34,26 +52,20 @@ export const headingFont = createInterFont(
34
52
  7: '700',
35
53
  },
36
54
  color: {
37
- 6: '$colorFocus',
38
- 7: '$color',
55
+ 6: 'color-focus',
56
+ 7: 'color',
39
57
  },
40
58
  letterSpacing: {
41
59
  5: 2,
42
60
  6: 1,
43
61
  7: 0,
44
62
  8: 0,
45
- 9: -0.1,
46
- 10: -0.25,
47
- 11: -0.5,
48
- 12: -0.75,
49
- 14: -1,
50
- 15: -2,
51
- },
52
- // for native
53
- face: {
54
- 700: { normal: 'InterBold' },
55
- 800: { normal: 'InterBold' },
56
- 900: { normal: 'InterBold' },
63
+ 9: 0,
64
+ 10: 0,
65
+ 11: 0,
66
+ 12: 0,
67
+ 14: 0,
68
+ 15: 0,
57
69
  },
58
70
  },
59
71
  { sizeLineHeight: (size) => Math.round(size * 1.1 + (size < 30 ? 10 : 5)) }
@@ -61,6 +73,10 @@ export const headingFont = createInterFont(
61
73
 
62
74
  export const bodyFont = createInterFont(
63
75
  {
76
+ family: interFamily,
77
+ size: {
78
+ true: 14,
79
+ },
64
80
  weight: {
65
81
  1: '400',
66
82
  },
@@ -72,7 +88,7 @@ export const bodyFont = createInterFont(
72
88
  )
73
89
 
74
90
  export const monoFont = createGenericFont(
75
- `"Berkeley Mono", "ui-monospace", "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`,
91
+ monoFamily,
76
92
  {
77
93
  weight: {
78
94
  1: '400',
package/src/media.ts CHANGED
@@ -17,13 +17,13 @@ const breakpoints = {
17
17
 
18
18
  export const media = {
19
19
  // v4 Config
20
- maxXs: { maxWidth: breakpoints.xs },
21
- max2xs: { maxWidth: breakpoints['2xs'] },
22
- maxSm: { maxWidth: breakpoints.sm },
23
- maxMd: { maxWidth: breakpoints.md },
24
- maxLg: { maxWidth: breakpoints.lg },
25
- maxXl: { maxWidth: breakpoints.xl },
26
- max2Xl: { maxWidth: breakpoints['2xl'] },
20
+ 'max-xs': { maxWidth: breakpoints.xs },
21
+ 'max-2xs': { maxWidth: breakpoints['2xs'] },
22
+ 'max-sm': { maxWidth: breakpoints.sm },
23
+ 'max-md': { maxWidth: breakpoints.md },
24
+ 'max-lg': { maxWidth: breakpoints.lg },
25
+ 'max-xl': { maxWidth: breakpoints.xl },
26
+ 'max-2xl': { maxWidth: breakpoints['2xl'] },
27
27
  // for site
28
28
  xl: { maxWidth: 1650 },
29
29
  // between lg and xl - for studio usage
@@ -1,26 +1,22 @@
1
- import { animationsCSS } from '@tamagui/config/v5-css'
2
- import { animationsMotion } from '@tamagui/config/v5-motion'
1
+ import { animationsCSS } from '@tamagui/config/animations-css'
2
+ import { animationsMotion } from '@tamagui/config/animations-motion'
3
+ // the pieces of the v5 default config the site keeps, each from its narrowest
4
+ // entry point. `@tamagui/config/v5-subtle` re-exports a whole theme pack, and
5
+ // `defaultConfig` holds another, so touching either ships ~250kb of theme values
6
+ // to the browser that the `themes:` line below then replaces.
3
7
  import {
4
- createV5Theme,
5
- defaultConfig,
6
- subtleChildrenThemes,
7
- } from '@tamagui/config/v5-subtle'
8
-
9
- // only generate the accent themes the site actually uses: red/green/blue/gray/yellow
10
- // (the @tamagui/logo tint family). dropping orange/pink/purple/teal/neutral roughly
11
- // halves the render-blocking theme css. note: dropping an accent also removes its
12
- // color tokens (--pink10 etc.), so all $pink/$purple/$orange/$teal/$neutral usages are
13
- // collapsed to kept colors across the site. component themes are kept (they dedupe to
14
- // surfaces in css and the site shows them off). themes-as-js is still stripped to {}
15
- // on the client below and hydrated from css.
16
- const { gray, blue, red, yellow, green } = subtleChildrenThemes
17
- const themes = createV5Theme({
18
- childrenThemes: { gray, blue, red, yellow, green },
19
- })
8
+ selectionStyles,
9
+ settings as defaultSettings,
10
+ sizes,
11
+ } from '@tamagui/config/settings'
20
12
  import type { CreateTamaguiProps } from '@tamagui/core'
21
13
  import { setupDev } from '@tamagui/core'
22
- import { bodyFont, cherryBombFont, headingFont, monoFont, silkscreenFont } from './fonts'
14
+ import { shorthands } from '@tamagui/shorthands/v4'
15
+ import { tokens } from '@tamagui/themes/v5'
16
+ import { bodyFont, cherryBombFont, headingFont, monoFont } from './fonts'
23
17
  import { media, mediaQueryDefaultActive } from './media'
18
+ import { clientThemes } from './themeMetadata'
19
+ import { themes } from './themes'
24
20
 
25
21
  setupDev({
26
22
  visualizer: true,
@@ -30,7 +26,6 @@ const fonts = {
30
26
  heading: headingFont,
31
27
  body: bodyFont,
32
28
  mono: monoFont,
33
- silkscreen: silkscreenFont,
34
29
  cherryBomb: cherryBombFont,
35
30
  }
36
31
 
@@ -39,19 +34,25 @@ export const animations = {
39
34
  css: animationsCSS,
40
35
  }
41
36
 
42
- // Use v5 config as base, but with tamagui.dev custom themes
37
+ const configuredThemes =
38
+ process.env.VITE_ENVIRONMENT === 'client'
39
+ ? (clientThemes as unknown as typeof themes)
40
+ : themes
41
+
43
42
  export const config = {
44
- ...defaultConfig,
45
- themes: process.env.VITE_ENVIRONMENT === 'client' ? ({} as typeof themes) : themes,
43
+ shorthands,
44
+ tokens,
45
+ selectionStyles,
46
+ sizes,
47
+ themes: configuredThemes,
46
48
  fonts,
47
49
  animations,
48
50
  media,
49
51
  settings: {
50
- ...defaultConfig.settings,
52
+ ...defaultSettings,
51
53
  mediaQueryDefaultActive,
52
54
  allowedStyleValues: 'somewhat-strict-web',
53
- autocompleteSpecificTokens: 'except-special',
54
- // Allow both shorthands and longhand names for flexibility
55
+ // allow both shorthands and longhand names for flexibility
55
56
  onlyAllowShorthands: false,
56
57
  },
57
58
  } satisfies CreateTamaguiProps