@adia-ai/web-components 0.3.0 → 0.3.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.
Files changed (123) hide show
  1. package/components/card/card.js +1 -1
  2. package/components/nav-group/nav-group.css +2 -0
  3. package/components/nav-item/nav-item.css +2 -1
  4. package/components/row/row.js +1 -1
  5. package/package.json +2 -2
  6. package/styles/README.md +286 -0
  7. package/traits/{active-state.js → active-state/active-state.js} +1 -1
  8. package/traits/{active-state.test.js → active-state/active-state.test.js} +1 -1
  9. package/traits/{anchor-positioning.js → anchor-positioning/anchor-positioning.js} +1 -1
  10. package/traits/{anchor-positioning.test.js → anchor-positioning/anchor-positioning.test.js} +1 -1
  11. package/traits/{announcer.js → announcer/announcer.js} +1 -1
  12. package/traits/{announcer.test.js → announcer/announcer.test.js} +1 -1
  13. package/traits/{arrow-grid-nav.js → arrow-grid-nav/arrow-grid-nav.js} +1 -1
  14. package/traits/{arrow-grid-nav.test.js → arrow-grid-nav/arrow-grid-nav.test.js} +1 -1
  15. package/traits/{attention-pulse.js → attention-pulse/attention-pulse.js} +2 -2
  16. package/traits/{attention-pulse.test.js → attention-pulse/attention-pulse.test.js} +1 -1
  17. package/traits/{confetti.js → confetti/confetti.js} +2 -2
  18. package/traits/{confetti.test.js → confetti/confetti.test.js} +1 -1
  19. package/traits/{confetti-burst.js → confetti-burst/confetti-burst.js} +3 -3
  20. package/traits/{confetti-burst.test.js → confetti-burst/confetti-burst.test.js} +2 -2
  21. package/traits/{count-up.js → count-up/count-up.js} +2 -2
  22. package/traits/{count-up.test.js → count-up/count-up.test.js} +1 -1
  23. package/traits/declarative.test.js +3 -3
  24. package/traits/{dirty-state.js → dirty-state/dirty-state.js} +1 -1
  25. package/traits/{dirty-state.test.js → dirty-state/dirty-state.test.js} +1 -1
  26. package/traits/{drag-ghost.js → drag-ghost/drag-ghost.js} +1 -1
  27. package/traits/{drag-ghost.test.js → drag-ghost/drag-ghost.test.js} +1 -1
  28. package/traits/{draggable.js → draggable/draggable.js} +1 -1
  29. package/traits/{draggable.test.js → draggable/draggable.test.js} +1 -1
  30. package/traits/{draggable-list-item.js → draggable-list-item/draggable-list-item.js} +2 -2
  31. package/traits/{draggable-list-item.test.js → draggable-list-item/draggable-list-item.test.js} +1 -1
  32. package/traits/{drop-target.js → drop-target/drop-target.js} +1 -1
  33. package/traits/{drop-target.test.js → drop-target/drop-target.test.js} +1 -1
  34. package/traits/{droppable.js → droppable/droppable.js} +1 -1
  35. package/traits/{droppable.test.js → droppable/droppable.test.js} +1 -1
  36. package/traits/{droppable-collection.js → droppable-collection/droppable-collection.js} +1 -1
  37. package/traits/{droppable-collection.test.js → droppable-collection/droppable-collection.test.js} +1 -1
  38. package/traits/{error-shake.js → error-shake/error-shake.js} +2 -2
  39. package/traits/{error-shake.test.js → error-shake/error-shake.test.js} +1 -1
  40. package/traits/{fade-presence.js → fade-presence/fade-presence.js} +1 -1
  41. package/traits/{fade-presence.test.js → fade-presence/fade-presence.test.js} +1 -1
  42. package/traits/{focus-restore.js → focus-restore/focus-restore.js} +1 -1
  43. package/traits/{focus-restore.test.js → focus-restore/focus-restore.test.js} +1 -1
  44. package/traits/{focus-trap.js → focus-trap/focus-trap.js} +1 -1
  45. package/traits/{focus-trap.test.js → focus-trap/focus-trap.test.js} +1 -1
  46. package/traits/{focusable.js → focusable/focusable.js} +1 -1
  47. package/traits/{focusable.test.js → focusable/focusable.test.js} +1 -1
  48. package/traits/{glow-focus.js → glow-focus/glow-focus.js} +2 -2
  49. package/traits/{glow-focus.test.js → glow-focus/glow-focus.test.js} +1 -1
  50. package/traits/{gradient-shift.js → gradient-shift/gradient-shift.js} +2 -2
  51. package/traits/{gradient-shift.test.js → gradient-shift/gradient-shift.test.js} +1 -1
  52. package/traits/{haptic-feedback.js → haptic-feedback/haptic-feedback.js} +1 -1
  53. package/traits/{haptic-feedback.test.js → haptic-feedback/haptic-feedback.test.js} +1 -1
  54. package/traits/{hotkey.js → hotkey/hotkey.js} +1 -1
  55. package/traits/{hotkey.test.js → hotkey/hotkey.test.js} +1 -1
  56. package/traits/{hoverable.js → hoverable/hoverable.js} +1 -1
  57. package/traits/{hoverable.test.js → hoverable/hoverable.test.js} +1 -1
  58. package/traits/index.js +56 -56
  59. package/traits/{inertia-drag.js → inertia-drag/inertia-drag.js} +1 -1
  60. package/traits/{inertia-drag.test.js → inertia-drag/inertia-drag.test.js} +1 -1
  61. package/traits/{input-mask.js → input-mask/input-mask.js} +1 -1
  62. package/traits/{input-mask.test.js → input-mask/input-mask.test.js} +1 -1
  63. package/traits/{intersection-observer.js → intersection-observer/intersection-observer.js} +1 -1
  64. package/traits/{intersection-observer.test.js → intersection-observer/intersection-observer.test.js} +1 -1
  65. package/traits/{keyboard-nav.js → keyboard-nav/keyboard-nav.js} +1 -1
  66. package/traits/{keyboard-nav.test.js → keyboard-nav/keyboard-nav.test.js} +1 -1
  67. package/traits/{keyboard-reorderable.js → keyboard-reorderable/keyboard-reorderable.js} +2 -2
  68. package/traits/{keyboard-reorderable.test.js → keyboard-reorderable/keyboard-reorderable.test.js} +1 -1
  69. package/traits/{layout-animation.js → layout-animation/layout-animation.js} +2 -2
  70. package/traits/{layout-animation.test.js → layout-animation/layout-animation.test.js} +1 -1
  71. package/traits/{long-press.js → long-press/long-press.js} +1 -1
  72. package/traits/{long-press.test.js → long-press/long-press.test.js} +1 -1
  73. package/traits/{magnetic-hover.js → magnetic-hover/magnetic-hover.js} +2 -2
  74. package/traits/{magnetic-hover.test.js → magnetic-hover/magnetic-hover.test.js} +1 -1
  75. package/traits/{noise-texture.js → noise-texture/noise-texture.js} +1 -1
  76. package/traits/{noise-texture.test.js → noise-texture/noise-texture.test.js} +1 -1
  77. package/traits/{parallax.js → parallax/parallax.js} +2 -2
  78. package/traits/{parallax.test.js → parallax/parallax.test.js} +1 -1
  79. package/traits/{portal.js → portal/portal.js} +1 -1
  80. package/traits/{portal.test.js → portal/portal.test.js} +1 -1
  81. package/traits/{pressable.js → pressable/pressable.js} +1 -1
  82. package/traits/{pressable.test.js → pressable/pressable.test.js} +1 -1
  83. package/traits/{resettable.js → resettable/resettable.js} +1 -1
  84. package/traits/{resettable.test.js → resettable/resettable.test.js} +1 -1
  85. package/traits/{resizable.js → resizable/resizable.js} +1 -1
  86. package/traits/{resizable.test.js → resizable/resizable.test.js} +1 -1
  87. package/traits/{resize-observer.js → resize-observer/resize-observer.js} +1 -1
  88. package/traits/{resize-observer.test.js → resize-observer/resize-observer.test.js} +1 -1
  89. package/traits/{ripple.js → ripple/ripple.js} +2 -2
  90. package/traits/{ripple.test.js → ripple/ripple.test.js} +1 -1
  91. package/traits/{roving-tabindex.js → roving-tabindex/roving-tabindex.js} +1 -1
  92. package/traits/{roving-tabindex.test.js → roving-tabindex/roving-tabindex.test.js} +1 -1
  93. package/traits/{scale-press.js → scale-press/scale-press.js} +1 -1
  94. package/traits/{scale-press.test.js → scale-press/scale-press.test.js} +1 -1
  95. package/traits/{scroll-lock.js → scroll-lock/scroll-lock.js} +1 -1
  96. package/traits/{scroll-lock.test.js → scroll-lock/scroll-lock.test.js} +1 -1
  97. package/traits/{scroll-progress.js → scroll-progress/scroll-progress.js} +1 -1
  98. package/traits/{scroll-progress.test.js → scroll-progress/scroll-progress.test.js} +1 -1
  99. package/traits/{shimmer-loading.js → shimmer-loading/shimmer-loading.js} +2 -2
  100. package/traits/{shimmer-loading.test.js → shimmer-loading/shimmer-loading.test.js} +1 -1
  101. package/traits/{snap-to-grid.js → snap-to-grid/snap-to-grid.js} +1 -1
  102. package/traits/{snap-to-grid.test.js → snap-to-grid/snap-to-grid.test.js} +1 -1
  103. package/traits/{sound-feedback.js → sound-feedback/sound-feedback.js} +1 -1
  104. package/traits/{sound-feedback.test.js → sound-feedback/sound-feedback.test.js} +1 -1
  105. package/traits/{spring-animate.js → spring-animate/spring-animate.js} +1 -1
  106. package/traits/{spring-animate.test.js → spring-animate/spring-animate.test.js} +1 -1
  107. package/traits/{success-checkmark.js → success-checkmark/success-checkmark.js} +2 -2
  108. package/traits/{success-checkmark.test.js → success-checkmark/success-checkmark.test.js} +1 -1
  109. package/traits/{tilt-hover.js → tilt-hover/tilt-hover.js} +2 -2
  110. package/traits/{tilt-hover.test.js → tilt-hover/tilt-hover.test.js} +1 -1
  111. package/traits/{tossable.js → tossable/tossable.js} +1 -1
  112. package/traits/{tossable.test.js → tossable/tossable.test.js} +1 -1
  113. package/traits/traits-host.test.js +2 -2
  114. package/traits/{typeahead.js → typeahead/typeahead.js} +1 -1
  115. package/traits/{typeahead.test.js → typeahead/typeahead.test.js} +1 -1
  116. package/traits/{typewriter.js → typewriter/typewriter.js} +2 -2
  117. package/traits/{typewriter.test.js → typewriter/typewriter.test.js} +1 -1
  118. package/traits/{validation.js → validation/validation.js} +1 -1
  119. package/traits/{validation.test.js → validation/validation.test.js} +1 -1
  120. package/traits/{view-transition.js → view-transition/view-transition.js} +2 -2
  121. package/traits/{view-transition.test.js → view-transition/view-transition.test.js} +2 -2
  122. /package/traits/{announcer-stage.js → announcer/announcer-stage.js} +0 -0
  123. /package/traits/{confetti-stage.js → confetti/confetti-stage.js} +0 -0
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  import { UIElement } from '../../core/element.js';
27
- import { draggable } from '../../traits/draggable.js';
27
+ import { draggable } from '../../traits/draggable/draggable.js';
28
28
 
29
29
  class UICard extends UIElement {
30
30
  static properties = {
@@ -9,6 +9,7 @@
9
9
  --nav-group-font-size: var(--a-ui-size);
10
10
  --nav-group-font-size-sm: var(--a-ui-sm);
11
11
  --nav-group-font-size-lg: var(--a-ui-lg);
12
+ --nav-group-font-weight: var(--a-font-weight-normal);
12
13
  --nav-group-fg: var(--a-fg);
13
14
  --nav-group-fg-hover: var(--a-fg-strong);
14
15
  --nav-group-fg-muted: var(--a-fg-muted);
@@ -27,6 +28,7 @@
27
28
  flex-direction: column;
28
29
  gap: var(--nav-gap);
29
30
  position: relative;
31
+ font-weight: var(--nav-group-text-weight);
30
32
  }
31
33
 
32
34
  /* Continuous indent rail */
@@ -15,7 +15,6 @@ nav-item-ui:hover [slot="icon"] {
15
15
  nav-item-ui[selected] {
16
16
  background: var(--nav-item-bg-selected);
17
17
  color: var(--nav-item-fg-selected);
18
- font-weight: var(--nav-item-selected-weight);
19
18
  }
20
19
  nav-item-ui[selected] [slot="icon"] {
21
20
  color: var(--nav-item-icon-fg-selected);
@@ -40,6 +39,7 @@ nav-item-ui[selected] [slot="icon"]:empty::before {
40
39
  --nav-item-font-size: var(--a-ui-size);
41
40
  --nav-item-font-size-sm: var(--a-ui-sm);
42
41
  --nav-item-font-size-lg: var(--a-ui-lg);
42
+ --nav-item-font-weight: var(--a-font-weight-normal);
43
43
  --nav-item-fg: var(--a-ui-text-subtle);
44
44
  --nav-item-fg-hover: var(--a-ui-text-hover);
45
45
  --nav-item-fg-selected: var(--a-ui-text-selected);
@@ -68,6 +68,7 @@ nav-item-ui[selected] [slot="icon"]:empty::before {
68
68
  background var(--nav-duration-fast) var(--nav-easing),
69
69
  color var(--nav-duration-fast) var(--nav-easing);
70
70
  outline: none;
71
+ font-weight: var(--nav-item-font-weight);
71
72
  }
72
73
 
73
74
  :scope:focus-visible {
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { UIElement } from '../../core/element.js';
9
- import { draggable } from '../../traits/draggable.js';
9
+ import { draggable } from '../../traits/draggable/draggable.js';
10
10
 
11
11
  class UIRow extends UIElement {
12
12
  static properties = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -48,4 +48,4 @@
48
48
  "url": "git+https://github.com/adiahealth/gen-ui-kit.git",
49
49
  "directory": "packages/web-components"
50
50
  }
51
- }
51
+ }
@@ -0,0 +1,286 @@
1
+ # AdiaUI Token Surface
2
+
3
+ Consumable design-token reference for component authors.
4
+
5
+ > **Rule of thumb:** Components consume **L3 semantic aliases** (`--a-fg`, `--a-bg-hover`, `--a-accent`). They never reference L1 primitives (`--a-neutral-50`) directly. The L3 layer maps to L2 families (`--a-canvas-text`), which map to L1 primitives (`--a-neutral-50`).
6
+
7
+ ---
8
+
9
+ ## Token layers
10
+
11
+ | Layer | Files | When to use |
12
+ |-------|-------|-------------|
13
+ | **L1 — Primitives** | `colors/parameters.css`, `colors/primitives.css` | Token system authors only. OKLCH base values, hue ramps, neutral scales. |
14
+ | **L2 — Families** | `colors/semantics.css` | Component authors building *new* semantic aliases not yet in L3. Maps primitives to semantic meaning (`--a-canvas-text`, `--a-danger-muted`). |
15
+ | **L3 — Semantic aliases** | `colors/semantics.css` (short-alias section) | **All component CSS.** The stable public API: `--a-fg`, `--a-bg`, `--a-accent`, `--a-border-subtle`. |
16
+ | **Dynamic / Theme** | `themes.css`, `colors/surfaces.css` | Theme authors. Per-theme hue shifts, density, radius overrides. |
17
+ | **Typography** | `typography.css` | Component authors for font-size, weight, leading, tracking. |
18
+ | **Spacing** | `tokens.css` | Component authors for padding, margin, gap. |
19
+ | **Chrome** | `tokens.css` | Shell / layout authors for chrome dimensions (header/footer/toolbar heights). |
20
+ | **Shadows** | `tokens.css` | Elevation authors. `--a-shadow-sm/md/lg`. |
21
+ | **Timing** | `tokens.css` | Motion authors. `--a-duration`, `--a-easing`. |
22
+
23
+ ---
24
+
25
+ ## L3 Color API (the tokens components consume)
26
+
27
+ ### Neutral surfaces (`--a-canvas-*` → `--a-bg-*` / `--a-fg-*`)
28
+
29
+ | Token | Purpose | Example use |
30
+ |-------|---------|-------------|
31
+ | `--a-bg` | Default surface (page bg, panel bg) | `body { background: var(--a-bg); }` |
32
+ | `--a-bg-subtle` | Alternating rows, card backgrounds | `.card { background: var(--a-bg-subtle); }` |
33
+ | `--a-bg-muted` | Disabled / inactive surfaces | `[disabled] { background: var(--a-bg-muted); }` |
34
+ | `--a-bg-strong` | Active track, selected chips | `.track-active { background: var(--a-bg-strong); }` |
35
+ | `--a-bg-hover` | Hover state backgrounds | `:hover { background: var(--a-bg-hover); }` |
36
+ | `--a-bg-active` | Pressed / active state | `:active { background: var(--a-bg-active); }` |
37
+ | `--a-bg-selected` | Selected item background | `[aria-selected="true"] { background: var(--a-bg-selected); }` |
38
+ | `--a-bg-disabled` | Disabled state background | `[disabled] { background: var(--a-bg-disabled); }` |
39
+ | `--a-bg-invalid` | Invalid / error state background | `[aria-invalid="true"] { background: var(--a-bg-invalid); }` |
40
+ | `--a-bg-scrim` | Modal overlay backdrop | `.modal-overlay { background: var(--a-bg-scrim); }` |
41
+ | `--a-fg` | Default text | `body { color: var(--a-fg); }` |
42
+ | `--a-fg-subtle` | Secondary text, descriptions | `.description { color: var(--a-fg-subtle); }` |
43
+ | `--a-fg-muted` | Placeholder text, timestamps | `.timestamp { color: var(--a-fg-muted); }` |
44
+ | `--a-fg-strong` | Headings, emphasized text | `h1 { color: var(--a-fg-strong); }` |
45
+ | `--a-fg-inverse` | Text on dark/brand buttons | `.button-primary { color: var(--a-fg-inverse); }` |
46
+
47
+ ### Borders
48
+
49
+ | Token | Purpose |
50
+ |-------|---------|
51
+ | `--a-border-subtle` | Dividers, hairlines |
52
+ | `--a-border` | Default borders, input outlines |
53
+ | `--a-border-strong` | Focus rings, active borders |
54
+ | `--a-border-hover` | Hover state borders |
55
+ | `--a-border-active` | Active/pressed borders |
56
+ | `--a-border-selected` | Selected item borders |
57
+ | `--a-border-invalid` | Error state borders |
58
+ | `--a-border-disabled` | Disabled borders |
59
+
60
+ ### Accent (interactive)
61
+
62
+ | Token | Purpose |
63
+ |-------|---------|
64
+ | `--a-accent` | Primary accent color (buttons, links, active states) |
65
+ | `--a-accent-hover` | Accent hover state |
66
+ | `--a-accent-active` | Accent pressed state |
67
+ | `--a-accent-muted` | Subtle accent (tinted backgrounds) |
68
+ | `--a-accent-bg` | Accent-filled surface |
69
+ | `--a-accent-bg-hover` | Accent-filled hover |
70
+ | `--a-accent-bg-active` | Accent-filled active |
71
+ | `--a-accent-fg` | Text on accent surfaces |
72
+ | `--a-accent-border` | Accent borders |
73
+
74
+ ### Brand
75
+
76
+ Same matrix as accent (`--a-brand`, `--a-brand-hover`, `--a-brand-bg`, `--a-brand-fg`, etc.) for brand-color surfaces. Used in marketing contexts, headers, hero sections.
77
+
78
+ ### Status colors
79
+
80
+ | Token family | Use case |
81
+ |--------------|----------|
82
+ | `--a-danger-*` | Errors, destructive actions, deletions |
83
+ | `--a-warning-*` | Warnings, caution states |
84
+ | `--a-success-*` | Success confirmations, completed states |
85
+ | `--a-info-*` | Informational highlights, tips |
86
+
87
+ Each status family mirrors the accent matrix: `-bg`, `-bg-hover`, `-bg-active`, `-fg`, `-border`, `-muted`, etc.
88
+
89
+ ### Data visualization (`--a-data-0` … `--a-data-9`)
90
+
91
+ Chromatic data colors for charts, graphs, status indicators. Ten slots distinguishable by hue shift.
92
+
93
+ | Token | Default hue | Use |
94
+ |-------|-------------|-----|
95
+ | `--a-data-0` | 225° | Primary data series |
96
+ | `--a-data-1` | 247° | Secondary series |
97
+ | `--a-data-2` | 269° | Tertiary |
98
+ | … | … | … |
99
+ | `--a-data-9` | 335° | Tenth series |
100
+
101
+ Individual hue overrides: `--a-data-N-hue: 180;` to pin a specific slot.
102
+
103
+ ---
104
+
105
+ ## Typography API
106
+
107
+ ### Scale tokens (use these directly)
108
+
109
+ | Token | Purpose |
110
+ |-------|---------|
111
+ | `--a-body-size` | Running text (paragraphs, descriptions) |
112
+ | `--a-heading-size` | Sub-headings |
113
+ | `--a-section-size` | Section headings |
114
+ | `--a-title-size` | Page titles |
115
+ | `--a-display-size` | Hero numbers, big stats |
116
+ | `--a-deck-size` | Lead paragraphs, hero copy |
117
+ | `--a-caption-size` | Captions, metadata, footnotes |
118
+ | `--a-code-size` | Monospace code blocks |
119
+ | `--a-label-size` | Form labels, badges |
120
+ | `--a-ui-size` | UI chrome text (buttons, tabs) |
121
+ | `--a-metric-size` | Dashboard metrics, KPIs |
122
+ | `--a-kicker-size` | Overlines, eyebrow text |
123
+
124
+ Each has `-sm`, `-md`, `-lg` variants (e.g., `--a-body-sm`, `--a-body-lg`).
125
+
126
+ ### Font families
127
+
128
+ | Token | Purpose |
129
+ |-------|---------|
130
+ | `--a-font-family-body` | Prose blocks |
131
+ | `--a-font-family-heading` | Headings |
132
+ | `--a-font-family-display` | Hero / display |
133
+ | `--a-font-family-code` | Monospace |
134
+ | `--a-font-family-ui` | Buttons, inputs, chrome |
135
+ | `--a-font-family-control` | Form controls |
136
+ | `--a-font-family-editorial` | Marketing / long-form |
137
+ | `--a-font-family-text` | Fallback generic text |
138
+
139
+ ### Weight & tracking
140
+
141
+ | Token | Value | Use |
142
+ |-------|-------|-----|
143
+ | `--a-weight-thin` | 300 | Hero numbers, elegant display |
144
+ | `--a-weight-light` | 400 | Body text |
145
+ | `--a-weight-normal` | 500 | Default UI |
146
+ | `--a-weight-medium` | 600 | Slightly emphasized |
147
+ | `--a-weight-semibold` | 700 | Headings |
148
+ | `--a-weight-bold` | 800 | Strong emphasis |
149
+ | `--a-tracking-tight` | -0.02em | Display / headlines |
150
+ | `--a-tracking-normal` | 0 | Body |
151
+ | `--a-tracking-wide` | 0.03em | Labels, uppercase |
152
+ | `--a-tracking-wider` | 0.06em | Kickers, overlines |
153
+
154
+ ---
155
+
156
+ ## Spacing API
157
+
158
+ ### Base tokens (parametric: value = `base × --a-density`)
159
+
160
+ | Token | Base value | Use |
161
+ |-------|-----------|-----|
162
+ | `--a-space-0` | 0 | None |
163
+ | `--a-space-0-5` | 0.125rem (2px) | Hairline |
164
+ | `--a-space-1` | 0.25rem (4px) | Tight padding |
165
+ | `--a-space-2` | 0.5rem (8px) | Default gap |
166
+ | `--a-space-3` | 0.75rem (12px) | Comfortable gap |
167
+ | `--a-space-4` | 1rem (16px) | Card padding |
168
+ | `--a-space-5` | 1.25rem (20px) | Section padding |
169
+ | `--a-space-6` | 1.5rem (24px) | Large gap |
170
+ | `--a-space-7` | 1.75rem (28px) | Extra large |
171
+ | `--a-space-8` | 2rem (32px) | Section gutters |
172
+ | `--a-space-10` | 2.5rem (40px) | Page gutters |
173
+ | `--a-space-12` | 3rem (48px) | Major sections |
174
+ | `--a-space-16` | 4rem (64px) | Hero spacing |
175
+
176
+ ### Composite gap tokens
177
+
178
+ | Token | Maps to | Use |
179
+ |-------|---------|-----|
180
+ | `--a-gap-sm` | `--a-space-3` | Tight component groups |
181
+ | `--a-gap-md` | `--a-space-4` | Default component groups |
182
+ | `--a-gap-lg` | `--a-space-6` | Loose component groups |
183
+
184
+ ---
185
+
186
+ ## Chrome dimensions
187
+
188
+ | Token | Value | Element |
189
+ |-------|-------|---------|
190
+ | `--a-chrome-app-header-height` | 48px | App-level header |
191
+ | `--a-chrome-app-toolbar-height` | 48px | App-level toolbar |
192
+ | `--a-chrome-app-footer-height` | 48px | App-level footer |
193
+ | `--a-chrome-pane-header-height` | 36px | Pane / panel header |
194
+ | `--a-chrome-pane-toolbar-height` | 36px | Pane / panel toolbar |
195
+ | `--a-chrome-pane-footer-height` | 36px | Pane / panel footer |
196
+
197
+ ---
198
+
199
+ ## Radius & density
200
+
201
+ | Token | Type | Default | Effect |
202
+ |-------|------|---------|--------|
203
+ | `--a-density` | `@property <number>` | 1 | Scales ALL spacing, padding, gaps, component heights |
204
+ | `--a-radius-k` | `@property <number>` | 1 | Scales ALL corner rounding |
205
+ | `--a-radius-sm` | length | 0.375rem | Small corners (inputs, buttons) |
206
+ | `--a-radius-md` | length | 0.5rem | Medium corners (cards, popovers) |
207
+ | `--a-radius-lg` | length | 0.75rem | Large corners (modals, drawers) |
208
+ | `--a-radius-full` | length | 9999px | Pills, chips, avatars |
209
+
210
+ Set `--a-density` and `--a-radius-k` on `:root` for global effect, or on `[density="tight"]` / `[density="comfortable"]` for scoped regions.
211
+
212
+ ---
213
+
214
+ ## Shadows
215
+
216
+ | Token | Default | Use |
217
+ |-------|---------|-----|
218
+ | `--a-shadow-sm` | `0 1px 2px` | Subtle lift (cards at rest) |
219
+ | `--a-shadow-md` | `0 4px 8px` | Elevated (dropdowns, popovers) |
220
+ | `--a-shadow-lg` | `0 8px 24px` | Highest elevation (modals, drawers) |
221
+ | `--a-shadow-intensity` | 1 | Multiplier for shadow opacity |
222
+
223
+ ---
224
+
225
+ ## Timing
226
+
227
+ | Token | Value | Use |
228
+ |-------|-------|-----|
229
+ | `--a-duration-fast` | 120ms | Hover states, micro-interactions |
230
+ | `--a-duration` | 250ms | Default transition |
231
+ | `--a-duration-slow` | 300ms | Page transitions, large movements |
232
+ | `--a-easing` | `cubic-bezier(0.25, 0.1, 0.25, 1)` | Default ease |
233
+ | `--a-easing-out` | `cubic-bezier(0.16, 1, 0.3, 1)` | Exit / snap animations |
234
+
235
+ ---
236
+
237
+ ## How to add a new token
238
+
239
+ 1. **Need a new semantic color?** Add it in `colors/semantics.css` L3 section, mapping to an L2 family. Example:
240
+ ```css
241
+ --a-bg-ghost: var(--a-canvas-0); /* new variant */
242
+ ```
243
+ 2. **Need a new primitive hue?** Extend `colors/parameters.css` hue ramp.
244
+ 3. **Need a new spacing step?** Add to `tokens.css` spacing scale.
245
+ 4. **Never** add tokens directly in component CSS. Always add to the token system first, then consume.
246
+
247
+ ---
248
+
249
+ ## File inventory
250
+
251
+ ```
252
+ styles/
253
+ ├── tokens.css # Spacing, chrome, shadows, timing, density, radius
254
+ ├── typography.css # Font families, type scale, weights, trackings
255
+ ├── themes.css # 8 named themes + light/dark scheme overrides
256
+ ├── colors/
257
+ │ ├── index.css # Barrel: parameters → primitives → surfaces → scrims → semantics
258
+ │ ├── parameters.css # L1: hue definitions, OKLCH ramp parameters
259
+ │ ├── primitives.css # L1: OKLCH color values
260
+ │ ├── surfaces.css # L2: canvas ramps (--a-canvas-0 … 6)
261
+ │ ├── scrims.css # L2: overlay transparency values
262
+ │ └── semantics.css # L2 families + L3 aliases (the consumable API)
263
+ ├── prose.css # Opt-in article typography
264
+ ├── resets.css # Minimal CSS reset
265
+ ├── fonts.css # @font-face declarations
266
+ ├── components.css # Component-specific rules (progress bars, etc.)
267
+ ├── elevation.examples.html # Shadow demo page
268
+ ├── icons.examples.html # Icon demo page
269
+ └── spacing.examples.html # Spacing demo page
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Token count (approximate)
275
+
276
+ | Layer | File(s) | ~Tokens |
277
+ |-------|---------|---------|
278
+ | L1 Primitives | `colors/parameters.css`, `colors/primitives.css` | ~80 |
279
+ | L2 Families | `colors/semantics.css` (family section) | ~60 |
280
+ | L3 Semantic aliases | `colors/semantics.css` (alias section) | ~150 |
281
+ | Typography | `typography.css` | ~80 |
282
+ | Spacing | `tokens.css` | ~25 |
283
+ | Chrome | `tokens.css` | ~10 |
284
+ | Shadows | `tokens.css` | ~4 |
285
+ | Timing | `tokens.css` | ~5 |
286
+ | **Total** | | **~410** |
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  export const activeState = defineTrait({
4
4
  name: 'active-state',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { activeState } from './active-state.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  describe('active-state', () => {
6
6
  beforeEach(resetDOM);
@@ -18,7 +18,7 @@
18
18
  * consumers and DevTools sessions can see which path actually ran.
19
19
  */
20
20
 
21
- import { defineTrait } from './define.js';
21
+ import { defineTrait } from '../define.js';
22
22
 
23
23
  /**
24
24
  * Feature-detect both halves of the API we depend on. Chrome 125+ and
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { anchorPositioning } from './anchor-positioning.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  /**
6
6
  * Note on test environment: happy-dom does not implement
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
  import { announce, getRegion } from './announcer-stage.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { announcer } from './announcer.js';
3
3
  import { _resetRegions, getRegion } from './announcer-stage.js';
4
- import { mountHost, connectTrait, spyEvent, resetDOM, tick, wait } from './test-helpers.js';
4
+ import { mountHost, connectTrait, spyEvent, resetDOM, tick, wait } from '../test-helpers.js';
5
5
 
6
6
  // happy-dom doesn't speak — we assert region textContent instead.
7
7
  async function settleAnnounce() {
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  /**
4
4
  * 2D arrow-key navigation for grids — calendars, menubars, color pickers,
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { arrowGridNav } from './arrow-grid-nav.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  /**
6
6
  * Build a row-flat grid with `total` cells laid out in `cols` columns.
@@ -1,5 +1,5 @@
1
- import { defineTrait } from './define.js';
2
- import { prefersReducedMotion } from './motion.js';
1
+ import { defineTrait } from '../define.js';
2
+ import { prefersReducedMotion } from '../motion.js';
3
3
 
4
4
  export const attentionPulse = defineTrait({
5
5
  name: 'attention-pulse',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { attentionPulse } from './attention-pulse.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  describe('attention-pulse', () => {
6
6
  beforeEach(resetDOM);
@@ -1,5 +1,5 @@
1
- import { defineTrait } from './define.js';
2
- import { prefersReducedMotion } from './motion.js';
1
+ import { defineTrait } from '../define.js';
2
+ import { prefersReducedMotion } from '../motion.js';
3
3
  import { getStage, viewportCenterOf, spawnParticle, SHARED_COLORS } from './confetti-stage.js';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { confetti } from './confetti.js';
3
3
  import { _resetStage } from './confetti-stage.js';
4
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
4
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
5
5
 
6
6
  describe('confetti', () => {
7
7
  beforeEach(() => {
@@ -1,6 +1,6 @@
1
- import { defineTrait } from './define.js';
2
- import { prefersReducedMotion } from './motion.js';
3
- import { getStage, viewportCenterOf, spawnParticle, SHARED_COLORS } from './confetti-stage.js';
1
+ import { defineTrait } from '../define.js';
2
+ import { prefersReducedMotion } from '../motion.js';
3
+ import { getStage, viewportCenterOf, spawnParticle, SHARED_COLORS } from '../confetti/confetti-stage.js';
4
4
 
5
5
  /**
6
6
  * `confetti-burst` — upward fountain on connect + on every `press`.
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { confettiBurst } from './confetti-burst.js';
3
- import { _resetStage } from './confetti-stage.js';
4
- import { mountHost, connectTrait, spyEvent, resetDOM, wait } from './test-helpers.js';
3
+ import { _resetStage } from '../confetti/confetti-stage.js';
4
+ import { mountHost, connectTrait, spyEvent, resetDOM, wait } from '../test-helpers.js';
5
5
 
6
6
  describe('confetti-burst', () => {
7
7
  beforeEach(() => {
@@ -1,5 +1,5 @@
1
- import { defineTrait } from './define.js';
2
- import { prefersReducedMotion } from './motion.js';
1
+ import { defineTrait } from '../define.js';
2
+ import { prefersReducedMotion } from '../motion.js';
3
3
 
4
4
  export const countUp = defineTrait({
5
5
  name: 'count-up',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { countUp } from './count-up.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM, wait, raf } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM, wait, raf } from '../test-helpers.js';
4
4
 
5
5
  describe('count-up', () => {
6
6
  beforeEach(resetDOM);
@@ -13,9 +13,9 @@
13
13
 
14
14
  import { describe, it, expect, beforeEach, vi } from 'vitest';
15
15
  import { UIElement } from '../core/element.js';
16
- import { pressable } from './pressable.js';
17
- import { focusable } from './focusable.js';
18
- import { hoverable } from './hoverable.js';
16
+ import { pressable } from './pressable/pressable.js';
17
+ import { focusable } from './focusable/focusable.js';
18
+ import { hoverable } from './hoverable/hoverable.js';
19
19
  import { resetDOM } from './test-helpers.js';
20
20
 
21
21
  let counter = 0;
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  export const dirtyState = defineTrait({
4
4
  name: 'dirty-state',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { dirtyState } from './dirty-state.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  describe('dirty-state', () => {
6
6
  beforeEach(resetDOM);
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  export const dragGhost = defineTrait({
4
4
  name: 'drag-ghost',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { dragGhost } from './drag-ghost.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  describe('drag-ghost', () => {
6
6
  beforeEach(resetDOM);
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  export const draggable = defineTrait({
4
4
  name: 'draggable',
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { draggable } from './draggable.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  function pointer(host, type, x, y) {
6
6
  const ev = new PointerEvent(type, { clientX: x, clientY: y, pointerId: 1, bubbles: true });
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  /**
4
4
  * `draggable-list-item` — pointer-driven list-reorder lifter.
@@ -39,7 +39,7 @@ import { defineTrait } from './define.js';
39
39
  * aria-live regions so screen-reader narration is single-stream.
40
40
  */
41
41
 
42
- import { announce } from './announcer-stage.js';
42
+ import { announce } from '../announcer/announcer-stage.js';
43
43
 
44
44
  // Drop-target-change announcements are debounced at 200 ms (per
45
45
  // a11y-live-region-drag-announcements.md research note); other phases
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { draggableListItem } from './draggable-list-item.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The draggable-list-item trait is the pointer
6
6
  // driver for the apps/tasks/ DnD model. The cases
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  /**
4
4
  * Declarative drop zone — wires the host into the HTML5 drag-and-drop
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { dropTarget } from './drop-target.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  /**
6
6
  * happy-dom's DragEvent constructor does NOT preserve the `dataTransfer`
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  /**
4
4
  * `droppable` — marks an element as a drop target for `draggable-list-item`.
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { droppable } from './droppable.js';
3
- import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The droppable trait is authored against the
6
6
  // apps/tasks/ DnD coordinator and assumes a sibling
@@ -1,4 +1,4 @@
1
- import { defineTrait } from './define.js';
1
+ import { defineTrait } from '../define.js';
2
2
 
3
3
  /**
4
4
  * `droppable-collection` — coordinator over a tree of `droppable` children.
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest';
2
2
  import { droppableCollection } from './droppable-collection.js';
3
- import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
3
+ import { mountHost, connectTrait, spyEvent, resetDOM } from '../test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The droppable-collection trait coordinates
6
6
  // child droppables of the apps/tasks/ DnD model;