@tamagui/theme-base 1.0.0-beta.172

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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/dist/cjs/colorUtils.js +60 -0
  4. package/dist/cjs/colorUtils.js.map +7 -0
  5. package/dist/cjs/colors.js +64 -0
  6. package/dist/cjs/colors.js.map +7 -0
  7. package/dist/cjs/firaFont.js +51 -0
  8. package/dist/cjs/firaFont.js.map +7 -0
  9. package/dist/cjs/fonts.js +19 -0
  10. package/dist/cjs/fonts.js.map +7 -0
  11. package/dist/cjs/index.js +20 -0
  12. package/dist/cjs/index.js.map +7 -0
  13. package/dist/cjs/interFont.js +80 -0
  14. package/dist/cjs/interFont.js.map +7 -0
  15. package/dist/cjs/themes.js +256 -0
  16. package/dist/cjs/themes.js.map +7 -0
  17. package/dist/cjs/tokens.js +89 -0
  18. package/dist/cjs/tokens.js.map +7 -0
  19. package/dist/esm/colorUtils.js +43 -0
  20. package/dist/esm/colorUtils.js.map +7 -0
  21. package/dist/esm/colors.js +54 -0
  22. package/dist/esm/colors.js.map +7 -0
  23. package/dist/esm/firaFont.js +32 -0
  24. package/dist/esm/firaFont.js.map +7 -0
  25. package/dist/esm/fonts.js +3 -0
  26. package/dist/esm/fonts.js.map +7 -0
  27. package/dist/esm/index.js +4 -0
  28. package/dist/esm/index.js.map +7 -0
  29. package/dist/esm/interFont.js +61 -0
  30. package/dist/esm/interFont.js.map +7 -0
  31. package/dist/esm/themes.js +232 -0
  32. package/dist/esm/themes.js.map +7 -0
  33. package/dist/esm/tokens.js +62 -0
  34. package/dist/esm/tokens.js.map +7 -0
  35. package/dist/jsx/colorUtils.js +42 -0
  36. package/dist/jsx/colors.js +53 -0
  37. package/dist/jsx/firaFont.js +31 -0
  38. package/dist/jsx/fonts.js +2 -0
  39. package/dist/jsx/index.js +3 -0
  40. package/dist/jsx/interFont.js +60 -0
  41. package/dist/jsx/themes.js +231 -0
  42. package/dist/jsx/tokens.js +61 -0
  43. package/package.json +27 -0
  44. package/types/colorUtils.d.ts +4 -0
  45. package/types/colorUtils.d.ts.map +1 -0
  46. package/types/colors.d.ts +444 -0
  47. package/types/colors.d.ts.map +1 -0
  48. package/types/firaFont.d.ts +28 -0
  49. package/types/firaFont.d.ts.map +1 -0
  50. package/types/fonts.d.ts +3 -0
  51. package/types/fonts.d.ts.map +1 -0
  52. package/types/index.d.ts +4 -0
  53. package/types/index.d.ts.map +1 -0
  54. package/types/interFont.d.ts +57 -0
  55. package/types/interFont.d.ts.map +1 -0
  56. package/types/themes.d.ts +559 -0
  57. package/types/themes.d.ts.map +1 -0
  58. package/types/tokens.d.ts +457 -0
  59. package/types/tokens.d.ts.map +1 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/themes.tsx"],
4
+ "sourcesContent": ["import * as Colors from '@tamagui/colors'\nimport { Variable, getVariableValue } from '@tamagui/core'\n\nimport { allDarkColors, allLightColors } from './colors'\nimport { setColorAlpha } from './colorUtils'\nimport { tokens } from './tokens'\n\ntype ThemeCreatorProps = {\n shift?: number\n backgrounds: (string | Variable)[]\n colors?: (string | Variable)[]\n offsets?: {\n color?: number[] | null\n background?: number[] | null\n borderColor?: number[] | null\n }\n isLight?: boolean\n isBase?: boolean\n}\n\n// helpers\n\nconst alternates = [1, 2, 3, 4] as const\ntype AltKeys = 1 | 2 | 3 | 4 // one less for dark_darker\ntype AltName<Name extends string, Keys extends string | number> = `${Name}_alt${Keys}`\ntype ThemeCreator<A = any> = (str: number, props: ThemeCreatorProps) => A\n\nfunction createThemesFrom<Name extends string, GetTheme extends ThemeCreator = ThemeCreator>(\n name: Name,\n getTheme: GetTheme,\n props: ThemeCreatorProps\n): {\n [key in `${Name}_alt${AltKeys}` | `${Name}` | `${Name}_darker`]: GetTheme extends ThemeCreator<\n infer Theme\n >\n ? Theme\n : never\n} {\n const { shift = 0 } = props\n const theme = getTheme(0 + shift, props)\n let themeEntries: any[] = [[name, theme]]\n const altThemes: any[] = alternates.map((alt) => [\n `${name}_alt${alt}`,\n getTheme(alt + shift, props),\n ])\n const altButtonThemes: any[] = alternates.map((_, i) => {\n const [bName, bTheme] = [altThemes[i][0], (altThemes[i + 1] || altThemes[i])[1]]\n return [`${bName}_Button` as any, bTheme]\n })\n // add these after alts since we rely on positioning\n const darkerTheme = getTheme(Math.max(0, shift + (props.isLight ? 1 : -1)), props)\n const activeTheme = makeActiveTheme(theme)\n themeEntries = [\n ...themeEntries,\n ...altThemes,\n ...altButtonThemes,\n [`${name}_Button`, altThemes[0][1]],\n [`${name}_darker`, darkerTheme],\n [`${name}_active`, activeTheme],\n ]\n const themes = Object.fromEntries(themeEntries)\n // if (props.isLight) {\n // console.log('themes', themes)\n // }\n return themes as any\n}\n\nconst createTheme: ThemeCreator = (\n str = 1,\n {\n backgrounds,\n isLight = true,\n // isBase = false,\n colors = [...backgrounds].reverse(),\n offsets: offsetsProp,\n }: ThemeCreatorProps\n) => {\n const offsets = {\n borderColor: offsetsProp?.borderColor ?? offsetsProp?.background ?? [0, 0, 0, 0],\n background: offsetsProp?.background ?? [0, 0, 0, 0],\n color: offsetsProp?.color ?? [0, 0, 0, 0],\n }\n const darkColors = isLight ? colors : backgrounds\n const lighterDir = isLight ? -1 : 1\n const darkerDir = -lighterDir\n const strongerDir = isLight ? darkerDir : lighterDir\n const get = (arr: any[], index: number, name = 'background') => {\n return arr[Math.max(0, Math.min(index + (offsets[name][str] || 0), arr.length - 1))]\n }\n\n const colorTranslucent = setColorAlpha(getVariableValue(get(colors, 0 + str, 'color')), 0.5)\n\n return {\n background: get(backgrounds, str),\n backgroundStronger: get(backgrounds, str + strongerDir),\n backgroundSoft: get(backgrounds, str + 3),\n backgroundHover: get(backgrounds, str + lighterDir),\n backgroundPress: get(backgrounds, str + darkerDir * 1),\n backgroundFocus: get(backgrounds, str + darkerDir * 2),\n backgroundTransparent: tokens.color.grayA1,\n borderColor: isLight\n ? get(colors, 8 - str, 'borderColor')\n : get(backgrounds, 2 + str, 'borderColor'),\n borderColorHover: isLight\n ? get(colors, 6 - str, 'borderColor')\n : get(backgrounds, 3 + str, 'borderColor'),\n borderColorPress: isLight\n ? get(colors, 5 - str, 'borderColor')\n : get(backgrounds, 1 + str, 'borderColor'),\n borderColorFocus: isLight\n ? get(colors, 4 - str, 'borderColor')\n : get(backgrounds, 3 + str, 'borderColor'),\n color: get(colors, 0 + str, 'color'),\n colorHover: get(colors, 1 + str, 'color'),\n colorPress: get(colors, 2 + str, 'color'),\n colorFocus: get(colors, 3 + str, 'color'),\n colorTranslucent,\n colorMid: colors[Math.floor(colors.length / 2)],\n shadowColor: isLight ? tokens.color.grayA3 : tokens.color.grayA8,\n shadowColorHover: darkColors[!isLight ? 1 : 8],\n shadowColorPress: darkColors[!isLight ? 1 : 8],\n shadowColorFocus: darkColors[!isLight ? 1 : 8],\n }\n}\n\nexport const colorSchemes = [\n { name: 'blue', colors: Colors.blue, darkColors: Colors.blueDark },\n { name: 'gray', colors: Colors.gray, darkColors: Colors.grayDark },\n { name: 'green', colors: Colors.green, darkColors: Colors.greenDark },\n { name: 'indigo', colors: Colors.indigo, darkColors: Colors.indigoDark },\n { name: 'orange', colors: Colors.orange, darkColors: Colors.orangeDark },\n { name: 'pink', colors: Colors.pink, darkColors: Colors.pinkDark },\n { name: 'purple', colors: Colors.purple, darkColors: Colors.purpleDark },\n { name: 'red', colors: Colors.red, darkColors: Colors.redDark },\n { name: 'violet', colors: Colors.violet, darkColors: Colors.violetDark },\n { name: 'yellow', colors: Colors.yellow, darkColors: Colors.yellowDark },\n { name: 'teal', colors: Colors.teal, darkColors: Colors.tealDark },\n { name: 'lime', colors: Colors.lime, darkColors: Colors.limeDark },\n { name: 'brown', colors: Colors.brown, darkColors: Colors.brownDark },\n] as const\n\nexport type ColorNames = typeof colorSchemes[number]['name']\n\nexport const lightGradient = [\n '#fff',\n '#f4f4f4',\n tokens.color.gray1,\n tokens.color.gray2,\n tokens.color.gray3,\n tokens.color.gray4,\n tokens.color.gray5,\n tokens.color.gray6,\n tokens.color.gray7,\n tokens.color.gray8,\n tokens.color.gray9,\n tokens.color.gray10,\n tokens.color.gray11,\n tokens.color.gray12,\n]\n\nexport const darkGradient = [\n '#0f0f0f',\n '#111111',\n '#141414',\n '#191919',\n '#242424',\n '#292929',\n '#323232',\n '#383838',\n '#424242',\n '#494949',\n '#545454',\n '#626262',\n]\n\nconst lightThemes = createThemesFrom('light', createTheme, {\n backgrounds: lightGradient,\n isLight: true,\n})\n\nconst darkThemes = createThemesFrom('dark', createTheme, {\n backgrounds: darkGradient,\n colors: lightGradient,\n isLight: false,\n shift: 1,\n offsets: {\n color: [0, 6, 7, 7, 7, 7],\n },\n})\n\nconst baseThemes = {\n // light\n ...lightThemes,\n light: {\n ...allLightColors,\n ...lightThemes.light,\n },\n light_active: makeActiveTheme(lightThemes.light),\n light_Card: lightThemes.light,\n light_Button: lightThemes.light_alt1,\n\n // dark\n ...darkThemes,\n dark: {\n ...allDarkColors,\n ...darkThemes.dark,\n },\n dark_active: makeActiveTheme(darkThemes.dark),\n dark_Card: darkThemes.dark_alt1,\n dark_Button: darkThemes.dark_alt1,\n}\n\nfunction makeActiveTheme(theme: any) {\n const res = { ...theme }\n res.backgroundHover = res.background\n res.colorHover = res.color\n res.backgroundPress = res.background\n res.colorPress = res.color\n return res\n}\n\ntype ColorThemeNames =\n | ColorNames\n | AltName<`light_${ColorNames}`, AltKeys>\n | AltName<`dark_${ColorNames}`, AltKeys>\n\nconst colorThemeEntries = colorSchemes.flatMap(({ name, colors, darkColors }) => {\n const [altLightThemes, altDarkThemes] = [colors, darkColors].map((colors, i) => {\n const isLight = i === 0\n const scheme = isLight ? 'light' : 'dark'\n const shift = isLight ? 0 : 1\n\n let backgrounds = Object.values(colors) as any[]\n if (!isLight) {\n const [_, h, sp, lp] = backgrounds[0].match(/hsl\\(([0-9\\.]+), ([0-9\\.]+)\\%, ([0-9\\.]+)\\%\\)/)\n backgrounds.unshift(`hsl(${h}, ${sp}%, ${parseFloat(lp) / 2}%)`)\n }\n\n const themeWithAlts = createThemesFrom(name, createTheme, {\n backgrounds,\n isLight,\n shift,\n isBase: false,\n offsets: {\n background: isLight ? [1, 1, 1, 0, 0, 0] : null,\n borderColor: isLight ? [0, 1, 1, 2, 2, -2] : null,\n color: isLight ? [0, 0, -1, -2, -3, -3, -4] : [-1, -1, -1, -1, -1, -1],\n },\n })\n return Object.entries(themeWithAlts).map(([k, v]) => [`${scheme}_${k}`, v])\n })\n const lightButtonTheme = altLightThemes[0]\n const darkButtonTheme = altDarkThemes[0]\n return [\n ...altLightThemes,\n [`${lightButtonTheme[0]}_Button`, altLightThemes[2][1]],\n ...altDarkThemes,\n [`${darkButtonTheme[0]}_Button`, altDarkThemes[2][1]],\n ]\n})\n\nconst transparent = {\n background: 'transparent',\n backgroundSoft: 'transparent',\n backgroundHover: 'transparent',\n backgroundPress: 'transparent',\n backgroundFocus: 'transparent',\n backgroundTransparent: 'transparent',\n shadowColor: 'transparent',\n shadowColorHover: 'transparent',\n shadowColorPress: 'transparent',\n shadowColorFocus: 'transparent',\n}\n\ntype MyThemeBase = typeof baseThemes['light_alt1']\n\n// @ts-ignore\nconst dark_outline: MyThemeBase = {\n ...baseThemes.dark,\n borderColor: '#fff',\n ...transparent,\n}\n\n// @ts-ignore\nconst light_outline: MyThemeBase = {\n ...baseThemes.light,\n borderColor: '#000',\n ...transparent,\n}\n\nconst colorThemes: {\n [key in ColorThemeNames]: MyThemeBase\n} = Object.fromEntries(colorThemeEntries) as any\n\nconst allThemes = {\n ...baseThemes,\n ...colorThemes,\n dark_outline,\n light_outline,\n} as const\n\nexport const themes: {\n [key in keyof typeof allThemes]: typeof baseThemes['light']\n} = allThemes as any\n\n// TODO\n// export function createThemes(props: {\n// colors?:\n// | 'amber'\n// | 'blue'\n// | 'bronze'\n// | 'brown'\n// | 'crimson'\n// | 'cyan'\n// | 'gold'\n// | 'grass'\n// | 'gray'\n// | 'green'\n// | 'indigo'\n// | 'lime'\n// | 'mint'\n// | 'olive'\n// | 'orange'\n// | 'pink'\n// | 'plum'\n// | 'purple'\n// | 'mauve'\n// | 'red'\n// | 'sage'\n// | 'sand'\n// | 'sky'\n// | 'slate'\n// | 'teal'\n// | 'tomato'\n// | 'violet'\n// | 'yellow'\n// alternates?: number\n// }) {}\n"],
5
+ "mappings": ";;AAAA;AACA;AAEA;AACA;AACA;AAiBA,MAAM,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;AAK9B,0BACE,MACA,UACA,OAOA;AACA,QAAM,EAAE,QAAQ,MAAM;AACtB,QAAM,QAAQ,SAAS,IAAI,OAAO,KAAK;AACvC,MAAI,eAAsB,CAAC,CAAC,MAAM,KAAK,CAAC;AACxC,QAAM,YAAmB,WAAW,IAAI,CAAC,QAAQ;AAAA,IAC/C,GAAG,WAAW;AAAA,IACd,SAAS,MAAM,OAAO,KAAK;AAAA,EAC7B,CAAC;AACD,QAAM,kBAAyB,WAAW,IAAI,CAAC,GAAG,MAAM;AACtD,UAAM,CAAC,OAAO,UAAU,CAAC,UAAU,GAAG,IAAK,WAAU,IAAI,MAAM,UAAU,IAAI,EAAE;AAC/E,WAAO,CAAC,GAAG,gBAAuB,MAAM;AAAA,EAC1C,CAAC;AAED,QAAM,cAAc,SAAS,KAAK,IAAI,GAAG,QAAS,OAAM,UAAU,IAAI,GAAG,GAAG,KAAK;AACjF,QAAM,cAAc,gBAAgB,KAAK;AACzC,iBAAe;AAAA,IACb,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,CAAC,GAAG,eAAe,UAAU,GAAG,EAAE;AAAA,IAClC,CAAC,GAAG,eAAe,WAAW;AAAA,IAC9B,CAAC,GAAG,eAAe,WAAW;AAAA,EAChC;AACA,QAAM,UAAS,OAAO,YAAY,YAAY;AAI9C,SAAO;AACT;AAtCS;AAwCT,MAAM,cAA4B,wBAChC,MAAM,GACN;AAAA,EACE;AAAA,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AAA,MACvE;AAAA,IACF,CAAC;AACD,WAAO,OAAO,QAAQ,aAAa,EAAE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC;AAAA,EAC5E,CAAC;AACD,QAAM,mBAAmB,eAAe;AACxC,QAAM,kBAAkB,cAAc;AACtC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAAC,GAAG,iBAAiB,aAAa,eAAe,GAAG,EAAE;AAAA,IACtD,GAAG;AAAA,IACH,CAAC,GAAG,gBAAgB,aAAa,cAAc,GAAG,EAAE;AAAA,EACtD;AACF,CAAC;AAED,MAAM,cAAc;AAAA,EAClB,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AACpB;AAKA,MAAM,eAA4B;AAAA,KAC7B,WAAW;AAAA,EACd,aAAa;AAAA,KACV;AACL;AAGA,MAAM,gBAA6B;AAAA,KAC9B,WAAW;AAAA,EACd,aAAa;AAAA,KACV;AACL;AAEA,MAAM,cAEF,OAAO,YAAY,iBAAiB;AAExC,MAAM,YAAY;AAAA,KACb;AAAA,KACA;AAAA,EACH;AAAA,EACA;AACF;AAEO,MAAM,SAET;",
6
+ "names": []
7
+ }
@@ -0,0 +1,62 @@
1
+ import { createTokens } from "@tamagui/core";
2
+ import { allLightColors, darkColorsPostfixed } from "./colors";
3
+ import { firaFont } from "./firaFont";
4
+ import { interFont } from "./interFont";
5
+ const size = {
6
+ true: 20,
7
+ 0: 0,
8
+ "0.5": 2,
9
+ 1: 6,
10
+ 2: 10,
11
+ 3: 15,
12
+ 4: 20,
13
+ 5: 25,
14
+ 6: 30,
15
+ 7: 40,
16
+ 8: 50,
17
+ 9: 65,
18
+ 10: 75,
19
+ 11: 85,
20
+ 12: 100
21
+ };
22
+ const space = {
23
+ ...size,
24
+ ...Object.fromEntries(Object.entries(size).map(([k, v]) => [`-${k}`, -v]))
25
+ };
26
+ const tokens = createTokens({
27
+ size,
28
+ space,
29
+ font: {
30
+ title: interFont,
31
+ body: interFont,
32
+ mono: firaFont
33
+ },
34
+ zIndex: {
35
+ 0: 0,
36
+ 1: 100,
37
+ 2: 200,
38
+ 3: 300,
39
+ 4: 400,
40
+ 5: 500
41
+ },
42
+ color: {
43
+ ...allLightColors,
44
+ ...darkColorsPostfixed
45
+ },
46
+ radius: {
47
+ 0: 0,
48
+ 1: 3,
49
+ 2: 5,
50
+ 3: 7,
51
+ 4: 9,
52
+ 5: 10,
53
+ 6: 12,
54
+ 7: 16,
55
+ 8: 20,
56
+ 9: 30
57
+ }
58
+ });
59
+ export {
60
+ tokens
61
+ };
62
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tokens.tsx"],
4
+ "sourcesContent": ["import { createTokens } from '@tamagui/core'\n\nimport { allLightColors, darkColorsPostfixed } from './colors'\nimport { firaFont } from './firaFont'\nimport { interFont } from './interFont'\n\nconst size = {\n true: 20, // for space boolean true\n 0: 0,\n '0.5': 2,\n 1: 6,\n 2: 10,\n 3: 15,\n 4: 20,\n 5: 25,\n 6: 30,\n 7: 40,\n 8: 50,\n 9: 65,\n 10: 75,\n 11: 85,\n 12: 100,\n} as const\n\ntype Sizes = typeof size\ntype SizeKeys = keyof Sizes\n\nconst space: {\n [Key in `-${SizeKeys}` | SizeKeys]: Key extends keyof Sizes ? Sizes[Key] : number\n} = {\n ...size,\n ...Object.fromEntries(Object.entries(size).map(([k, v]) => [`-${k}`, -v])),\n} as any\n\nexport const tokens = createTokens({\n size,\n space,\n font: {\n title: interFont,\n body: interFont,\n mono: firaFont,\n },\n zIndex: {\n 0: 0,\n 1: 100,\n 2: 200,\n 3: 300,\n 4: 400,\n 5: 500,\n },\n color: {\n ...allLightColors,\n ...darkColorsPostfixed,\n },\n radius: {\n 0: 0,\n 1: 3,\n 2: 5,\n 3: 7,\n 4: 9,\n 5: 10,\n 6: 12,\n 7: 16,\n 8: 20,\n 9: 30,\n },\n})\n"],
5
+ "mappings": "AAAA;AAEA;AACA;AACA;AAEA,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,GAAG;AAAA,EACH,OAAO;AAAA,EACP,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAKA,MAAM,QAEF;AAAA,KACC;AAAA,KACA,OAAO,YAAY,OAAO,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3E;AAEO,MAAM,SAAS,aAAa;AAAA,EACjC;AAAA,EACA;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAAA,EACA,OAAO;AAAA,OACF;AAAA,OACA;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,IACN,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { getVariableValue } from "@tamagui/core";
4
+ const hexToRGBA = /* @__PURE__ */ __name((hex, alpha = 1) => {
5
+ var _a;
6
+ if (!isValidHex(hex)) {
7
+ throw new Error("Invalid HEX");
8
+ }
9
+ const chunkSize = Math.floor((hex.length - 1) / 3);
10
+ const hexArr = getChunksFromString(hex.slice(1), chunkSize);
11
+ const [r, g, b, a] = (_a = hexArr == null ? void 0 : hexArr.map(convertHexUnitTo256)) != null ? _a : [];
12
+ return `rgba(${r}, ${g}, ${b}, ${getAlphaFloat(a, alpha)})`;
13
+ }, "hexToRGBA");
14
+ const setColorAlpha = /* @__PURE__ */ __name((colorIn, alpha = 1) => {
15
+ let color = `${getVariableValue(colorIn)}`;
16
+ if (color.startsWith("hsl(")) {
17
+ return color.replace("hsl", "hsla").replace(")", `, ${alpha})`);
18
+ }
19
+ if (color.startsWith("#")) {
20
+ return hexToRGBA(color, alpha);
21
+ }
22
+ if (color.startsWith("rgb(")) {
23
+ return color.replace("rgb", "rgba").replace(")", `, ${alpha})`);
24
+ }
25
+ return color;
26
+ }, "setColorAlpha");
27
+ const isValidHex = /* @__PURE__ */ __name((hex) => /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex), "isValidHex");
28
+ const getChunksFromString = /* @__PURE__ */ __name((st, chunkSize = 0) => st.match(new RegExp(`.{${chunkSize}}`, "g")), "getChunksFromString");
29
+ const convertHexUnitTo256 = /* @__PURE__ */ __name((hexStr) => parseInt(hexStr.repeat(2 / hexStr.length), 16), "convertHexUnitTo256");
30
+ const getAlphaFloat = /* @__PURE__ */ __name((a, alpha = 1) => {
31
+ if (a !== void 0) {
32
+ return a / 255;
33
+ }
34
+ if (typeof alpha != "number" || alpha < 0 || alpha > 1) {
35
+ return 1;
36
+ }
37
+ return alpha;
38
+ }, "getAlphaFloat");
39
+ export {
40
+ hexToRGBA,
41
+ setColorAlpha
42
+ };
@@ -0,0 +1,53 @@
1
+ import * as Colors from "@tamagui/colors";
2
+ const colorNames = [
3
+ "blue",
4
+ "gray",
5
+ "green",
6
+ "indigo",
7
+ "orange",
8
+ "pink",
9
+ "purple",
10
+ "red",
11
+ "violet",
12
+ "yellow",
13
+ "teal"
14
+ ];
15
+ const allLightColors = {
16
+ ...Colors.blue,
17
+ ...Colors.gray,
18
+ ...Colors.grayA,
19
+ ...Colors.green,
20
+ ...Colors.indigo,
21
+ ...Colors.orange,
22
+ ...Colors.pink,
23
+ ...Colors.purple,
24
+ ...Colors.red,
25
+ ...Colors.violet,
26
+ ...Colors.yellow,
27
+ ...Colors.teal
28
+ };
29
+ const allDarkColors = {
30
+ ...Colors.blueDark,
31
+ ...Colors.grayDark,
32
+ ...Colors.grayDarkA,
33
+ ...Colors.greenDark,
34
+ ...Colors.indigoDark,
35
+ ...Colors.orangeDark,
36
+ ...Colors.pinkDark,
37
+ ...Colors.purpleDark,
38
+ ...Colors.redDark,
39
+ ...Colors.violetDark,
40
+ ...Colors.yellowDark,
41
+ ...Colors.tealDark
42
+ };
43
+ const darkColorsPostfixed = Object.fromEntries(Object.entries(allDarkColors).map(([k, v]) => [`${k}Dark`, v]));
44
+ const colorNamesLight = Object.keys(allLightColors);
45
+ const colorNamesDark = Object.keys(allDarkColors);
46
+ export {
47
+ allDarkColors,
48
+ allLightColors,
49
+ colorNames,
50
+ colorNamesDark,
51
+ colorNamesLight,
52
+ darkColorsPostfixed
53
+ };
@@ -0,0 +1,31 @@
1
+ import { createFont } from "@tamagui/core";
2
+ const firaFont = createFont({
3
+ family: "Fira Code, Monaco, Consolas, Ubuntu Mono, monospace",
4
+ size: {
5
+ 1: 10,
6
+ 2: 11,
7
+ 3: 12,
8
+ 4: 13,
9
+ 5: 15,
10
+ 6: 16,
11
+ 7: 17
12
+ },
13
+ lineHeight: {
14
+ 1: 15,
15
+ 2: 18,
16
+ 3: 19,
17
+ 4: 20,
18
+ 5: 22,
19
+ 6: 24
20
+ },
21
+ weight: {
22
+ 4: "300",
23
+ 6: "700"
24
+ },
25
+ letterSpacing: {
26
+ 4: 0
27
+ }
28
+ });
29
+ export {
30
+ firaFont
31
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./interFont";
2
+ export * from "./firaFont";
@@ -0,0 +1,3 @@
1
+ export * from "./themes";
2
+ export * from "./tokens";
3
+ export * from "./colors";
@@ -0,0 +1,60 @@
1
+ import { createFont } from "@tamagui/core";
2
+ const interFont = createFont({
3
+ family: 'Inter, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
4
+ size: {
5
+ 1: 10,
6
+ 2: 12,
7
+ 3: 14,
8
+ 4: 15,
9
+ 5: 16,
10
+ 6: 17,
11
+ 7: 21,
12
+ 8: 25,
13
+ 9: 32,
14
+ 10: 45,
15
+ 11: 58,
16
+ 12: 68,
17
+ 13: 82,
18
+ 14: 102,
19
+ 15: 124,
20
+ 16: 144
21
+ },
22
+ lineHeight: {
23
+ 1: 15,
24
+ 2: 20,
25
+ 3: 25,
26
+ 4: 27,
27
+ 5: 29,
28
+ 6: 31,
29
+ 7: 34,
30
+ 8: 38,
31
+ 9: 42,
32
+ 10: 54,
33
+ 11: 72,
34
+ 12: 80,
35
+ 13: 100,
36
+ 14: 120,
37
+ 15: 150,
38
+ 16: 170
39
+ },
40
+ weight: {
41
+ 4: "300",
42
+ 7: "600",
43
+ 8: "700"
44
+ },
45
+ letterSpacing: {
46
+ 4: 0,
47
+ 7: 0,
48
+ 8: -1,
49
+ 9: -2,
50
+ 10: -3,
51
+ 11: -4,
52
+ 12: -5,
53
+ 13: -6,
54
+ 14: -7,
55
+ 15: -8
56
+ }
57
+ });
58
+ export {
59
+ interFont
60
+ };
@@ -0,0 +1,231 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import * as Colors from "@tamagui/colors";
4
+ import { getVariableValue } from "@tamagui/core";
5
+ import { allDarkColors, allLightColors } from "./colors";
6
+ import { setColorAlpha } from "./colorUtils";
7
+ import { tokens } from "./tokens";
8
+ const alternates = [1, 2, 3, 4];
9
+ function createThemesFrom(name, getTheme, props) {
10
+ const { shift = 0 } = props;
11
+ const theme = getTheme(0 + shift, props);
12
+ let themeEntries = [[name, theme]];
13
+ const altThemes = alternates.map((alt) => [
14
+ `${name}_alt${alt}`,
15
+ getTheme(alt + shift, props)
16
+ ]);
17
+ const altButtonThemes = alternates.map((_, i) => {
18
+ const [bName, bTheme] = [altThemes[i][0], (altThemes[i + 1] || altThemes[i])[1]];
19
+ return [`${bName}_Button`, bTheme];
20
+ });
21
+ const darkerTheme = getTheme(Math.max(0, shift + (props.isLight ? 1 : -1)), props);
22
+ const activeTheme = makeActiveTheme(theme);
23
+ themeEntries = [
24
+ ...themeEntries,
25
+ ...altThemes,
26
+ ...altButtonThemes,
27
+ [`${name}_Button`, altThemes[0][1]],
28
+ [`${name}_darker`, darkerTheme],
29
+ [`${name}_active`, activeTheme]
30
+ ];
31
+ const themes2 = Object.fromEntries(themeEntries);
32
+ return themes2;
33
+ }
34
+ __name(createThemesFrom, "createThemesFrom");
35
+ const createTheme = /* @__PURE__ */ __name((str = 1, {
36
+ backgrounds,
37
+ isLight = true,
38
+ colors = [...backgrounds].reverse(),
39
+ offsets: offsetsProp
40
+ }) => {
41
+ var _a, _b, _c, _d;
42
+ const offsets = {
43
+ borderColor: (_b = (_a = offsetsProp == null ? void 0 : offsetsProp.borderColor) != null ? _a : offsetsProp == null ? void 0 : offsetsProp.background) != null ? _b : [0, 0, 0, 0],
44
+ background: (_c = offsetsProp == null ? void 0 : offsetsProp.background) != null ? _c : [0, 0, 0, 0],
45
+ color: (_d = offsetsProp == null ? void 0 : offsetsProp.color) != null ? _d : [0, 0, 0, 0]
46
+ };
47
+ const darkColors = isLight ? colors : backgrounds;
48
+ const lighterDir = isLight ? -1 : 1;
49
+ const darkerDir = -lighterDir;
50
+ const strongerDir = isLight ? darkerDir : lighterDir;
51
+ const get = /* @__PURE__ */ __name((arr, index, name = "background") => {
52
+ return arr[Math.max(0, Math.min(index + (offsets[name][str] || 0), arr.length - 1))];
53
+ }, "get");
54
+ const colorTranslucent = setColorAlpha(getVariableValue(get(colors, 0 + str, "color")), 0.5);
55
+ return {
56
+ background: get(backgrounds, str),
57
+ backgroundStronger: get(backgrounds, str + strongerDir),
58
+ backgroundSoft: get(backgrounds, str + 3),
59
+ backgroundHover: get(backgrounds, str + lighterDir),
60
+ backgroundPress: get(backgrounds, str + darkerDir * 1),
61
+ backgroundFocus: get(backgrounds, str + darkerDir * 2),
62
+ backgroundTransparent: tokens.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
+ color: get(colors, 0 + str, "color"),
68
+ colorHover: get(colors, 1 + str, "color"),
69
+ colorPress: get(colors, 2 + str, "color"),
70
+ colorFocus: get(colors, 3 + str, "color"),
71
+ colorTranslucent,
72
+ colorMid: colors[Math.floor(colors.length / 2)],
73
+ shadowColor: isLight ? tokens.color.grayA3 : tokens.color.grayA8,
74
+ shadowColorHover: darkColors[!isLight ? 1 : 8],
75
+ shadowColorPress: darkColors[!isLight ? 1 : 8],
76
+ shadowColorFocus: darkColors[!isLight ? 1 : 8]
77
+ };
78
+ }, "createTheme");
79
+ const colorSchemes = [
80
+ { name: "blue", colors: Colors.blue, darkColors: Colors.blueDark },
81
+ { name: "gray", colors: Colors.gray, darkColors: Colors.grayDark },
82
+ { name: "green", colors: Colors.green, darkColors: Colors.greenDark },
83
+ { name: "indigo", colors: Colors.indigo, darkColors: Colors.indigoDark },
84
+ { name: "orange", colors: Colors.orange, darkColors: Colors.orangeDark },
85
+ { name: "pink", colors: Colors.pink, darkColors: Colors.pinkDark },
86
+ { name: "purple", colors: Colors.purple, darkColors: Colors.purpleDark },
87
+ { name: "red", colors: Colors.red, darkColors: Colors.redDark },
88
+ { name: "violet", colors: Colors.violet, darkColors: Colors.violetDark },
89
+ { name: "yellow", colors: Colors.yellow, darkColors: Colors.yellowDark },
90
+ { name: "teal", colors: Colors.teal, darkColors: Colors.tealDark },
91
+ { name: "lime", colors: Colors.lime, darkColors: Colors.limeDark },
92
+ { name: "brown", colors: Colors.brown, darkColors: Colors.brownDark }
93
+ ];
94
+ const lightGradient = [
95
+ "#fff",
96
+ "#f4f4f4",
97
+ tokens.color.gray1,
98
+ tokens.color.gray2,
99
+ tokens.color.gray3,
100
+ tokens.color.gray4,
101
+ tokens.color.gray5,
102
+ tokens.color.gray6,
103
+ tokens.color.gray7,
104
+ tokens.color.gray8,
105
+ tokens.color.gray9,
106
+ tokens.color.gray10,
107
+ tokens.color.gray11,
108
+ tokens.color.gray12
109
+ ];
110
+ const darkGradient = [
111
+ "#0f0f0f",
112
+ "#111111",
113
+ "#141414",
114
+ "#191919",
115
+ "#242424",
116
+ "#292929",
117
+ "#323232",
118
+ "#383838",
119
+ "#424242",
120
+ "#494949",
121
+ "#545454",
122
+ "#626262"
123
+ ];
124
+ const lightThemes = createThemesFrom("light", createTheme, {
125
+ backgrounds: lightGradient,
126
+ isLight: true
127
+ });
128
+ const darkThemes = createThemesFrom("dark", createTheme, {
129
+ backgrounds: darkGradient,
130
+ colors: lightGradient,
131
+ isLight: false,
132
+ shift: 1,
133
+ offsets: {
134
+ color: [0, 6, 7, 7, 7, 7]
135
+ }
136
+ });
137
+ const baseThemes = {
138
+ ...lightThemes,
139
+ light: {
140
+ ...allLightColors,
141
+ ...lightThemes.light
142
+ },
143
+ light_active: makeActiveTheme(lightThemes.light),
144
+ light_Card: lightThemes.light,
145
+ light_Button: lightThemes.light_alt1,
146
+ ...darkThemes,
147
+ dark: {
148
+ ...allDarkColors,
149
+ ...darkThemes.dark
150
+ },
151
+ dark_active: makeActiveTheme(darkThemes.dark),
152
+ dark_Card: darkThemes.dark_alt1,
153
+ dark_Button: darkThemes.dark_alt1
154
+ };
155
+ function makeActiveTheme(theme) {
156
+ const res = { ...theme };
157
+ res.backgroundHover = res.background;
158
+ res.colorHover = res.color;
159
+ res.backgroundPress = res.background;
160
+ res.colorPress = res.color;
161
+ return res;
162
+ }
163
+ __name(makeActiveTheme, "makeActiveTheme");
164
+ const colorThemeEntries = colorSchemes.flatMap(({ name, colors, darkColors }) => {
165
+ const [altLightThemes, altDarkThemes] = [colors, darkColors].map((colors2, i) => {
166
+ const isLight = i === 0;
167
+ const scheme = isLight ? "light" : "dark";
168
+ const shift = isLight ? 0 : 1;
169
+ let backgrounds = Object.values(colors2);
170
+ if (!isLight) {
171
+ const [_, h, sp, lp] = backgrounds[0].match(/hsl\(([0-9\.]+), ([0-9\.]+)\%, ([0-9\.]+)\%\)/);
172
+ backgrounds.unshift(`hsl(${h}, ${sp}%, ${parseFloat(lp) / 2}%)`);
173
+ }
174
+ const themeWithAlts = createThemesFrom(name, createTheme, {
175
+ backgrounds,
176
+ isLight,
177
+ shift,
178
+ isBase: false,
179
+ offsets: {
180
+ background: isLight ? [1, 1, 1, 0, 0, 0] : null,
181
+ borderColor: isLight ? [0, 1, 1, 2, 2, -2] : null,
182
+ color: isLight ? [0, 0, -1, -2, -3, -3, -4] : [-1, -1, -1, -1, -1, -1]
183
+ }
184
+ });
185
+ return Object.entries(themeWithAlts).map(([k, v]) => [`${scheme}_${k}`, v]);
186
+ });
187
+ const lightButtonTheme = altLightThemes[0];
188
+ const darkButtonTheme = altDarkThemes[0];
189
+ return [
190
+ ...altLightThemes,
191
+ [`${lightButtonTheme[0]}_Button`, altLightThemes[2][1]],
192
+ ...altDarkThemes,
193
+ [`${darkButtonTheme[0]}_Button`, altDarkThemes[2][1]]
194
+ ];
195
+ });
196
+ const transparent = {
197
+ background: "transparent",
198
+ backgroundSoft: "transparent",
199
+ backgroundHover: "transparent",
200
+ backgroundPress: "transparent",
201
+ backgroundFocus: "transparent",
202
+ backgroundTransparent: "transparent",
203
+ shadowColor: "transparent",
204
+ shadowColorHover: "transparent",
205
+ shadowColorPress: "transparent",
206
+ shadowColorFocus: "transparent"
207
+ };
208
+ const dark_outline = {
209
+ ...baseThemes.dark,
210
+ borderColor: "#fff",
211
+ ...transparent
212
+ };
213
+ const light_outline = {
214
+ ...baseThemes.light,
215
+ borderColor: "#000",
216
+ ...transparent
217
+ };
218
+ const colorThemes = Object.fromEntries(colorThemeEntries);
219
+ const allThemes = {
220
+ ...baseThemes,
221
+ ...colorThemes,
222
+ dark_outline,
223
+ light_outline
224
+ };
225
+ const themes = allThemes;
226
+ export {
227
+ colorSchemes,
228
+ darkGradient,
229
+ lightGradient,
230
+ themes
231
+ };
@@ -0,0 +1,61 @@
1
+ import { createTokens } from "@tamagui/core";
2
+ import { allLightColors, darkColorsPostfixed } from "./colors";
3
+ import { firaFont } from "./firaFont";
4
+ import { interFont } from "./interFont";
5
+ const size = {
6
+ true: 20,
7
+ 0: 0,
8
+ "0.5": 2,
9
+ 1: 6,
10
+ 2: 10,
11
+ 3: 15,
12
+ 4: 20,
13
+ 5: 25,
14
+ 6: 30,
15
+ 7: 40,
16
+ 8: 50,
17
+ 9: 65,
18
+ 10: 75,
19
+ 11: 85,
20
+ 12: 100
21
+ };
22
+ const space = {
23
+ ...size,
24
+ ...Object.fromEntries(Object.entries(size).map(([k, v]) => [`-${k}`, -v]))
25
+ };
26
+ const tokens = createTokens({
27
+ size,
28
+ space,
29
+ font: {
30
+ title: interFont,
31
+ body: interFont,
32
+ mono: firaFont
33
+ },
34
+ zIndex: {
35
+ 0: 0,
36
+ 1: 100,
37
+ 2: 200,
38
+ 3: 300,
39
+ 4: 400,
40
+ 5: 500
41
+ },
42
+ color: {
43
+ ...allLightColors,
44
+ ...darkColorsPostfixed
45
+ },
46
+ radius: {
47
+ 0: 0,
48
+ 1: 3,
49
+ 2: 5,
50
+ 3: 7,
51
+ 4: 9,
52
+ 5: 10,
53
+ 6: 12,
54
+ 7: 16,
55
+ 8: 20,
56
+ 9: 30
57
+ }
58
+ });
59
+ export {
60
+ tokens
61
+ };
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@tamagui/theme-base",
3
+ "version": "1.0.0-beta.172+0f3fd8dc",
4
+ "typings": "types",
5
+ "main": "dist/cjs",
6
+ "module": "dist/esm",
7
+ "module:jsx": "dist/jsx",
8
+ "files": [
9
+ "types",
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tamagui-build",
14
+ "watch": "tamagui-build --watch",
15
+ "clean": "tamagui-build clean",
16
+ "clean:build": "tamagui-build clean:build"
17
+ },
18
+ "devDependencies": {
19
+ "@tamagui/build": "^1.0.0-beta.172+0f3fd8dc",
20
+ "@tamagui/colors": "^1.0.0-beta.172+0f3fd8dc",
21
+ "@tamagui/core": "^1.0.0-beta.172+0f3fd8dc"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "gitHead": "0f3fd8dc83eede20419fb180704eb9ad1d63e814"
27
+ }
@@ -0,0 +1,4 @@
1
+ import { Variable } from '@tamagui/core';
2
+ export declare const hexToRGBA: (hex: string, alpha?: number) => string;
3
+ export declare const setColorAlpha: (colorIn: string | Variable, alpha?: number) => string;
4
+ //# sourceMappingURL=colorUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../src/colorUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,eAAe,CAAA;AAE1D,eAAO,MAAM,SAAS,QAAS,MAAM,2BAQpC,CAAA;AAED,eAAO,MAAM,aAAa,YAAa,MAAM,GAAG,QAAQ,2BAYvD,CAAA"}