@pudge-ui/mcp-server 0.1.0 → 0.2.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.
Files changed (114) hide show
  1. package/README.md +10 -0
  2. package/dist/tools.d.ts +25 -0
  3. package/dist/tools.js +23 -13
  4. package/package.json +5 -4
  5. package/spec/components/.gstack/browse.json.lock +1 -0
  6. package/spec/spec/components/_index.yaml +0 -822
  7. package/spec/spec/components/buttons/clear-button.md +0 -89
  8. package/spec/spec/components/buttons/fn-grid.md +0 -104
  9. package/spec/spec/components/buttons/gel-button.md +0 -125
  10. package/spec/spec/components/buttons/icon-button.md +0 -108
  11. package/spec/spec/components/buttons/keypad-button.md +0 -123
  12. package/spec/spec/components/buttons/push-button.md +0 -139
  13. package/spec/spec/components/buttons/rec-button.md +0 -105
  14. package/spec/spec/components/buttons/rubber-button.md +0 -100
  15. package/spec/spec/components/buttons/segmented-control.md +0 -95
  16. package/spec/spec/components/data/assembled-panel.md +0 -135
  17. package/spec/spec/components/data/data-table.md +0 -116
  18. package/spec/spec/components/data/film-strip.md +0 -110
  19. package/spec/spec/components/data/media-grid.md +0 -98
  20. package/spec/spec/components/dials/click-wheel.md +0 -115
  21. package/spec/spec/components/dials/cylindrical-horizontal.md +0 -130
  22. package/spec/spec/components/dials/cylindrical-scroll.md +0 -141
  23. package/spec/spec/components/dials/cylindrical-vertical.md +0 -100
  24. package/spec/spec/components/dials/mode-dial.md +0 -123
  25. package/spec/spec/components/dials/radial-knob.md +0 -150
  26. package/spec/spec/components/dials/rotary-encoder.md +0 -118
  27. package/spec/spec/components/forms/color-picker.md +0 -99
  28. package/spec/spec/components/forms/file-input.md +0 -105
  29. package/spec/spec/components/forms/search-bar.md +0 -96
  30. package/spec/spec/components/forms/select.md +0 -143
  31. package/spec/spec/components/forms/text-input.md +0 -114
  32. package/spec/spec/components/forms/textarea.md +0 -85
  33. package/spec/spec/components/indicators/accordion.md +0 -137
  34. package/spec/spec/components/indicators/badges.md +0 -87
  35. package/spec/spec/components/indicators/chips.md +0 -93
  36. package/spec/spec/components/indicators/led-dots.md +0 -103
  37. package/spec/spec/components/indicators/mode-badge.md +0 -97
  38. package/spec/spec/components/indicators/profile-badge.md +0 -99
  39. package/spec/spec/components/indicators/skeleton.md +0 -94
  40. package/spec/spec/components/indicators/spinners.md +0 -95
  41. package/spec/spec/components/indicators/status-chips.md +0 -85
  42. package/spec/spec/components/indicators/transport-controls.md +0 -114
  43. package/spec/spec/components/meters/battery-icon.md +0 -104
  44. package/spec/spec/components/meters/eq-bars.md +0 -93
  45. package/spec/spec/components/meters/ev-meter.md +0 -96
  46. package/spec/spec/components/meters/exposure-scale.md +0 -110
  47. package/spec/spec/components/meters/gauge-full.md +0 -102
  48. package/spec/spec/components/meters/gauge-semi.md +0 -113
  49. package/spec/spec/components/meters/histogram.md +0 -70
  50. package/spec/spec/components/meters/level-indicator.md +0 -95
  51. package/spec/spec/components/meters/oscilloscope.md +0 -83
  52. package/spec/spec/components/meters/progress-bar.md +0 -84
  53. package/spec/spec/components/meters/signal-bars.md +0 -80
  54. package/spec/spec/components/meters/signal-meter.md +0 -84
  55. package/spec/spec/components/meters/vu-meter.md +0 -88
  56. package/spec/spec/components/meters/waveform.md +0 -70
  57. package/spec/spec/components/navigation/breadcrumbs.md +0 -94
  58. package/spec/spec/components/navigation/context-menu.md +0 -94
  59. package/spec/spec/components/navigation/d-pad.md +0 -121
  60. package/spec/spec/components/navigation/drawer.md +0 -103
  61. package/spec/spec/components/navigation/menu-grid.md +0 -113
  62. package/spec/spec/components/navigation/menu-list.md +0 -134
  63. package/spec/spec/components/navigation/pagination.md +0 -100
  64. package/spec/spec/components/navigation/rack-panel.md +0 -124
  65. package/spec/spec/components/navigation/scrollbar.md +0 -97
  66. package/spec/spec/components/navigation/status-bar.md +0 -117
  67. package/spec/spec/components/navigation/tab-bar.md +0 -104
  68. package/spec/spec/components/overlays/chassis-panel.md +0 -94
  69. package/spec/spec/components/overlays/device-bezel.md +0 -83
  70. package/spec/spec/components/overlays/dialog.md +0 -100
  71. package/spec/spec/components/overlays/focus-brackets.md +0 -124
  72. package/spec/spec/components/overlays/grid-overlay.md +0 -93
  73. package/spec/spec/components/overlays/modal.md +0 -89
  74. package/spec/spec/components/overlays/panel.md +0 -114
  75. package/spec/spec/components/overlays/plastic-card.md +0 -92
  76. package/spec/spec/components/overlays/popover.md +0 -75
  77. package/spec/spec/components/overlays/toast.md +0 -93
  78. package/spec/spec/components/overlays/tooltip.md +0 -85
  79. package/spec/spec/components/readouts/camera-readout.md +0 -123
  80. package/spec/spec/components/readouts/dot-matrix.md +0 -88
  81. package/spec/spec/components/readouts/lcd-readout.md +0 -116
  82. package/spec/spec/components/readouts/resource-monitor.md +0 -98
  83. package/spec/spec/components/readouts/seven-segment.md +0 -110
  84. package/spec/spec/components/readouts/signal-display.md +0 -93
  85. package/spec/spec/components/readouts/timecode-display.md +0 -94
  86. package/spec/spec/components/sliders/crossfader.md +0 -102
  87. package/spec/spec/components/sliders/dual-range.md +0 -97
  88. package/spec/spec/components/sliders/range-fader.md +0 -100
  89. package/spec/spec/components/sliders/scrubber.md +0 -104
  90. package/spec/spec/components/sliders/stepper.md +0 -106
  91. package/spec/spec/components/sliders/vertical-fader.md +0 -116
  92. package/spec/spec/components/sliders/volume-slider.md +0 -107
  93. package/spec/spec/components/toggles/dip-switch.md +0 -100
  94. package/spec/spec/components/toggles/led-checkbox.md +0 -108
  95. package/spec/spec/components/toggles/power-toggle.md +0 -93
  96. package/spec/spec/components/toggles/radio-button.md +0 -106
  97. package/spec/spec/components/toggles/rocker-switch.md +0 -92
  98. package/spec/spec/components/toggles/slide-switch.md +0 -121
  99. package/spec/spec/components/toggles/toggle-switch.md +0 -135
  100. package/spec/spec/compositions/audio-mixer-strip.md +0 -62
  101. package/spec/spec/compositions/camera-viewfinder.md +0 -66
  102. package/spec/spec/compositions/phone-interface.md +0 -66
  103. package/spec/spec/foundation/accessibility.md +0 -33
  104. package/spec/spec/foundation/canvas.md +0 -20
  105. package/spec/spec/foundation/depth-model.md +0 -82
  106. package/spec/spec/foundation/layout.md +0 -33
  107. package/spec/spec/foundation/materials.md +0 -68
  108. package/spec/spec/foundation/naming.md +0 -33
  109. package/spec/spec/foundation/philosophy.md +0 -27
  110. package/spec/spec/foundation/theme.md +0 -39
  111. package/spec/spec/foundation/tokens.md +0 -148
  112. package/spec/spec/guides/extension.md +0 -189
  113. package/spec/spec/guides/for-llms.md +0 -129
  114. package/spec/spec/guides/prompt-templates.md +0 -143
@@ -1,20 +0,0 @@
1
- # Canvas-Based Components
2
-
3
- Rendering algorithms for components drawn directly to HTML5 Canvas — histogram, waveform, and oscilloscope visualizations that simulate phosphor-screen displays.
4
-
5
- ---
6
-
7
- ## Histogram (F5)
8
-
9
- Renders 200x80px luminance distribution. For each x pixel, calculate a height value using a sine-based curve with random variation, then draw a 1px-wide vertical bar with an amber gradient (`rgba(245,166,35,0.1)` to `rgba(245,166,35,0.6)`).
10
-
11
- ## Waveform (F6)
12
-
13
- Renders 200x80px audio waveform. Single stroke path using compound sine waves (`sin(x*0.08)` + `sin(x*0.03)`) with random jitter. Stroke color: `rgba(102,255,102,0.6)`, 1px line width.
14
-
15
- ## Oscilloscope (F14)
16
-
17
- Animated 200x80px trace. Uses `requestAnimationFrame` loop. Each frame:
18
- 1. Draw semi-transparent background (creates trail effect)
19
- 2. Calculate sine wave with time offset: `sin(x*0.06 + t)` + harmonics
20
- 3. Stroke with green `rgba(102,255,102,0.8)` and `shadowBlur: 4` for phosphor glow
@@ -1,82 +0,0 @@
1
- # Depth Model
2
-
3
- How raised, recessed, glowing, and textured elements are constructed using shadow stacks, inset shadows, glow effects, and CSS texture patterns. This model ensures every element feels like part of one continuous physical object.
4
-
5
- ---
6
-
7
- ## Raised Elements
8
-
9
- Three tiers of prominence:
10
-
11
- **Tier 1 — Flush** (chips, pagination buttons):
12
- - Bottom edge: `0 1px 0 border-deep`
13
- - Top highlight: `inset 0 1px 0 glossy-hi`
14
- - Press: `translateY(1px)`, shadow to `none`
15
-
16
- **Tier 2 — Standard** (buttons, tabs, controls):
17
- - Bottom edge: `0 2-3px 0 border-deep`
18
- - Top highlight: `inset 0 1px 0 border-hi`
19
- - Bottom chamfer: `inset 0 -1px 0 #111`
20
- - Press: `translateY(1-2px)`, bottom edge collapses to `0 1px 0`
21
-
22
- **Tier 3 — Elevated** (panels, cards, dialogs):
23
- - Bottom edge: `0 4px 0 border-deep`
24
- - Ambient shadow: `0 8px 24px rgba(0,0,0,0.5)`
25
- - Top highlight: `inset 0 1px 0 border-hi`
26
- - No press state (panels don't press)
27
-
28
- ## Recessed Elements
29
-
30
- All recessed elements (displays, input fields, toggle tracks, slider tracks) use:
31
- ```css
32
- box-shadow: inset 0 1px 4px rgba(0,0,0,0.4-0.9);
33
- ```
34
- The opacity varies by depth:
35
- - 0.4: shallow recess (toggle tracks, slider tracks)
36
- - 0.6: standard recess (readouts, text inputs)
37
- - 0.9: deep recess (signal displays, phosphor screens)
38
-
39
- Optional inner ring for extra depth:
40
- ```css
41
- box-shadow: inset 0 1px 4px rgba(0,0,0,0.6), inset 0 0 0 1px #181818;
42
- ```
43
-
44
- ## Glow Effects
45
-
46
- Glow simulates light emission from LEDs, phosphor screens, and active indicators:
47
-
48
- ```css
49
- /* Element glow (LEDs, active indicators) */
50
- box-shadow: 0 0 6-12px <accent-glow>;
51
-
52
- /* Text glow (readout values, display text) */
53
- text-shadow: 0 0 12-16px <accent-glow>;
54
- ```
55
-
56
- Glow radius by context:
57
- - 6px: small LEDs, indicator dots
58
- - 8px: active chips, checkbox marks
59
- - 12px: readout values, timecode
60
- - 16px: large display values
61
- - 18px: REC button recording glow
62
-
63
- ## Knurl / Texture Patterns
64
-
65
- Knurled grip textures use CSS repeating gradients:
66
-
67
- **Vertical grooves** (cylindrical dial side grips):
68
- ```css
69
- background: repeating-linear-gradient(to bottom, #252525 0px, #252525 2px, #0d0d0d 2px, #0d0d0d 5px);
70
- ```
71
-
72
- **Diamond crosshatch** (horizontal command dials):
73
- ```css
74
- background-image:
75
- repeating-linear-gradient(75deg, transparent 0px, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 3px, transparent 3px, transparent 6px),
76
- repeating-linear-gradient(-75deg, transparent 0px, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 3px, transparent 3px, transparent 6px);
77
- ```
78
-
79
- **Conic knurl ring** (rotary encoder outer edge):
80
- ```css
81
- background: repeating-conic-gradient(#202020 0deg 4deg, #0d0d0d 4deg 8deg);
82
- ```
@@ -1,33 +0,0 @@
1
- # Layout Patterns
2
-
3
- Page structure, grid system, and responsive breakpoints used to compose pudge-ui components into full layouts.
4
-
5
- ---
6
-
7
- ## Page Structure
8
-
9
- ```
10
- [Sticky Nav] — .dir-nav, position: sticky, top: 0, z-index: 100
11
- [Page Header] — .page-header, 48px padding
12
- [Section] — .section, 48px left/right padding
13
- [Section Header] — .section-header, flex baseline, bottom border
14
- [Component Row] — .component-row, flex wrap, 36px gap
15
- [Component Block] — .component-block, flex column, 10px gap
16
- [Label] — .component-label, uppercase eyebrow
17
- [Component] — the actual component
18
- [Spec Table] — .spec-table, annotation
19
- [Divider] — .divider, 1px line
20
- ```
21
-
22
- ## Grid System
23
-
24
- Panels use CSS Grid with `auto-fit` and `minmax`:
25
- ```css
26
- display: grid;
27
- grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
28
- gap: 24px;
29
- ```
30
-
31
- ## Responsive Breakpoints
32
-
33
- - **720px and below**: Padding reduces to 16px, title shrinks, component rows reflow to column
@@ -1,68 +0,0 @@
1
- # Material Recipes
2
-
3
- The six canonical physical materials used across all pudge-ui components. Each material maps to a real-world manufacturing process and defines specific CSS treatments for gradients, highlights, borders, and shadows.
4
-
5
- ---
6
-
7
- ## Brushed Metal (Anodized Aluminum)
8
- **Physical analog**: iPod back plate, MacBook Pro chassis, Nikon camera body
9
- ```css
10
- background: linear-gradient(145deg, #d8d6d0, #b8b6b0);
11
- border: 1px solid #a8a6a0;
12
- box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.5);
13
- ```
14
- **Characteristics**: Subtle diagonal gradient simulates brushed grain. High-opacity white inset highlight = polished metal catching light. Border matches mid-tone of gradient.
15
- **When to use**: Premium dials, device panels, chassis components.
16
-
17
- ## Chrome (Polished)
18
- **Physical analog**: Nikon mode dial ring, car stereo trim, iPod clickwheel ring
19
- ```css
20
- background: linear-gradient(180deg, #5a5855, #3a3835); /* dark theme */
21
- /* OR */
22
- background: linear-gradient(180deg, #e8e6e0, #c8c6c0, #d0cec8); /* light theme — triple-stop = reflection band */
23
- border: 1px solid #666;
24
- box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.06);
25
- ```
26
- **Characteristics**: Triple-stop gradient creates a reflection band. Both top and bottom inset shadows = dual chamfer typical of chrome trim.
27
- **When to use**: Accent rings, dial variants, premium trim elements.
28
-
29
- ## Rubber (Soft-Touch Matte)
30
- **Physical analog**: Gameboy buttons, camera grip, headphone ear pads
31
- ```css
32
- background: linear-gradient(180deg, var(--rubber-hi), var(--rubber-bg));
33
- border: 1px solid var(--rubber-lo);
34
- box-shadow: 0 2px 0 var(--border-deep), inset 0 1px 0 rgba(255,255,255,0.06);
35
- ```
36
- **Characteristics**: Very subtle gradient (nearly flat). Minimal highlight opacity (0.06 vs 0.14 for glossy) = matte surface. Pill-shaped border-radius (100px) feels more organic.
37
- **When to use**: Soft buttons, D-pad arms, Start/Select, grip textures.
38
-
39
- ## Glossy Polycarbonate (Gel)
40
- **Physical analog**: iPod Nano case, PSP face, early 2000s phone buttons
41
- ```css
42
- background: linear-gradient(180deg, var(--clear-glass), transparent 50%),
43
- linear-gradient(180deg, var(--bg-surface), var(--bg-panel));
44
- border: none;
45
- box-shadow: 0 3px 0 var(--border-deep), inset 0 1px 0 var(--glossy-hi);
46
- ```
47
- **Characteristics**: **Two-layer background** is critical — the first layer is a catch-light that fades halfway down. This creates the "gel" dome appearance. `--glossy-hi` (0.14 opacity white) = sharp specular highlight. 3px bottom edge shadow = thicker than rubber (polycarbonate has more depth).
48
- **When to use**: Main action buttons, media player controls, phone buttons.
49
-
50
- ## Glass (Translucent / Clear Plastic)
51
- **Physical analog**: iMac G3 clear shell, transparent phone cases, frosted diffuser
52
- ```css
53
- background: rgba(255,255,255,0.08);
54
- border: 1px solid var(--border-subtle);
55
- backdrop-filter: blur(4px);
56
- ```
57
- **Characteristics**: No gradient — flat transparency. `backdrop-filter` creates the frosted glass effect. Very subtle border. No bottom-edge shadow (glass doesn't cast the same hard edge).
58
- **When to use**: Overlay buttons, translucent panels, secondary actions.
59
-
60
- ## Phosphor Screen (LCD/OLED Display Cavity)
61
- **Physical analog**: Camera viewfinder display, VU meter face, alarm clock display
62
- ```css
63
- background: linear-gradient(180deg, #080808, #111);
64
- border: 1px solid #1f1f1f;
65
- box-shadow: inset 0 1px 8px rgba(0,0,0,0.9), inset 0 0 0 1px #181818;
66
- ```
67
- **Characteristics**: Nearly black background with slight gradient = depth in the cavity. Heavy inset shadow (0.9 opacity) = deep recess. Double inset (shadow + ring) creates the "sunken screen" look. Text on this surface always has `text-shadow` with the accent glow color = phosphor bleed.
68
- **When to use**: All readout displays, signal displays, histogram/waveform frames, seven-segment displays.
@@ -1,33 +0,0 @@
1
- # Naming Conventions
2
-
3
- CSS class naming rules for all pudge-ui components, ensuring consistent and predictable class names across the system.
4
-
5
- ---
6
-
7
- ## BEM-lite Pattern
8
-
9
- `component-element` (no `__` or `--`, use `-` throughout):
10
- - `.push-btn` (component)
11
- - `.readout-value` (element within readout)
12
- - `.dial-center-bar` (element within dial)
13
-
14
- ## State Classes
15
-
16
- Added to the component root:
17
- - `.active` — selected / on state
18
- - `.on` — power-on / enabled (for toggles)
19
- - `.pressed` — currently being pressed
20
- - `.disabled` or `[disabled]` — unavailable
21
- - `.error` — error state
22
- - `.recording` — REC active
23
-
24
- ## Material Variant Classes
25
-
26
- - `.variant-metal` — brushed aluminum
27
- - `.variant-silver` — silver anodized
28
- - `.variant-chrome` — polished chrome
29
- - `.variant-glossy` — polycarbonate gel
30
-
31
- ## Size Classes
32
-
33
- `.xs`, `.sm`, (default = md), `.lg`, `.xl`
@@ -1,27 +0,0 @@
1
- # Philosophy
2
-
3
- Core design principles that govern every visual decision in the pudge-ui design system. Every CSS property maps to a real material or manufacturing process from 2000s consumer electronics.
4
-
5
- ---
6
-
7
- ### Physical Analog Commitment
8
- Every CSS property in this system has a physical-world justification. A `box-shadow` is not decoration — it is the shadow cast by a raised button onto the panel surface beneath it. A `border-radius` is the machining tolerance of a milled edge. An `inset` shadow is light being blocked by the lip of a recessed display cavity.
9
-
10
- ### Warm Neutral Palette
11
- All grays carry a slight amber/brown warmth (`#1c1a18` not `#1c1c1c`). Pure grays read as "digital" — warm grays read as "physical material under warm tungsten workbench lighting." This is the main visual distinction from generic dark UIs.
12
-
13
- ### Three-Plane Depth Model
14
- Every raised element (buttons, panels, cards) exists in a three-layer shadow stack:
15
- 1. **Bottom edge** — the shadow cast onto the surface below
16
- 2. **Inner top highlight** — light catching the top chamfer
17
- 3. **Inner bottom shadow** — shadow on the bottom chamfer
18
-
19
- Recessed elements (displays, inputs) invert this model. This consistency is what makes the entire system feel like one physical object.
20
-
21
- ### Inversion Symmetry
22
- Raised and recessed elements use the same shadow logic, inverted:
23
- - Raised: dark below, bright above
24
- - Recessed: dark above (lip shadow), bright below (light hitting the bottom edge of the recess)
25
-
26
- ### Material Honesty
27
- Components declare which physical material they simulate. A rubber button behaves differently from a glossy polycarbonate button — different gradients, different highlight sharpness, different border treatment. The system defines six canonical materials.
@@ -1,39 +0,0 @@
1
- # Theme System
2
-
3
- How light and dark themes work in pudge-ui — the switching mechanism, what properties change between themes, and which components need explicit overrides beyond token swaps.
4
-
5
- ---
6
-
7
- ## Mechanism
8
-
9
- Theme is controlled by `data-theme` attribute on `<html>`:
10
- ```html
11
- <html lang="en" data-theme="dark">
12
- ```
13
-
14
- Toggle via JS:
15
- ```javascript
16
- document.documentElement.dataset.theme =
17
- document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark';
18
- ```
19
-
20
- ## What Changes Between Themes
21
-
22
- | Property | Dark | Light |
23
- |----------|------|-------|
24
- | Surface colors | Dark warm grays | Cream/white warm tones |
25
- | Text colors | Light on dark | Dark on light |
26
- | Border colors | Subtle dark lines | Subtle light lines |
27
- | Shadows | High opacity (0.5+) | Low opacity (0.08) |
28
- | Rubber material | Dark `#2a2826` | Light `#c8c4bc` |
29
- | Clear glass | `rgba(255,255,255,0.08)` | `rgba(255,255,255,0.5)` |
30
- | Inset shadow | Strong `rgba(0,0,0,0.6)` | Subtle `rgba(0,0,0,0.08)` |
31
- | Toggle on-state | Dark green `#0d1a0d` | Light green `#d0f0d0` |
32
-
33
- ## Components with Theme-Specific Overrides
34
-
35
- Some components need explicit `[data-theme="light"]` overrides beyond token swaps:
36
- - **Cylindrical dials**: Light backgrounds need reduced knurl opacity
37
- - **Dial vignettes**: Must match the cylinder background color
38
- - **Toggle thumbs**: Need brighter gradients in light mode
39
- - **Rubber buttons**: Active state needs light green tones
@@ -1,148 +0,0 @@
1
- # Token Reference
2
-
3
- All design tokens used across the pudge-ui system — colors, typography, spacing, radii, motion, and shadows. These tokens form the shared vocabulary for every component.
4
-
5
- ---
6
-
7
- ## Color Tokens — Surface Hierarchy
8
-
9
- | Token | Dark Mode | Light Mode | Physical Analog |
10
- |-------|-----------|------------|-----------------|
11
- | `--bg-base` | `#141210` | `#f5f0e8` | Workbench / desk surface |
12
- | `--bg-raised` | `#1c1a18` | `#ffffff` | Device chassis top plate |
13
- | `--bg-surface` | `#2a2826` | `#f0ece4` | Panel face, module front |
14
- | `--bg-inset` | `#0e0c0a` | `#e8e4dc` | Display cavity, recessed area |
15
- | `--bg-panel` | `#22201e` | `#faf6ee` | Button face, control surface |
16
-
17
- ## Color Tokens — Accents
18
-
19
- | Token | Value | Usage |
20
- |-------|-------|-------|
21
- | `--amber` | `#f5a623` | Primary active/selection indicator. The universal "this is selected" signal. |
22
- | `--amber-dim` | `#a06010` | Secondary amber: colon separators, inactive amber elements |
23
- | `--amber-glow` | `rgba(245,166,35,0.35)` | Glow halo behind active amber elements (simulates phosphor bleed) |
24
- | `--green-on` | `#33cc66` | Power-on, connected, success states |
25
- | `--green-hi` | `#66ff66` | High-brightness green: focus lock, peak meter |
26
- | `--green-glow` | `rgba(51,204,102,0.3)` | Green glow halo |
27
- | `--red-alert` | `#cc2200` | REC, error, critical battery, destructive action |
28
- | `--red-glow` | `rgba(204,34,0,0.3)` | Red glow halo |
29
- | `--blue-info` | `#4477cc` | Info states, iPod-era accent, selected items in consumer contexts |
30
- | `--blue-glow` | `rgba(68,119,204,0.3)` | Blue glow halo |
31
- | `--pink-action` | `#ee6688` | Action buttons (Gameboy A), highlights, feminine accent |
32
- | `--gold-warm` | `#ddaa33` | Premium accent, warm EQ bands |
33
-
34
- ## Color Tokens — Text
35
-
36
- | Token | Dark Mode | Light Mode |
37
- |-------|-----------|------------|
38
- | `--text-primary` | `#d8d4cc` | `#2a2826` |
39
- | `--text-secondary` | `#9a9690` | `#6a6662` |
40
- | `--text-muted` | `#6a6662` | `#9a9690` |
41
-
42
- Note: `--text-secondary` and `--text-muted` swap values between themes.
43
-
44
- ## Color Tokens — Borders
45
-
46
- | Token | Dark Mode | Light Mode | Usage |
47
- |-------|-----------|------------|-------|
48
- | `--border-deep` | `#0a0908` | `#b8b4ac` | Button bottom edge shadow line |
49
- | `--border-mid` | `#3a3835` | `#c8c4bc` | Panel seams, general borders |
50
- | `--border-subtle` | `#2a2826` | `#d8d4cc` | Dividers, section separators |
51
- | `--border-hi` | `#4a4845` | `#e8e4dc` | Top-edge highlight (light catch) |
52
-
53
- ## Typography
54
-
55
- | Token | Font Family | Role | Usage |
56
- |-------|-------------|------|-------|
57
- | `--font-display` | `Michroma` | Display / Title | Section titles, mode labels, badge letters, dial values. Geometric sans-serif that evokes consumer electronics branding. |
58
- | `--font-mono` | `IBM Plex Mono` | Data / Readout | Numeric readouts, data values, technical labels, text inputs. The workhorse monospace for all data display. |
59
- | `--font-ui` | `Rajdhani` | UI / Body | Body text, descriptions, button labels, spec tables. Semi-rounded geometric with good readability at small sizes. |
60
- | `--font-lcd` | `VT323` | Retro LCD | Optional pixel-font variant for deliberately retro LCD readouts. Used in 7-segment displays and dot-matrix marquees. |
61
-
62
- **Font size scale** (commonly used):
63
- - 7px: micro labels (mode keys, tiny annotations)
64
- - 8-9px: chip text, status labels, specs
65
- - 10-11px: button labels, UI labels, body text
66
- - 12-13px: data values, readout values (small)
67
- - 14-16px: medium readout values, keypad numbers
68
- - 20-24px: large readout values
69
- - 28-34px: hero display values, signal display
70
- - 42px: 7-segment display digits
71
-
72
- **Letter-spacing conventions**:
73
- - 0.5-1px: body text, data values
74
- - 1-2px: button labels, UI text
75
- - 2-3px: section titles, status labels
76
- - 3-4px: eyebrow text, panel labels
77
-
78
- ## Spacing Scale
79
-
80
- | Token | Value | Usage |
81
- |-------|-------|-------|
82
- | `--space-xs` | `4px` | Chip padding, tight gaps |
83
- | `--space-sm` | `8px` | Button gaps, small component padding |
84
- | `--space-md` | `14px` | Standard padding, component gaps |
85
- | `--space-lg` | `22px` | Panel padding, section gaps |
86
- | `--space-xl` | `36px` | Section spacing |
87
- | `--space-2xl` | `56px` | Page-level spacing |
88
-
89
- ## Border Radius Scale
90
-
91
- | Token | Value | Usage |
92
- |-------|-------|-------|
93
- | `--radius-sm` | `4px` | Chips, small buttons, tick marks, film frames |
94
- | `--radius-md` | `8px` | Standard buttons, readouts, inputs, tabs |
95
- | `--radius-lg` | `14px` | Panels, cards, device bezels, dialogs |
96
- | `--radius-pill` | `100px` | Pill buttons, toggle tracks, progress bars |
97
- | `--radius-round` | `50%` | Circular dials, LED dots, knobs |
98
-
99
- ## Motion / Easing
100
-
101
- | Token | Value | Physical Analog | Usage |
102
- |-------|-------|-----------------|-------|
103
- | `--snap-fast` | `cubic-bezier(0.34, 1.56, 0.64, 1)` | Mechanical detent click — slight overshoot then settle | Button press, toggle snap, segmented control switch |
104
- | `--snap-soft` | `cubic-bezier(0.16, 1, 0.3, 1)` | Drawer slide, damped return | Drawer panels, slide animations |
105
- | `--ease-out` | `cubic-bezier(0, 0, 0.2, 1)` | Meter fill, smooth deceleration | Progress bars, slider fills, meter animations |
106
- | `--spring` | `cubic-bezier(0.34, 1.3, 0.64, 1)` | Spring-loaded mechanism with overshoot | Mode dial rotation, gauge needle |
107
-
108
- **Timing conventions**:
109
- - 70-90ms: press/release (instantaneous mechanical feel)
110
- - 120-150ms: state transitions (color change, toggle snap)
111
- - 180-220ms: movement animations (toggle slide, dial rotation)
112
- - 250-350ms: larger movements (drawer open, mode dial spring)
113
-
114
- ## Shadow Tokens
115
-
116
- **Raised element shadow stacks** (3 tiers by prominence):
117
-
118
- ```css
119
- /* Small — chips, small buttons */
120
- box-shadow: 0 1px 0 var(--border-deep), inset 0 1px 0 var(--glossy-hi);
121
-
122
- /* Medium — standard buttons, controls */
123
- box-shadow: 0 2px 0 var(--border-deep), inset 0 1px 0 var(--border-hi), inset 0 -1px 0 #111;
124
-
125
- /* Large — panels, cards */
126
- box-shadow: 0 4px 0 var(--border-deep), 0 8px 24px rgba(0,0,0,0.5), inset 0 1px 0 var(--border-hi);
127
- ```
128
-
129
- **Recessed element shadow**:
130
- ```css
131
- box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
132
- ```
133
-
134
- **Press interaction** (applied on `:active`):
135
- ```css
136
- transform: translateY(1px); /* or 2px for large buttons */
137
- box-shadow: 0 1px 0 var(--border-deep); /* collapse bottom edge */
138
- ```
139
-
140
- **Glow effects**:
141
- ```css
142
- /* Amber glow (active indicators) */
143
- box-shadow: 0 0 8px rgba(245,166,35,0.35);
144
- text-shadow: 0 0 14px rgba(245,166,35,0.35);
145
-
146
- /* Green glow (on-state) */
147
- box-shadow: 0 0 8px rgba(51,204,102,0.3);
148
- ```
@@ -1,189 +0,0 @@
1
- # Extension Guide — Adding New Components
2
-
3
- This guide explains how to create new pudge-ui components that fit the design system.
4
-
5
- ## The Spec File Template
6
-
7
- Every component spec file follows this structure:
8
-
9
- ```markdown
10
- ---
11
- name: Component Name
12
- id: kebab-case-id
13
- class: .css-class-name
14
- category: category-folder
15
- index: N
16
- materials: [default, metal, chrome, glossy, rubber, glass]
17
- sizes: [xs, sm, md, lg, xl]
18
- interactive: true
19
- requires_js: false
20
- canvas: false
21
- ---
22
-
23
- # Component Name
24
-
25
- ## Physical Analog
26
- **Reference devices**: Specific 2000s products with model numbers.
27
- **Mechanism**: How the physical mechanism works — the material science,
28
- the forces involved, the geometry.
29
-
30
- ## Geometry
31
- | Property | Value | Physical Reason |
32
- |----------|-------|-----------------|
33
- | Height | Npx | What real-world dimension this represents |
34
- | Width | Npx | — |
35
- | Border-radius | Npx | Machining tolerance or mold radius |
36
-
37
- ## CSS Recipe
38
- ### Default State
39
- \`\`\`css
40
- .component-name {
41
- /* Full CSS recipe */
42
- }
43
- \`\`\`
44
- ### Hover
45
- \`\`\`css
46
- .component-name:hover { }
47
- \`\`\`
48
- ### Active / Pressed
49
- \`\`\`css
50
- .component-name:active { }
51
- \`\`\`
52
- ### Disabled
53
- \`\`\`css
54
- .component-name:disabled { }
55
- \`\`\`
56
-
57
- ## HTML Structure
58
- \`\`\`html
59
- <element class="component-name [variants]">content</element>
60
- \`\`\`
61
-
62
- ## Size Variants
63
- | Class | Analog | Height | Min-Width |
64
- |-------|--------|--------|-----------|
65
-
66
- ## Material Variants
67
- | Class | Material | Visual Change |
68
- |-------|----------|---------------|
69
-
70
- ## Theme Behavior
71
- What changes between dark and light themes.
72
-
73
- ## Constraints
74
- 1. MUST: [rule with physical reasoning]
75
- 2. MUST NOT: [rule with physical reasoning]
76
-
77
- ## Accessibility
78
- - Element type and ARIA role
79
- - Keyboard interaction pattern
80
- - Focus behavior
81
- ```
82
-
83
- ## Step-by-Step Process
84
-
85
- ### Step 1: Choose a Physical Analog
86
-
87
- Every pudge-ui component MUST have a real-world 2000s-era electronics counterpart. This is not optional — it's what makes the system work. Ask yourself:
88
- - What physical device from 2000-2010 had this control?
89
- - How did the mechanism actually work?
90
- - What material was it made from?
91
- - What did it feel like to operate?
92
-
93
- Good analogs: Sony Walkman play button, Nokia phone keypad, iPod click wheel, Nikon mode dial, Mackie mixer fader, Roland synthesizer knob.
94
-
95
- ### Step 2: Select a Material
96
-
97
- Choose from the 6 canonical materials defined in `foundation/materials.md`:
98
-
99
- | Material | When to use |
100
- |----------|-------------|
101
- | Brushed Metal | Premium controls, device chassis, high-end knobs |
102
- | Chrome | Accent rings, trim, dial rings |
103
- | Rubber | Grip surfaces, soft-touch buttons, D-pad arms |
104
- | Glossy Polycarbonate | Consumer electronics buttons, cases, glossy controls |
105
- | Glass | Translucent overlays, frosted panels |
106
- | Phosphor Screen | All displays and readout cavities |
107
-
108
- If your component supports multiple materials, make the most common one the default and add `.variant-*` classes for others.
109
-
110
- ### Step 3: Apply the Depth Model
111
-
112
- Consult `foundation/depth-model.md`:
113
-
114
- - **Raised element?** (proud of the surface) → Use the appropriate shadow tier:
115
- - Tier 1 (flush): chips, pagination buttons — 1px bottom shadow
116
- - Tier 2 (standard): buttons, controls — 2-3px bottom shadow + chamfer highlights
117
- - Tier 3 (elevated): panels, cards — 4px bottom shadow + ambient shadow
118
-
119
- - **Recessed element?** (inset into the surface) → Use inset shadow:
120
- - Shallow: `inset 0 1px 4px rgba(0,0,0,0.4)` (toggle tracks)
121
- - Standard: `inset 0 1px 4px rgba(0,0,0,0.6)` (readouts, inputs)
122
- - Deep: `inset 0 1px 8px rgba(0,0,0,0.9)` (signal displays)
123
-
124
- - **Glowing element?** → Add glow with accent color at 6-16px radius.
125
-
126
- ### Step 4: Set Typography
127
-
128
- | Content type | Font token |
129
- |-------------|-----------|
130
- | Display values, titles, mode labels | `--font-display` (Michroma) |
131
- | Data values, readouts, code | `--font-mono` (IBM Plex Mono) |
132
- | Labels, body text, UI elements | `--font-ui` (Rajdhani) |
133
- | Retro LCD characters | `--font-lcd` (VT323) |
134
-
135
- ### Step 5: Define States
136
-
137
- Every interactive component needs at minimum:
138
- - **Default**: base appearance
139
- - **Hover**: subtle highlight (text brightening or border change)
140
- - **Active / Pressed**: `translateY(1-2px)` + shadow collapse
141
- - **Disabled**: `opacity: 0.35`, `pointer-events: none`
142
-
143
- Optional states:
144
- - **Active (selected)**: amber accent color + glow
145
- - **Error**: red accent color
146
- - **Loading**: pulse animation
147
-
148
- ### Step 6: Support Both Themes
149
-
150
- Check your component in both `[data-theme="dark"]` and `[data-theme="light"]`. Most components adapt via token values automatically. Add explicit `[data-theme="light"]` overrides only for:
151
- - Gradients with hardcoded dark colors
152
- - Knurl/texture patterns (reduce opacity in light mode)
153
- - Material-specific shadows
154
-
155
- ### Step 7: Write the Constraints
156
-
157
- The Constraints section is the most important part of the spec. Write in imperative language (MUST, MUST NOT) and always explain WHY with physical reasoning:
158
-
159
- **Good constraint**: "Travel MUST be 1-2px maximum. More feels like a keyboard key, not a camera button — real dome switches have only 0.3-0.5mm travel."
160
-
161
- **Bad constraint**: "Keep the animation subtle." (too vague, no physical reasoning)
162
-
163
- ### Step 8: Follow Naming Conventions
164
-
165
- - Component class: `kebab-case` noun (e.g., `range-slider`)
166
- - Element class: `component-element` (e.g., `range-slider-thumb`)
167
- - State class: adjective (e.g., `.active`, `.on`, `.error`)
168
- - Size class: `.xs`, `.sm`, `.lg`, `.xl`
169
- - Material class: `.variant-metal`, `.variant-chrome`, etc.
170
-
171
- ## Checklist
172
-
173
- Before submitting a new component:
174
-
175
- - [ ] Physical analog documented (specific 2000s device/mechanism)
176
- - [ ] Mechanical principle explained (how the physical thing works)
177
- - [ ] Material recipe applied from `materials.md`
178
- - [ ] Shadow stack follows `depth-model.md` (raised or recessed)
179
- - [ ] CSS Recipe uses exact values (not prose approximations)
180
- - [ ] HTML structure is minimal and semantic
181
- - [ ] All states defined (default, hover, active, disabled)
182
- - [ ] Size variants follow the existing scale (xs/sm/md/lg/xl)
183
- - [ ] Typography uses system font tokens
184
- - [ ] Works in dark theme
185
- - [ ] Works in light theme
186
- - [ ] Constraints use MUST/MUST NOT with physical reasoning
187
- - [ ] Accessibility documented (element type, ARIA, keyboard)
188
- - [ ] Named following conventions
189
- - [ ] Added to `_index.yaml` catalog