eidotter 0.19.1 → 0.20.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/README.md CHANGED
@@ -12,9 +12,7 @@ npm install eidotter
12
12
 
13
13
  ```tsx
14
14
  import { Terminal, Button, Alert } from 'eidotter';
15
- import 'eidotter/fonts.css'; // Flexi IBM VGA True @font-face (required)
16
- import 'eidotter/styles'; // Component CSS (includes Tailwind utilities)
17
- import 'eidotter/tokens.css'; // Design token CSS variables (required)
15
+ import 'eidotter/styles'; // All styles: fonts, tokens, components
18
16
 
19
17
  function App() {
20
18
  return (
@@ -32,18 +30,35 @@ function App() {
32
30
 
33
31
  ### Basic (no Tailwind needed)
34
32
 
35
- Import the styles, tokens, and font. All component styling is pre-compiled — no build tools required.
33
+ Import the styles. All component styling, fonts, and design tokens are pre-compiled — no build tools required.
36
34
 
37
35
  ```tsx
38
- import 'eidotter/fonts.css'; // Flexi IBM VGA True @font-face (required)
39
- import 'eidotter/styles'; // Component CSS (includes Tailwind utilities)
40
- import 'eidotter/tokens.css'; // CSS variable definitions
36
+ import 'eidotter/styles'; // Fonts, tokens, components, Tailwind utilities
41
37
 
42
38
  // Optional: import a theme
43
39
  import 'eidotter/themes/amber-mono.css';
40
+
41
+ // Optional (v0.19.4+): DOS typography utility classes for raw HTML / MDX / prose
42
+ // 12 classes: .dos-page, .dos-hero, .dos-h1–.dos-h5, .dos-body, .dos-body-lg,
43
+ // .dos-caption, .dos-micro, .dos-label, .dos-code, .dos-scanlines
44
+ import 'eidotter/utilities';
45
+ ```
46
+
47
+ Individual imports are still available for granular control:
48
+
49
+ ```tsx
50
+ import 'eidotter/fonts.css'; // Flexi IBM VGA True @font-face
51
+ import 'eidotter/tokens.css'; // CSS variable definitions
52
+ import 'eidotter/styles'; // Component CSS + Tailwind utilities
53
+ import 'eidotter/utilities'; // Opt-in .dos-* typography classes (v0.19.4+)
44
54
  ```
45
55
 
46
- **Font:** eiDotter uses [Flexi IBM VGA True v2](https://int10h.org/blog/2018/05/flexi-ibm-vga-scalable-truetype-font/) — an aspect-corrected vector remake of the IBM VGA BIOS font (CC BY-SA 4.0). The "True" variant matches authentic 4:3 VGA proportions with an extended character set (Greek, Cyrillic, Hebrew, Latin). The `fonts.css` import loads the bundled TTF via `@font-face`. No fallback fonts are configured so you'll immediately see if the font isn't loading.
56
+ **Font:** eiDotter uses [Flexi IBM VGA True v2](https://int10h.org/blog/2018/05/flexi-ibm-vga-scalable-truetype-font/) — an aspect-corrected vector remake of the IBM VGA BIOS font (CC BY-SA 4.0). The "True" variant matches authentic 4:3 VGA proportions with an extended character set (Greek, Cyrillic, Hebrew, Latin). The `fonts.css` import loads the bundled TTF via `@font-face`.
57
+
58
+ Two fontFamily tokens are exported, with distinct intent:
59
+
60
+ - **`font-dos`** → `"Flexi IBM VGA True", monospace` — the default. Preserves the terminal aesthetic on degraded `@font-face` loads (strict CSP, web-fonts disabled, reader mode).
61
+ - **`font-dos-fallback`** → `monospace` only — intentionally bare, as a **fail-loud diagnostic** utility for surfaces that want to surface font-loading failures explicitly. Compose `font-dos font-dos-fallback` when you want strict Flexi-or-nothing behavior.
47
62
 
48
63
  ### With Tailwind CSS
49
64
 
@@ -68,13 +83,20 @@ module.exports = {
68
83
  </div>
69
84
  ```
70
85
 
71
- For React Aria state variants and animations, use the enhanced preset:
86
+ The preset auto-registers `tailwindcss-react-aria-components` and `tailwindcss-animate` via require-if-available. Consumers who already list either plugin in their own Tailwind config may see duplicate-variant warnings from Tailwind — either rely on the preset's registration alone, or pass those plugins explicitly in your config (they're idempotent, but the duplicate registration is noisy).
72
87
 
73
- ```js
74
- presets: [require('eidotter/tailwind.preset.enhanced')],
88
+ #### Migration from 0.19.1 and earlier
89
+
90
+ In 0.19.2 the two older presets (`eidotter/tailwind.preset` and `eidotter/tailwind.preset.enhanced`) were merged into a single `eidotter/tailwind.preset` that includes all tokens plus the React Aria + animate plugins. The enhanced subpath is now a deprecated alias that logs a one-time `console.warn` on load and will be removed in 0.21.0:
91
+
92
+ ```diff
93
+ - presets: [require('eidotter/tailwind.preset.enhanced')]
94
+ + presets: [require('eidotter/tailwind.preset')]
75
95
  ```
76
96
 
77
- ## Available Components (33)
97
+ No behavior change — the merged preset already carries everything the enhanced preset used to add.
98
+
99
+ ## Available Components (36)
78
100
 
79
101
  | Component | Description |
80
102
  |-----------|-------------|
@@ -89,12 +111,15 @@ presets: [require('eidotter/tailwind.preset.enhanced')],
89
111
  | ChatInput | Multiline textarea with Enter-to-send |
90
112
  | ChatContainer | Composes ChatHistory + ChatInput — place inside Terminal for DOS chat |
91
113
  | Checkbox | DOS-style checkbox with `[X]` bracket indicator |
114
+ | CmdPalette | ⌘K / Ctrl+K command palette overlay with scored search + keyboard navigation |
92
115
  | CommandPrompt | Interactive command-line input with blinking cursor |
116
+ | DosFigure | Demoscene-style painted-screen media placeholder with scanline sweep + optional pins |
93
117
  | FilterBar | Multi-select toggle group for faceted filtering |
94
118
  | Footer | Site footer with legal links (Impressum + Datenschutz) |
95
119
  | Header | Sticky site header composing branding + Nav — retro/modern variants |
96
120
  | Icon | SVG icons backed by pixelarticons (MIT) — authentic DOS pixel art |
97
121
  | InlineExpand | Inline disclosure widget for expanding text within prose |
122
+ | InlineLink | In-flow navigational anchor — dotted underline, phosphor-invert hover, external variant |
98
123
  | Input | Text input with DOS styling and error variant |
99
124
  | Modal | Dialog overlay with title bar and close button |
100
125
  | Nav | Responsive navigation with desktop/mobile variants |
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import './CmdPalette.css';
3
+ export interface CmdPaletteItem {
4
+ /** Stable identifier for React keys and `onSelect` lookups. */
5
+ id: string;
6
+ /** Primary label shown in the list. Uppercase recommended. */
7
+ label: string;
8
+ /** Optional secondary hint shown on the right (shortcut, type, etc.). */
9
+ hint?: React.ReactNode;
10
+ /** Additional keywords that contribute to search matching. */
11
+ keywords?: string[];
12
+ /** Optional type tag used for grouping/filtering by callers. */
13
+ type?: string;
14
+ /** Called when the item is activated via click or Enter. */
15
+ onSelect?: (item: CmdPaletteItem) => void;
16
+ }
17
+ export interface CmdPaletteProps {
18
+ /** Controlled open state. */
19
+ open: boolean;
20
+ /**
21
+ * Called when the overlay requests open/close (Escape, backdrop click,
22
+ * item selection, hotkey toggle).
23
+ */
24
+ onOpenChange: (open: boolean) => void;
25
+ /** Items to search. Pure data — parent owns the list. */
26
+ items: CmdPaletteItem[];
27
+ /** Input placeholder. */
28
+ placeholder?: string;
29
+ /** Global activation hotkey. `"mod+k"`, `"mod+shift+p"`, or `false` to disable. */
30
+ hotkey?: string | false;
31
+ /** Message shown when search matches nothing. */
32
+ emptyMessage?: React.ReactNode;
33
+ /** Footer hint row text / JSX. Pass `null` to hide. */
34
+ footerHint?: React.ReactNode;
35
+ /** Custom renderer for each row. Falls back to label + hint. */
36
+ renderItem?: (item: CmdPaletteItem, isSelected: boolean) => React.ReactNode;
37
+ /** Cap on filtered result rows. */
38
+ maxResults?: number;
39
+ /** Extra class names merged onto the dialog container. */
40
+ className?: string;
41
+ /** Accessible dialog label. */
42
+ 'aria-label'?: string;
43
+ }
44
+ /**
45
+ * CmdPalette — ⌘K / Ctrl+K launcher overlay.
46
+ *
47
+ * Controlled component. Parent owns `open` and item list; CmdPalette handles
48
+ * search, keyboard navigation, focus management, and hotkey binding.
49
+ *
50
+ * Built on React Aria `ModalOverlay` + `Modal` + `Dialog` — same primitives
51
+ * as `<Modal>` — so focus trap, Esc-to-close, and backdrop dismissal are
52
+ * standard.
53
+ */
54
+ export declare const CmdPalette: React.ForwardRefExoticComponent<CmdPaletteProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { CmdPalette } from './CmdPalette';
2
+ export type { CmdPaletteProps, CmdPaletteItem } from './CmdPalette';
@@ -0,0 +1,2 @@
1
+ export { CmdPalette } from './components';
2
+ export type { CmdPaletteProps, CmdPaletteItem } from './components';
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import './DosFigure.css';
3
+ export interface DosFigurePin {
4
+ /** Horizontal position as a percentage (0–100). */
5
+ x: number;
6
+ /** Vertical position as a percentage (0–100). */
7
+ y: number;
8
+ /** Pin label — short; renders next to the dot. */
9
+ label: string;
10
+ }
11
+ export interface DosFigureProps {
12
+ /** Title shown in the top chrome strip. Uppercase recommended. */
13
+ title?: string;
14
+ /** Resolution tag rendered bottom-right (e.g. `"640×480"`). */
15
+ resolution?: string;
16
+ /** Subject content — ASCII, SVG, or anything you'd "paint the screen" with. */
17
+ subject: React.ReactNode;
18
+ /** Caption rendered beneath the frame via `<figcaption>`. */
19
+ caption?: React.ReactNode;
20
+ /** Optional annotation pins positioned as percentages over the subject. */
21
+ pins?: DosFigurePin[];
22
+ /** Disables the scanline-sweep animation. Defaults to true (enabled). */
23
+ animated?: boolean;
24
+ /** Accessible label when `subject` has no inherent semantics. */
25
+ 'aria-label'?: string;
26
+ /** Extra class names merged onto the `<figure>` root. */
27
+ className?: string;
28
+ }
29
+ /**
30
+ * DosFigure — demoscene-style placeholder for media.
31
+ *
32
+ * Sierra / LucasArts / demoscene title cards painted the screen with a
33
+ * limited palette, dithering, and annotated frames. DosFigure recreates
34
+ * that aesthetic: amber chrome, scanline sweep, optional pins, and a
35
+ * resolution tag. Use as a lead-in for blog articles or as a placeholder
36
+ * where a photograph would otherwise go.
37
+ *
38
+ * Not intended as a replacement for semantic imagery — pass `aria-label`
39
+ * (or a `<figcaption>` via `caption`) so the figure is meaningful to AT.
40
+ */
41
+ export declare const DosFigure: React.ForwardRefExoticComponent<DosFigureProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { DosFigure } from './DosFigure';
2
+ export type { DosFigureProps, DosFigurePin } from './DosFigure';
@@ -0,0 +1,2 @@
1
+ export { DosFigure } from './components';
2
+ export type { DosFigureProps, DosFigurePin } from './components';
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import './InlineLink.css';
3
+ export interface InlineLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> {
4
+ /** Link text. */
5
+ children: React.ReactNode;
6
+ /** Target URL. */
7
+ href: string;
8
+ /**
9
+ * Render the trailing glyph (`▸` for internal, `↗` for `external`).
10
+ * Defaults to `true`. When `false`, no glyph renders regardless of the
11
+ * `external` prop.
12
+ */
13
+ showGlyph?: boolean;
14
+ /**
15
+ * External link — adds `target="_blank"` and `rel="noopener noreferrer"`
16
+ * (safe tabnabbing defaults) and, when `showGlyph` is `true`, swaps the
17
+ * trailing glyph to `↗`. `showGlyph={false}` still suppresses the glyph.
18
+ */
19
+ external?: boolean;
20
+ /** Extra class names merged onto the root anchor. */
21
+ className?: string;
22
+ }
23
+ /**
24
+ * In-flow navigational anchor. Distinct from `<InlineExpand>` — this is a
25
+ * destination, not a disclosure.
26
+ *
27
+ * Rest: dotted amber underline, trailing `▸`.
28
+ * Hover: phosphor inversion — amber background, dark foreground.
29
+ * Visited: dimmed amber (`--color-cga-amber-dim` → brown fallback).
30
+ * External: opens in a new tab safely, trailing glyph becomes `↗`.
31
+ *
32
+ * Consumer-passed `target="_blank"` is treated as implicit-external for
33
+ * `rel` safety — a `rel` is auto-applied if none is provided, preventing
34
+ * tabnabbing even when the caller doesn't explicitly set `external`.
35
+ */
36
+ export declare const InlineLink: React.ForwardRefExoticComponent<InlineLinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,2 @@
1
+ export { InlineLink } from './InlineLink';
2
+ export type { InlineLinkProps } from './InlineLink';
@@ -0,0 +1,2 @@
1
+ export { InlineLink } from './components';
2
+ export type { InlineLinkProps } from './components';