@aghents/tokens 0.1.0
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.
- package/dist/index.d.ts +80 -0
- package/dist/index.js +82 -0
- package/package.json +32 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const tokens: {
|
|
2
|
+
readonly void: "#0D1117";
|
|
3
|
+
readonly surface: "#161C24";
|
|
4
|
+
readonly hairline: "#2B323C";
|
|
5
|
+
readonly cream: "#D8D8D8";
|
|
6
|
+
readonly 'cream-dim': "#8A9199";
|
|
7
|
+
readonly lime: "#D6EA36";
|
|
8
|
+
readonly rose: "#E6B6AA";
|
|
9
|
+
readonly 'lime-glow': "0 0 0 4px rgba(214, 234, 54, 0.18)";
|
|
10
|
+
readonly 'font-display': "'Newsreader', Georgia, serif";
|
|
11
|
+
readonly 'font-mono': "'DM Mono', ui-monospace, Menlo, monospace";
|
|
12
|
+
readonly 'display-xl': "300 56px/1.05 var(--games-font-display)";
|
|
13
|
+
readonly 'display-l': "300 40px/1.1 var(--games-font-display)";
|
|
14
|
+
readonly 'display-m': "400 28px/1.2 var(--games-font-display)";
|
|
15
|
+
readonly body: "300 17px/1.5 var(--games-font-display)";
|
|
16
|
+
readonly label: "400 12px/1.4 var(--games-font-mono)";
|
|
17
|
+
readonly value: "400 14px/1.4 var(--games-font-mono)";
|
|
18
|
+
readonly 'tracking-label': "0.14em";
|
|
19
|
+
readonly 'space-1': "4px";
|
|
20
|
+
readonly 'space-2': "8px";
|
|
21
|
+
readonly 'space-3': "16px";
|
|
22
|
+
readonly 'space-4': "24px";
|
|
23
|
+
readonly 'space-5': "40px";
|
|
24
|
+
readonly 'space-6': "64px";
|
|
25
|
+
readonly 'space-7': "96px";
|
|
26
|
+
readonly radius: "2px";
|
|
27
|
+
readonly shadow: "none";
|
|
28
|
+
readonly 'motion-fast': "180ms";
|
|
29
|
+
readonly 'motion-base': "280ms";
|
|
30
|
+
readonly 'motion-reveal': "500ms";
|
|
31
|
+
readonly ease: "cubic-bezier(0.2, 0, 0, 1)";
|
|
32
|
+
};
|
|
33
|
+
type TokenName = keyof typeof tokens;
|
|
34
|
+
declare const cssVariables = ":root {\n --games-void: #0D1117;\n --games-surface: #161C24;\n --games-hairline: #2B323C;\n --games-cream: #D8D8D8;\n --games-cream-dim: #8A9199;\n --games-lime: #D6EA36;\n --games-rose: #E6B6AA;\n --games-lime-glow: 0 0 0 4px rgba(214, 234, 54, 0.18);\n --games-font-display: 'Newsreader', Georgia, serif;\n --games-font-mono: 'DM Mono', ui-monospace, Menlo, monospace;\n --games-display-xl: 300 56px/1.05 var(--games-font-display);\n --games-display-l: 300 40px/1.1 var(--games-font-display);\n --games-display-m: 400 28px/1.2 var(--games-font-display);\n --games-body: 300 17px/1.5 var(--games-font-display);\n --games-label: 400 12px/1.4 var(--games-font-mono);\n --games-value: 400 14px/1.4 var(--games-font-mono);\n --games-tracking-label: 0.14em;\n --games-space-1: 4px;\n --games-space-2: 8px;\n --games-space-3: 16px;\n --games-space-4: 24px;\n --games-space-5: 40px;\n --games-space-6: 64px;\n --games-space-7: 96px;\n --games-radius: 2px;\n --games-shadow: none;\n --games-motion-fast: 180ms;\n --games-motion-base: 280ms;\n --games-motion-reveal: 500ms;\n --games-ease: cubic-bezier(0.2, 0, 0, 1);\n}";
|
|
35
|
+
declare const fontImportUrl = "https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;1,6..72,300&family=DM+Mono:wght@300;400&display=swap";
|
|
36
|
+
|
|
37
|
+
declare const colors: {
|
|
38
|
+
readonly void: "#0D1117";
|
|
39
|
+
readonly surface: "#161C24";
|
|
40
|
+
readonly hairline: "#2B323C";
|
|
41
|
+
readonly cream: "#D8D8D8";
|
|
42
|
+
readonly creamDim: "#8A9199";
|
|
43
|
+
readonly lime: "#D6EA36";
|
|
44
|
+
readonly rose: "#E6B6AA";
|
|
45
|
+
};
|
|
46
|
+
declare const fonts: {
|
|
47
|
+
readonly display: string;
|
|
48
|
+
readonly mono: string;
|
|
49
|
+
};
|
|
50
|
+
declare const rnTheme: {
|
|
51
|
+
readonly colors: {
|
|
52
|
+
readonly void: "#0D1117";
|
|
53
|
+
readonly surface: "#161C24";
|
|
54
|
+
readonly hairline: "#2B323C";
|
|
55
|
+
readonly cream: "#D8D8D8";
|
|
56
|
+
readonly creamDim: "#8A9199";
|
|
57
|
+
readonly lime: "#D6EA36";
|
|
58
|
+
readonly rose: "#E6B6AA";
|
|
59
|
+
};
|
|
60
|
+
readonly fonts: {
|
|
61
|
+
readonly display: string;
|
|
62
|
+
readonly mono: string;
|
|
63
|
+
};
|
|
64
|
+
readonly space: readonly [4, 8, 16, 24, 40, 64, 96];
|
|
65
|
+
readonly radius: 2;
|
|
66
|
+
};
|
|
67
|
+
declare const nativeFonts: {
|
|
68
|
+
readonly display: {
|
|
69
|
+
family: string;
|
|
70
|
+
package: string;
|
|
71
|
+
weights: number[];
|
|
72
|
+
};
|
|
73
|
+
readonly mono: {
|
|
74
|
+
family: string;
|
|
75
|
+
package: string;
|
|
76
|
+
weights: number[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { type TokenName, colors, cssVariables, fontImportUrl, fonts, nativeFonts, rnTheme, tokens };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/generated.ts
|
|
2
|
+
var tokens = {
|
|
3
|
+
"void": "#0D1117",
|
|
4
|
+
"surface": "#161C24",
|
|
5
|
+
"hairline": "#2B323C",
|
|
6
|
+
"cream": "#D8D8D8",
|
|
7
|
+
"cream-dim": "#8A9199",
|
|
8
|
+
"lime": "#D6EA36",
|
|
9
|
+
"rose": "#E6B6AA",
|
|
10
|
+
"lime-glow": "0 0 0 4px rgba(214, 234, 54, 0.18)",
|
|
11
|
+
"font-display": "'Newsreader', Georgia, serif",
|
|
12
|
+
"font-mono": "'DM Mono', ui-monospace, Menlo, monospace",
|
|
13
|
+
"display-xl": "300 56px/1.05 var(--games-font-display)",
|
|
14
|
+
"display-l": "300 40px/1.1 var(--games-font-display)",
|
|
15
|
+
"display-m": "400 28px/1.2 var(--games-font-display)",
|
|
16
|
+
"body": "300 17px/1.5 var(--games-font-display)",
|
|
17
|
+
"label": "400 12px/1.4 var(--games-font-mono)",
|
|
18
|
+
"value": "400 14px/1.4 var(--games-font-mono)",
|
|
19
|
+
"tracking-label": "0.14em",
|
|
20
|
+
"space-1": "4px",
|
|
21
|
+
"space-2": "8px",
|
|
22
|
+
"space-3": "16px",
|
|
23
|
+
"space-4": "24px",
|
|
24
|
+
"space-5": "40px",
|
|
25
|
+
"space-6": "64px",
|
|
26
|
+
"space-7": "96px",
|
|
27
|
+
"radius": "2px",
|
|
28
|
+
"shadow": "none",
|
|
29
|
+
"motion-fast": "180ms",
|
|
30
|
+
"motion-base": "280ms",
|
|
31
|
+
"motion-reveal": "500ms",
|
|
32
|
+
"ease": "cubic-bezier(0.2, 0, 0, 1)"
|
|
33
|
+
};
|
|
34
|
+
var cssVariables = ":root {\n --games-void: #0D1117;\n --games-surface: #161C24;\n --games-hairline: #2B323C;\n --games-cream: #D8D8D8;\n --games-cream-dim: #8A9199;\n --games-lime: #D6EA36;\n --games-rose: #E6B6AA;\n --games-lime-glow: 0 0 0 4px rgba(214, 234, 54, 0.18);\n --games-font-display: 'Newsreader', Georgia, serif;\n --games-font-mono: 'DM Mono', ui-monospace, Menlo, monospace;\n --games-display-xl: 300 56px/1.05 var(--games-font-display);\n --games-display-l: 300 40px/1.1 var(--games-font-display);\n --games-display-m: 400 28px/1.2 var(--games-font-display);\n --games-body: 300 17px/1.5 var(--games-font-display);\n --games-label: 400 12px/1.4 var(--games-font-mono);\n --games-value: 400 14px/1.4 var(--games-font-mono);\n --games-tracking-label: 0.14em;\n --games-space-1: 4px;\n --games-space-2: 8px;\n --games-space-3: 16px;\n --games-space-4: 24px;\n --games-space-5: 40px;\n --games-space-6: 64px;\n --games-space-7: 96px;\n --games-radius: 2px;\n --games-shadow: none;\n --games-motion-fast: 180ms;\n --games-motion-base: 280ms;\n --games-motion-reveal: 500ms;\n --games-ease: cubic-bezier(0.2, 0, 0, 1);\n}";
|
|
35
|
+
var fontImportUrl = "https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;1,6..72,300&family=DM+Mono:wght@300;400&display=swap";
|
|
36
|
+
|
|
37
|
+
// src/index.ts
|
|
38
|
+
var colors = {
|
|
39
|
+
void: tokens.void,
|
|
40
|
+
surface: tokens.surface,
|
|
41
|
+
hairline: tokens.hairline,
|
|
42
|
+
cream: tokens.cream,
|
|
43
|
+
creamDim: tokens["cream-dim"],
|
|
44
|
+
lime: tokens.lime,
|
|
45
|
+
rose: tokens.rose
|
|
46
|
+
};
|
|
47
|
+
var firstFamily = (stack) => (stack.split(",")[0] ?? "").trim().replace(/^['"]|['"]$/g, "");
|
|
48
|
+
var fonts = {
|
|
49
|
+
display: firstFamily(tokens["font-display"]),
|
|
50
|
+
mono: firstFamily(tokens["font-mono"])
|
|
51
|
+
};
|
|
52
|
+
var rnTheme = {
|
|
53
|
+
colors,
|
|
54
|
+
fonts,
|
|
55
|
+
space: [4, 8, 16, 24, 40, 64, 96],
|
|
56
|
+
radius: 2
|
|
57
|
+
};
|
|
58
|
+
var weightsFor = (family) => {
|
|
59
|
+
const spec = new URL(fontImportUrl).searchParams.getAll("family").find((f) => f.startsWith(`${family}:`));
|
|
60
|
+
const [axes = "", tuples = ""] = (spec?.split(":")[1] ?? "").split("@");
|
|
61
|
+
const i = axes.split(",").indexOf("wght");
|
|
62
|
+
if (i < 0) return [];
|
|
63
|
+
return [...new Set(tuples.split(";").map((t) => Number(t.split(",")[i])))];
|
|
64
|
+
};
|
|
65
|
+
var nativeFont = (family) => ({
|
|
66
|
+
family,
|
|
67
|
+
package: `@expo-google-fonts/${family.toLowerCase().replace(/\s+/g, "-")}`,
|
|
68
|
+
weights: weightsFor(family)
|
|
69
|
+
});
|
|
70
|
+
var nativeFonts = {
|
|
71
|
+
display: nativeFont(fonts.display),
|
|
72
|
+
mono: nativeFont(fonts.mono)
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
colors,
|
|
76
|
+
cssVariables,
|
|
77
|
+
fontImportUrl,
|
|
78
|
+
fonts,
|
|
79
|
+
nativeFonts,
|
|
80
|
+
rnTheme,
|
|
81
|
+
tokens
|
|
82
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aghents/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^22.10.2",
|
|
22
|
+
"tsx": "^4.19.2",
|
|
23
|
+
"typescript": "^5.9.3",
|
|
24
|
+
"vitest": "^2.1.9"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
28
|
+
"gen": "tsx scripts/gen.ts",
|
|
29
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
30
|
+
"test": "vitest run"
|
|
31
|
+
}
|
|
32
|
+
}
|