@simscloud/design 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/fonts/DejaVuSans-Bold.woff2 +0 -0
- package/fonts/DejaVuSans.woff2 +0 -0
- package/fonts/fonts.css +25 -0
- package/package.json +29 -0
- package/tailwind-preset.js +67 -0
- package/tokens.css +122 -0
|
Binary file
|
|
Binary file
|
package/fonts/fonts.css
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIMS — shared web fonts (part of the design system).
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* Self-hosted DejaVu Sans (Latin subset). Imported through the bundler by both
|
|
5
|
+
* the landing page and the webapp, so the relative url()s below are rewritten
|
|
6
|
+
* to hashed, cache-busted asset URLs automatically — no per-app public/ copy.
|
|
7
|
+
*
|
|
8
|
+
* global.css (or app entry): @import ".../design/fonts/fonts.css";
|
|
9
|
+
* ===========================================================================*/
|
|
10
|
+
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: "DejaVu Sans";
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
font-display: swap;
|
|
16
|
+
src: url("./DejaVuSans.woff2") format("woff2");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: "DejaVu Sans";
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
font-display: swap;
|
|
24
|
+
src: url("./DejaVuSans-Bold.woff2") format("woff2");
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simscloud/design",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared SIMS design tokens — CSS variables, Tailwind preset, and web fonts. Framework-agnostic (no React).",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Kaistein01/SIMS.git",
|
|
9
|
+
"directory": "libs/design"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./tailwind-preset.js",
|
|
17
|
+
"./tailwind-preset": "./tailwind-preset.js",
|
|
18
|
+
"./tokens.css": "./tokens.css",
|
|
19
|
+
"./fonts/*": "./fonts/*"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"tailwind-preset.js",
|
|
23
|
+
"tokens.css",
|
|
24
|
+
"fonts"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIMS — Tailwind preset (shared design system)
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* Exposes the SEMANTIC tokens from `tokens.css` as Tailwind utilities, so
|
|
5
|
+
* `bg-surface text-text rounded-md` means the exact same thing in the Astro
|
|
6
|
+
* landing page and in the React + Vite webapp.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* - Landing page (Astro, Tailwind v4): loaded via `@config` in global.css.
|
|
10
|
+
* - Webapp (React + Vite): presets: [simsPreset] in its tailwind config,
|
|
11
|
+
* and import "design/tokens.css" once at the root.
|
|
12
|
+
*
|
|
13
|
+
* Components reference ONLY these semantic names — never raw hex — so a theme
|
|
14
|
+
* swap (dark mode, per-tenant brand) happens entirely in `tokens.css`.
|
|
15
|
+
* ===========================================================================*/
|
|
16
|
+
|
|
17
|
+
/** @type {import('tailwindcss').Config} */
|
|
18
|
+
export default {
|
|
19
|
+
theme: {
|
|
20
|
+
extend: {
|
|
21
|
+
colors: {
|
|
22
|
+
brand: {
|
|
23
|
+
DEFAULT: 'var(--color-brand)',
|
|
24
|
+
strong: 'var(--color-brand-strong)',
|
|
25
|
+
soft: 'var(--color-brand-soft)',
|
|
26
|
+
},
|
|
27
|
+
'on-brand': 'var(--color-on-brand)',
|
|
28
|
+
|
|
29
|
+
bg: 'var(--color-bg)',
|
|
30
|
+
surface: {
|
|
31
|
+
DEFAULT: 'var(--color-surface)',
|
|
32
|
+
muted: 'var(--color-surface-muted)',
|
|
33
|
+
},
|
|
34
|
+
header: 'var(--color-header-bg)',
|
|
35
|
+
banner: 'var(--color-banner)',
|
|
36
|
+
overlay: 'var(--color-overlay)',
|
|
37
|
+
|
|
38
|
+
text: {
|
|
39
|
+
DEFAULT: 'var(--color-text)',
|
|
40
|
+
muted: 'var(--color-text-muted)',
|
|
41
|
+
inverse: 'var(--color-text-inverse)',
|
|
42
|
+
},
|
|
43
|
+
heading: 'var(--color-heading)',
|
|
44
|
+
|
|
45
|
+
line: 'var(--color-border)',
|
|
46
|
+
ring: 'var(--color-ring)',
|
|
47
|
+
|
|
48
|
+
success: 'var(--color-success)',
|
|
49
|
+
warning: 'var(--color-warning)',
|
|
50
|
+
danger: 'var(--color-danger)',
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
fontFamily: {
|
|
54
|
+
sans: 'var(--font-sans)',
|
|
55
|
+
display: 'var(--font-display)',
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
borderRadius: {
|
|
59
|
+
sm: 'var(--radius-sm)',
|
|
60
|
+
md: 'var(--radius-md)',
|
|
61
|
+
lg: 'var(--radius-lg)',
|
|
62
|
+
xl: 'var(--radius-xl)',
|
|
63
|
+
full: 'var(--radius-full)',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
package/tokens.css
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIMS — Design Tokens (single source of truth)
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* Shared by the Astro landing page AND the future React + Vite webapp.
|
|
5
|
+
* Two layers, per the UI architecture notes:
|
|
6
|
+
* Layer 1 — PRIMITIVES : raw values (never used directly by components).
|
|
7
|
+
* Layer 2 — SEMANTIC : intent, referencing primitives. Components use ONLY
|
|
8
|
+
* these, so re-theming = swap the semantic layer.
|
|
9
|
+
*
|
|
10
|
+
* Light mode only for now. Dark mode / per-tenant branding are intentionally
|
|
11
|
+
* left "open": because semantics are CSS variables, a future `[data-theme]`
|
|
12
|
+
* override re-themes the whole app with ZERO component changes (see bottom).
|
|
13
|
+
* =============================================================================
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
:root {
|
|
17
|
+
/* ========================================================================
|
|
18
|
+
* Layer 1 — PRIMITIVES
|
|
19
|
+
* ===================================================================== */
|
|
20
|
+
|
|
21
|
+
/* Brand navy — every step is a tint/shade of the brand navy #000059
|
|
22
|
+
(matches the logo). #000059 is the anchor (navy-600). */
|
|
23
|
+
--navy-50: #ebebf2;
|
|
24
|
+
--navy-100: #d6d6e4;
|
|
25
|
+
--navy-200: #adadca;
|
|
26
|
+
--navy-300: #8585af;
|
|
27
|
+
--navy-400: #575791;
|
|
28
|
+
--navy-500: #2e2e77;
|
|
29
|
+
--navy-600: #000059; /* ← primary brand (matches the logo) */
|
|
30
|
+
--navy-700: #000047;
|
|
31
|
+
--navy-800: #000037;
|
|
32
|
+
--navy-900: #000028;
|
|
33
|
+
|
|
34
|
+
/* Accent blues — pulled from the logo's highlight gradients */
|
|
35
|
+
--blue-100: #e9e9ff;
|
|
36
|
+
--blue-200: #c7c7ff;
|
|
37
|
+
--blue-400: #8686bf;
|
|
38
|
+
|
|
39
|
+
/* Neutral (slate) */
|
|
40
|
+
--gray-0: #ffffff;
|
|
41
|
+
--gray-50: #f6f8fb;
|
|
42
|
+
--gray-100: #eef1f6;
|
|
43
|
+
--gray-200: #e3e7ef;
|
|
44
|
+
--gray-300: #cbd2de;
|
|
45
|
+
--gray-400: #9aa3b2;
|
|
46
|
+
--gray-500: #64748b;
|
|
47
|
+
--gray-600: #475569;
|
|
48
|
+
--gray-700: #334155;
|
|
49
|
+
--gray-800: #1e293b;
|
|
50
|
+
--gray-900: #0f172a;
|
|
51
|
+
|
|
52
|
+
/* Support / status */
|
|
53
|
+
--green-500: #16a34a;
|
|
54
|
+
--amber-500: #f59e0b;
|
|
55
|
+
--red-500: #dc2626;
|
|
56
|
+
|
|
57
|
+
/* Typography — DejaVu Sans (matches the logo wordmark; self-hosted, so it
|
|
58
|
+
renders identically on every OS). The @font-face lives in the consuming
|
|
59
|
+
app's stylesheet, e.g. the landing page's global.css. */
|
|
60
|
+
--font-sans: "DejaVu Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
61
|
+
--font-display: var(--font-sans);
|
|
62
|
+
|
|
63
|
+
/* Radii */
|
|
64
|
+
--radius-sm: 0.375rem;
|
|
65
|
+
--radius-md: 0.625rem;
|
|
66
|
+
--radius-lg: 1rem;
|
|
67
|
+
--radius-xl: 1.5rem;
|
|
68
|
+
--radius-full: 9999px;
|
|
69
|
+
|
|
70
|
+
/* ========================================================================
|
|
71
|
+
* Layer 2 — SEMANTIC (light theme)
|
|
72
|
+
* ===================================================================== */
|
|
73
|
+
|
|
74
|
+
/* Brand */
|
|
75
|
+
--color-brand: var(--navy-600);
|
|
76
|
+
--color-brand-strong: var(--navy-800);
|
|
77
|
+
--color-brand-soft: var(--navy-50);
|
|
78
|
+
--color-on-brand: #ffffff;
|
|
79
|
+
|
|
80
|
+
/* Surfaces */
|
|
81
|
+
--color-bg: var(--gray-0);
|
|
82
|
+
--color-surface: var(--gray-50);
|
|
83
|
+
--color-surface-muted: #eef1fc; /* the pale-blue section bg */
|
|
84
|
+
--color-header-bg: #e7e8ea;
|
|
85
|
+
--color-banner: var(--color-brand); /* top announcement bar = brand */
|
|
86
|
+
--color-overlay: rgba(0, 0, 40, 0.55);/* image scrim on the hero */
|
|
87
|
+
|
|
88
|
+
/* Text */
|
|
89
|
+
--color-text: var(--gray-900);
|
|
90
|
+
--color-text-muted: var(--gray-500);
|
|
91
|
+
--color-text-inverse: #ffffff;
|
|
92
|
+
--color-heading: var(--navy-800);
|
|
93
|
+
|
|
94
|
+
/* Lines & focus */
|
|
95
|
+
--color-border: var(--gray-200);
|
|
96
|
+
--color-ring: var(--navy-600);
|
|
97
|
+
|
|
98
|
+
/* Status */
|
|
99
|
+
--color-success: var(--green-500);
|
|
100
|
+
--color-warning: var(--amber-500);
|
|
101
|
+
--color-danger: var(--red-500);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* =============================================================================
|
|
105
|
+
* Dark theme — NOT enabled yet. Kept here (commented) to prove the door is
|
|
106
|
+
* open: switching is a token swap on the root, no component edits. To enable,
|
|
107
|
+
* add `data-theme="dark"` on <html> and uncomment.
|
|
108
|
+
* ===========================================================================*/
|
|
109
|
+
/*
|
|
110
|
+
[data-theme="dark"] {
|
|
111
|
+
--color-bg: var(--navy-900);
|
|
112
|
+
--color-surface: #0c0c33;
|
|
113
|
+
--color-surface-muted: #11113f;
|
|
114
|
+
--color-header-bg: #0a0a30;
|
|
115
|
+
--color-text: #e8e9f5;
|
|
116
|
+
--color-text-muted: #a9adc4;
|
|
117
|
+
--color-heading: #ffffff;
|
|
118
|
+
--color-border: #1c1c4d;
|
|
119
|
+
--color-brand: var(--blue-200);
|
|
120
|
+
--color-on-brand: var(--navy-900);
|
|
121
|
+
}
|
|
122
|
+
*/
|