@kornorg/design-system 0.8.0 → 0.8.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.
- package/README.md +5 -4
- package/dist/index.d.ts +87 -103
- package/dist/index.mjs +413 -579
- package/dist/themes/cobalt.css +2 -2
- package/dist/themes/gestplate.css +2 -2
- package/dist/themes/modern-neutral.css +2 -2
- package/dist/themes/spartan.css +2 -2
- package/dist/themes/sprout.css +2 -2
- package/dist/themes/warm.css +2 -2
- package/dist/tokens.d.ts +28 -31
- package/dist/tokens.mjs +48 -40
- package/package.json +12 -13
package/dist/tokens.mjs
CHANGED
|
@@ -1,47 +1,55 @@
|
|
|
1
1
|
// src/tokens.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Design tokens — typed source of truth for the values that have no CSS
|
|
4
|
+
* backing (spacing scale, type scale, font weights).
|
|
5
|
+
*
|
|
6
|
+
* Color, radius, and font-family values live in a theme's CSS custom
|
|
7
|
+
* properties (`src/styles/themes/<feel>.css`) instead — components consume
|
|
8
|
+
* those through Tailwind utility classes (e.g. `bg-primary`), which is the
|
|
9
|
+
* only place a `var(--x)` reference resolves. The published `tokens` export
|
|
10
|
+
* needs to work without a DOM (chart libraries, canvas/SVG rendering, email
|
|
11
|
+
* templates), so `scripts/build-css.mjs` resolves the default theme's CSS to
|
|
12
|
+
* literal values at build time and appends them to this file's build output
|
|
13
|
+
* as `light` / `dark` (see `scripts/generate-tokens.mjs`), plus `radii` and
|
|
14
|
+
* `fontFamily`. Import them from `@kornorg/design-system/tokens` alongside
|
|
15
|
+
* the tokens defined here — this source file only has the pieces below.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Spacing scale (rem). Matches Tailwind's default 4px step so utility classes
|
|
19
|
+
* (`p-4`, `gap-2`, …) and token references stay aligned.
|
|
20
|
+
*/
|
|
21
|
+
const spacing = {
|
|
22
|
+
0: "0rem",
|
|
23
|
+
.5: "0.125rem",
|
|
24
|
+
1: "0.25rem",
|
|
25
|
+
2: "0.5rem",
|
|
26
|
+
3: "0.75rem",
|
|
27
|
+
4: "1rem",
|
|
28
|
+
5: "1.25rem",
|
|
29
|
+
6: "1.5rem",
|
|
30
|
+
8: "2rem",
|
|
31
|
+
10: "2.5rem",
|
|
32
|
+
12: "3rem",
|
|
33
|
+
16: "4rem"
|
|
26
34
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
/** Typography scale: [font-size, line-height]. */
|
|
36
|
+
const fontSize = {
|
|
37
|
+
xs: ["0.75rem", "1rem"],
|
|
38
|
+
sm: ["0.875rem", "1.25rem"],
|
|
39
|
+
base: ["1rem", "1.5rem"],
|
|
40
|
+
lg: ["1.125rem", "1.75rem"],
|
|
41
|
+
xl: ["1.25rem", "1.75rem"],
|
|
42
|
+
"2xl": ["1.5rem", "2rem"],
|
|
43
|
+
"3xl": ["1.875rem", "2.25rem"],
|
|
44
|
+
"4xl": ["2.25rem", "2.5rem"],
|
|
45
|
+
"5xl": ["3rem", "1"]
|
|
37
46
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
const fontWeight = {
|
|
48
|
+
normal: "400",
|
|
49
|
+
medium: "500",
|
|
50
|
+
semibold: "600",
|
|
51
|
+
bold: "700"
|
|
43
52
|
};
|
|
44
|
-
|
|
45
53
|
export { fontSize, fontWeight, spacing };
|
|
46
54
|
|
|
47
55
|
// --- Generated by scripts/build-css.mjs from src/styles/themes/modern-neutral.css. ---
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kornorg/design-system",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Modern Neutral — a React + Tailwind CSS design system (components, tokens, Geist fonts).",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://lurking-walrus.github.io/design-system/",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/lurking-walrus/design-system.git"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"design-system",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "next dev --turbopack",
|
|
46
|
-
"build": "
|
|
46
|
+
"build": "tsdown && node scripts/postbuild.mjs && pnpm run build:css",
|
|
47
47
|
"build:css": "node scripts/build-css.mjs",
|
|
48
48
|
"build:showcase": "next build",
|
|
49
49
|
"prepack": "pnpm run build",
|
|
@@ -83,20 +83,19 @@
|
|
|
83
83
|
"@types/react-dom": "^19",
|
|
84
84
|
"@vitejs/plugin-react": "^6.1.0",
|
|
85
85
|
"geist": "^1.7.2",
|
|
86
|
-
"jsdom": "^
|
|
87
|
-
"next": "16.
|
|
88
|
-
"react": "19.
|
|
89
|
-
"react-dom": "19.
|
|
86
|
+
"jsdom": "^31.0.1",
|
|
87
|
+
"next": "16.4.6",
|
|
88
|
+
"react": "19.3.1",
|
|
89
|
+
"react-dom": "19.3.1",
|
|
90
90
|
"tailwindcss": "^4",
|
|
91
|
-
"
|
|
91
|
+
"tsdown": "^0.23.7",
|
|
92
92
|
"tw-animate-css": "^1.4.0",
|
|
93
|
-
"typescript": "^
|
|
94
|
-
"vitest": "^
|
|
93
|
+
"typescript": "^7.0.2",
|
|
94
|
+
"vitest": "^5.0.1"
|
|
95
95
|
},
|
|
96
96
|
"pnpm": {
|
|
97
97
|
"overrides": {
|
|
98
|
-
"
|
|
99
|
-
"vite": "^8.0.16",
|
|
98
|
+
"vite": "^8.1.6",
|
|
100
99
|
"esbuild@>=0.27.3 <0.28.1": "^0.28.1",
|
|
101
100
|
"postcss@<8.5.10": "^8.5.10"
|
|
102
101
|
}
|