@xex/tokens 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iGattreX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # @xex/tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Design tokens for the XeX design system.
4
+
5
+ ```ts
6
+ import { themes, getTheme, SHADE_STEPS, fontStack, DEFAULT_FONT } from '@xex/tokens'
7
+ import '@xex/tokens/styles.css' // brand overrides, dark mode and shared classes
8
+ ```
9
+
10
+ - `themes`: the colour presets (each has `shades` 50–900). Run `npm run audit:contrast` in the repo to check one.
11
+ - `styles.css`: plain CSS (no Tailwind directives); import it once, after your own CSS.
12
+
13
+ MIT licensed.
@@ -0,0 +1,55 @@
1
+ declare const SHADE_STEPS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
2
+ type ShadeStep = (typeof SHADE_STEPS)[number];
3
+ interface Theme {
4
+ id: string;
5
+ name: string;
6
+ /** Tailwind-style 50–900 steps, hex strings. */
7
+ shades: Record<ShadeStep, string>;
8
+ }
9
+ /**
10
+ * Ordered around the colour wheel (blue → violet → pink/red → orange → yellow →
11
+ * green → teal), then a neutral. Hue of the 600 step is noted for each.
12
+ *
13
+ * Sunset, Gold, Lime, Forest and Teal are light hues, so their 500–900 steps are
14
+ * taken one Tailwind step darker; that keeps white text on bg-brand-600 at ≥ 4.5:1.
15
+ * `node scripts/audit-contrast.mjs` checks every pairing the system uses.
16
+ */
17
+ declare const themes: Theme[];
18
+ declare const DEFAULT_THEME_ID = "classic";
19
+ declare function getTheme(id: string | null | undefined): Theme;
20
+
21
+ type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
22
+ interface FontChoice {
23
+ /** Font family name (also the unique id), e.g. "DM Sans". */
24
+ family: string;
25
+ category: FontCategory;
26
+ /** Available static weights, used to build the Google Fonts URL. */
27
+ weights?: number[];
28
+ /** Custom CSS stack for non-web fonts (e.g. the system font). */
29
+ stack?: string;
30
+ /** The app already ships this font (self-hosted); never request it from Google Fonts. */
31
+ bundled?: boolean;
32
+ }
33
+ /** Inter is the design system's default typeface. Apps are expected to self-host it (e.g. @fontsource/inter). */
34
+ declare const DEFAULT_FONT: FontChoice;
35
+ declare const SYSTEM_FONT: FontChoice;
36
+ declare const FONT_CATEGORIES: {
37
+ value: FontCategory;
38
+ label: string;
39
+ }[];
40
+ declare function fontStack(f: FontChoice): string;
41
+ /** True for fonts that must not be fetched from Google Fonts (custom stacks and bundled fonts such as Inter). */
42
+ declare const isLocalFont: (f: FontChoice) => boolean;
43
+ /**
44
+ * Loads the regular weight of many families with ONE Google Fonts stylesheet request, so
45
+ * list rows can be drawn in their own typeface. Skips local fonts and families already requested.
46
+ * Only called by the optional font picker; nothing in the core talks to Google.
47
+ */
48
+ declare function loadFontPreviews(list: FontChoice[]): void;
49
+ /**
50
+ * Injects (once) the Google Fonts stylesheet for a family. No-op for local fonts, so an app that
51
+ * never lets users pick a Google font makes no external requests.
52
+ */
53
+ declare function loadGoogleFont(f: FontChoice): void;
54
+
55
+ export { DEFAULT_FONT, DEFAULT_THEME_ID, FONT_CATEGORIES, type FontCategory, type FontChoice, SHADE_STEPS, SYSTEM_FONT, type ShadeStep, type Theme, fontStack, getTheme, isLocalFont, loadFontPreviews, loadGoogleFont, themes };
package/dist/index.js ADDED
@@ -0,0 +1,266 @@
1
+ // src/themes.ts
2
+ var SHADE_STEPS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
3
+ var themes = [
4
+ {
5
+ id: "classic",
6
+ // blue ~221°
7
+ name: "Classic",
8
+ shades: {
9
+ 50: "#eff6ff",
10
+ 100: "#dbeafe",
11
+ 200: "#bfdbfe",
12
+ 300: "#93c5fd",
13
+ 400: "#60a5fa",
14
+ 500: "#3b82f6",
15
+ 600: "#2563eb",
16
+ 700: "#1d4ed8",
17
+ 800: "#1e40af",
18
+ 900: "#1e3a8a"
19
+ }
20
+ },
21
+ {
22
+ id: "midnight",
23
+ // indigo ~243°
24
+ name: "Midnight",
25
+ shades: {
26
+ 50: "#eef2ff",
27
+ 100: "#e0e7ff",
28
+ 200: "#c7d2fe",
29
+ 300: "#a5b4fc",
30
+ 400: "#818cf8",
31
+ 500: "#6366f1",
32
+ 600: "#4f46e5",
33
+ 700: "#4338ca",
34
+ 800: "#3730a3",
35
+ 900: "#312e81"
36
+ }
37
+ },
38
+ {
39
+ id: "royal",
40
+ // violet ~262°
41
+ name: "Royal",
42
+ shades: {
43
+ 50: "#f5f3ff",
44
+ 100: "#ede9fe",
45
+ 200: "#ddd6fe",
46
+ 300: "#c4b5fd",
47
+ 400: "#a78bfa",
48
+ 500: "#8b5cf6",
49
+ 600: "#7c3aed",
50
+ 700: "#6d28d9",
51
+ 800: "#5b21b6",
52
+ 900: "#4c1d95"
53
+ }
54
+ },
55
+ {
56
+ id: "orchid",
57
+ // fuchsia ~293°
58
+ name: "Orchid",
59
+ shades: {
60
+ 50: "#fdf4ff",
61
+ 100: "#fae8ff",
62
+ 200: "#f5d0fe",
63
+ 300: "#f0abfc",
64
+ 400: "#e879f9",
65
+ 500: "#d946ef",
66
+ 600: "#c026d3",
67
+ 700: "#a21caf",
68
+ 800: "#86198f",
69
+ 900: "#701a75"
70
+ }
71
+ },
72
+ {
73
+ id: "crimson",
74
+ // rose ~347°
75
+ name: "Crimson",
76
+ shades: {
77
+ 50: "#fff1f2",
78
+ 100: "#ffe4e6",
79
+ 200: "#fecdd3",
80
+ 300: "#fda4af",
81
+ 400: "#fb7185",
82
+ 500: "#f43f5e",
83
+ 600: "#e11d48",
84
+ 700: "#be123c",
85
+ 800: "#9f1239",
86
+ 900: "#881337"
87
+ }
88
+ },
89
+ {
90
+ id: "sunset",
91
+ // orange ~21°
92
+ name: "Sunset",
93
+ shades: {
94
+ 50: "#fff7ed",
95
+ 100: "#ffedd5",
96
+ 200: "#fed7aa",
97
+ 300: "#fdba74",
98
+ 400: "#fb923c",
99
+ 500: "#ea580c",
100
+ 600: "#c2410c",
101
+ 700: "#9a3412",
102
+ 800: "#7c2d12",
103
+ 900: "#431407"
104
+ }
105
+ },
106
+ {
107
+ id: "gold",
108
+ // yellow ~40°
109
+ name: "Gold",
110
+ shades: {
111
+ 50: "#fefce8",
112
+ 100: "#fef9c3",
113
+ 200: "#fef08a",
114
+ 300: "#fde047",
115
+ 400: "#facc15",
116
+ 500: "#ca8a04",
117
+ 600: "#a16207",
118
+ 700: "#854d0e",
119
+ 800: "#713f12",
120
+ 900: "#422006"
121
+ }
122
+ },
123
+ {
124
+ id: "lime",
125
+ // lime ~85°
126
+ name: "Lime",
127
+ shades: {
128
+ 50: "#f7fee7",
129
+ 100: "#ecfccb",
130
+ 200: "#d9f99d",
131
+ 300: "#bef264",
132
+ 400: "#a3e635",
133
+ 500: "#65a30d",
134
+ 600: "#4d7c0f",
135
+ 700: "#3f6212",
136
+ 800: "#365314",
137
+ 900: "#1a2e05"
138
+ }
139
+ },
140
+ {
141
+ id: "forest",
142
+ // green ~142°
143
+ name: "Forest",
144
+ shades: {
145
+ 50: "#f0fdf4",
146
+ 100: "#dcfce7",
147
+ 200: "#bbf7d0",
148
+ 300: "#86efac",
149
+ 400: "#4ade80",
150
+ 500: "#16a34a",
151
+ 600: "#15803d",
152
+ 700: "#166534",
153
+ 800: "#14532d",
154
+ 900: "#052e16"
155
+ }
156
+ },
157
+ {
158
+ id: "teal",
159
+ // teal ~175°
160
+ name: "Teal",
161
+ shades: {
162
+ 50: "#f0fdfa",
163
+ 100: "#ccfbf1",
164
+ 200: "#99f6e4",
165
+ 300: "#5eead4",
166
+ 400: "#2dd4bf",
167
+ 500: "#0d9488",
168
+ 600: "#0f766e",
169
+ 700: "#115e59",
170
+ 800: "#134e4a",
171
+ 900: "#042f2e"
172
+ }
173
+ },
174
+ {
175
+ id: "graphite",
176
+ // neutral slate
177
+ name: "Graphite",
178
+ shades: {
179
+ 50: "#f8fafc",
180
+ 100: "#f1f5f9",
181
+ 200: "#e2e8f0",
182
+ 300: "#cbd5e1",
183
+ 400: "#94a3b8",
184
+ 500: "#64748b",
185
+ 600: "#475569",
186
+ 700: "#334155",
187
+ 800: "#1e293b",
188
+ 900: "#0f172a"
189
+ }
190
+ }
191
+ ];
192
+ var DEFAULT_THEME_ID = "classic";
193
+ function getTheme(id) {
194
+ return themes.find((t) => t.id === id) ?? themes.find((t) => t.id === DEFAULT_THEME_ID);
195
+ }
196
+
197
+ // src/fonts.ts
198
+ var DEFAULT_FONT = { family: "Inter", category: "sans-serif", weights: [400, 500, 600, 700], bundled: true };
199
+ var SYSTEM_FONT = {
200
+ family: "System UI",
201
+ category: "sans-serif",
202
+ stack: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"
203
+ };
204
+ var FONT_CATEGORIES = [
205
+ { value: "sans-serif", label: "Sans serif" },
206
+ { value: "serif", label: "Serif" },
207
+ { value: "display", label: "Display" },
208
+ { value: "handwriting", label: "Handwriting" },
209
+ { value: "monospace", label: "Monospace" }
210
+ ];
211
+ var FALLBACK = {
212
+ "sans-serif": "ui-sans-serif, system-ui, sans-serif",
213
+ serif: "ui-serif, Georgia, serif",
214
+ display: "ui-sans-serif, system-ui, sans-serif",
215
+ handwriting: "cursive",
216
+ monospace: "ui-monospace, SFMono-Regular, Menlo, monospace"
217
+ };
218
+ function fontStack(f) {
219
+ return f.stack ?? `'${f.family}', ${FALLBACK[f.category] ?? FALLBACK["sans-serif"]}`;
220
+ }
221
+ var isLocalFont = (f) => Boolean(f.stack || f.bundled || f.family === DEFAULT_FONT.family);
222
+ var WANTED_WEIGHTS = [400, 500, 600, 700];
223
+ var requested = /* @__PURE__ */ new Set();
224
+ var previewBatch = 0;
225
+ function loadFontPreviews(list) {
226
+ if (typeof document === "undefined") return;
227
+ const fresh = list.filter((f) => !isLocalFont(f) && !requested.has(f.family));
228
+ if (fresh.length === 0) return;
229
+ const params = fresh.map((f) => {
230
+ const w = f.weights?.includes(400) ? 400 : f.weights?.[0] ?? 400;
231
+ requested.add(f.family);
232
+ return `family=${f.family.replace(/ /g, "+")}:wght@${w}`;
233
+ });
234
+ const link = document.createElement("link");
235
+ link.id = `gf-preview-${previewBatch++}`;
236
+ link.rel = "stylesheet";
237
+ link.href = `https://fonts.googleapis.com/css2?${params.join("&")}&display=swap`;
238
+ document.head.appendChild(link);
239
+ }
240
+ function loadGoogleFont(f) {
241
+ if (isLocalFont(f) || typeof document === "undefined") return;
242
+ const id = `gf-${f.family.replace(/\s+/g, "-")}`;
243
+ if (document.getElementById(id)) return;
244
+ const available = f.weights?.length ? f.weights : [400];
245
+ let weights = WANTED_WEIGHTS.filter((w) => available.includes(w));
246
+ if (weights.length === 0) weights = [available[0]];
247
+ const spec = `${f.family.replace(/ /g, "+")}:wght@${weights.join(";")}`;
248
+ const link = document.createElement("link");
249
+ link.id = id;
250
+ link.rel = "stylesheet";
251
+ link.href = `https://fonts.googleapis.com/css2?family=${spec}&display=swap`;
252
+ document.head.appendChild(link);
253
+ }
254
+ export {
255
+ DEFAULT_FONT,
256
+ DEFAULT_THEME_ID,
257
+ FONT_CATEGORIES,
258
+ SHADE_STEPS,
259
+ SYSTEM_FONT,
260
+ fontStack,
261
+ getTheme,
262
+ isLocalFont,
263
+ loadFontPreviews,
264
+ loadGoogleFont,
265
+ themes
266
+ };
@@ -0,0 +1,622 @@
1
+ /* Generated by scripts/gen-css.mjs — do not edit. Compiled to dist/styles.css at build time. */
2
+
3
+ /* ------------------------------------------------------------------ *
4
+ * Brand overrides (runtime theming)
5
+ *
6
+ * Tailwind compiles bg-brand-600 etc. at build time; relying on the
7
+ * compiled output to repaint when --brand-* changes is not reliable
8
+ * across every build setup. These plain-CSS rules use !important to
9
+ * re-declare the brand utilities we use as direct var() lookups, so a
10
+ * theme switch repaints immediately wherever this file is loaded.
11
+ * Only add a utility here if you use it. (Opacity modifiers such as
12
+ * bg-brand-600/50 are not supported by var() colors.)
13
+ * ------------------------------------------------------------------ */
14
+
15
+ :root {
16
+ /* Fallback = Classic, so the first paint is never unstyled. */
17
+ --brand-50: #eff6ff;
18
+ --brand-100: #dbeafe;
19
+ --brand-200: #bfdbfe;
20
+ --brand-300: #93c5fd;
21
+ --brand-400: #60a5fa;
22
+ --brand-500: #3b82f6;
23
+ --brand-600: #2563eb;
24
+ --brand-700: #1d4ed8;
25
+ --brand-800: #1e40af;
26
+ --brand-900: #1e3a8a;
27
+ --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
28
+ }
29
+
30
+ .bg-brand-50 {
31
+ background-color: var(--brand-50) !important;
32
+ }
33
+
34
+ .bg-brand-100 {
35
+ background-color: var(--brand-100) !important;
36
+ }
37
+
38
+ .bg-brand-200 {
39
+ background-color: var(--brand-200) !important;
40
+ }
41
+
42
+ .bg-brand-300 {
43
+ background-color: var(--brand-300) !important;
44
+ }
45
+
46
+ .bg-brand-400 {
47
+ background-color: var(--brand-400) !important;
48
+ }
49
+
50
+ .bg-brand-500 {
51
+ background-color: var(--brand-500) !important;
52
+ }
53
+
54
+ .bg-brand-600 {
55
+ background-color: var(--brand-600) !important;
56
+ }
57
+
58
+ .bg-brand-700 {
59
+ background-color: var(--brand-700) !important;
60
+ }
61
+
62
+ .bg-brand-800 {
63
+ background-color: var(--brand-800) !important;
64
+ }
65
+
66
+ .bg-brand-900 {
67
+ background-color: var(--brand-900) !important;
68
+ }
69
+
70
+ .text-brand-500 {
71
+ color: var(--brand-500) !important;
72
+ }
73
+
74
+ .text-brand-600 {
75
+ color: var(--brand-600) !important;
76
+ }
77
+
78
+ .text-brand-700 {
79
+ color: var(--brand-700) !important;
80
+ }
81
+
82
+ .text-brand-800 {
83
+ color: var(--brand-800) !important;
84
+ }
85
+
86
+ .border-brand-200 {
87
+ border-color: var(--brand-200) !important;
88
+ }
89
+
90
+ .border-brand-300 {
91
+ border-color: var(--brand-300) !important;
92
+ }
93
+
94
+ .border-brand-400 {
95
+ border-color: var(--brand-400) !important;
96
+ }
97
+
98
+ .border-brand-500 {
99
+ border-color: var(--brand-500) !important;
100
+ }
101
+
102
+ .border-brand-600 {
103
+ border-color: var(--brand-600) !important;
104
+ }
105
+
106
+ .ring-brand-200 {
107
+ --tw-ring-color: var(--brand-200) !important;
108
+ }
109
+
110
+ .ring-brand-300 {
111
+ --tw-ring-color: var(--brand-300) !important;
112
+ }
113
+
114
+ .ring-brand-400 {
115
+ --tw-ring-color: var(--brand-400) !important;
116
+ }
117
+
118
+ .hover\:bg-brand-50:hover {
119
+ background-color: var(--brand-50) !important;
120
+ }
121
+
122
+ .hover\:bg-brand-100:hover {
123
+ background-color: var(--brand-100) !important;
124
+ }
125
+
126
+ .hover\:bg-brand-600:hover {
127
+ background-color: var(--brand-600) !important;
128
+ }
129
+
130
+ .hover\:bg-brand-700:hover {
131
+ background-color: var(--brand-700) !important;
132
+ }
133
+
134
+ .hover\:text-brand-600:hover {
135
+ color: var(--brand-600) !important;
136
+ }
137
+
138
+ .hover\:text-brand-700:hover {
139
+ color: var(--brand-700) !important;
140
+ }
141
+
142
+ .hover\:text-brand-800:hover {
143
+ color: var(--brand-800) !important;
144
+ }
145
+
146
+ .hover\:border-brand-300:hover {
147
+ border-color: var(--brand-300) !important;
148
+ }
149
+
150
+ .hover\:border-brand-400:hover {
151
+ border-color: var(--brand-400) !important;
152
+ }
153
+
154
+ .hover\:border-brand-500:hover {
155
+ border-color: var(--brand-500) !important;
156
+ }
157
+
158
+ .focus\:ring-brand-400:focus, .focus-visible\:ring-brand-400:focus-visible, .focus-within\:ring-brand-400:focus-within {
159
+ --tw-ring-color: var(--brand-400) !important;
160
+ }
161
+
162
+ .focus\:border-brand-400:focus {
163
+ border-color: var(--brand-400) !important;
164
+ }
165
+
166
+ .group:focus-visible .group-focus-visible\:ring-brand-400 {
167
+ --tw-ring-color: var(--brand-400) !important;
168
+ }
169
+
170
+ .from-brand-50 {
171
+ --tw-gradient-from: var(--brand-50) !important;
172
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(255 255 255 / 0)) !important;
173
+ }
174
+
175
+ .from-brand-100 {
176
+ --tw-gradient-from: var(--brand-100) !important;
177
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(255 255 255 / 0)) !important;
178
+ }
179
+
180
+ .from-brand-500 {
181
+ --tw-gradient-from: var(--brand-500) !important;
182
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(255 255 255 / 0)) !important;
183
+ }
184
+
185
+ .from-brand-600 {
186
+ --tw-gradient-from: var(--brand-600) !important;
187
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(255 255 255 / 0)) !important;
188
+ }
189
+
190
+ .to-brand-100 {
191
+ --tw-gradient-to: var(--brand-100) !important;
192
+ }
193
+
194
+ .to-brand-600 {
195
+ --tw-gradient-to: var(--brand-600) !important;
196
+ }
197
+
198
+ .to-brand-700 {
199
+ --tw-gradient-to: var(--brand-700) !important;
200
+ }
201
+
202
+ .to-brand-800 {
203
+ --tw-gradient-to: var(--brand-800) !important;
204
+ }
205
+
206
+ /* ------------------------------------------------------------------ *
207
+ * Global conventions
208
+ * ------------------------------------------------------------------ */
209
+
210
+ body {
211
+ --tw-bg-opacity: 1;
212
+ background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
213
+ font-family: var(--font-sans), Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
214
+ --tw-text-opacity: 1;
215
+ color: rgb(17 24 39 / var(--tw-text-opacity, 1));
216
+ -webkit-font-smoothing: antialiased;
217
+ -moz-osx-font-smoothing: grayscale;
218
+ }
219
+
220
+ html[data-mode='dark'] body {
221
+ background-color: #1a2138;
222
+ color: #f3f4f6;
223
+ }
224
+
225
+ input[type='checkbox'], input[type='radio'], input[type='range'] {
226
+ accent-color: var(--brand-600);
227
+ }
228
+
229
+ /* Default keyboard-focus ring, themed. :where() keeps specificity at zero, so any control that
230
+ defines its own ring (focus-visible:ring-*, focus:outline-none) simply overrides this. */
231
+
232
+ :where(:focus-visible) {
233
+ outline: 2px solid var(--brand-500);
234
+ outline-offset: 2px;
235
+ }
236
+
237
+ :where(html[data-mode='dark'] :focus-visible) {
238
+ outline-color: var(--brand-300);
239
+ }
240
+
241
+ .card {
242
+ border-radius: 0.75rem;
243
+ border-width: 1px;
244
+ --tw-border-opacity: 1;
245
+ border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));
246
+ --tw-bg-opacity: 1;
247
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
248
+ --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
249
+ --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
250
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
251
+ }
252
+
253
+ html[data-mode='dark'] .card {
254
+ background-color: #141a2e;
255
+ border-color: #2a3352;
256
+ }
257
+
258
+ .nav-item-active {
259
+ display: flex;
260
+ align-items: center;
261
+ gap: 0.75rem;
262
+ border-radius: 0.5rem;
263
+ padding-left: 0.75rem;
264
+ padding-right: 0.75rem;
265
+ padding-top: 0.5rem;
266
+ padding-bottom: 0.5rem;
267
+ font-size: 0.875rem;
268
+ line-height: 1.25rem;
269
+ font-weight: 500;
270
+ --tw-text-opacity: 1;
271
+ color: rgb(255 255 255 / var(--tw-text-opacity, 1));
272
+ background-color: var(--brand-600);
273
+ }
274
+
275
+ .nav-item-inactive {
276
+ display: flex;
277
+ align-items: center;
278
+ gap: 0.75rem;
279
+ border-radius: 0.5rem;
280
+ padding-left: 0.75rem;
281
+ padding-right: 0.75rem;
282
+ padding-top: 0.5rem;
283
+ padding-bottom: 0.5rem;
284
+ font-size: 0.875rem;
285
+ line-height: 1.25rem;
286
+ font-weight: 500;
287
+ --tw-text-opacity: 1;
288
+ color: rgb(75 85 99 / var(--tw-text-opacity, 1));
289
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
290
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
291
+ transition-duration: 150ms;
292
+ }
293
+
294
+ html[data-mode='dark'] .nav-item-inactive:hover {
295
+ background-color: #222a45;
296
+ }
297
+
298
+ html[data-mode='dark'] .nav-item-inactive {
299
+ color: #cbd2e1;
300
+ }
301
+
302
+ .nav-item-inactive:hover {
303
+ --tw-bg-opacity: 1;
304
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
305
+ --tw-text-opacity: 1;
306
+ color: rgb(17 24 39 / var(--tw-text-opacity, 1));
307
+ }
308
+
309
+ .stat-indigo {
310
+ border-width: 1px;
311
+ background-color: var(--brand-50);
312
+ color: var(--brand-700);
313
+ border-color: var(--brand-200);
314
+ }
315
+
316
+ .stat-emerald {
317
+ border-width: 1px;
318
+ background-color: #ecfdf5;
319
+ color: #047857;
320
+ border-color: #a7f3d0;
321
+ }
322
+
323
+ .stat-amber {
324
+ border-width: 1px;
325
+ background-color: #fffbeb;
326
+ color: #b45309;
327
+ border-color: #fde68a;
328
+ }
329
+
330
+ .stat-rose {
331
+ border-width: 1px;
332
+ background-color: #fff1f2;
333
+ color: #be123c;
334
+ border-color: #fecdd3;
335
+ }
336
+
337
+ .stat-sky {
338
+ border-width: 1px;
339
+ background-color: #f0f9ff;
340
+ color: #0369a1;
341
+ border-color: #bae6fd;
342
+ }
343
+
344
+ .weight-pill {
345
+ display: inline-flex;
346
+ min-width: 1.5rem;
347
+ align-items: center;
348
+ justify-content: center;
349
+ border-radius: 0.375rem;
350
+ --tw-bg-opacity: 1;
351
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
352
+ padding-left: 0.375rem;
353
+ padding-right: 0.375rem;
354
+ padding-top: 0.125rem;
355
+ padding-bottom: 0.125rem;
356
+ font-size: 0.75rem;
357
+ line-height: 1rem;
358
+ font-weight: 600;
359
+ --tw-numeric-spacing: tabular-nums;
360
+ font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
361
+ --tw-text-opacity: 1;
362
+ color: rgb(55 65 81 / var(--tw-text-opacity, 1));
363
+ }
364
+
365
+ html[data-mode='dark'] .weight-pill {
366
+ background-color: #222a45;
367
+ color: #cbd2e1;
368
+ }
369
+
370
+ /* LoadingDots */
371
+
372
+ @keyframes xex-dot-fade {
373
+ 0%, 80%, 100% {
374
+ opacity: 0.2;
375
+ }
376
+
377
+ 40% {
378
+ opacity: 1;
379
+ }
380
+ }
381
+
382
+ .xex-dots {
383
+ display: inline-flex;
384
+ align-items: center;
385
+ gap: 3px;
386
+ vertical-align: middle;
387
+ }
388
+
389
+ .xex-dots > i {
390
+ width: 6px;
391
+ height: 6px;
392
+ border-radius: 9999px;
393
+ background: currentColor;
394
+ opacity: 0.2;
395
+ animation: xex-dot-fade 0.7s ease-in-out infinite;
396
+ }
397
+
398
+ .xex-dots > i:nth-child(2) {
399
+ animation-delay: 0.12s;
400
+ }
401
+
402
+ .xex-dots > i:nth-child(3) {
403
+ animation-delay: 0.24s;
404
+ }
405
+
406
+ /* ProgressBar (indeterminate), ProgressRing track, LoadingOverlay scrim */
407
+
408
+ @keyframes xex-indeterminate {
409
+ 0% {
410
+ left: -40%;
411
+ }
412
+
413
+ 100% {
414
+ left: 100%;
415
+ }
416
+ }
417
+
418
+ .xex-indeterminate {
419
+ animation: xex-indeterminate 1.2s ease-in-out infinite;
420
+ }
421
+
422
+ .xex-ring-track {
423
+ stroke: #e5e7eb;
424
+ }
425
+
426
+ .xex-overlay {
427
+ background-color: rgb(255 255 255 / 0.65);
428
+ }
429
+
430
+ @media (prefers-reduced-motion: reduce) {
431
+ .xex-dots > i {
432
+ animation: none;
433
+ opacity: 0.6;
434
+ }
435
+
436
+ .xex-indeterminate {
437
+ animation: none;
438
+ left: 0;
439
+ width: 100%;
440
+ opacity: 0.5;
441
+ }
442
+ }
443
+
444
+ /* ------------------------------------------------------------------ *
445
+ * Dark mode (per theme): remap neutral surfaces + soften brand tints.
446
+ * Driven by <html data-mode="dark">, set by ThemeProvider.
447
+ * ------------------------------------------------------------------ */
448
+
449
+ html[data-mode='dark'] body {
450
+ background-color: #0b1020;
451
+ color: #e5e7eb;
452
+ }
453
+
454
+ html[data-mode='dark'] .bg-white {
455
+ background-color: #141a2e !important;
456
+ }
457
+
458
+ html[data-mode='dark'] .xex-ring-track {
459
+ stroke: #2a3352;
460
+ }
461
+
462
+ html[data-mode='dark'] .xex-overlay {
463
+ background-color: rgb(20 26 46 / 0.65);
464
+ }
465
+
466
+ html[data-mode='dark'] .group:focus-visible .group-focus-visible\:ring-offset-white {
467
+ --tw-ring-offset-color: #141a2e;
468
+ }
469
+
470
+ html[data-mode='dark'] .bg-gray-50, html[data-mode='dark'] .hover\:bg-gray-50:hover {
471
+ background-color: #1a2138 !important;
472
+ }
473
+
474
+ html[data-mode='dark'] .bg-gray-100, html[data-mode='dark'] .hover\:bg-gray-100:hover, html[data-mode='dark'] .weight-pill {
475
+ background-color: #222a45 !important;
476
+ }
477
+
478
+ html[data-mode='dark'] .bg-gray-200 {
479
+ background-color: #323b5c !important;
480
+ }
481
+
482
+ html[data-mode='dark'] .border-gray-100 {
483
+ border-color: #1f2740 !important;
484
+ }
485
+
486
+ html[data-mode='dark'] .border-gray-200 {
487
+ border-color: #2a3352 !important;
488
+ }
489
+
490
+ html[data-mode='dark'] .border-gray-300 {
491
+ border-color: #3a4468 !important;
492
+ }
493
+
494
+ html[data-mode='dark'] .text-gray-900, html[data-mode='dark'] .text-gray-800 {
495
+ color: #f3f4f6 !important;
496
+ }
497
+
498
+ html[data-mode='dark'] .text-gray-700, html[data-mode='dark'] .text-gray-600, html[data-mode='dark'] .weight-pill {
499
+ color: #cbd2e1 !important;
500
+ }
501
+
502
+ html[data-mode='dark'] .text-gray-500, html[data-mode='dark'] .text-gray-400 {
503
+ color: #8d97b3 !important;
504
+ }
505
+
506
+ html[data-mode='dark'] .bg-brand-50, html[data-mode='dark'] .hover\:bg-brand-50:hover {
507
+ background-color: color-mix(in srgb, var(--brand-500) 16%, #0b1020) !important;
508
+ }
509
+
510
+ html[data-mode='dark'] .bg-brand-100 {
511
+ background-color: color-mix(in srgb, var(--brand-500) 26%, #0b1020) !important;
512
+ }
513
+
514
+ html[data-mode='dark'] .text-brand-600, html[data-mode='dark'] .text-brand-700, html[data-mode='dark'] .text-brand-800 {
515
+ color: var(--brand-300) !important;
516
+ }
517
+
518
+ html[data-mode='dark'] .border-brand-200 {
519
+ border-color: color-mix(in srgb, var(--brand-500) 40%, #0b1020) !important;
520
+ }
521
+
522
+ html[data-mode='dark'] .from-brand-50 {
523
+ --tw-gradient-from: color-mix(in srgb, var(--brand-500) 16%, #0b1020) !important;
524
+ }
525
+
526
+ html[data-mode='dark'] .from-brand-100 {
527
+ --tw-gradient-from: color-mix(in srgb, var(--brand-500) 26%, #0b1020) !important;
528
+ }
529
+
530
+ html[data-mode='dark'] .to-brand-100 {
531
+ --tw-gradient-to: color-mix(in srgb, var(--brand-500) 30%, #0b1020) !important;
532
+ }
533
+
534
+ html[data-mode='dark'] .ring-brand-200 {
535
+ --tw-ring-color: color-mix(in srgb, var(--brand-500) 40%, #0b1020) !important;
536
+ }
537
+
538
+ html[data-mode='dark'] .stat-indigo {
539
+ background-color: color-mix(in srgb, var(--brand-500) 16%, #0b1020);
540
+ color: var(--brand-300);
541
+ border-color: color-mix(in srgb, var(--brand-500) 40%, #0b1020);
542
+ }
543
+
544
+ html[data-mode='dark'] .bg-red-50 {
545
+ background-color: #3a1620 !important;
546
+ }
547
+
548
+ html[data-mode='dark'] .border-red-200 {
549
+ border-color: #7f1d1d !important;
550
+ }
551
+
552
+ html[data-mode='dark'] .text-red-600, html[data-mode='dark'] .text-red-700, html[data-mode='dark'] .text-red-800 {
553
+ color: #fca5a5 !important;
554
+ }
555
+
556
+ html[data-mode='dark'] .bg-emerald-100 {
557
+ background-color: #0c3a2c !important;
558
+ }
559
+
560
+ html[data-mode='dark'] .text-emerald-700 {
561
+ color: #6ee7b7 !important;
562
+ }
563
+
564
+ html[data-mode='dark'] .bg-amber-100 {
565
+ background-color: #4a3410 !important;
566
+ }
567
+
568
+ html[data-mode='dark'] .text-amber-700 {
569
+ color: #fcd34d !important;
570
+ }
571
+
572
+ html[data-mode='dark'] .bg-red-100 {
573
+ background-color: #4a1a22 !important;
574
+ }
575
+
576
+ html[data-mode='dark'] .bg-sky-100 {
577
+ background-color: #0c3350 !important;
578
+ }
579
+
580
+ html[data-mode='dark'] .text-sky-700 {
581
+ color: #7dd3fc !important;
582
+ }
583
+
584
+ html[data-mode='dark'] .bg-purple-100 {
585
+ background-color: #3a1f5a !important;
586
+ }
587
+
588
+ html[data-mode='dark'] .text-purple-700 {
589
+ color: #d8b4fe !important;
590
+ }
591
+
592
+ html[data-mode='dark'] .stat-emerald {
593
+ background-color: #0c2f25;
594
+ color: #6ee7b7;
595
+ border-color: #14532d;
596
+ }
597
+
598
+ html[data-mode='dark'] .stat-amber {
599
+ background-color: #3a2a0c;
600
+ color: #fcd34d;
601
+ border-color: #78350f;
602
+ }
603
+
604
+ html[data-mode='dark'] .stat-rose {
605
+ background-color: #3a1420;
606
+ color: #fda4af;
607
+ border-color: #881337;
608
+ }
609
+
610
+ html[data-mode='dark'] .stat-sky {
611
+ background-color: #0c2a40;
612
+ color: #7dd3fc;
613
+ border-color: #075985;
614
+ }
615
+
616
+ html[data-mode='dark'] input::-moz-placeholder, html[data-mode='dark'] textarea::-moz-placeholder {
617
+ color: #6b7592;
618
+ }
619
+
620
+ html[data-mode='dark'] input::placeholder, html[data-mode='dark'] textarea::placeholder {
621
+ color: #6b7592;
622
+ }
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@xex/tokens",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "XeX design tokens: colour themes, font helpers and the shared stylesheet.",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "design-system",
8
+ "design-tokens",
9
+ "themes",
10
+ "tailwind"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/iGattreX/xex.git",
15
+ "directory": "packages/tokens"
16
+ },
17
+ "homepage": "https://github.com/iGattreX/xex#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/iGattreX/xex/issues"
20
+ },
21
+ "type": "module",
22
+ "sideEffects": [
23
+ "**/*.css"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
33
+ "./styles.css": "./dist/styles.css",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "scripts": {
45
+ "build": "node scripts/gen-css.mjs && tailwindcss -c tailwind.styles.config.js -i src/styles.src.css -o dist/styles.css && tsup",
46
+ "audit:contrast": "node scripts/audit-contrast.mjs",
47
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
48
+ "typecheck": "tsc --noEmit"
49
+ },
50
+ "devDependencies": {
51
+ "@xex/tailwind-preset": "^0.1.0",
52
+ "tailwindcss": "^3.4.17",
53
+ "tsup": "^8.3.5",
54
+ "typescript": "^5.7.2"
55
+ }
56
+ }