@adia-ai/web-components 0.8.30 → 0.8.32

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 (120) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/components/accordion/accordion.d.ts +2 -2
  3. package/components/action-list/action-list.class.js +6 -2
  4. package/components/action-list/action-list.d.ts +1 -1
  5. package/components/agent-artifact/agent-artifact.d.ts +1 -1
  6. package/components/agent-feedback-bar/agent-feedback-bar.d.ts +2 -2
  7. package/components/agent-questions/agent-questions.d.ts +1 -1
  8. package/components/agent-reasoning/agent-reasoning.d.ts +3 -3
  9. package/components/agent-suggestions/agent-suggestions.d.ts +1 -1
  10. package/components/agent-trace/agent-trace.d.ts +1 -1
  11. package/components/alert/alert.d.ts +2 -2
  12. package/components/anchor-bar/anchor-bar.d.ts +2 -2
  13. package/components/avatar/avatar.class.js +0 -1
  14. package/components/avatar/avatar.css +16 -2
  15. package/components/badge/badge.css +30 -2
  16. package/components/breadcrumb/breadcrumb.css +15 -3
  17. package/components/button/button.d.ts +1 -1
  18. package/components/calendar-grid/calendar-grid.d.ts +2 -2
  19. package/components/card/card.css +21 -0
  20. package/components/card/card.yaml +9 -0
  21. package/components/chart/chart.d.ts +4 -4
  22. package/components/chart-legend/chart-legend.d.ts +1 -1
  23. package/components/chat-thread/chat-input.css +1 -1
  24. package/components/chat-thread/chat-input.js +9 -1
  25. package/components/chat-thread/chat-thread.class.js +6 -0
  26. package/components/chat-thread/chat-thread.d.ts +2 -2
  27. package/components/check/check.css +3 -3
  28. package/components/command/command.d.ts +2 -2
  29. package/components/context-menu/context-menu.d.ts +3 -3
  30. package/components/datetime-picker/datetime-picker.d.ts +5 -5
  31. package/components/demo-toggle/demo-toggle.d.ts +1 -1
  32. package/components/drawer/drawer.d.ts +2 -2
  33. package/components/heatmap/heatmap.d.ts +5 -5
  34. package/components/index.js +1 -0
  35. package/components/inline-edit/inline-edit.d.ts +4 -4
  36. package/components/input/input.a2ui.json +4 -1
  37. package/components/input/input.css +18 -0
  38. package/components/input/input.yaml +11 -1
  39. package/components/integration-card/integration-card.d.ts +4 -4
  40. package/components/link/link.d.ts +1 -1
  41. package/components/list/list-item.a2ui.json +6 -0
  42. package/components/list/list-item.yaml +13 -0
  43. package/components/list/list.class.js +28 -7
  44. package/components/list/list.d.ts +1 -1
  45. package/components/list-window/list-window.d.ts +5 -5
  46. package/components/menu/menu.css +2 -2
  47. package/components/menu/menu.d.ts +1 -1
  48. package/components/modal/modal.d.ts +1 -1
  49. package/components/nav/nav.css +8 -0
  50. package/components/nav/nav.d.ts +1 -1
  51. package/components/nav-group/nav-group.css +58 -9
  52. package/components/nav-group/nav-group.d.ts +1 -1
  53. package/components/nav-item/nav-item.css +7 -4
  54. package/components/nav-item/nav-item.d.ts +1 -1
  55. package/components/noodles/noodles.d.ts +3 -3
  56. package/components/option-card/option-card.css +1 -1
  57. package/components/pagination/pagination.d.ts +1 -1
  58. package/components/pane/pane.d.ts +1 -1
  59. package/components/password-strength/password-strength.d.ts +1 -1
  60. package/components/pipeline-status/pipeline-status.a2ui.json +14 -8
  61. package/components/pipeline-status/pipeline-status.d.ts +5 -4
  62. package/components/pipeline-status/pipeline-status.yaml +17 -11
  63. package/components/radio/radio.a2ui.json +4 -3
  64. package/components/radio/radio.css +2 -2
  65. package/components/radio/radio.yaml +7 -14
  66. package/components/radio-group/radio-group.a2ui.json +118 -0
  67. package/components/radio-group/radio-group.class.js +75 -0
  68. package/components/radio-group/radio-group.css +31 -0
  69. package/components/radio-group/radio-group.d.ts +20 -0
  70. package/components/radio-group/radio-group.examples.md +37 -0
  71. package/components/radio-group/radio-group.js +17 -0
  72. package/components/radio-group/radio-group.yaml +114 -0
  73. package/components/segmented/segmented.a2ui.json +5 -0
  74. package/components/segmented/segmented.class.js +20 -2
  75. package/components/segmented/segmented.yaml +5 -0
  76. package/components/stat/stat.css +12 -8
  77. package/components/stat/stat.js +66 -1
  78. package/components/stat/stat.yaml +3 -0
  79. package/components/stepper/stepper-item.a2ui.json +5 -0
  80. package/components/stepper/stepper-item.yaml +11 -0
  81. package/components/stepper/stepper.a2ui.json +38 -3
  82. package/components/stepper/stepper.class.js +199 -2
  83. package/components/stepper/stepper.css +30 -0
  84. package/components/stepper/stepper.d.ts +28 -1
  85. package/components/stepper/stepper.yaml +76 -2
  86. package/components/stream/stream.d.ts +3 -3
  87. package/components/swatch/swatch.class.js +1 -1
  88. package/components/swatch/swatch.d.ts +1 -1
  89. package/components/swiper/swiper.d.ts +3 -3
  90. package/components/table/table.a2ui.json +2 -2
  91. package/components/table/table.d.ts +7 -7
  92. package/components/table/table.yaml +9 -1
  93. package/components/table-toolbar/table-toolbar.d.ts +4 -4
  94. package/components/tabs/tabs.css +11 -3
  95. package/components/tabs/tabs.d.ts +1 -1
  96. package/components/tag/tag.a2ui.json +1 -1
  97. package/components/tag/tag.css +78 -13
  98. package/components/tag/tag.d.ts +12 -8
  99. package/components/tag/tag.examples.md +4 -4
  100. package/components/tag/tag.yaml +18 -7
  101. package/components/tags-input/tags-input.d.ts +4 -4
  102. package/components/timeline/timeline.d.ts +1 -1
  103. package/components/toc/toc.d.ts +1 -1
  104. package/components/toggle-group/toggle-group.d.ts +1 -1
  105. package/components/toggle-scheme/toggle-scheme.d.ts +1 -1
  106. package/components/tour/tour.d.ts +4 -4
  107. package/components/tree/tree.d.ts +1 -1
  108. package/core/icons-phosphor.js +129 -71
  109. package/core/provider.js +84 -23
  110. package/dist/host.min.css +1 -1
  111. package/dist/host.sheet.js +1 -1
  112. package/dist/theme-provider.min.js +1 -1
  113. package/dist/web-components.min.css +1 -1
  114. package/dist/web-components.min.js +89 -87
  115. package/dist/web-components.sheet.js +1 -1
  116. package/package.json +1 -1
  117. package/styles/api/sizing-fallback.css +32 -0
  118. package/styles/api/sizing.css +7 -3
  119. package/styles/components.css +1 -0
  120. package/styles/tokens.css +1 -0
@@ -27,12 +27,12 @@ export class UITabs extends UIElement {
27
27
  /** Visual variant — `default` (underline strip) or `bordered`. */
28
28
  variant: 'default' | 'bordered';
29
29
 
30
+ addEventListener(type: 'change', listener: (ev: TabsChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
30
31
  addEventListener<K extends keyof HTMLElementEventMap>(
31
32
  type: K,
32
33
  listener: (this: UITabs, ev: HTMLElementEventMap[K]) => unknown,
33
34
  options?: boolean | AddEventListenerOptions,
34
35
  ): void;
35
- addEventListener(type: 'change', listener: (ev: TabsChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
36
36
  }
37
37
 
38
38
  export class UITab extends UIElement {
@@ -46,7 +46,7 @@
46
46
  "$ref": "common_types.json#/$defs/DynamicString"
47
47
  },
48
48
  "tone": {
49
- "description": "Fill style — orthogonal to [variant]. Three values:\n - `solid` (default for family variants) — saturated bg + on-strong\n (near-white) text. The chip IS the state.\n - `muted` — tinted bg with scheme-paired text. Matches <badge-ui>'s\n default look. Use on metadata chips in dense lists where the\n saturated default would compete for attention.\n - `outline` — transparent bg + family-colored border + family-colored\n text. The lightest visual weight; good in dense data tables or\n faceted filter rows where multiple chips would otherwise compete.\nThe `default` variant (no family) stays quiet chrome regardless of\ntone unless `tone=\"solid\"` is set explicitly (high-contrast neutral\ninverse), or `tone=\"outline\"` (fg-muted text + subtle border).\n",
49
+ "description": "Fill style — orthogonal to [variant]. Three values:\n - `solid` (default for EVERY variant, including the family-less\n `default`, since gh#794) — saturated bg + on-strong (near-white)\n text. The chip IS the state. A bare `<tag-ui text=\"…\">` renders\n this look with no attributes at all.\n - `muted` — tinted bg with scheme-paired text. Matches <badge-ui>'s\n default look, and is the pre-gh#794 look for the family-less\n `default` variant. Use on metadata / citation chips in dense\n lists or tables where the saturated default would compete for\n attention (gh#778's oversized-pill concern).\n - `outline` — transparent bg + family-colored border + family-colored\n text. The lightest visual weight; good in dense data tables or\n faceted filter rows where multiple chips would otherwise compete.\n`tone` is a declarative presentational attribute (not a reactive\nprop see tag.class.js) so its schema `default` here is documentation\nof the rendered-by-default look, not a reflected attribute value.\n",
50
50
  "type": "string",
51
51
  "enum": [
52
52
  "solid",
@@ -6,15 +6,43 @@ tag-ui[removable]:not([disabled]):hover {
6
6
 
7
7
  @scope (tag-ui) {
8
8
  :where(:scope) {
9
- /* ── Tokens ── */
10
- --tag-bg: var(--a-bg-muted);
11
- --tag-fg: var(--md-sys-color-neutral-on-surface);
9
+ /* ── Tokens ──
10
+ gh#794: the real bare-tag default lives HERE, not in the
11
+ `:scope[variant="default"]` rule below — `variant` is a reflect:true
12
+ prop (tag.class.js), and `installProps()`'s reflect() only fires on
13
+ a property SET, never for a value that equals its declared class
14
+ default at construction time. A bare `<tag-ui text="…">` therefore
15
+ never gets a physical `variant="default"` attribute; these
16
+ `:where(:scope)` zero-specificity tokens are what it actually
17
+ renders. Solid neutral inverse (was `--a-bg-muted` quiet chrome
18
+ pre-#794) — same pair the family variants and the redundant
19
+ `:scope[variant="default"]` rule below carry, for the rare case
20
+ `variant="default"` IS reflected explicitly (SSR/a2ui-producer
21
+ markup). Opt out via `[tone="muted"]`. */
22
+ --tag-bg: var(--md-sys-color-neutral-on-surface);
23
+ --tag-fg: var(--md-sys-color-neutral-background);
12
24
  --tag-border: transparent;
13
25
  --tag-radius: var(--a-radius-full);
14
26
  --tag-px: var(--a-space-1-5);
15
- --tag-py: 0.125rem;
27
+ --tag-py: var(--a-space-0-5);
16
28
  --tag-gap: var(--a-space-1);
17
29
  --tag-font: var(--a-ui-sm);
30
+
31
+ /* ── Size tiers (gh#779) — md (above) is the pixel-identical default;
32
+ [size="sm"|"lg"] below re-point the active tokens. Component-owned
33
+ ladder, NOT a direct alias of the universal --a-ui-px/--a-ui-size
34
+ tokens (styles/api/sizing.css) — tag-ui's own md baseline predates
35
+ and differs from that system's md (6px/12px here vs 8px/13px
36
+ there), so aliasing directly would shift every default tag's
37
+ geometry (gh#778 is exactly this failure mode — an inflated
38
+ default). Instead sm/lg step off tag's OWN md baseline by the
39
+ same rung spacing the space/type scales already use. */
40
+ --tag-px-sm: var(--a-space-1);
41
+ --tag-px-lg: var(--a-space-2);
42
+ --tag-py-sm: var(--a-space-px);
43
+ --tag-py-lg: var(--a-space-1);
44
+ --tag-font-sm: var(--a-ui-xs);
45
+ --tag-font-lg: var(--a-ui-md);
18
46
  --tag-font-family: var(--a-font-family-ui);
19
47
  --tag-dismiss-size: 1rem;
20
48
  --tag-bg-hover: var(--a-bg-hover);
@@ -134,12 +162,16 @@ tag-ui[removable]:not([disabled]):hover {
134
162
  --tag-fg: var(--md-sys-color-danger-on-danger);
135
163
  }
136
164
 
137
- /* `default` (no family) stays as quiet chromea stark fg/bg-inverse
138
- would be too loud for the no-variant case. Opt in to the inverse
139
- stamp via `[tone="solid"]` when you want a high-contrast neutral pill. */
165
+ /* `default` (no family) is solid by default (gh#794) the same
166
+ high-contrast neutral inverse the family variants already carry.
167
+ A bare `<tag-ui text="">` is now a stamped pill, not quiet chrome.
168
+ Opt OUT to the pre-#794 quiet-chrome look via `[tone="muted"]`
169
+ (below) on metadata/citation chips in dense lists or tables where
170
+ the saturated look competes for attention (gh#778's oversized-pill
171
+ complaint) — same escape hatch the family variants already use. */
140
172
  :scope[variant="default"] {
141
- --tag-bg: var(--a-bg-muted);
142
- --tag-fg: var(--md-sys-color-neutral-on-surface);
173
+ --tag-bg: var(--md-sys-color-neutral-on-surface);
174
+ --tag-fg: var(--md-sys-color-neutral-background);
143
175
  }
144
176
 
145
177
  /* ── Tone modifier — orthogonal to [variant] ──
@@ -170,10 +202,26 @@ tag-ui[removable]:not([disabled]):hover {
170
202
  --tag-bg: var(--md-sys-color-primary-container);
171
203
  --tag-fg: var(--md-sys-color-primary-on-surface);
172
204
  }
205
+ /* gh#794: the pre-#794 quiet-chrome look for the variant-less default —
206
+ same values the `:where(:scope)` base tokens carried before the
207
+ solid-default flip. This is the explicit opt-out for bare tags that
208
+ need the old quiet register (dense-list metadata/citation chips,
209
+ gh#778's oversized-pill concern) instead of the new stamped-pill
210
+ default. `:not([variant=…])` (not `[variant="default"]`) because
211
+ `variant` is a reflect:true prop whose class default ("default")
212
+ never gets a physical attribute reflected on a bare tag (the
213
+ `installProps()` reflect() path only fires on a property SET) —
214
+ the same reason the `[tone="solid"]` fallback below uses this same
215
+ `:not()` shape instead of `[variant="default"]`. */
216
+ :scope[tone="muted"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="accent"]) {
217
+ --tag-bg: var(--a-bg-muted);
218
+ --tag-fg: var(--md-sys-color-neutral-on-surface);
219
+ }
173
220
 
174
- /* `[tone="solid"]` on the neutral default (or no variant) inverts the
175
- chrome solid fg-color bg with bg-color text. High-contrast neutral
176
- stamp. Explicit opt-in; the variant-less default stays quiet chrome.
221
+ /* `[tone="solid"]` explicit opt-in redundant with the bare default
222
+ since gh#794 (the variant-less default is solid unconditionally
223
+ above) but kept so `tone="solid"` stays a valid, harmless, explicit
224
+ statement of intent for consumers who set it directly.
177
225
  [variant="accent"] is excluded — it already has an explicit solid
178
226
  pair above (the plain [variant="accent"] rule) that this higher-
179
227
  specificity fallback would otherwise clobber when tone="solid" is
@@ -220,7 +268,24 @@ tag-ui[removable]:not([disabled]):hover {
220
268
  --tag-border: var(--md-sys-color-neutral-outline);
221
269
  }
222
270
 
223
- /* Size handled by universal [size] attribute system. */
271
+ /* ── Size tiers (gh#779) re-point the active tokens to the matching
272
+ tier; the token defaults at :where(:scope) above ARE the md tier, so
273
+ [size="md"] is declared only for explicitness (mirrors kbd.css). */
274
+ :scope[size="sm"] {
275
+ --tag-px: var(--tag-px-sm);
276
+ --tag-py: var(--tag-py-sm);
277
+ --tag-font: var(--tag-font-sm);
278
+ }
279
+ :scope[size="md"] {
280
+ --tag-px: var(--a-space-1-5);
281
+ --tag-py: var(--a-space-0-5);
282
+ --tag-font: var(--a-ui-sm);
283
+ }
284
+ :scope[size="lg"] {
285
+ --tag-px: var(--tag-px-lg);
286
+ --tag-py: var(--tag-py-lg);
287
+ --tag-font: var(--tag-font-lg);
288
+ }
224
289
 
225
290
  /* hover rule moved outside @scope — see Safari 17.x bug note at top. */
226
291
 
@@ -41,26 +41,30 @@ export class UITag extends UIElement {
41
41
  /** Tag label. Renderer routes this to the `text` attribute, rendered via CSS attr(text) on ::after. */
42
42
  textContent: string;
43
43
  /** Fill style — orthogonal to [variant]. Three values:
44
- - `solid` (default for family variants) saturated bg + on-strong
45
- (near-white) text. The chip IS the state.
44
+ - `solid` (default for EVERY variant, including the family-less
45
+ `default`, since gh#794) saturated bg + on-strong (near-white)
46
+ text. The chip IS the state. A bare `<tag-ui text="…">` renders
47
+ this look with no attributes at all.
46
48
  - `muted` — tinted bg with scheme-paired text. Matches <badge-ui>'s
47
- default look. Use on metadata chips in dense lists where the
48
- saturated default would compete for attention.
49
+ default look, and is the pre-gh#794 look for the family-less
50
+ `default` variant. Use on metadata / citation chips in dense
51
+ lists or tables where the saturated default would compete for
52
+ attention (gh#778's oversized-pill concern).
49
53
  - `outline` — transparent bg + family-colored border + family-colored
50
54
  text. The lightest visual weight; good in dense data tables or
51
55
  faceted filter rows where multiple chips would otherwise compete.
52
- The `default` variant (no family) stays quiet chrome regardless of
53
- tone unless `tone="solid"` is set explicitly (high-contrast neutral
54
- inverse), or `tone="outline"` (fg-muted text + subtle border).
56
+ `tone` is a declarative presentational attribute (not a reactive
57
+ prop see tag.class.js) so its schema `default` here is documentation
58
+ of the rendered-by-default look, not a reflected attribute value.
55
59
  */
56
60
  tone: 'solid' | 'muted' | 'outline';
57
61
  /** Semantic variant — `default | accent | info | success | warning | danger`. `accent` is brand-primary emphasis for non-semantic labels — a filter chip or taxonomy tag that shouldn't imply a success/warning/danger state. Mirrors <badge-ui>'s `accent` variant token-for-token. */
58
62
  variant: 'default' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
59
63
 
64
+ addEventListener(type: 'remove', listener: (ev: TagRemoveEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
60
65
  addEventListener<K extends keyof HTMLElementEventMap>(
61
66
  type: K,
62
67
  listener: (this: UITag, ev: HTMLElementEventMap[K]) => unknown,
63
68
  options?: boolean | AddEventListenerOptions,
64
69
  ): void;
65
- addEventListener(type: 'remove', listener: (ev: TagRemoveEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
66
70
  }
@@ -6,14 +6,14 @@
6
6
  <tag-ui text="Default"></tag-ui>
7
7
  ```
8
8
 
9
- ## tone
9
+ ## size
10
10
 
11
11
  ```html
12
- <tag-ui text="Default" tone="solid"></tag-ui>
12
+ <tag-ui text="Small" size="sm"></tag-ui>
13
13
  ```
14
14
 
15
- ## size
15
+ ## removable
16
16
 
17
17
  ```html
18
- <tag-ui text="Small" size="sm"></tag-ui>
18
+ <tag-ui text="Removable" removable></tag-ui>
19
19
  ```
@@ -62,17 +62,21 @@ props:
62
62
  tone:
63
63
  description: |
64
64
  Fill style — orthogonal to [variant]. Three values:
65
- - `solid` (default for family variants) saturated bg + on-strong
66
- (near-white) text. The chip IS the state.
65
+ - `solid` (default for EVERY variant, including the family-less
66
+ `default`, since gh#794) saturated bg + on-strong (near-white)
67
+ text. The chip IS the state. A bare `<tag-ui text="…">` renders
68
+ this look with no attributes at all.
67
69
  - `muted` — tinted bg with scheme-paired text. Matches <badge-ui>'s
68
- default look. Use on metadata chips in dense lists where the
69
- saturated default would compete for attention.
70
+ default look, and is the pre-gh#794 look for the family-less
71
+ `default` variant. Use on metadata / citation chips in dense
72
+ lists or tables where the saturated default would compete for
73
+ attention (gh#778's oversized-pill concern).
70
74
  - `outline` — transparent bg + family-colored border + family-colored
71
75
  text. The lightest visual weight; good in dense data tables or
72
76
  faceted filter rows where multiple chips would otherwise compete.
73
- The `default` variant (no family) stays quiet chrome regardless of
74
- tone unless `tone="solid"` is set explicitly (high-contrast neutral
75
- inverse), or `tone="outline"` (fg-muted text + subtle border).
77
+ `tone` is a declarative presentational attribute (not a reactive
78
+ prop see tag.class.js) so its schema `default` here is documentation
79
+ of the rendered-by-default look, not a reflected attribute value.
76
80
  type: string
77
81
  default: solid
78
82
  enum:
@@ -127,6 +131,13 @@ a2ui:
127
131
  Group multiple tags inside a <row-ui gap="2"> — never stack them
128
132
  vertically; vertical lists of dismissable items are an
129
133
  <action-list-ui> use case, not <tag-ui>.
134
+ - >-
135
+ Bare <tag-ui text="…"> (no [tone]) renders the high-contrast
136
+ solid pill by default (gh#794). In dense tables, tight metadata
137
+ rows, or citation/footnote strips where many tags sit close
138
+ together, set [tone="muted"] to keep the quieter tinted look
139
+ instead — a wall of solid pills reads as visual noise there
140
+ (gh#778).
130
141
  anti_patterns: []
131
142
  examples:
132
143
  - name: basic-tag
@@ -108,13 +108,13 @@ replaces the rendered chips. Reflection skipped — array values
108
108
  do not round-trip through attribute strings. */
109
109
  value: string;
110
110
 
111
+ addEventListener(type: 'change', listener: (ev: TagsInputChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
112
+ addEventListener(type: 'commit', listener: (ev: TagsInputCommitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
113
+ addEventListener(type: 'input', listener: (ev: TagsInputInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
114
+ addEventListener(type: 'invalid', listener: (ev: TagsInputInvalidEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
111
115
  addEventListener<K extends keyof HTMLElementEventMap>(
112
116
  type: K,
113
117
  listener: (this: UITagsInput, ev: HTMLElementEventMap[K]) => unknown,
114
118
  options?: boolean | AddEventListenerOptions,
115
119
  ): void;
116
- addEventListener(type: 'change', listener: (ev: TagsInputChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
117
- addEventListener(type: 'commit', listener: (ev: TagsInputCommitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
118
- addEventListener(type: 'input', listener: (ev: TagsInputInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
119
- addEventListener(type: 'invalid', listener: (ev: TagsInputInvalidEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
120
120
  }
@@ -25,12 +25,12 @@ export class UITimeline extends UIElement {
25
25
  /** Rail size preset — use `sm` for agent-reasoning/pipeline views; `md` is the default. */
26
26
  size: 'sm' | 'md';
27
27
 
28
+ addEventListener(type: 'timeline-toggle', listener: (ev: TimelineToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
28
29
  addEventListener<K extends keyof HTMLElementEventMap>(
29
30
  type: K,
30
31
  listener: (this: UITimeline, ev: HTMLElementEventMap[K]) => unknown,
31
32
  options?: boolean | AddEventListenerOptions,
32
33
  ): void;
33
- addEventListener(type: 'timeline-toggle', listener: (ev: TimelineToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
34
  }
35
35
 
36
36
  export class UITimelineItem extends UIElement {
@@ -52,10 +52,10 @@ scans the toc-ui's parent element. Set to `#article` /
52
52
  */
53
53
  target: string;
54
54
 
55
+ addEventListener(type: 'section-change', listener: (ev: TableOfContentsSectionChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
55
56
  addEventListener<K extends keyof HTMLElementEventMap>(
56
57
  type: K,
57
58
  listener: (this: UITableOfContents, ev: HTMLElementEventMap[K]) => unknown,
58
59
  options?: boolean | AddEventListenerOptions,
59
60
  ): void;
60
- addEventListener(type: 'section-change', listener: (ev: TableOfContentsSectionChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
61
61
  }
@@ -25,12 +25,12 @@ export class UIToggleGroup extends UIElement {
25
25
  /** Comma-separated selected values */
26
26
  value: string;
27
27
 
28
+ addEventListener(type: 'change', listener: (ev: ToggleGroupChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
28
29
  addEventListener<K extends keyof HTMLElementEventMap>(
29
30
  type: K,
30
31
  listener: (this: UIToggleGroup, ev: HTMLElementEventMap[K]) => unknown,
31
32
  options?: boolean | AddEventListenerOptions,
32
33
  ): void;
33
- addEventListener(type: 'change', listener: (ev: ToggleGroupChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
34
  }
35
35
 
36
36
  export class UIToggleOption extends UIElement {
@@ -49,10 +49,10 @@ export class UIToggleScheme extends UIElement {
49
49
  /** Visual style forwarded to the internal <button-ui>. Defaults to "ghost" (matches app practice). */
50
50
  variant: 'default' | 'solid' | 'outline' | 'ghost' | 'primary' | 'secondary' | 'soft';
51
51
 
52
+ addEventListener(type: 'scheme-change', listener: (ev: ToggleSchemeSchemeChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
52
53
  addEventListener<K extends keyof HTMLElementEventMap>(
53
54
  type: K,
54
55
  listener: (this: UIToggleScheme, ev: HTMLElementEventMap[K]) => unknown,
55
56
  options?: boolean | AddEventListenerOptions,
56
57
  ): void;
57
- addEventListener(type: 'scheme-change', listener: (ev: ToggleSchemeSchemeChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
58
58
  }
@@ -48,15 +48,15 @@ tour to that step (updating spotlight + popover position).
48
48
  */
49
49
  step: number;
50
50
 
51
+ addEventListener(type: 'tour-finish', listener: (ev: TourFinishEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
52
+ addEventListener(type: 'tour-skip', listener: (ev: TourSkipEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
53
+ addEventListener(type: 'tour-start', listener: (ev: TourStartEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
54
+ addEventListener(type: 'tour-step-change', listener: (ev: TourStepChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
51
55
  addEventListener<K extends keyof HTMLElementEventMap>(
52
56
  type: K,
53
57
  listener: (this: UITour, ev: HTMLElementEventMap[K]) => unknown,
54
58
  options?: boolean | AddEventListenerOptions,
55
59
  ): void;
56
- addEventListener(type: 'tour-finish', listener: (ev: TourFinishEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
57
- addEventListener(type: 'tour-skip', listener: (ev: TourSkipEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
58
- addEventListener(type: 'tour-start', listener: (ev: TourStartEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
59
- addEventListener(type: 'tour-step-change', listener: (ev: TourStepChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
60
60
  }
61
61
 
62
62
  export class UITourStep extends UIElement {
@@ -31,12 +31,12 @@ export type TreeSelectEvent = CustomEvent<TreeSelectEventDetail>;
31
31
 
32
32
  export class UITree extends UIElement {
33
33
 
34
+ addEventListener(type: 'tree-select', listener: (ev: TreeSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
35
  addEventListener<K extends keyof HTMLElementEventMap>(
35
36
  type: K,
36
37
  listener: (this: UITree, ev: HTMLElementEventMap[K]) => unknown,
37
38
  options?: boolean | AddEventListenerOptions,
38
39
  ): void;
39
- addEventListener(type: 'tree-select', listener: (ev: TreeSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
40
40
  }
41
41
 
42
42
  export class UITreeItem extends UIElement {
@@ -37,36 +37,48 @@
37
37
  * });
38
38
  *
39
39
  * Brace-list globs are statically analyzed; only the named files are
40
- * emitted as chunks (or inlined when `eager: true`). Use the `../node_modules/...`
41
- * form shown here, not `/node_modules/...` see "Why the glob is entry-relative,
42
- * not root-relative" below; the same reasoning applies to a hand-written
43
- * scoped glob as to the auto-discovery globs this file installs by default.
40
+ * emitted as chunks (or inlined when `eager: true`). Better yet, in your OWN
41
+ * source you can skip globs entirely and use plain bare-specifier `?raw`
42
+ * imports (see `icons.js`'s JSDoc, loading path 3) module resolution finds
43
+ * the package under any layout. If you do hand-write a glob, note it resolves
44
+ * by literal path join from YOUR file, not module resolution — see "Why there
45
+ * are three candidate globs" below.
44
46
  *
45
- * ## Why the glob is entry-relative, not root-relative
47
+ * ## Why there are three candidate globs, not one (gh#287 · gh#340 · gh#786)
46
48
  *
47
49
  * `import.meta.glob` only accepts a small set of static forms (`/`-rooted,
48
50
  * `./`, `../`, `**\/`, or a `#`-subpath with a literal `*`), and each resolves
49
51
  * via a literal path join, not module resolution (confirmed against Vite 8's
50
- * `toAbsoluteGlob`, gh#287). A `/`-rooted glob joins to Vite's CONFIGURED
51
- * PROJECT ROOT for a consumer app, that only reaches `@phosphor-icons/core`
52
- * when it's ALSO hoisted to that exact root. Under pnpm's default
53
- * (non-hoisted, symlinked) linking, a package you depend on only
54
- * TRANSITIVELY `@phosphor-icons/core` is a dependency of THIS package, not
55
- * necessarily your app's — is linked only inside that package's own
56
- * resolution scope, never flattened into your app's top-level `node_modules`.
57
- * A root-rooted glob then silently matches zero files.
58
- *
59
- * A `../`-prefixed glob instead joins to THIS FILE'S OWN directory
60
- * (`core/`), one level inside `@adia-ai/web-components` so `../node_modules`
61
- * reaches `@adia-ai/web-components`'s own local `node_modules`, which pnpm
62
- * always populates with a package's own direct dependencies (a symlink into
63
- * the pnpm store) regardless of whether your app also hoists them. This
64
- * holds for the published package too `core/icons-phosphor.js` ships at
65
- * the same one-level depth (see `package.json`'s `files` field). Verified
66
- * empirically against a real hoisting-gap install (a pnpm workspace where
67
- * `@phosphor-icons/core` is declared only by a nested package, not the
68
- * workspace root): the root-rooted form matches zero files; the
69
- * entry-relative form matches the full set with real content.
52
+ * `toAbsoluteGlob`, gh#287). No single literal path exists that reaches
53
+ * `@phosphor-icons/core` under every package manager's `node_modules` layout,
54
+ * so this file probes THREE entry-relative candidates (resolved from this
55
+ * file's own directory, `core/`, one level inside `@adia-ai/web-components`
56
+ * the published package ships at the same depth) and installs the first that
57
+ * matches anything:
58
+ *
59
+ * 1. `../node_modules/@phosphor-icons/core/…` pnpm's nested layout.
60
+ * pnpm always populates a package's OWN local `node_modules` with its
61
+ * direct dependencies (a symlink into the store), regardless of what the
62
+ * consumer app hoists. gh#287's original fix; still first preference.
63
+ * 2. `../../../@phosphor-icons/core/…` npm / yarn-classic hoisting in a
64
+ * consumer install. `core/` sits at
65
+ * `node_modules/@adia-ai/web-components/core/`, so three levels up IS
66
+ * the consumer's (or workspace root's) `node_modules`, where hoisting
67
+ * flattens transitive deps as siblings. This is the layout gh#786's
68
+ * npm-workspace consumer has candidate 1 is structurally guaranteed
69
+ * to match zero files there.
70
+ * 3. `../../../node_modules/@phosphor-icons/core/…` THIS repo's own
71
+ * checkout when `node_modules` is npm-shaped (gh#340: `npm ci` /
72
+ * `npm install` re-shape it). `core/` sits at
73
+ * `packages/web-components/core/`, so three levels up is the repo root
74
+ * and the hoisted copy lives in its `node_modules/`.
75
+ *
76
+ * A `/`-rooted glob is NOT among the candidates: it joins to Vite's
77
+ * CONFIGURED PROJECT ROOT, which only reaches `@phosphor-icons/core` when
78
+ * it happens to be hoisted to that exact root — the original gh#287 failure.
79
+ * Globs that match zero files are free: `import.meta.glob` returns `{}`
80
+ * without touching the filesystem at runtime, so the losing candidates cost
81
+ * nothing.
70
82
  *
71
83
  * ## Vite dep-optimizer pre-bundling (gh#287, second independent failure mode)
72
84
  *
@@ -104,19 +116,50 @@
104
116
  * to the manifest fetch below
105
117
  */
106
118
 
107
- import { installIconLoaders } from './icons.js';
119
+ import { installIconLoaders, iconRegistryUnwired } from './icons.js';
108
120
 
109
- let weightModules;
121
+ let candidates;
110
122
  let hasViteGlob = false;
111
123
  try {
112
- weightModules = {
113
- regular: import.meta.glob('../node_modules/@phosphor-icons/core/assets/regular/*.svg', { query: '?raw', import: 'default' }),
114
- thin: import.meta.glob('../node_modules/@phosphor-icons/core/assets/thin/*.svg', { query: '?raw', import: 'default' }),
115
- light: import.meta.glob('../node_modules/@phosphor-icons/core/assets/light/*.svg', { query: '?raw', import: 'default' }),
116
- bold: import.meta.glob('../node_modules/@phosphor-icons/core/assets/bold/*.svg', { query: '?raw', import: 'default' }),
117
- fill: import.meta.glob('../node_modules/@phosphor-icons/core/assets/fill/*.svg', { query: '?raw', import: 'default' }),
118
- duotone: import.meta.glob('../node_modules/@phosphor-icons/core/assets/duotone/*.svg', { query: '?raw', import: 'default' }),
119
- };
124
+ // Three node_modules layouts, probed in order — see the JSDoc section
125
+ // "Why there are three candidate globs" above. Every glob string and its
126
+ // options object must stay a static literal (Vite's macro constraint), so
127
+ // the 18 calls can't be generated from a loop.
128
+ candidates = [
129
+ {
130
+ layout: 'pnpm-nested `../node_modules/@phosphor-icons/core`',
131
+ weights: {
132
+ regular: import.meta.glob('../node_modules/@phosphor-icons/core/assets/regular/*.svg', { query: '?raw', import: 'default' }),
133
+ thin: import.meta.glob('../node_modules/@phosphor-icons/core/assets/thin/*.svg', { query: '?raw', import: 'default' }),
134
+ light: import.meta.glob('../node_modules/@phosphor-icons/core/assets/light/*.svg', { query: '?raw', import: 'default' }),
135
+ bold: import.meta.glob('../node_modules/@phosphor-icons/core/assets/bold/*.svg', { query: '?raw', import: 'default' }),
136
+ fill: import.meta.glob('../node_modules/@phosphor-icons/core/assets/fill/*.svg', { query: '?raw', import: 'default' }),
137
+ duotone: import.meta.glob('../node_modules/@phosphor-icons/core/assets/duotone/*.svg', { query: '?raw', import: 'default' }),
138
+ },
139
+ },
140
+ {
141
+ layout: 'npm/yarn-hoisted sibling `../../../@phosphor-icons/core`',
142
+ weights: {
143
+ regular: import.meta.glob('../../../@phosphor-icons/core/assets/regular/*.svg', { query: '?raw', import: 'default' }),
144
+ thin: import.meta.glob('../../../@phosphor-icons/core/assets/thin/*.svg', { query: '?raw', import: 'default' }),
145
+ light: import.meta.glob('../../../@phosphor-icons/core/assets/light/*.svg', { query: '?raw', import: 'default' }),
146
+ bold: import.meta.glob('../../../@phosphor-icons/core/assets/bold/*.svg', { query: '?raw', import: 'default' }),
147
+ fill: import.meta.glob('../../../@phosphor-icons/core/assets/fill/*.svg', { query: '?raw', import: 'default' }),
148
+ duotone: import.meta.glob('../../../@phosphor-icons/core/assets/duotone/*.svg', { query: '?raw', import: 'default' }),
149
+ },
150
+ },
151
+ {
152
+ layout: 'workspace-root `../../../node_modules/@phosphor-icons/core` (npm-shaped monorepo checkout)',
153
+ weights: {
154
+ regular: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/regular/*.svg', { query: '?raw', import: 'default' }),
155
+ thin: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/thin/*.svg', { query: '?raw', import: 'default' }),
156
+ light: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/light/*.svg', { query: '?raw', import: 'default' }),
157
+ bold: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/bold/*.svg', { query: '?raw', import: 'default' }),
158
+ fill: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/fill/*.svg', { query: '?raw', import: 'default' }),
159
+ duotone: import.meta.glob('../../../node_modules/@phosphor-icons/core/assets/duotone/*.svg', { query: '?raw', import: 'default' }),
160
+ },
161
+ },
162
+ ];
120
163
  hasViteGlob = true;
121
164
  } catch (err) {
122
165
  // FB-08: distinguish "no Vite at all" (expected, ReferenceError) from
@@ -135,45 +178,60 @@ try {
135
178
  }
136
179
 
137
180
  if (hasViteGlob) {
138
- // FB-08: detect the silent-empty-glob case `import.meta.glob` returns
139
- // `{}` when zero files match (it does NOT throw). The previous behavior
140
- // installed empty per-weight maps and the consumer saw an empty icon
141
- // registry with no diagnostic. gh#287 names two independent causes, both
142
- // producing this same empty-map symptom:
143
- // 1. A packaging/bundler step re-nested this file at a different depth
144
- // than it ships at (breaks the `../`-relative glob's one-level-inside
145
- // assumption — see "Why the glob is entry-relative" above), a Yarn
146
- // Berry PnP install (virtual/zip filesystem), or @phosphor-icons/core
147
- // missing entirely.
148
- // 2. Vite's dev-server `optimizeDeps` pre-bundled this package (see
149
- // "Vite dep-optimizer pre-bundling" above) — confirmed empirically to
150
- // transform the glob into a literal empty object, no exception.
151
- const totalIcons = Object.values(weightModules).reduce(
181
+ // Install the first candidate layout whose globs matched anything.
182
+ // `import.meta.glob` returns `{}` when zero files match (it does NOT
183
+ // throw), so the losing layouts cost nothing.
184
+ const candidateTotal = (c) => Object.values(c.weights).reduce(
152
185
  (sum, weight) => sum + Object.keys(weight).length, 0
153
186
  );
154
- if (totalIcons === 0) {
155
- console.warn(
156
- `[icons-phosphor] No Phosphor icons matched the auto-install glob ` +
157
- `\`../node_modules/@phosphor-icons/core/assets/<weight>/*.svg\` (resolved ` +
158
- `relative to this file's own directory hoisting-safe under pnpm, gh#287). ` +
159
- `Two known causes: (1) this package got pre-bundled by Vite's dev-server ` +
160
- `optimizeDeps, which empties the glob add it to optimizeDeps.exclude in ` +
161
- `your Vite config:\n` +
162
- ` optimizeDeps: { exclude: ['@adia-ai/web-components', '@adia-ai/web-modules'] }\n` +
163
- `(2) @phosphor-icons/core is missing, or this file was re-nested to a ` +
164
- `different depth by a packaging step (Yarn PnP, a custom bundler). If ` +
165
- `neither fix applies, install loaders manually instead:\n` +
166
- ` import { installIconLoaders } from '@adia-ai/web-components/core/icons';\n` +
167
- ` import caretRight from '@phosphor-icons/core/assets/regular/caret-right.svg?raw';\n` +
168
- ` installIconLoaders({\n` +
169
- ` regular: {\n` +
170
- ` '/node_modules/@phosphor-icons/core/assets/regular/caret-right.svg': caretRight,\n` +
171
- ` },\n` +
172
- ` });\n` +
173
- `See the JSDoc header of icons-phosphor.js for the full recipe.`
174
- );
187
+ const matched = candidates.find(c => candidateTotal(c) > 0);
188
+ if (matched) {
189
+ installIconLoaders(matched.weights);
190
+ } else {
191
+ // Every candidate matched zero files. Two possibilities remain, and
192
+ // only one is a failure:
193
+ // - The consumer registers icons manually (installIconLoaders /
194
+ // registerIcon) and never wanted the auto-install path — gh#786's
195
+ // reporter. Their registration runs later in the same startup, so
196
+ // defer the verdict and stay silent once the registry is wired.
197
+ // - The registry genuinely ends up empty: Vite's dev-server
198
+ // optimizeDeps pre-bundled this package (esbuild rewrites the globs
199
+ // to empty literals, gh#287), @phosphor-icons/core is missing, or
200
+ // the install layout is one this file doesn't probe (e.g. Yarn PnP's
201
+ // virtual filesystem). Zero icons will render — fail loudly, once,
202
+ // naming the fix (gh#340's acceptance).
203
+ // Deliberately NOT calling installIconLoaders with empty maps here:
204
+ // that would mark the registry "ready", suppressing <icon-ui>'s own
205
+ // unwired-registry diagnostic and clobbering nothing-yet for manual
206
+ // consumers.
207
+ setTimeout(() => {
208
+ if (!iconRegistryUnwired()) return; // manual registration landed — working setup, no noise
209
+ console.error(
210
+ `[icons-phosphor] Zero-config icon auto-install failed: no Phosphor ` +
211
+ `SVGs found under any known node_modules layout (probed pnpm-nested ` +
212
+ `\`../node_modules/\`, npm/yarn-hoisted \`../../../\`, and workspace-root ` +
213
+ `\`../../../node_modules/\` — all relative to icons-phosphor.js), and no ` +
214
+ `icons were registered manually. Every <icon-ui> will render blank. ` +
215
+ `Fixes, most likely first:\n` +
216
+ `(1) Vite dev-server pre-bundling emptied the globs — exclude this ` +
217
+ `package from optimizeDeps in vite.config.js:\n` +
218
+ ` optimizeDeps: { exclude: ['@adia-ai/web-components', '@adia-ai/web-modules'] }\n` +
219
+ `(2) @phosphor-icons/core is not installed, or your package manager ` +
220
+ `lays out node_modules somewhere this file doesn't probe (Yarn PnP is ` +
221
+ `not supported by the zero-config path).\n` +
222
+ `(3) Register the icons you use manually — this also silences this ` +
223
+ `error permanently:\n` +
224
+ ` import { installIconLoaders } from '@adia-ai/web-components/core/icons';\n` +
225
+ ` import caretRight from '@phosphor-icons/core/assets/regular/caret-right.svg?raw';\n` +
226
+ ` installIconLoaders({\n` +
227
+ ` regular: {\n` +
228
+ ` '/node_modules/@phosphor-icons/core/assets/regular/caret-right.svg': caretRight,\n` +
229
+ ` },\n` +
230
+ ` });\n` +
231
+ `See the JSDoc header of icons-phosphor.js for the full recipe (gh#786).`
232
+ );
233
+ }, 0);
175
234
  }
176
- installIconLoaders(weightModules);
177
235
  } else {
178
236
  // Non-Vite static serving: fetch the build-time manifest in the
179
237
  // background. No top-level await — module finishes loading immediately;