@sola-air-ui/tokens 1.0.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.
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@sola-air-ui/tokens",
3
+ "version": "1.0.1",
4
+ "description": "Design tokens for Sola AIR — spacing, radius, type scale, color, and semantic palette",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js",
9
+ "./css": "./src/tokens.css"
10
+ },
11
+ "keywords": ["sola", "design-tokens", "css-variables", "design-system", "tokens"],
12
+ "license": "MIT",
13
+ "homepage": "https://sola-air.dev",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/rbm3267/sola-air"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public",
20
+ "registry": "https://registry.npmjs.org/"
21
+ }
22
+ }
package/src/index.js ADDED
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @sola-air-ui/tokens
3
+ *
4
+ * JavaScript representation of the Sola AIR design token system.
5
+ * Import the CSS for actual browser use; use this object for tooling,
6
+ * tests, or generating platform-specific token files.
7
+ *
8
+ * import '@sola-air-ui/tokens/css'; // CSS custom properties
9
+ * import { tokens } from '@sola-air-ui/tokens'; // JS values
10
+ */
11
+
12
+ export const tokens = {
13
+ space: {
14
+ xxs: '2px',
15
+ xs: '4px',
16
+ sm: '8px',
17
+ md: '12px',
18
+ lg: '16px',
19
+ xl: '24px',
20
+ '2xl': '32px',
21
+ '3xl': '40px',
22
+ },
23
+
24
+ radius: {
25
+ sm: '2px',
26
+ md: '6px',
27
+ lg: '8px',
28
+ xl: '12px',
29
+ '2xl': '16px',
30
+ full: '9999px',
31
+ },
32
+
33
+ fontSize: {
34
+ sm: '12px',
35
+ md: '16px',
36
+ lg: '20px',
37
+ xl: '24px',
38
+ '2xl': '32px',
39
+ },
40
+
41
+ fontWeight: {
42
+ normal: 400,
43
+ medium: 500,
44
+ semibold: 600,
45
+ bold: 700,
46
+ },
47
+
48
+ leading: {
49
+ tight: 1.25,
50
+ normal: 1.5,
51
+ relaxed: 1.75,
52
+ },
53
+
54
+ color: {
55
+ primary: {
56
+ 50: '#ecfdf5',
57
+ 100: '#d1fae5',
58
+ 200: '#a7f3d0',
59
+ 300: '#6ee7b7',
60
+ 400: '#34d399',
61
+ 500: '#10b981',
62
+ 600: '#059669',
63
+ 700: '#047857',
64
+ 800: '#065f46',
65
+ 900: '#064e3b',
66
+ },
67
+ neutral: {
68
+ 0: '#ffffff',
69
+ 50: '#f8fafc',
70
+ 100: '#f1f5f9',
71
+ 200: '#e2e8f0',
72
+ 300: '#cbd5e1',
73
+ 400: '#94a3b8',
74
+ 500: '#64748b',
75
+ 600: '#475569',
76
+ 700: '#334155',
77
+ 800: '#1e293b',
78
+ 900: '#0f172a',
79
+ 950: '#020617',
80
+ },
81
+ },
82
+
83
+ /**
84
+ * Semantic severity scale — 7 roles from informational to critical.
85
+ * Useful for AI interfaces where output certainty and action urgency
86
+ * need clear, consistent visual encoding.
87
+ */
88
+ alert: {
89
+ low: { fg: '#64748b', bg: '#f8fafc' },
90
+ positive: { fg: '#059669', bg: '#ecfdf5' },
91
+ info: { fg: '#0284c7', bg: '#f0f9ff' },
92
+ moderate: { fg: '#ca8a04', bg: '#fefce8' },
93
+ warning: { fg: '#ea580c', bg: '#fff7ed' },
94
+ high: { fg: '#dc2626', bg: '#fef2f2' },
95
+ critical: { fg: '#9333ea', bg: '#faf5ff' },
96
+ },
97
+ };
98
+
99
+ export default tokens;
package/src/tokens.css ADDED
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @sola-air-ui/tokens — Sola AIR design token system
3
+ *
4
+ * An 8px-base spacing grid, a 5-step type scale, and a 7-role semantic
5
+ * alert palette. These are Sola AIR's own choices, grounded in the same
6
+ * principles common across modern design systems: pixel-grid alignment,
7
+ * typographic hierarchy, and purposeful semantic color.
8
+ *
9
+ * --sola-space-* spacing scale (2–40px, 8 steps)
10
+ * --sola-radius-* corner-radius scale (2–9999px)
11
+ * --sola-font-size-* type scale (12–32px, 5 steps)
12
+ * --sola-font-weight-* weight scale
13
+ * --sola-leading-* line-height scale
14
+ * --sola-color-primary-* emerald primary palette (50–900)
15
+ * --sola-color-neutral-* slate neutral palette (0–950)
16
+ * --sola-text-* semantic text roles (primary/secondary/tertiary)
17
+ * --sola-surface-* surface backgrounds
18
+ * --sola-border-* border roles
19
+ * --sola-alert-* semantic severity scale (low→critical, 7 roles)
20
+ */
21
+
22
+ :root {
23
+ /* ─── Spacing ───────────────────────────────────────────────────────────────
24
+ * 8px-base grid with a 2px micro step for tight contexts.
25
+ * All components snap to these increments for visual rhythm.
26
+ */
27
+ --sola-space-xxs: 2px;
28
+ --sola-space-xs: 4px;
29
+ --sola-space-sm: 8px;
30
+ --sola-space-md: 12px;
31
+ --sola-space-lg: 16px;
32
+ --sola-space-xl: 24px;
33
+ --sola-space-2xl: 32px;
34
+ --sola-space-3xl: 40px;
35
+
36
+ /* ─── Corner radius ─────────────────────────────────────────────────────────
37
+ * sm: tight elements like status chips and badges
38
+ * md: interactive controls — buttons, inputs
39
+ * lg: dialog-level containers
40
+ * xl / 2xl: cards and panels with a softer feel
41
+ * full: pill shapes, avatars, tags
42
+ */
43
+ --sola-radius-sm: 2px;
44
+ --sola-radius-md: 6px;
45
+ --sola-radius-lg: 8px;
46
+ --sola-radius-xl: 12px;
47
+ --sola-radius-2xl: 16px;
48
+ --sola-radius-full: 9999px;
49
+
50
+ /* ─── Type scale ────────────────────────────────────────────────────────────
51
+ * 5-step modular scale. md (16px) is the component default.
52
+ * sm is for labels and metadata only — not primary reading content.
53
+ * 2xl is a page-title step; use at most once per view.
54
+ */
55
+ --sola-font-size-sm: 12px;
56
+ --sola-font-size-md: 16px;
57
+ --sola-font-size-lg: 20px;
58
+ --sola-font-size-xl: 24px;
59
+ --sola-font-size-2xl: 32px;
60
+
61
+ /* ─── Font weight ───────────────────────────────────────────────────────────
62
+ * Semibold for titles; bold sparingly — prefer color + size for hierarchy.
63
+ */
64
+ --sola-font-weight-normal: 400;
65
+ --sola-font-weight-medium: 500;
66
+ --sola-font-weight-semibold: 600;
67
+ --sola-font-weight-bold: 700;
68
+
69
+ /* ─── Line height ───────────────────────────────────────────────────────────*/
70
+ --sola-leading-tight: 1.25;
71
+ --sola-leading-normal: 1.5;
72
+ --sola-leading-relaxed: 1.75;
73
+
74
+ /* ─── Primary palette (Emerald) ─────────────────────────────────────────────
75
+ * The Sola AIR brand color. Use -500 as the base; -600/-700 for
76
+ * hover/active states; -50 through -200 for tinted backgrounds.
77
+ */
78
+ --sola-color-primary-50: #ecfdf5;
79
+ --sola-color-primary-100: #d1fae5;
80
+ --sola-color-primary-200: #a7f3d0;
81
+ --sola-color-primary-300: #6ee7b7;
82
+ --sola-color-primary-400: #34d399;
83
+ --sola-color-primary-500: #10b981;
84
+ --sola-color-primary-600: #059669;
85
+ --sola-color-primary-700: #047857;
86
+ --sola-color-primary-800: #065f46;
87
+ --sola-color-primary-900: #064e3b;
88
+
89
+ /* ─── Neutral palette (Slate) ───────────────────────────────────────────────
90
+ * A full neutral range with a subtle blue-grey bias — chosen, not defaulted.
91
+ */
92
+ --sola-color-neutral-0: #ffffff;
93
+ --sola-color-neutral-50: #f8fafc;
94
+ --sola-color-neutral-100: #f1f5f9;
95
+ --sola-color-neutral-200: #e2e8f0;
96
+ --sola-color-neutral-300: #cbd5e1;
97
+ --sola-color-neutral-400: #94a3b8;
98
+ --sola-color-neutral-500: #64748b;
99
+ --sola-color-neutral-600: #475569;
100
+ --sola-color-neutral-700: #334155;
101
+ --sola-color-neutral-800: #1e293b;
102
+ --sola-color-neutral-900: #0f172a;
103
+ --sola-color-neutral-950: #020617;
104
+
105
+ /* ─── Semantic text roles ───────────────────────────────────────────────────
106
+ * Three levels of visual weight for reading hierarchy:
107
+ * primary: essential content — body copy, component labels
108
+ * secondary: supporting content — input labels, captions
109
+ * tertiary: metadata — timestamps, supplemental data
110
+ */
111
+ --sola-text-primary: #0f172a;
112
+ --sola-text-secondary: #475569;
113
+ --sola-text-tertiary: #94a3b8;
114
+
115
+ /* ─── Surface roles ─────────────────────────────────────────────────────────*/
116
+ --sola-surface-0: #ffffff;
117
+ --sola-surface-1: #f8fafc;
118
+ --sola-surface-2: #f1f5f9;
119
+ --sola-surface-overlay: rgba(15, 23, 42, 0.6);
120
+
121
+ /* ─── Border roles ──────────────────────────────────────────────────────────*/
122
+ --sola-border-subtle: #e2e8f0;
123
+ --sola-border-default: #cbd5e1;
124
+ --sola-border-strong: #94a3b8;
125
+
126
+ /* ─── Semantic severity scale ───────────────────────────────────────────────
127
+ * 7 roles from informational to critical. Designed for AI interfaces where
128
+ * you need to communicate output certainty and action urgency clearly.
129
+ * Each role: foreground (text/icon) + tinted background for containing surfaces.
130
+ *
131
+ * low — neutral informational, no urgency
132
+ * positive — success / confirmed / safe
133
+ * info — informational, passive awareness
134
+ * moderate — soft caution, worth noting
135
+ * warning — action recommended
136
+ * high — action required soon
137
+ * critical — immediate action required
138
+ */
139
+ --sola-alert-low: #64748b;
140
+ --sola-alert-low-bg: #f8fafc;
141
+
142
+ --sola-alert-positive: #059669;
143
+ --sola-alert-positive-bg: #ecfdf5;
144
+
145
+ --sola-alert-info: #0284c7;
146
+ --sola-alert-info-bg: #f0f9ff;
147
+
148
+ --sola-alert-moderate: #ca8a04;
149
+ --sola-alert-moderate-bg: #fefce8;
150
+
151
+ --sola-alert-warning: #ea580c;
152
+ --sola-alert-warning-bg: #fff7ed;
153
+
154
+ --sola-alert-high: #dc2626;
155
+ --sola-alert-high-bg: #fef2f2;
156
+
157
+ --sola-alert-critical: #9333ea;
158
+ --sola-alert-critical-bg: #faf5ff;
159
+
160
+ /* ─── Focus ring ────────────────────────────────────────────────────────────*/
161
+ --sola-focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.4);
162
+ }
163
+
164
+ /* ─── Dark mode — system default ─────────────────────────────────────────────
165
+ * Redefines only token values; component styles consume tokens only,
166
+ * never direct colors. Guard prevents overriding an explicit data-theme="light".
167
+ */
168
+ @media (prefers-color-scheme: dark) {
169
+ :root:not([data-theme="light"]) {
170
+ --sola-text-primary: #f8fafc;
171
+ --sola-text-secondary: #94a3b8;
172
+ --sola-text-tertiary: #64748b;
173
+
174
+ --sola-surface-0: #0f172a;
175
+ --sola-surface-1: #1e293b;
176
+ --sola-surface-2: #334155;
177
+ --sola-surface-overlay: rgba(2, 6, 23, 0.75);
178
+
179
+ --sola-border-subtle: #1e293b;
180
+ --sola-border-default: #334155;
181
+ --sola-border-strong: #475569;
182
+
183
+ --sola-alert-low-bg: #1e293b;
184
+ --sola-alert-positive-bg: #022c22;
185
+ --sola-alert-info-bg: #082f49;
186
+ --sola-alert-moderate-bg: #1c1400;
187
+ --sola-alert-warning-bg: #1c0c00;
188
+ --sola-alert-high-bg: #1c0000;
189
+ --sola-alert-critical-bg: #1a0030;
190
+ }
191
+ }
192
+
193
+ /* ─── Dark mode — explicit toggle ────────────────────────────────────────────*/
194
+ :root[data-theme="dark"] {
195
+ --sola-text-primary: #f8fafc;
196
+ --sola-text-secondary: #94a3b8;
197
+ --sola-text-tertiary: #64748b;
198
+
199
+ --sola-surface-0: #0f172a;
200
+ --sola-surface-1: #1e293b;
201
+ --sola-surface-2: #334155;
202
+ --sola-surface-overlay: rgba(2, 6, 23, 0.75);
203
+
204
+ --sola-border-subtle: #1e293b;
205
+ --sola-border-default: #334155;
206
+ --sola-border-strong: #475569;
207
+
208
+ --sola-alert-low-bg: #1e293b;
209
+ --sola-alert-positive-bg: #022c22;
210
+ --sola-alert-info-bg: #082f49;
211
+ --sola-alert-moderate-bg: #1c1400;
212
+ --sola-alert-warning-bg: #1c0c00;
213
+ --sola-alert-high-bg: #1c0000;
214
+ --sola-alert-critical-bg: #1a0030;
215
+ }