@adia-ai/web-components 0.3.1 → 0.3.3
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 +1 -1
- package/components/nav-group/nav-group.css +2 -0
- package/components/nav-item/nav-item.css +2 -1
- package/components/table-toolbar/table-toolbar.a2ui.json +2 -29
- package/components/table-toolbar/table-toolbar.css +4 -23
- package/components/table-toolbar/table-toolbar.yaml +2 -20
- package/package.json +1 -1
- package/styles/README.md +286 -0
- package/traits/CATEGORIES.md +139 -0
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ file using **two-block `@scope`**:
|
|
|
110
110
|
}
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Authoring rules (enforced by `
|
|
113
|
+
Authoring rules (enforced by `ui-audit-coherence`):
|
|
114
114
|
|
|
115
115
|
1. **No raw colors** in component CSS — every color goes through a token.
|
|
116
116
|
2. **Variants change tokens, modes change layout.** A selector that sets
|
|
@@ -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 {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://adiaui.dev/a2ui/v0_9/components/TableToolbar.json",
|
|
4
4
|
"title": "TableToolbar",
|
|
5
|
-
"description": "Header / companion bar for a sibling table-ui. Renders title + count badge, filter / sort / columns popovers, and a search input — all wired to the target table via an [for] id-ref. Modeled on chart-legend-ui's [for] binding pattern. Drop next to (or above) any table-ui to add the standard data-grid toolbar without re-implementing search, filter, sort, or column visibility. Filter rows auto-pick a primitive per column: ≤ 50 distinct values → multi- select (searchable
|
|
5
|
+
"description": "Header / companion bar for a sibling table-ui. Renders title + count badge, filter / sort / columns popovers, and a search input — all wired to the target table via an [for] id-ref. Modeled on chart-legend-ui's [for] binding pattern. Drop next to (or above) any table-ui to add the standard data-grid toolbar without re-implementing search, filter, sort, or column visibility. Filter rows auto-pick a primitive per column: ≤ 50 distinct values → multi- select (searchable when ≥ 12 options), id-like keys → free-text contains. The column descriptor's `filter` field overrides the auto-detect: `'select'` forces multi-select even on high-cardinality columns; `'text'` forces a contains input even on small enums.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"allOf": [
|
|
8
8
|
{
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"default": "Search..."
|
|
53
53
|
},
|
|
54
54
|
"text": {
|
|
55
|
-
"description": "Title text shown on the left.
|
|
55
|
+
"description": "Title text shown on the left.",
|
|
56
56
|
"type": "string",
|
|
57
57
|
"default": ""
|
|
58
58
|
},
|
|
@@ -117,9 +117,6 @@
|
|
|
117
117
|
"popover"
|
|
118
118
|
],
|
|
119
119
|
"slots": {
|
|
120
|
-
"default": {
|
|
121
|
-
"description": "Optional title content. Used when [text] is empty."
|
|
122
|
-
},
|
|
123
120
|
"actions": {
|
|
124
121
|
"description": "Trailing action area — primary buttons (e.g. \"New row\") rendered after the search input."
|
|
125
122
|
}
|
|
@@ -163,30 +160,6 @@
|
|
|
163
160
|
"--table-toolbar-gap": {
|
|
164
161
|
"description": "Gap between toolbar clusters"
|
|
165
162
|
},
|
|
166
|
-
"--table-toolbar-popover-bg": {
|
|
167
|
-
"description": "Popover background"
|
|
168
|
-
},
|
|
169
|
-
"--table-toolbar-popover-border": {
|
|
170
|
-
"description": "Popover border"
|
|
171
|
-
},
|
|
172
|
-
"--table-toolbar-popover-fg": {
|
|
173
|
-
"description": "Popover text color"
|
|
174
|
-
},
|
|
175
|
-
"--table-toolbar-popover-gap": {
|
|
176
|
-
"description": "Popover content gap"
|
|
177
|
-
},
|
|
178
|
-
"--table-toolbar-popover-min": {
|
|
179
|
-
"description": "Popover minimum width"
|
|
180
|
-
},
|
|
181
|
-
"--table-toolbar-popover-pad": {
|
|
182
|
-
"description": "Popover padding"
|
|
183
|
-
},
|
|
184
|
-
"--table-toolbar-popover-radius": {
|
|
185
|
-
"description": "Popover radius"
|
|
186
|
-
},
|
|
187
|
-
"--table-toolbar-popover-shadow": {
|
|
188
|
-
"description": "Popover shadow"
|
|
189
|
-
},
|
|
190
163
|
"--table-toolbar-px": {
|
|
191
164
|
"description": "Horizontal padding"
|
|
192
165
|
},
|
|
@@ -22,29 +22,10 @@
|
|
|
22
22
|
--table-toolbar-search-min: 14rem;
|
|
23
23
|
--table-toolbar-search-max: 22rem;
|
|
24
24
|
|
|
25
|
-
/*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
--table-toolbar-popover-radius: var(--a-radius-lg);
|
|
30
|
-
--table-toolbar-popover-shadow: var(--a-shadow-lg);
|
|
31
|
-
--table-toolbar-popover-pad: var(--a-space-2);
|
|
32
|
-
--table-toolbar-popover-gap: var(--a-space-1);
|
|
33
|
-
--table-toolbar-popover-min: 16rem;
|
|
34
|
-
--table-toolbar-popover-head-fg: var(--a-fg-muted);
|
|
35
|
-
--table-toolbar-popover-head-size: var(--a-ui-tiny);
|
|
36
|
-
--table-toolbar-popover-head-pad: var(--a-space-2);
|
|
37
|
-
--table-toolbar-popover-row-pad: var(--a-space-2);
|
|
38
|
-
--table-toolbar-popover-row-radius: var(--a-radius-sm);
|
|
39
|
-
--table-toolbar-popover-row-bg-hover: var(--a-bg-hover);
|
|
40
|
-
--table-toolbar-popover-input-bg: var(--a-bg-subtle);
|
|
41
|
-
--table-toolbar-popover-input-border: var(--a-border-subtle);
|
|
42
|
-
--table-toolbar-popover-input-radius: var(--a-radius-sm);
|
|
43
|
-
--table-toolbar-popover-input-py: var(--a-space-1);
|
|
44
|
-
--table-toolbar-popover-input-px: var(--a-space-2);
|
|
45
|
-
--table-toolbar-popover-input-size: var(--a-ui-sm);
|
|
46
|
-
--table-toolbar-popover-action-fg: var(--a-accent);
|
|
47
|
-
--table-toolbar-popover-action-size: var(--a-ui-sm);
|
|
25
|
+
/* Popover tokens removed — popover escapes to top layer and
|
|
26
|
+
cannot inherit @scope tokens. Raw --a-* tokens are used
|
|
27
|
+
directly in the unscoped popover rules below (see comment
|
|
28
|
+
at the rules block). */
|
|
48
29
|
}
|
|
49
30
|
|
|
50
31
|
/* ═══════ Base ═══════ */
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
pattern. Drop next to (or above) any table-ui to add the standard data-grid
|
|
12
12
|
toolbar without re-implementing search, filter, sort, or column visibility.
|
|
13
13
|
Filter rows auto-pick a primitive per column: ≤ 50 distinct values → multi-
|
|
14
|
-
select (searchable
|
|
14
|
+
select (searchable when ≥ 12 options), id-like keys → free-text contains. The
|
|
15
15
|
column descriptor's `filter` field overrides the auto-detect: `'select'`
|
|
16
16
|
forces multi-select even on high-cardinality columns; `'text'` forces a
|
|
17
17
|
contains input even on small enums.
|
|
@@ -22,7 +22,7 @@ props:
|
|
|
22
22
|
default: ""
|
|
23
23
|
reflect: true
|
|
24
24
|
text:
|
|
25
|
-
description: Title text shown on the left.
|
|
25
|
+
description: Title text shown on the left.
|
|
26
26
|
type: string
|
|
27
27
|
default: ""
|
|
28
28
|
count:
|
|
@@ -75,8 +75,6 @@ events:
|
|
|
75
75
|
columns-change:
|
|
76
76
|
description: "Column visibility changed. Detail: { hiddenColumns }."
|
|
77
77
|
slots:
|
|
78
|
-
default:
|
|
79
|
-
description: Optional title content. Used when [text] is empty.
|
|
80
78
|
actions:
|
|
81
79
|
description: Trailing action area — primary buttons (e.g. "New row") rendered after the search input.
|
|
82
80
|
states:
|
|
@@ -102,22 +100,6 @@ tokens:
|
|
|
102
100
|
description: Title font size
|
|
103
101
|
--table-toolbar-title-weight:
|
|
104
102
|
description: Title font weight
|
|
105
|
-
--table-toolbar-popover-bg:
|
|
106
|
-
description: Popover background
|
|
107
|
-
--table-toolbar-popover-fg:
|
|
108
|
-
description: Popover text color
|
|
109
|
-
--table-toolbar-popover-border:
|
|
110
|
-
description: Popover border
|
|
111
|
-
--table-toolbar-popover-radius:
|
|
112
|
-
description: Popover radius
|
|
113
|
-
--table-toolbar-popover-shadow:
|
|
114
|
-
description: Popover shadow
|
|
115
|
-
--table-toolbar-popover-pad:
|
|
116
|
-
description: Popover padding
|
|
117
|
-
--table-toolbar-popover-gap:
|
|
118
|
-
description: Popover content gap
|
|
119
|
-
--table-toolbar-popover-min:
|
|
120
|
-
description: Popover minimum width
|
|
121
103
|
a2ui:
|
|
122
104
|
rules: []
|
|
123
105
|
anti_patterns: []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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": {
|
package/styles/README.md
ADDED
|
@@ -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** |
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# AdiaUI Traits — Categories Index
|
|
2
|
+
|
|
3
|
+
**Auto-generated** from `packages/web-components/traits/_catalog.json`. Run `npm run build:traits` to refresh.
|
|
4
|
+
|
|
5
|
+
**56 traits across 9 categories.**
|
|
6
|
+
|
|
7
|
+
Traits are cross-cutting capabilities — orthogonal to the 93 primitives. Any primitive can opt into any trait by adding `data-*` attributes; traits hydrate via `defineTrait()` calls in the trait's `<name>.js`.
|
|
8
|
+
|
|
9
|
+
## At a glance
|
|
10
|
+
|
|
11
|
+
| Category | Count | Domain |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `animation-feedback` | 7 | Reactive visual feedback to user input or state changes — shake on error, pulse on attention. |
|
|
14
|
+
| `audio-haptics-sensory` | 6 | Non-visual feedback channels — sound, vibration, haptics — used for accessibility and delight. |
|
|
15
|
+
| `forms-data` | 4 | Form-centric behaviors — submission flow, field-level validation, dirty tracking. |
|
|
16
|
+
| `input-interaction` | 7 | Pointer + touch input behaviors — clickability, drag, multi-select, hover affordances. |
|
|
17
|
+
| `interaction-delight` | 3 | Optional flourishes that enhance perceived quality — confetti, sparkles, reveal animations. |
|
|
18
|
+
| `keyboard-navigation` | 8 | Keyboard-first patterns — focus rings, type-ahead, arrow-key roving, shortcut handling. |
|
|
19
|
+
| `layout-measurement` | 6 | Geometry observers — element-resize, intersection, container-query awareness. |
|
|
20
|
+
| `motion-positioning` | 10 | Element positioning + motion — sticky, parallax, snap-scroll, magnetic alignment. |
|
|
21
|
+
| `visual-dynamics` | 5 | Theme-aware visual responses — color shifts, gradient drift, light/dark adaptation. |
|
|
22
|
+
|
|
23
|
+
## Per-category trait list
|
|
24
|
+
|
|
25
|
+
### `animation-feedback` (7)
|
|
26
|
+
|
|
27
|
+
_Reactive visual feedback to user input or state changes — shake on error, pulse on attention._
|
|
28
|
+
|
|
29
|
+
- **`error-shake`** — Horizontal lateral oscillation on validation failure
|
|
30
|
+
- **`fade-presence`** — Enter/exit fade with lifecycle
|
|
31
|
+
- **`ripple`** — Material-style press ripple effect
|
|
32
|
+
- **`scale-press`** — Subtle scale transform on press
|
|
33
|
+
- **`spring-animate`** — Spring-based motion transitions
|
|
34
|
+
- **`success-checkmark`** — Stroke-draw checkmark on validation success
|
|
35
|
+
- **`tilt-hover`** — Tilt based on pointer position
|
|
36
|
+
|
|
37
|
+
### `audio-haptics-sensory` (6)
|
|
38
|
+
|
|
39
|
+
_Non-visual feedback channels — sound, vibration, haptics — used for accessibility and delight._
|
|
40
|
+
|
|
41
|
+
- **`announcer`** — aria-live mirror for AT — announces host state changes via singleton polite/assertive regions
|
|
42
|
+
- **`attention-pulse`** — Periodic pulse to draw attention
|
|
43
|
+
- **`count-up`** — Animated numeric transitions
|
|
44
|
+
- **`haptic-feedback`** — Vibration API feedback
|
|
45
|
+
- **`sound-feedback`** — Synthesized tones via Web Audio API
|
|
46
|
+
- **`typewriter`** — Animated text reveal character by character
|
|
47
|
+
|
|
48
|
+
### `forms-data` (4)
|
|
49
|
+
|
|
50
|
+
_Form-centric behaviors — submission flow, field-level validation, dirty tracking._
|
|
51
|
+
|
|
52
|
+
- **`dirty-state`** — Tracks modified vs initial value
|
|
53
|
+
- **`input-mask`** — Locale-aware as-you-type formatter (phone, credit-card, date, currency)
|
|
54
|
+
- **`resettable`** — Snaps the host value back to its initial value on form reset
|
|
55
|
+
- **`validation`** — Validation rules: required, minlength, pattern, email
|
|
56
|
+
|
|
57
|
+
### `input-interaction` (7)
|
|
58
|
+
|
|
59
|
+
_Pointer + touch input behaviors — clickability, drag, multi-select, hover affordances._
|
|
60
|
+
|
|
61
|
+
- **`active-state`** — Tracks pointer-down / active interaction state
|
|
62
|
+
- **`droppable`** — Marks an element as a drop target for draggable-list-item; emits dnd-drop-enter / leave / receive
|
|
63
|
+
- **`droppable-collection`** — Coordinates droppable children; re-emits drops as dnd-collection-drop
|
|
64
|
+
- **`focusable`** — Keyboard-only focus ring, ignores pointer focus
|
|
65
|
+
- **`hoverable`** — Pointer hover enter/leave state tracking
|
|
66
|
+
- **`long-press`** — Press-and-hold trigger: fires after configurable duration with progress events
|
|
67
|
+
- **`pressable`** — Normalizes click/tap/keyboard into a single "press" event
|
|
68
|
+
|
|
69
|
+
### `interaction-delight` (3)
|
|
70
|
+
|
|
71
|
+
_Optional flourishes that enhance perceived quality — confetti, sparkles, reveal animations._
|
|
72
|
+
|
|
73
|
+
- **`confetti`** — Radial particle burst on press
|
|
74
|
+
- **`confetti-burst`** — Upward fountain particle burst — fires on each `press` event
|
|
75
|
+
- **`magnetic-hover`** — Element subtly follows cursor
|
|
76
|
+
|
|
77
|
+
### `keyboard-navigation` (8)
|
|
78
|
+
|
|
79
|
+
_Keyboard-first patterns — focus rings, type-ahead, arrow-key roving, shortcut handling._
|
|
80
|
+
|
|
81
|
+
- **`arrow-grid-nav`** — 2D arrow-key navigation for grids, calendars, menubars (APG grid pattern)
|
|
82
|
+
- **`focus-restore`** — Capture previously-focused element on connect, restore focus on disconnect
|
|
83
|
+
- **`focus-trap`** — Traps Tab/Shift+Tab within a container
|
|
84
|
+
- **`hotkey`** — Global or scoped keyboard shortcuts
|
|
85
|
+
- **`keyboard-nav`** — Arrow keys, Enter, Escape — semantic navigation events
|
|
86
|
+
- **`keyboard-reorderable`** — Keyboard alternative to draggable-list-item: arrow keys + Space to lift / drop / Esc to cancel
|
|
87
|
+
- **`roving-tabindex`** — Focus management within composite widgets
|
|
88
|
+
- **`typeahead`** — Incremental search within a collection
|
|
89
|
+
|
|
90
|
+
### `layout-measurement` (6)
|
|
91
|
+
|
|
92
|
+
_Geometry observers — element-resize, intersection, container-query awareness._
|
|
93
|
+
|
|
94
|
+
- **`anchor-positioning`** — Positions relative to an anchor element
|
|
95
|
+
- **`intersection-observer`** — Visibility detection (viewport)
|
|
96
|
+
- **`portal`** — Renders content in a different DOM root
|
|
97
|
+
- **`resize-observer`** — Reacts to element size changes
|
|
98
|
+
- **`scroll-lock`** — Disables background scrolling
|
|
99
|
+
- **`scroll-progress`** — Page or element scroll progress as 0..1 attribute + CSS variable + event
|
|
100
|
+
|
|
101
|
+
### `motion-positioning` (10)
|
|
102
|
+
|
|
103
|
+
_Element positioning + motion — sticky, parallax, snap-scroll, magnetic alignment._
|
|
104
|
+
|
|
105
|
+
- **`drag-ghost`** — Ghost clone at origin during drag
|
|
106
|
+
- **`draggable`** — Pointer drag to reposition
|
|
107
|
+
- **`draggable-list-item`** — Pointer drag for list reordering; emits dnd-lift/drop-target-change/drop/drop-cancel
|
|
108
|
+
- **`drop-target`** — Declarative drop zone: hit-testing, accept-reject, drag-over feedback
|
|
109
|
+
- **`inertia-drag`** — Momentum-based dragging, smooth deceleration
|
|
110
|
+
- **`layout-animation`** — FLIP-style layout transition: animate from old to new bounds without explicit coordinates
|
|
111
|
+
- **`resizable`** — Drag edges/corners to resize
|
|
112
|
+
- **`snap-to-grid`** — Snaps position to configurable grid
|
|
113
|
+
- **`tossable`** — Flick with momentum + viewport bounce
|
|
114
|
+
- **`view-transition`** — Wraps document.startViewTransition() for morph animations between DOM states
|
|
115
|
+
|
|
116
|
+
### `visual-dynamics` (5)
|
|
117
|
+
|
|
118
|
+
_Theme-aware visual responses — color shifts, gradient drift, light/dark adaptation._
|
|
119
|
+
|
|
120
|
+
- **`glow-focus`** — Animated pulsing glow on focus
|
|
121
|
+
- **`gradient-shift`** — Animated rainbow gradient backgrounds
|
|
122
|
+
- **`noise-texture`** — Procedural grain overlay
|
|
123
|
+
- **`parallax`** — Layered motion relative to pointer
|
|
124
|
+
- **`shimmer-loading`** — Skeleton shimmer effect
|
|
125
|
+
|
|
126
|
+
## See also
|
|
127
|
+
|
|
128
|
+
- [`docs/specs/traits.md`](../../../docs/specs/traits.md) — trait system architecture
|
|
129
|
+
- [`packages/web-components/traits/<name>/<name>.js`](.) — per-trait source (5 files: `.js .html .examples.html .examples.js .test.js`)
|
|
130
|
+
- [`_catalog.json`](./_catalog.json) — generated catalog (do not hand-edit)
|
|
131
|
+
- [`_api-table.js`](./_api-table.js) — generated API surface (do not hand-edit)
|
|
132
|
+
|
|
133
|
+
## Authoring a new trait
|
|
134
|
+
|
|
135
|
+
1. `mkdir packages/web-components/traits/<name>/` (use lowercase + hyphens)
|
|
136
|
+
2. Author 5 files: `<name>.js`, `<name>.html`, `<name>.examples.html`, `<name>.examples.js`, `<name>.test.js`
|
|
137
|
+
3. Pick the most-fitting of the 9 categories above (avoid creating new ones; if you must, document why in the journal)
|
|
138
|
+
4. Run `npm run build:traits` to regenerate `_catalog.json` and `_api-table.js`
|
|
139
|
+
5. Run `npm run verify:traits` — must report 100% coverage
|