eidotter 0.41.0 → 0.41.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.
@@ -5,5 +5,7 @@
5
5
  * @example
6
6
  * cn('bg-dos-bg-primary text-dos-text-primary', 'bg-dos-bg-secondary')
7
7
  * // → 'text-dos-text-primary bg-dos-bg-secondary'
8
+ * cn('text-dos-text-brand', 'text-dos-text-sm')
9
+ * // → 'text-dos-text-brand text-dos-text-sm' (colour and size both kept)
8
10
  */
9
11
  export declare function cn(...inputs: (string | undefined | null | false)[]): string;
package/dist/utils/cn.js CHANGED
@@ -1,4 +1,34 @@
1
- import { twMerge } from 'tailwind-merge';
1
+ import { extendTailwindMerge } from 'tailwind-merge';
2
+ import { DOS_FONT_SIZES } from './dosFontSizes.js';
3
+ /**
4
+ * tailwind-merge knows nothing about eidotter's preset, so it reads any
5
+ * `text-<unknown>` class as a text colour. `text-dos-text-sm` (a font size)
6
+ * then "conflicts" with `text-dos-text-brand` (a colour) and the colour is
7
+ * dropped. Registering the dos font sizes as a font-size group keeps both.
8
+ * The list is generated from the preset (scripts/generate-tailwind-safelist.mjs),
9
+ * so a new size token joins automatically.
10
+ *
11
+ * It is a group of its own rather than tailwind-merge's `font-size`, because
12
+ * that group also removes any earlier `leading-*` class (stock Tailwind sizes
13
+ * carry a line height). Button and Badge pair a dos size with a leading class,
14
+ * and the dos sizes defer to it (their line height, where they set one, reads
15
+ * Tailwind's leading variable first).
16
+ * A dos size and a stock size still replace each other.
17
+ *
18
+ * Keep stock size class names out of comments in src: Tailwind scans these
19
+ * files and would compile any it finds into dist/eidotter.css.
20
+ */
21
+ const twMerge = extendTailwindMerge({
22
+ extend: {
23
+ classGroups: {
24
+ 'dos-font-size': [{ text: [...DOS_FONT_SIZES] }],
25
+ },
26
+ conflictingClassGroups: {
27
+ 'dos-font-size': ['font-size'],
28
+ 'font-size': ['dos-font-size'],
29
+ },
30
+ },
31
+ });
2
32
  /**
3
33
  * Merge Tailwind CSS classes with conflict resolution.
4
34
  * Wraps tailwind-merge for consistent class merging across eidotter components.
@@ -6,6 +36,8 @@ import { twMerge } from 'tailwind-merge';
6
36
  * @example
7
37
  * cn('bg-dos-bg-primary text-dos-text-primary', 'bg-dos-bg-secondary')
8
38
  * // → 'text-dos-text-primary bg-dos-bg-secondary'
39
+ * cn('text-dos-text-brand', 'text-dos-text-sm')
40
+ * // → 'text-dos-text-brand text-dos-text-sm' (colour and size both kept)
9
41
  */
10
42
  export function cn(...inputs) {
11
43
  return twMerge(inputs.filter(Boolean));
@@ -0,0 +1,2 @@
1
+ /** The eidotter font-size keys (`text-<key>` classes), registered with tailwind-merge by cn(). */
2
+ export declare const DOS_FONT_SIZES: readonly string[];
@@ -0,0 +1,17 @@
1
+ // GENERATED by scripts/generate-tailwind-safelist.mjs from tailwind.preset.cjs.
2
+ // Do not edit; run `npm run build-tokens`.
3
+ /** The eidotter font-size keys (`text-<key>` classes), registered with tailwind-merge by cn(). */
4
+ export const DOS_FONT_SIZES = [
5
+ 'dos-text-base',
6
+ 'dos-text-xs',
7
+ 'dos-text-sm',
8
+ 'dos-text-md',
9
+ 'dos-text-lg',
10
+ 'dos-text-xl',
11
+ 'dos-display-xs',
12
+ 'dos-display-sm',
13
+ 'dos-display-md',
14
+ 'dos-display-lg',
15
+ 'dos-display-xl',
16
+ 'dos-display-2xl',
17
+ ];
package/llms.txt CHANGED
@@ -28,7 +28,7 @@ Apps default to the amber theme and offer the light theme via a consistent setti
28
28
  ## Upgrading
29
29
  - Every minor with breaking/visible changes ships a guide at `node_modules/eidotter/migrations/<version>.md` (index: `migrations/README.md`).
30
30
  - Read every guide between the installed and the target version, oldest first, and follow its checklist. First guide: `migrations/0.41.0.md`.
31
- - 0.x caret gotcha: `^0.40.x` never resolves to 0.41.0; bump the range explicitly.
31
+ - 0.x caret gotcha: `^0.40.x` never resolves to 0.41.0; bump the range explicitly, to `^0.41.2` (0.41.0 shipped before its review fixes).
32
32
 
33
33
  ## Token Categories
34
34
  - `--color-semantic-*`: USE THESE for components (background, text, border, status)
@@ -10,6 +10,8 @@ You are reading this from `node_modules/eidotter/migrations/0.41.0.md`, or from
10
10
  the repository's `migrations/` folder. If you are upgrading across several
11
11
  minors, read [`README.md`](./README.md) in this folder first.
12
12
 
13
+ > **Install 0.41.1 or later.** 0.41.0 was published before the release review fixes. It lacks the eidotter token utilities that section 2 promises, its reset still cancels Tailwind v4 utilities, and `Stat` loses its colours. 0.41.1 fixes all of this with no API change, and everything in this guide applies to it.
14
+
13
15
  ## Who must act
14
16
 
15
17
  Every consumer. 0.41.0 is a 0.x **minor**, so it carries visible changes, and a
@@ -49,7 +51,7 @@ Older ranges such as `^0.38.0`, `^0.37.0` or `^0.33.0` are the same: none of
49
51
  them reach 0.41.0. Change the range explicitly:
50
52
 
51
53
  ```bash
52
- npm install eidotter@^0.41.0
54
+ npm install eidotter@^0.41.2
53
55
  # check what actually resolved
54
56
  npm ls eidotter
55
57
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eidotter",
3
- "version": "0.41.0",
3
+ "version": "0.41.2",
4
4
  "type": "module",
5
5
  "description": "A DOS Themed Design System",
6
6
  "main": "./dist/index.umd.js",
@@ -88,7 +88,7 @@
88
88
  "fetch-icons": "node scripts/icons/fetch-svgs.mjs",
89
89
  "generate-icons": "node scripts/icons/build-tsx.mjs && node scripts/icons/build-barrels.mjs",
90
90
  "prepublishOnly": "npm run build",
91
- "build-tokens": "node style-dictionary.config.mjs && node scripts/generate-shadcn-shim.mjs",
91
+ "build-tokens": "node style-dictionary.config.mjs && node scripts/generate-shadcn-shim.mjs && node scripts/generate-tailwind-safelist.mjs",
92
92
  "lint": "eslint src/ --report-unused-disable-directives --max-warnings 0",
93
93
  "lint-tokens": "node scripts/lint-token-refs.mjs",
94
94
  "check-contrast": "node scripts/check-contrast.mjs",
@@ -43,9 +43,12 @@
43
43
  font-synthesis: none;
44
44
  }
45
45
 
46
- /* Text floor (DMNC-1579): nothing in eidotter renders below 16px (--typography-font-size-text-base,
47
- * Tailwind text-dos-text-base). The DOS VGA font's native cell is 9x16, so 16px is the authentic
48
- * size. The preset aliases Tailwind text-xs/text-sm to the same 1rem. Never go below body size.
46
+ /* Text floor (DMNC-1579): body text, labels and controls never render below 16px
47
+ * (--typography-font-size-text-base, Tailwind text-dos-text-base). The DOS VGA font's native cell
48
+ * is 9x16, so 16px is the authentic size. The preset aliases Tailwind text-xs/text-sm to the same
49
+ * 1rem. Named exceptions, and the only ones: em-relative secondary glyphs that scale with their
50
+ * parent (CalendarHeatmap day labels 0.6em, ProgressRing centre label 0.5em, Stat/VitalsStrip unit
51
+ * suffix 0.5em of the display-size value). LegalPage sits on the floor since DMNC-1610.
49
52
  */
50
53
 
51
54
  /* Body tier — JetBrains Mono Nerd Font (multi-weight; includes Nerd Font glyphs).
@@ -8,8 +8,9 @@
8
8
  * then delete your own :root/.dark/etc. colour definitions. Re-themes via
9
9
  * [data-theme]. Opt-in — NOT part of eidotter/styles.
10
10
  *
11
- * sidebar-* and chart-* are best-effort amber-family aliases; override per
12
- * surface for real sidebar/data-viz needs.
11
+ * sidebar-* are best-effort aliases of the core roles; chart-* are five
12
+ * series chosen per theme (>=3:1 on --background, pairwise distinct).
13
+ * Override per surface for real sidebar/data-viz needs.
13
14
  * ========================================================================== */
14
15
 
15
16
  :root {
@@ -41,9 +42,9 @@
41
42
  --sidebar-border: 37 75% 41%;
42
43
  --sidebar-ring: 45 77% 55%;
43
44
  --chart-1: 41 100% 50%;
44
- --chart-2: 34 100% 30%;
45
+ --chart-2: 37 75% 41%;
45
46
  --chart-3: 27 96% 81%;
46
- --chart-4: 45 77% 55%;
47
+ --chart-4: 40 66% 48%;
47
48
  --chart-5: 34 100% 30%;
48
49
  }
49
50
 
@@ -78,7 +79,7 @@
78
79
  --chart-1: 41 100% 50%;
79
80
  --chart-2: 37 75% 41%;
80
81
  --chart-3: 27 96% 81%;
81
- --chart-4: 45 77% 55%;
82
+ --chart-4: 40 66% 48%;
82
83
  --chart-5: 34 100% 30%;
83
84
  }
84
85
 
@@ -111,10 +112,10 @@
111
112
  --sidebar-border: 37 5% 66%;
112
113
  --sidebar-ring: 41 100% 50%;
113
114
  --chart-1: 41 100% 50%;
114
- --chart-2: 30 100% 33%;
115
- --chart-3: 27 96% 81%;
116
- --chart-4: 41 100% 50%;
117
- --chart-5: 34 100% 30%;
115
+ --chart-2: 180 100% 67%;
116
+ --chart-3: 300 100% 67%;
117
+ --chart-4: 120 100% 67%;
118
+ --chart-5: 37 5% 66%;
118
119
  }
119
120
 
120
121
  [data-theme="cga-mode4-p0"], .theme-cga-mode4-p0 {
@@ -146,10 +147,10 @@
146
147
  --sidebar-border: 120 100% 50%;
147
148
  --sidebar-ring: 60 100% 50%;
148
149
  --chart-1: 60 100% 50%;
149
- --chart-2: 60 100% 50%;
150
- --chart-3: 60 100% 50%;
151
- --chart-4: 120 100% 50%;
152
- --chart-5: 120 100% 50%;
150
+ --chart-2: 120 100% 50%;
151
+ --chart-3: 0 100% 50%;
152
+ --chart-4: 180 100% 33%;
153
+ --chart-5: 0 0% 100%;
153
154
  }
154
155
 
155
156
  [data-theme="cga-mode4-p1"], .theme-cga-mode4-p1 {
@@ -181,10 +182,10 @@
181
182
  --sidebar-border: 180 100% 50%;
182
183
  --sidebar-ring: 38 100% 98%;
183
184
  --chart-1: 180 100% 50%;
184
- --chart-2: 38 100% 98%;
185
+ --chart-2: 300 100% 50%;
185
186
  --chart-3: 38 100% 98%;
186
- --chart-4: 180 100% 50%;
187
- --chart-5: 180 100% 50%;
187
+ --chart-4: 120 100% 33%;
188
+ --chart-5: 0 100% 67%;
188
189
  }
189
190
 
190
191
  [data-theme="cga-mode5"], .theme-cga-mode5 {
@@ -216,10 +217,10 @@
216
217
  --sidebar-border: 180 100% 50%;
217
218
  --sidebar-ring: 38 100% 98%;
218
219
  --chart-1: 180 100% 50%;
219
- --chart-2: 38 100% 98%;
220
+ --chart-2: 0 100% 50%;
220
221
  --chart-3: 38 100% 98%;
221
- --chart-4: 180 100% 50%;
222
- --chart-5: 180 100% 50%;
222
+ --chart-4: 120 100% 33%;
223
+ --chart-5: 180 100% 33%;
223
224
  }
224
225
 
225
226
  [data-theme="light"], .theme-light {
@@ -250,11 +251,11 @@
250
251
  --sidebar-accent-foreground: 33 17% 10%;
251
252
  --sidebar-border: 40 18% 80%;
252
253
  --sidebar-ring: 34 100% 30%;
253
- --chart-1: 41 100% 50%;
254
+ --chart-1: 34 100% 30%;
254
255
  --chart-2: 39 8% 40%;
255
- --chart-3: 41 100% 44%;
256
- --chart-4: 34 100% 30%;
257
- --chart-5: 42 83% 91%;
256
+ --chart-3: 34 100% 24%;
257
+ --chart-4: 28 74% 21%;
258
+ --chart-5: 33 17% 10%;
258
259
  }
259
260
 
260
261
  [data-theme="amber-paper"], .theme-amber-paper {
@@ -286,8 +287,8 @@
286
287
  --sidebar-border: 280 100% 1%;
287
288
  --sidebar-ring: 280 100% 1%;
288
289
  --chart-1: 280 100% 1%;
289
- --chart-2: 28 74% 21%;
290
- --chart-3: 22 87% 9%;
291
- --chart-4: 37 100% 5%;
292
- --chart-5: 29 80% 16%;
290
+ --chart-2: 25 83% 14%;
291
+ --chart-3: 28 74% 21%;
292
+ --chart-4: 34 100% 24%;
293
+ --chart-5: 0 100% 33%;
293
294
  }
@@ -47,7 +47,7 @@
47
47
  --typography-font-family-primary: 'Perfect DOS VGA 437', monospace; /** Perfect DOS VGA 437 by Zeh Fernando (free-for-any-use; ships with bundled LICENSE.txt). Pixel-perfect-vector TTF — every glyph outline is axis-aligned, scales cleanly to any size. The `monospace` fallback preserves DOS aesthetic on @font-face failure. Used for display/heading tiers (dos-hero, dos-h1…h5). */
48
48
  --typography-font-family-body: 'JetBrains Mono Nerd Font', monospace; /** JetBrains Mono Nerd Font (OFL-1.1; ships with bundled JetBrainsMonoNerdFont_OFL.txt). Multi-weight monospace body font — includes Nerd Font glyph extensions (powerline, devicons, language logos) for terminal-aesthetic UIs alongside pixelarticons. Ships as four per-weight woff2 files (Regular/Medium/SemiBold/Bold). Used for body/prose tiers (dos-body, dos-body-lg, dos-caption, dos-micro). Use fontWeight.body-* tokens for real weight variation (DMNC-885). */
49
49
  --typography-font-family-fallback: monospace; /** Bare `monospace` stack — fail-loud diagnostic counterpart to `primary`. Compose with `primary` when consumers want strict Perfect-DOS-or-nothing rendering. */
50
- --typography-font-size-text-base: 1rem; /** 16px — body floor (DOS VGA native 9x16 cell); nothing in eidotter renders text smaller (DMNC-1579) */
50
+ --typography-font-size-text-base: 1rem; /** 16px — body floor (DOS VGA native 9x16 cell) for body text, labels and controls (DMNC-1579). Named exceptions: em-relative secondary glyphs that scale with their parent (CalendarHeatmap day labels 0.6em, ProgressRing centre label 0.5em, Stat/VitalsStrip unit suffix 0.5em of the display-size value) */
51
51
  --typography-font-size-text-xs: 1.125rem; /** 18px — smallest body text */
52
52
  --typography-font-size-text-sm: 1.25rem; /** 20px — secondary body text */
53
53
  --typography-font-size-text-md: 1.375rem; /** 22px — default body text */