@adia-ai/web-components 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -110,7 +110,7 @@ file using **two-block `@scope`**:
110
110
  }
111
111
  ```
112
112
 
113
- Authoring rules (enforced by `coherence-audit`):
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
@@ -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 above 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.",
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. Alternative to slotted heading content.",
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
- /* ── Popover ── */
26
- --table-toolbar-popover-bg: var(--a-canvas);
27
- --table-toolbar-popover-fg: var(--a-canvas-text);
28
- --table-toolbar-popover-border: var(--a-border);
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 above 12 options), id-like keys → free-text contains. The
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. Alternative to slotted heading content.
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.2",
3
+ "version": "0.3.4",
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,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