@adia-ai/web-components 0.8.46 → 0.8.47

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog — @adia-ai/web-components
2
2
 
3
+ ## [0.8.47] — 2026-08-22
4
+
5
+
6
+ ### Maintenance
7
+ - **`components/` touched in this release window** (12 file(s), e.g. `nav-group/nav-group.css`) — carried by the entries above.
8
+ - **`core/` touched in this release window** (1 file(s), e.g. `core/anchor.js`) — carried by the entries above.
9
+ - **`dist/` bundles rebuilt** in this cut's window (6 file(s)) — regenerated from the source changes described above, not independent edits.
10
+ - **`styles/` touched in this release window** (1 file(s), e.g. `colors/material-static.css`) — carried by the entries above.
11
+
3
12
  ## [0.8.46] — 2026-08-22
4
13
 
5
14
 
@@ -29,11 +29,11 @@
29
29
  --nav-icon-size-collapsed: 18px;
30
30
 
31
31
  /* Group-heading kicker */
32
- --nav-label-fg: var(--a-fg-muted);
32
+ --nav-label-fg: var(--md-sys-color-neutral);
33
33
  --nav-label-font-size: var(--a-kicker-sm);
34
34
  --nav-label-weight: var(--a-weight-medium);
35
- --nav-label-px: var(--a-space-4);
36
- --nav-label-py: var(--a-space-3) var(--a-space-1);
35
+ --nav-label-px: var(--a-space-2);
36
+ --nav-label-py: var(--a-space-4) var(--a-space-1);
37
37
  }
38
38
 
39
39
  :scope {
@@ -76,6 +76,10 @@
76
76
  [data-nav-label] {
77
77
  display: block;
78
78
  padding: var(--nav-label-py) var(--nav-label-px);
79
+ /* Deliberate inline-start bump beyond the shared padding shorthand
80
+ above, so the kicker breathes more on its leading edge than its
81
+ trailing one (gh#1736). */
82
+ padding-inline-start: var(--a-space-2);
79
83
  font-size: var(--nav-label-font-size);
80
84
  font-weight: var(--nav-label-weight);
81
85
  color: var(--nav-label-fg);
@@ -19,20 +19,26 @@
19
19
  glyph ruling); Figma's neutral/surfaceBright was considered for the
20
20
  selected fill and RULED OUT — container stays (gh#795's mirror).
21
21
  gh#968's ladder above is about ROUTE selection (hover/selected);
22
- it says nothing about the group's own open/closed disclosure state,
23
- which --nav-group-fg left pinned unconditionally to one role
24
- (neutral-high) regardless of [open]. gh#1740 (operator ruling,
25
- 2026-08-19) supersedes that unconditional pin with a second,
26
- orthogonal axis the header text and caret glyph now also shift
27
- role by [open], the same way they already shift by [selected]/
28
- hover; the two ladders compose (a selected-route header still wins
29
- its --nav-group-fg-selected treatment regardless of open state
30
- see the :scope[open] rule below, kept lower-precedence than
31
- :scope[selected] by source order). */
32
- --nav-group-fg: var(--md-sys-color-neutral);
33
- --nav-group-fg-active: var(--md-sys-color-neutral-high);
22
+ it says nothing about the group's own open/closed disclosure state.
23
+ Header-TEXT history: gh#1740 (2026-08-19) split idle text into an
24
+ [open]-keyed role (idle NEUTRAL, open NEUTRAL-HIGH), and PR 460
25
+ (gh#459) added a third [selected] role on top. On 2026-08-22 (Kim,
26
+ live) the state split was removed and the header text settled on
27
+ one unconditional NEUTRAL-HIGH for idle/open/selected alike no
28
+ [open]/[selected] header-text override rules exist below anymore.
29
+ --nav-group-fg-selected is KEPT (not deleted) because a second,
30
+ unrelated consumer still needs the distinct role: the popover's
31
+ selected/current-option row below (`[role="option"]
32
+ [aria-current="page"]`/`[aria-selected="true"]`) documents (TKT-
33
+ 0017) that its color change is one of three signals (with bg fill
34
+ + font-weight) marking the current page in that list. The caret
35
+ glyph's own [open] ladder (gh#1740, below) is UNCHANGED. */
36
+ --nav-group-fg: var(--md-sys-color-neutral-high);
34
37
  --nav-group-fg-hover: var(--a-fg-strong);
35
38
  --nav-group-fg-muted: var(--a-fg-muted);
39
+ /* Consumed ONLY by the popover's selected/current-option row further
40
+ down this file — no longer by the group header (see the
41
+ --nav-group-fg comment above); keep this scoped to that one use. */
36
42
  --nav-group-fg-selected: var(--a-fg-strong);
37
43
  --nav-group-icon-fg: var(--md-sys-color-neutral);
38
44
  --nav-group-icon-fg-selected: var(--a-fg-strong);
@@ -89,40 +95,31 @@
89
95
  background: var(--nav-group-indent-rail-bg, var(--md-sys-color-neutral-outline-variant));
90
96
  pointer-events: none;
91
97
  }
92
- /* Disclosure-state ladder (gh#1740, operator ruling 2026-08-19): the
93
- header text and caret glyph step UP a role when the group is open
94
- idle/closed reads NEUTRAL, expanded reads NEUTRAL-HIGH. Placed BEFORE
95
- the [selected]/[data-selected-within] block below so an equal-
96
- specificity (0,3,0) tie always resolves to the route-selection color:
97
- a selected-route group keeps its existing --nav-group-fg-selected
98
- treatment regardless of its own open/closed state — this rule only
99
- ever wins when the group is open AND not selected. */
100
- :scope[open] > [slot="header"] {
101
- color: var(--nav-group-fg-active);
102
- }
98
+ /* Disclosure-state ladder (gh#1740, operator ruling 2026-08-19) the
99
+ caret glyph steps UP a role when the group is open: idle/closed reads
100
+ NEUTRAL-LOW, expanded reads NEUTRAL. The matching header-TEXT half of
101
+ this ladder (--nav-group-fg-active) was reverted 2026-08-22 header
102
+ text is unconditional plain NEUTRAL now (see the --nav-group-fg
103
+ comment above), so only the caret still steps by [open]. */
103
104
  :scope[open] > [slot="header"] [slot="caret"] {
104
105
  color: var(--nav-group-caret-fg-active);
105
106
  }
106
- /* Selected-look header treatment keys on [selected] the CSS half of
107
- gh issue 459 (PR 460 corrected the icon weight): the group CONTAINING
108
- the selected route reads strong; a merely-expanded group does not.
109
- Text color applies in BOTH rail modes subtle, no double-marking risk.
110
- The BACKGROUND fill (gh#795) is collapsed-only (see the two
111
- nav-ui[collapsed] / @container sidebar blocks below): [selected] and
107
+ /* Selected header TEXT color previously diverged here (gh#459/PR 460:
108
+ the group CONTAINING the selected route read strong text). Reverted
109
+ 2026-08-22 along with the [open] split above header text is now
110
+ plain NEUTRAL in every state, so this rule was removed as dead code
111
+ rather than left pointing at a token that resolves to the same value
112
+ as the ambient [slot="header"] color. The BACKGROUND fill (gh#795)
113
+ is UNCHANGED and still collapsed-only (see the two nav-ui[collapsed]
114
+ / @container sidebar blocks below): [selected] and
112
115
  [data-selected-within] both mean "CONTAINS the selected route", never
113
116
  "IS the selected route" (nav-group.class.js's own doc comment on the
114
- `selected` prop consumers set it from active-route logic exactly
115
- like the JS-derived data-selected-within case; there is no
116
- directly-selected-leaf-group state distinct from it). In the expanded
117
- rail the contained child already paints its own real selected pill
118
- (nav-item.css), so a header background here double-marks the same
119
- selection (gh#806 operator screenshot, profile-security). Collapsed
120
- hides the children, so the header becomes the ONLY selection signal
121
- and needs the fill nav-item-ui gets. */
122
- :scope[selected] > [slot="header"],
123
- :scope[data-selected-within] > [slot="header"] {
124
- color: var(--nav-group-fg-selected);
125
- }
117
+ `selected` prop). In the expanded rail the contained child already
118
+ paints its own real selected pill (nav-item.css), so a header
119
+ background here would double-mark the same selection (gh#806);
120
+ collapsed hides the children, so the header becomes the ONLY
121
+ selection signal and needs the fill nav-item-ui gets — that part of
122
+ the design is untouched by this text-color collapse. */
126
123
  /* Icon color = the SELECTION color, one language with nav-item's accent
127
124
  glyph (gh#522, operator ruling 2026-07-30): filled + primary whenever
128
125
  this group is selected OR contains the selected route.
@@ -40,14 +40,20 @@ nav-item-ui[selected] [slot="icon"]:empty::before {
40
40
  --nav-item-font-size-sm: var(--a-ui-sm);
41
41
  --nav-item-font-size-lg: var(--a-ui-lg);
42
42
  --nav-item-font-weight: var(--a-weight-normal);
43
- /* State color spec (gh#968, operator ruling 2026-08-11):
43
+ /* State color spec (gh#968, operator ruling 2026-08-11; idle tier
44
+ re-confirmed NEUTRAL-HIGH 2026-08-22 after a brief same-day
45
+ collapse-to-NEUTRAL experiment, Kim — mirrored in nav-group-ui's
46
+ header, nav-group.css):
44
47
  idle — bg transparent · icon NEUTRAL · text NEUTRAL-HIGH
45
48
  hover — bg container-low · icon + text ON-SURFACE
46
49
  selected — bg container · icon + text ON-SURFACE
47
- Idle sits two quiet steps down (icon quieter than text); hover and
48
- selected converge on on-surface. The selected ICON no longer takes
49
- the primary accent (supersedes gh#522 for the glyph) the accent
50
- BAR remains the primary selection marker. */
50
+ Hover and selected converge on on-surface (--a-ui-text-hover/
51
+ -selected) that ladder step carries the component's only
52
+ remaining visual selected-state cue in the section variant (see
53
+ below) and is intentionally distinct from idle.
54
+ The selected ICON no longer takes the primary accent (supersedes
55
+ gh#522 for the glyph) — the accent BAR remains the primary
56
+ selection marker. */
51
57
  --nav-item-fg: var(--md-sys-color-neutral-high);
52
58
  --nav-item-fg-hover: var(--a-ui-text-hover);
53
59
  --nav-item-fg-selected: var(--a-ui-text-selected);
@@ -90,8 +90,18 @@ export class UIPreview extends UIElement {
90
90
  const code = document.createElement('code-ui');
91
91
  code.setAttribute('language', lang);
92
92
  // The CODE pane shows the clean consumer-facing HTML — strip doc-only
93
- // corpus markers (data-chunk / -kind / -slot) that the render keeps.
94
- code.textContent = source.replace(/\s+data-chunk(?:-[a-z]+)?="[^"]*"/g, '');
93
+ // corpus markers (data-chunk / -kind / -slot) that the render keeps,
94
+ // plus `data-a2ui-id` — bookkeeping the A2UI runtime renderer stamps on
95
+ // every element it creates (packages/gen-ui/a2ui/renderer.js's
96
+ // `newEl.setAttribute('data-a2ui-id', comp.id)`), never something an
97
+ // author writes. Only reachable when this source came from ALREADY-
98
+ // rendered A2UI DOM (site-a2ui docs pages feeding real component
99
+ // subtrees into <preview-ui> as children instead of authoring literal
100
+ // markup) — a hand-authored `<preview-ui>` in an .examples.html never
101
+ // has it, so the strip is a no-op there.
102
+ code.textContent = source
103
+ .replace(/\s+data-chunk(?:-[a-z]+)?="[^"]*"/g, '')
104
+ .replace(/\s+data-a2ui-id="[^"]*"/g, '');
95
105
  codeWrap.appendChild(code);
96
106
  return codeFirst ? [codeWrap, render] : [render, codeWrap];
97
107
  }
@@ -80,6 +80,16 @@
80
80
  "type": "number",
81
81
  "default": 0
82
82
  },
83
+ "size": {
84
+ "description": "Toolbar scale, via sizing.css's universal [size=\"sm|md|lg\"] ambient tokens. Not table-toolbar-specific chrome — the same attribute that scales any component. Set it once on the toolbar instead of on each slotted scope/actions-leading/actions control individually; anything slotted with no [size] of its own inherits the ambient value. Default (empty) = md.",
85
+ "type": "string",
86
+ "enum": [
87
+ "sm",
88
+ "md",
89
+ "lg"
90
+ ],
91
+ "default": ""
92
+ },
83
93
  "stage": {
84
94
  "description": "Explicit compaction-stage override (ADR-0076). Unset (the default, empty string) means auto-snap: the toolbar's own inline-size container query picks the nearest stage from its live width against the three --table-toolbar-bp-* breakpoints, snapping discretely, never interpolating. Setting stage explicitly pins that stage's rendering regardless of the container's actual width — overriding the container query, mirroring chart-ui's ratio override shape. Primary use: visual-eval fixtures that need a deterministic stage without resizing a real container, and a consumer embedding the toolbar inside a known-narrow panel who wants to skip auto-detection entirely. All four stages' CSS is now live (ADR-0076): search-tight steps the search field down (step 2); icon-only drops control labels and compacts/hides the range summary (steps 3+4); overflow collapses Filter/Sort/Columns into one \"More\" trigger routed through the same menu-ui/menu-item-ui pattern used elsewhere in the corpus (step 5). The resolved stage — the pin if set, otherwise the live width classification — also reflects onto the host as `data-stage-resolved` (step 7, informational only, mirrors chart-ui's `data-ratio-resolved` convention — never drives table-toolbar's own rendering, which stays 100% CSS-driven).",
85
95
  "type": "string",
@@ -153,6 +153,20 @@ function collectUniqueValues(col, data) {
153
153
  export class UITableToolbar extends UIElement {
154
154
  static properties = {
155
155
  for: { type: String, default: '', reflect: true },
156
+ // Not consumed by any table-toolbar-specific CSS — sizing.css's
157
+ // universal [size="sm|md|lg"] (unscoped attribute selector, ambient
158
+ // inheriting tokens) already governs the host AND every slotted
159
+ // consumer content (scope select-ui, actions-leading/actions
160
+ // button-ui) that carries no [size] of its own, same as
161
+ // `<div size="sm">…</div>`. Declared (reflect: true) purely so this
162
+ // A2UI-modeled prop survives the docs-transpiler's schema-scoped
163
+ // attribute walk (unmodeled attributes are silently dropped there —
164
+ // verified live: `<table-toolbar-ui size="sm">` authored in
165
+ // table-toolbar.examples.html rendered with no [size] attribute at
166
+ // all on the generated site-a2ui page until this was added) and so
167
+ // `el.size = 'sm'` works from JS, matching card-ui/button-ui's own
168
+ // `size` property shape.
169
+ size: { type: String, default: '', reflect: true },
156
170
  text: { type: String, default: '', reflect: false },
157
171
  count: { type: String, default: '', reflect: false },
158
172
  rangeStart: { type: Number, default: 0, reflect: true, attribute: 'range-start' },
@@ -233,6 +247,27 @@ export class UITableToolbar extends UIElement {
233
247
 
234
248
  connected() {
235
249
  this.setAttribute('role', 'toolbar');
250
+ // `size` (declared above, reflect: true) defaults to '' — the base
251
+ // property system's own reflect pass (core/element.js) deliberately
252
+ // does NOT auto-stamp a non-empty string/number default onto the DOM
253
+ // (gh#961: scoped to Boolean-true defaults only, to avoid a
254
+ // framework-wide `attr=""`-stamping cascade), so a bare
255
+ // `<table-toolbar-ui>` never actually gets a `[size]` attribute from
256
+ // the default alone. Stamped explicitly, once, HERE — sizing.css's
257
+ // `[size="sm"]` is a plain unscoped attribute selector that needs the
258
+ // literal attribute present to set the ambient `--a-size`/`--a-ui-size`
259
+ // tokens at all. Every native control this component stamps below
260
+ // (badge, search, page-size select, granular buttons, overflow
261
+ // trigger) is a light-DOM descendant with no `[size]` of its own, so
262
+ // it inherits those tokens the same way any plain
263
+ // `<div size="sm">…</div>` cascades to its children — no per-child
264
+ // `size=` stamping needed (tried first, reverted: redundant with what
265
+ // inheritance already does for every element still in this light-DOM
266
+ // subtree, and actively wrong once a consumer sets an explicit
267
+ // `size="lg"` after connect — the per-child copies would go stale
268
+ // since nothing re-stamps them on a later property change, while
269
+ // inheritance updates live).
270
+ if (!this.hasAttribute('size')) this.setAttribute('size', this.size || 'sm');
236
271
  this.#warnUnknownOptOutAttrs();
237
272
  // gh#1615 — hydrate `page-size-options="[10,25,50]"` once at connect,
238
273
  // same pattern as table-ui's `data`/`columns` JSON-array attributes
@@ -479,6 +514,26 @@ export class UITableToolbar extends UIElement {
479
514
 
480
515
  // ── DOM stamp ────────────────────────────────────────────────────────────
481
516
 
517
+ // Used ONLY for the two stamped elements that end up OUTSIDE
518
+ // table-toolbar-ui's own light DOM — the popover-panel action buttons
519
+ // (#mkPopoverAction) and the filter-input (#fillFilterPanel), both
520
+ // appended to `document.body` for the Popover API's top-layer promotion
521
+ // (#togglePopover) — so ambient CSS inheritance from the host's own
522
+ // `[size]` attribute (stamped once in connected(), above) can never
523
+ // reach them. Every OTHER stamped control (badge, search, page-size
524
+ // select, granular Filter/Sort/Columns buttons, the overflow trigger)
525
+ // stays in the host's own light DOM and inherits that ambient value
526
+ // directly — no per-element `size=` copy needed, and no risk of one
527
+ // going stale after a later `.size =` change the way an explicit copy
528
+ // would (tried first, reverted: every in-tree control hardcoded
529
+ // `size="sm"` unconditionally, which not only ignored a consumer's
530
+ // `size="lg"` but also fought its OWN copy going stale on any later
531
+ // property change nothing re-stamped). Falls back to "sm" (the
532
+ // pre-existing hardcoded default) when `size` is unset.
533
+ #stampSize() {
534
+ return this.size || 'sm';
535
+ }
536
+
482
537
  #stamp() {
483
538
  if (this.querySelector(':scope > [data-toolbar]')) return;
484
539
 
@@ -509,7 +564,8 @@ export class UITableToolbar extends UIElement {
509
564
 
510
565
  const badge = document.createElement('badge-ui');
511
566
  badge.setAttribute('data-toolbar-count-badge', '');
512
- badge.setAttribute('size', 'sm');
567
+ // No own [size] — inherits the host's ambient --a-size (stamped in
568
+ // connected(), above).
513
569
  badge.setAttribute('tone', 'muted');
514
570
  badge.hidden = true;
515
571
  title.appendChild(badge);
@@ -577,7 +633,7 @@ export class UITableToolbar extends UIElement {
577
633
  // name renders as literal text before the icon registry resolves.
578
634
  const search = document.createElement('search-ui');
579
635
  search.setAttribute('data-search', '');
580
- search.setAttribute('size', 'sm'); // match toolbar buttons + badge + filter chips
636
+ // No own [size] inherits the host's ambient --a-size, same as badge.
581
637
  search.setAttribute('placeholder', this.placeholder);
582
638
  search.setAttribute('debounce', String(SEARCH_DEBOUNCE));
583
639
  search.addEventListener('search', this.#onSearch);
@@ -590,7 +646,7 @@ export class UITableToolbar extends UIElement {
590
646
  // existing default behavior for consumers that never set pageSizeOptions.
591
647
  const pageSize = document.createElement('select-ui');
592
648
  pageSize.setAttribute('data-page-size', '');
593
- pageSize.setAttribute('size', 'sm');
649
+ // No own [size] — inherits the host's ambient --a-size, same as badge.
594
650
  pageSize.setAttribute('aria-label', 'Rows per page');
595
651
  pageSize.hidden = true;
596
652
  pageSize.addEventListener('change', this.#onPageSizeChange);
@@ -645,7 +701,12 @@ export class UITableToolbar extends UIElement {
645
701
  btn.setAttribute('data-popover-action', '');
646
702
  btn.setAttribute('text', label);
647
703
  btn.setAttribute('variant', 'ghost');
648
- btn.setAttribute('size', 'sm');
704
+ // Explicit [size] IS still needed here, unlike the in-tree stamped
705
+ // controls above — #togglePopover appends this button's panel straight
706
+ // to `document.body` (Popover API top-layer promotion), not nested
707
+ // inside table-toolbar-ui in the DOM, so ambient CSS inheritance from
708
+ // the host's own [size] never reaches it.
709
+ btn.setAttribute('size', this.#stampSize());
649
710
  btn.setAttribute('stretch', '');
650
711
  btn.addEventListener('click', onClick);
651
712
  return btn;
@@ -657,7 +718,7 @@ export class UITableToolbar extends UIElement {
657
718
  btn.setAttribute('icon', icon);
658
719
  btn.setAttribute('text', label);
659
720
  btn.setAttribute('variant', 'outline');
660
- btn.setAttribute('size', 'sm');
721
+ // No own [size] — inherits the host's ambient --a-size, same as badge.
661
722
  btn.setAttribute('aria-haspopup', 'menu');
662
723
  // ADR-0076 REQ-X-002 — unconditional (harmless at full-text stages,
663
724
  // becomes the hover-tooltip affordance at the icon-only stage once
@@ -689,7 +750,7 @@ export class UITableToolbar extends UIElement {
689
750
  trigger.setAttribute('slot', 'trigger');
690
751
  trigger.setAttribute('icon', 'dots-three-vertical');
691
752
  trigger.setAttribute('variant', 'outline');
692
- trigger.setAttribute('size', 'sm');
753
+ // No own [size] — inherits the host's ambient --a-size, same as badge.
693
754
  // REQ-X-003 — a genuinely new interactive element (not a repurposed
694
755
  // existing button), so it needs its own static accessible name rather
695
756
  // than an inherited one. No [text] attribute — always icon-only,
@@ -1085,7 +1146,9 @@ export class UITableToolbar extends UIElement {
1085
1146
  } else {
1086
1147
  const input = document.createElement('input-ui');
1087
1148
  input.setAttribute('type', 'text');
1088
- input.setAttribute('size', 'sm');
1149
+ // Explicit [size] needed — this panel is appended straight to
1150
+ // document.body (see #mkPopoverAction's comment above).
1151
+ input.setAttribute('size', this.#stampSize());
1089
1152
  input.setAttribute('data-filter-input', '');
1090
1153
  input.setAttribute('placeholder', '—');
1091
1154
  if (current?.op === 'contains') input.value = current.value ?? '';
@@ -284,6 +284,21 @@
284
284
  flex: 0 0 auto;
285
285
  }
286
286
 
287
+ /* See [data-page-size]'s own comment below — same --select-min-width
288
+ floor, same fix, but targeted at the select-ui DESCENDANT directly
289
+ rather than set as an inheriting custom property on the [data-scope]
290
+ wrapper: select-ui's own `:where(:scope) { --select-min-width: 20ch }`
291
+ (select.css) directly assigns the property on the select-ui element
292
+ itself — a direct assignment always wins over an inherited value
293
+ regardless of the assigning rule's (here, zero) specificity, so a
294
+ value merely inherited from an ancestor wrapper never actually
295
+ reaches it. Matching the select-ui element directly puts this
296
+ override in the same competition as that rule, where normal
297
+ specificity comparison (0,2,0) vs (0,0,0) applies and this wins. */
298
+ [data-scope] select-ui {
299
+ --select-min-width: 0;
300
+ }
301
+
287
302
  [data-scope]:empty { display: none; }
288
303
 
289
304
  /* ═══════ Title cluster ═══════ */
@@ -305,6 +320,21 @@
305
320
 
306
321
  [data-toolbar-count-badge][hidden] { display: none; }
307
322
 
323
+ /* Scope reconciliation — a filled [slot="scope"] already names the
324
+ entity being listed (a select/menu whose own displayed value IS the
325
+ label, e.g. "All Accounts (3)"), so the separate [text]/[count] title
326
+ cluster next to it says the same thing twice ("All accounts" +
327
+ "Accounts 3"). CSS-only, not #updateTitle() (JS never even sees
328
+ [text]/[count] are redundant here — [count] still falls back to the
329
+ bound table's row length regardless, so a JS hide would need a new
330
+ prop; this reads what's already in the DOM, same `:has()` idiom the
331
+ [data-summary]/[data-page-size] reconciliation above already uses).
332
+ A consumer wanting BOTH visible can still override with normal CSS
333
+ specificity — this isn't a hard mode switch, just the default. */
334
+ :scope:has([data-scope]:not(:empty)) [data-title] {
335
+ display: none;
336
+ }
337
+
308
338
  /* ═══════ Range summary ═══════ (gh#1615 — "Showing X–Y of N", independent of [data-title]) */
309
339
 
310
340
  [data-summary] {
@@ -371,7 +401,17 @@
371
401
  --table-toolbar-bp-overflow's own default (same duplication +
372
402
  source-assertion discipline as the search-tight/icon-only boundaries
373
403
  above). */
374
- [data-toolbar-overflow] { display: none; }
404
+ /* BUG (found live, verified in a real browser — a fresh table-toolbar-ui
405
+ at ANY stage, including "full", rendered Filter/Sort/Columns AND the
406
+ "More" trigger simultaneously): menu-ui's own base rule (menu.css,
407
+ `:scope { display: flex; }`) is the same (0,1,0) specificity as a bare
408
+ `[data-toolbar-overflow]` selector — a cascade TIE this file's source
409
+ order loses (menu.css wins), so this default-hide rule never actually
410
+ applied. The `:scope … [data-toolbar-overflow][hidden]` override below
411
+ already carries the `:scope` prefix for exactly this reason (its own
412
+ comment: "must match or exceed the (0,3,0) specificity … to win the
413
+ tie") — this rule needed the same prefix and never got it. */
414
+ :scope [data-toolbar-overflow] { display: none; }
375
415
 
376
416
  @container table-toolbar (max-width: 26rem) {
377
417
  :scope:is(:not([stage]), [stage=""]) [data-toolbar-btn] {
@@ -405,19 +445,62 @@
405
445
  conflicting author rule. */
406
446
  :scope [data-toolbar-overflow][hidden] { display: none; }
407
447
 
448
+ /* menu-ui's own popover carries a hardcoded `min-width: 10rem` (menu.css
449
+ — a LITERAL, not even the `--menu-popover-min-width` token declared
450
+ next to it: the popover is promoted to the top layer via the Popover
451
+ API but stays a real light-DOM child of <menu-ui>, per menu.css's own
452
+ comment "the top-layer element can't inherit the scoped token", so
453
+ that rule hardcodes the value instead of reading the custom property).
454
+ Same class of bug as --input-min-width/--select-min-width above: sized
455
+ for a generic dropdown menu of arbitrary action items, not this
456
+ specific "More" trigger's three short labels (Filter/Sort/Columns),
457
+ each already narrower than 10rem on its own. Scoped to JUST this
458
+ menu-ui instance (`[data-toolbar-overflow]`) — the [data-menu-popover]
459
+ it targets is menu-ui's own internal implementation selector, not
460
+ table-toolbar's; overriding the LITERAL selector directly here rather
461
+ than touching menu.css keeps every other menu-ui consumer's own
462
+ 10rem floor (a reasonable default for a menu of arbitrary items)
463
+ untouched. */
464
+ :scope [data-toolbar-overflow] [data-menu-popover] {
465
+ min-width: 0;
466
+ }
467
+
408
468
  /* ═══════ Search ═══════ */
409
469
 
410
470
  [data-search] {
411
471
  flex: 1 1 var(--table-toolbar-search-min);
412
472
  /* gh#1076 — never collapse to 0: floor at a usable width and let the
413
- flex-wrap above move it to its own row when the container is tight. */
414
- min-width: min(10rem, 100%);
473
+ flex-wrap above move it to its own row when the container is tight.
474
+ BUG (found live, 2026-08-22): this used to be a hardcoded
475
+ `min(10rem, 100%)`, independent of `--table-toolbar-search-min` —
476
+ at the search-tight/icon-only/overflow stages that token gets
477
+ reassigned to `--table-toolbar-search-tight-min` (9rem default),
478
+ but the hardcoded 10rem floor here still won, so the tight tier's
479
+ own declared 9rem target could never actually be reached. Deriving
480
+ the floor from the SAME token as the flex-basis keeps them in sync
481
+ at every stage instead of drifting against each other. */
482
+ min-width: min(var(--table-toolbar-search-min), 100%);
415
483
  max-width: var(--table-toolbar-search-max);
416
484
  margin-inline-start: auto;
417
485
  }
418
486
 
419
487
  [data-search][hidden] { display: none; }
420
488
 
489
+ /* input-ui's own --input-min-width default (20ch — input.css) is sized
490
+ for a BARE, standalone field where the component has no other context
491
+ to size against. Inside [data-search] that's a second, independent
492
+ floor competing with the one above — at the tight/icon-only/overflow
493
+ stages input-ui's 20ch (~164px) is WIDER than
494
+ --table-toolbar-search-tight-min (9rem/144px), so it silently won
495
+ regardless of what [data-search]'s own min-width — even after the fix
496
+ above — asked for. table-toolbar-ui owns the search field's sizing
497
+ budget end-to-end (it's the one deciding how much room is left after
498
+ the title/controls/page-size clusters); input-ui's independent
499
+ opinion has nothing to add here and only fights the outer token. */
500
+ [data-search] input-ui {
501
+ --input-min-width: 0;
502
+ }
503
+
421
504
  /* ═══════ Actions-leading slot ═══════ (gh#1649 — app-owned triggers, e.g.
422
505
  custom Filter/Columns buttons, that land BEFORE the page-size select)
423
506
  Carries the SAME margin-inline-start:auto as [data-search]/[data-page-size]
@@ -449,9 +532,23 @@
449
532
  is safe — only the first one with unclaimed free space to its left
450
533
  actually receives it. */
451
534
 
535
+ /* select-ui's own --select-min-width default (20ch — select.css,
536
+ gh#1633, the SAME UA-baseline floor input.css's --input-min-width
537
+ already documents for input-ui) is sized for a bare, standalone
538
+ select. Found live (root-caused alongside the earlier search-field
539
+ min-width fix, same shape): with no override here, [data-page-size]
540
+ and [data-scope] select-ui both floor at ~151px regardless of how
541
+ short their actual content is ("25 / page", "All Accounts (3)") —
542
+ visible dead space inside the trigger. The filter/sort/columns
543
+ popover's OWN per-column selects already avoid this (they share the
544
+ `[data-filter-input]` marker with the text-input case, and
545
+ `[data-toolbar-popover] [data-filter-input] { min-width: 0; }`
546
+ already resets it there) — this is the same fix for the two
547
+ main-row selects that marker doesn't reach. */
452
548
  [data-page-size] {
453
549
  flex: 0 0 auto;
454
550
  margin-inline-start: auto;
551
+ --select-min-width: 0;
455
552
  }
456
553
 
457
554
  [data-page-size][hidden] { display: none; }
@@ -50,6 +50,8 @@ export class UITableToolbar extends UIElement {
50
50
  rangeStart: number;
51
51
  /** Total row count across all pages, for the range summary (e.g. `320` in "Showing 1–25 of 320"). Distinct from pagination-ui's `total` (total PAGES) — this is total ROWS; deliberately not spelled `total` to avoid that cross-sibling name collision (ADR-0063 B5). See rangeStart. */
52
52
  rangeTotal: number;
53
+ /** Toolbar scale, via sizing.css's universal [size="sm|md|lg"] ambient tokens. Not table-toolbar-specific chrome — the same attribute that scales any component. Set it once on the toolbar instead of on each slotted scope/actions-leading/actions control individually; anything slotted with no [size] of its own inherits the ambient value. Default (empty) = md. */
54
+ size: 'sm' | 'md' | 'lg';
53
55
  /** Explicit compaction-stage override (ADR-0076). Unset (the default, empty string) means auto-snap: the toolbar's own inline-size container query picks the nearest stage from its live width against the three --table-toolbar-bp-* breakpoints, snapping discretely, never interpolating. Setting stage explicitly pins that stage's rendering regardless of the container's actual width — overriding the container query, mirroring chart-ui's ratio override shape. Primary use: visual-eval fixtures that need a deterministic stage without resizing a real container, and a consumer embedding the toolbar inside a known-narrow panel who wants to skip auto-detection entirely. All four stages' CSS is now live (ADR-0076): search-tight steps the search field down (step 2); icon-only drops control labels and compacts/hides the range summary (steps 3+4); overflow collapses Filter/Sort/Columns into one "More" trigger routed through the same menu-ui/menu-item-ui pattern used elsewhere in the corpus (step 5). The resolved stage — the pin if set, otherwise the live width classification — also reflects onto the host as `data-stage-resolved` (step 7, informational only, mirrors chart-ui's `data-ratio-resolved` convention — never drives table-toolbar's own rendering, which stays 100% CSS-driven). */
54
56
  stage: '' | 'full' | 'search-tight' | 'icon-only' | 'overflow';
55
57
  /** Title text shown on the left. */
@@ -14,45 +14,45 @@
14
14
  ## Rendered demos
15
15
 
16
16
  ```html
17
- <col-ui gap="0">
18
- <table-toolbar-ui for="demo-table" text="All employees" count="32" placeholder="Search employees…"></table-toolbar-ui>
19
- <card-ui>
20
- <section bleed>
21
- <table-ui id="demo-table" sortable raw>
22
- <table>
23
- <thead>
24
- <tr>
25
- <th>Name</th>
26
- <th>Role</th>
27
- <th>Status</th>
28
- </tr>
29
- </thead>
30
- <tbody>
31
- <tr>
32
- <td>Maya Chen</td>
33
- <td>Designer</td>
34
- <td>
35
- <tag-ui variant="success">Active</tag-ui>
36
- </td>
37
- </tr>
38
- <tr>
39
- <td>Alex Park</td>
40
- <td>Engineer</td>
41
- <td>
42
- <tag-ui variant="success">Active</tag-ui>
43
- </td>
44
- </tr>
45
- <tr>
46
- <td>Jordan Lee</td>
47
- <td>Product</td>
48
- <td>
49
- <tag-ui variant="warning">Away</tag-ui>
50
- </td>
51
- </tr>
52
- </tbody>
53
- </table>
54
- </table-ui>
55
- </section>
56
- </card-ui>
57
- </col-ui>
17
+ <card-ui>
18
+ <header>
19
+ <table-toolbar-ui for="demo-table" text="All employees" count="32" placeholder="Search employees…"></table-toolbar-ui>
20
+ </header>
21
+ <section bleed>
22
+ <table-ui id="demo-table" sortable raw>
23
+ <table>
24
+ <thead>
25
+ <tr>
26
+ <th>Name</th>
27
+ <th>Role</th>
28
+ <th>Status</th>
29
+ </tr>
30
+ </thead>
31
+ <tbody>
32
+ <tr>
33
+ <td>Maya Chen</td>
34
+ <td>Designer</td>
35
+ <td>
36
+ <tag-ui variant="success">Active</tag-ui>
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td>Alex Park</td>
41
+ <td>Engineer</td>
42
+ <td>
43
+ <tag-ui variant="success">Active</tag-ui>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td>Jordan Lee</td>
48
+ <td>Product</td>
49
+ <td>
50
+ <tag-ui variant="warning">Away</tag-ui>
51
+ </td>
52
+ </tr>
53
+ </tbody>
54
+ </table>
55
+ </table-ui>
56
+ </section>
57
+ </card-ui>
58
58
  ```
@@ -40,6 +40,20 @@ props:
40
40
  type: string
41
41
  default: ""
42
42
  reflect: true
43
+ size:
44
+ description: >-
45
+ Toolbar scale, via sizing.css's universal [size="sm|md|lg"] ambient
46
+ tokens. Not table-toolbar-specific chrome — the same attribute that
47
+ scales any component. Set it once on the toolbar instead of on each
48
+ slotted scope/actions-leading/actions control individually; anything
49
+ slotted with no [size] of its own inherits the ambient value.
50
+ Default (empty) = md.
51
+ type: string
52
+ default: ""
53
+ enum:
54
+ - sm
55
+ - md
56
+ - lg
43
57
  text:
44
58
  description: Title text shown on the left.
45
59
  type: string