@adia-ai/web-components 0.8.4 → 0.8.6

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 (64) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/USAGE.md +60 -25
  3. package/components/adia-mark/adia-mark.a2ui.json +123 -0
  4. package/components/adia-mark/adia-mark.class.js +64 -0
  5. package/components/adia-mark/adia-mark.css +48 -0
  6. package/components/adia-mark/adia-mark.d.ts +20 -0
  7. package/components/adia-mark/adia-mark.examples.md +26 -0
  8. package/components/adia-mark/adia-mark.js +17 -0
  9. package/components/adia-mark/adia-mark.test.js +69 -0
  10. package/components/adia-mark/adia-mark.yaml +121 -0
  11. package/components/agent-questions/agent-questions.a2ui.json +2 -1
  12. package/components/agent-questions/agent-questions.class.js +96 -53
  13. package/components/agent-questions/agent-questions.css +27 -106
  14. package/components/agent-questions/agent-questions.yaml +1 -0
  15. package/components/button/button.class.js +5 -1
  16. package/components/calendar-grid/calendar-grid.a2ui.json +3 -1
  17. package/components/calendar-grid/calendar-grid.class.js +11 -6
  18. package/components/calendar-grid/calendar-grid.css +42 -20
  19. package/components/calendar-grid/calendar-grid.yaml +5 -0
  20. package/components/calendar-picker/calendar-picker.a2ui.json +3 -1
  21. package/components/calendar-picker/calendar-picker.class.js +11 -6
  22. package/components/calendar-picker/calendar-picker.css +39 -19
  23. package/components/calendar-picker/calendar-picker.yaml +5 -0
  24. package/components/chart/chart.class.js +17 -14
  25. package/components/color-input/color-input.class.js +8 -5
  26. package/components/color-picker/color-picker.class.js +6 -3
  27. package/components/field/field.class.js +10 -7
  28. package/components/field/field.css +21 -0
  29. package/components/fields/fields.class.js +15 -12
  30. package/components/icon/icon.class.js +9 -5
  31. package/components/index.js +1 -0
  32. package/components/nav/nav.class.js +2 -1
  33. package/components/noodles/noodles.class.js +14 -10
  34. package/components/page/page.class.js +3 -2
  35. package/components/select/select.class.js +3 -2
  36. package/components/swatch/swatch.class.js +27 -24
  37. package/components/swiper/swiper.class.js +4 -1
  38. package/components/swiper/swiper.css +13 -4
  39. package/components/table/table.a2ui.json +1 -1
  40. package/components/table/table.class.js +17 -0
  41. package/components/table/table.css +15 -2
  42. package/components/table/table.d.ts +1 -1
  43. package/components/table/table.test.js +51 -0
  44. package/components/table/table.yaml +6 -1
  45. package/components/toolbar/toolbar.class.js +11 -6
  46. package/components/tree/tree.class.js +5 -2
  47. package/core/data-stream.js +21 -15
  48. package/core/element.js +60 -1
  49. package/core/element.test.js +138 -0
  50. package/core/icons-phosphor.js +86 -22
  51. package/core/icons.js +22 -8
  52. package/dist/host.min.css +1 -1
  53. package/dist/host.sheet.js +1 -1
  54. package/dist/theme-provider.min.js +2 -2
  55. package/dist/web-components.min.css +1 -1
  56. package/dist/web-components.min.js +107 -102
  57. package/dist/web-components.sheet.js +1 -1
  58. package/package.json +1 -5
  59. package/styles/colors/semantics/core.css +1 -1
  60. package/styles/colors/semantics/features.css +1 -1
  61. package/styles/components.css +1 -0
  62. package/traits/error-shake/error-shake.js +23 -17
  63. package/traits/fade-presence/fade-presence.js +19 -15
  64. package/traits/success-checkmark/success-checkmark.js +21 -16
@@ -115,14 +115,23 @@
115
115
  color: var(--calendar-grid-title-fg);
116
116
  }
117
117
 
118
- [data-cal-prev],
119
- [data-cal-next] {
118
+ /* Stamped <button-ui variant="ghost" size="xs" icon="caret-…"> (gh issue
119
+ 276 wave 4) — icon-only (no [text], no child text) so button-ui's own
120
+ [data-icon-only] rule already squares it to --button-height; pointing
121
+ --button-height at the nav size (not just literal width/height) avoids
122
+ the min-width/min-height floor trap. Literal background/color below
123
+ out-specify button.css's own (via the `button-ui` type-selector bump —
124
+ same technique as swiper's dots), so the button-ui type-selector prefix
125
+ is load-bearing, not decorative. */
126
+ button-ui[data-cal-prev],
127
+ button-ui[data-cal-next] {
128
+ --button-height: var(--calendar-grid-nav-size);
129
+ --a-icon-size: var(--calendar-grid-nav-icon-size);
130
+
120
131
  display: inline-flex;
121
132
  align-items: center;
122
133
  justify-content: center;
123
- width: var(--calendar-grid-nav-size);
124
134
  height: var(--calendar-grid-nav-size);
125
- padding: 0;
126
135
  border: none;
127
136
  border-radius: var(--calendar-grid-nav-radius);
128
137
  background: var(--calendar-grid-nav-bg);
@@ -131,10 +140,9 @@
131
140
  transition:
132
141
  background var(--calendar-grid-duration) var(--calendar-grid-easing),
133
142
  color var(--calendar-grid-duration) var(--calendar-grid-easing);
134
- --a-icon-size: var(--calendar-grid-nav-icon-size);
135
143
  }
136
- [data-cal-prev]:hover,
137
- [data-cal-next]:hover {
144
+ button-ui[data-cal-prev]:hover,
145
+ button-ui[data-cal-next]:hover {
138
146
  background: var(--calendar-grid-nav-bg-hover);
139
147
  color: var(--calendar-grid-nav-fg-hover);
140
148
  }
@@ -164,7 +172,18 @@
164
172
  gap: var(--calendar-grid-day-grid-gap);
165
173
  }
166
174
 
167
- [data-cal-day] {
175
+ /* Stamped <button-ui variant="ghost" text="…"> (gh issue 276 wave 4).
176
+ button-ui floors min-width/min-height at --button-height — point it at
177
+ the day-cell size (not just the literal width/height below) so the
178
+ floor never clamps a smaller [size] tier. The literal geometry/color
179
+ declarations below out-specify button-ui's own equivalents via the
180
+ `button-ui` type-selector bump (same technique as swiper's dots).
181
+ button-ui renders its label via `::after { content: attr(text) }` — the
182
+ today-indicator dot below therefore uses `::before` (kept free), not
183
+ `::after`, to avoid the two fighting over the same pseudo-element. */
184
+ button-ui[data-cal-day] {
185
+ --button-height: var(--calendar-grid-day-size);
186
+
168
187
  display: flex;
169
188
  align-items: center;
170
189
  justify-content: center;
@@ -188,25 +207,25 @@
188
207
  }
189
208
 
190
209
  /* ── State: hover ── */
191
- [data-cal-day]:not([disabled]):not([data-outside]):hover {
210
+ button-ui[data-cal-day]:not([disabled]):not([data-outside]):hover {
192
211
  background: var(--calendar-grid-day-bg-hover);
193
212
  color: var(--calendar-grid-day-fg-hover);
194
213
  }
195
214
 
196
215
  /* ── State: focus ── */
197
- [data-cal-day]:not([disabled]):not([data-outside]):focus-visible,
198
- [data-cal-day][data-focused] {
216
+ button-ui[data-cal-day]:not([disabled]):not([data-outside]):focus-visible,
217
+ button-ui[data-cal-day][data-focused] {
199
218
  outline: none;
200
219
  box-shadow: var(--calendar-grid-day-focus-ring);
201
220
  }
202
221
 
203
222
  /* ── State: selected ── */
204
- [data-cal-day][data-selected] {
223
+ button-ui[data-cal-day][data-selected] {
205
224
  background: var(--calendar-grid-day-bg-selected);
206
225
  color: var(--calendar-grid-day-fg-selected);
207
226
  font-weight: var(--calendar-grid-selected-weight);
208
227
  }
209
- [data-cal-day][data-selected]:not([disabled]):hover {
228
+ button-ui[data-cal-day][data-selected]:not([disabled]):hover {
210
229
  background: var(--calendar-grid-day-bg-selected);
211
230
  color: var(--calendar-grid-day-fg-selected);
212
231
  }
@@ -217,21 +236,21 @@
217
236
  fill); the in-range middle is visually subordinate. `:not([data-selected])`
218
237
  guard prevents the muted fill from overriding the endpoint cells in
219
238
  consumer code that sets both `value` AND `range-start`/`range-end`. */
220
- [data-cal-day][data-in-range]:not([data-selected]) {
239
+ button-ui[data-cal-day][data-in-range]:not([data-selected]) {
221
240
  background: var(--calendar-grid-day-bg-in-range);
222
241
  color: var(--calendar-grid-day-fg-in-range);
223
242
  }
224
- [data-cal-day][data-in-range]:not([data-selected]):not([disabled]):hover {
243
+ button-ui[data-cal-day][data-in-range]:not([data-selected]):not([disabled]):hover {
225
244
  background: var(--calendar-grid-day-bg-in-range);
226
245
  }
227
246
 
228
247
  /* ── State: today (unselected) ── */
229
- [data-cal-day][data-today]:not([data-selected]) {
248
+ button-ui[data-cal-day][data-today]:not([data-selected]) {
230
249
  position: relative;
231
250
  color: var(--calendar-grid-day-today-color);
232
251
  font-weight: var(--calendar-grid-today-weight);
233
252
  }
234
- [data-cal-day][data-today]:not([data-selected])::after {
253
+ button-ui[data-cal-day][data-today]:not([data-selected])::before {
235
254
  content: "";
236
255
  position: absolute;
237
256
  left: 50%;
@@ -245,13 +264,16 @@
245
264
  }
246
265
 
247
266
  /* ── State: outside month ── */
248
- [data-cal-day][data-outside] {
267
+ button-ui[data-cal-day][data-outside] {
249
268
  color: var(--calendar-grid-day-fg-outside);
250
269
  cursor: default;
251
270
  }
252
271
 
253
- /* ── State: disabled (excluding outside) ── */
254
- [data-cal-day]:disabled:not([data-outside]) {
272
+ /* ── State: disabled (excluding outside) ──
273
+ `[disabled]` — NOT the `:disabled` pseudo-class, which only matches
274
+ native form controls; button-ui is a custom element, so `:disabled`
275
+ silently never matches it. */
276
+ button-ui[data-cal-day][disabled]:not([data-outside]) {
255
277
  color: var(--calendar-grid-day-fg-disabled);
256
278
  cursor: not-allowed;
257
279
  }
@@ -16,6 +16,11 @@ description: >-
16
16
  (two side-by-side grids), and datetime-picker-ui (one grid + time pane).
17
17
  For a complete date-picker affordance (trigger + popover + form
18
18
  participation), use calendar-picker-ui.
19
+ # Per ADR-0027 — primitives that programmatically create other primitives
20
+ # in their render() do NOT auto-import them. Consumer (or demo shell) must
21
+ # explicitly import each composed primitive.
22
+ composes:
23
+ - button-ui # day cells + month nav (gh issue 276 wave 4)
19
24
  props:
20
25
  value:
21
26
  description: Selected date in ISO format (YYYY-MM-DD).
@@ -94,7 +94,9 @@
94
94
  "x-adiaui": {
95
95
  "anti_patterns": [],
96
96
  "category": "input",
97
- "composes": [],
97
+ "composes": [
98
+ "button-ui"
99
+ ],
98
100
  "events": {
99
101
  "change": {
100
102
  "description": "Fired when a date is selected"
@@ -191,10 +191,14 @@ export class UICalendarPicker extends UIFormElement {
191
191
  const maxDate = parseISO(this.max);
192
192
 
193
193
  // Header
194
+ // <button-ui variant="ghost" icon="…"> (gh issue 276 wave 4) — no
195
+ // tabindex here, matching the native version: these nav buttons stay in
196
+ // the default tab order (unlike calendar-grid-ui's, which are pulled out
197
+ // via tabindex="-1" for its inline roving-tabindex day grid).
194
198
  let h = `<div data-cal-header>
195
- <button data-cal-prev type="button" aria-label="Previous month"><icon-ui name="caret-left"></icon-ui></button>
199
+ <button-ui variant="ghost" size="xs" icon="caret-left" data-cal-prev aria-label="Previous month"></button-ui>
196
200
  <span data-cal-title>${MONTHS_LONG[month]} ${year}</span>
197
- <button data-cal-next type="button" aria-label="Next month"><icon-ui name="caret-right"></icon-ui></button>
201
+ <button-ui variant="ghost" size="xs" icon="caret-right" data-cal-next aria-label="Next month"></button-ui>
198
202
  </div>`;
199
203
 
200
204
  // Day-of-week header
@@ -210,7 +214,7 @@ export class UICalendarPicker extends UIFormElement {
210
214
  // Previous month trailing days
211
215
  for (let i = firstDay - 1; i >= 0; i--) {
212
216
  const day = daysInPrev - i;
213
- h += `<button type="button" data-cal-day data-outside disabled tabindex="-1">${day}</button>`;
217
+ h += `<button-ui variant="ghost" data-cal-day data-outside disabled tabindex="-1" text="${day}"></button-ui>`;
214
218
  }
215
219
 
216
220
  // Current month days
@@ -223,7 +227,6 @@ export class UICalendarPicker extends UIFormElement {
223
227
  const isFocused = this.#focusedDay === d;
224
228
 
225
229
  const attrs = [
226
- 'type="button"',
227
230
  'data-cal-day',
228
231
  `data-date="${iso}"`,
229
232
  isToday ? 'data-today' : '',
@@ -233,14 +236,16 @@ export class UICalendarPicker extends UIFormElement {
233
236
  `tabindex="${isFocused ? '0' : '-1'}"`,
234
237
  ].filter(Boolean).join(' ');
235
238
 
236
- h += `<button ${attrs}>${d}</button>`;
239
+ // <button-ui variant="ghost" text="…"> (gh issue 276 wave 4) — the day
240
+ // number moves from element text content to the `text` attribute.
241
+ h += `<button-ui variant="ghost" ${attrs} text="${d}"></button-ui>`;
237
242
  }
238
243
 
239
244
  // Next month leading days
240
245
  const totalCells = firstDay + daysInMonth;
241
246
  const remaining = (7 - (totalCells % 7)) % 7;
242
247
  for (let d = 1; d <= remaining; d++) {
243
- h += `<button type="button" data-cal-day data-outside disabled tabindex="-1">${d}</button>`;
248
+ h += `<button-ui variant="ghost" data-cal-day data-outside disabled tabindex="-1" text="${d}"></button-ui>`;
244
249
  }
245
250
 
246
251
  h += '</div>';
@@ -232,14 +232,22 @@ calendar-picker-ui [data-cal-title] {
232
232
  color: var(--calendar-picker-title-fg);
233
233
  }
234
234
 
235
- calendar-picker-ui [data-cal-prev],
236
- calendar-picker-ui [data-cal-next] {
235
+ /* Stamped <button-ui variant="ghost" size="xs" icon="caret-…"> (gh issue 276
236
+ wave 4) — icon-only (no [text], no child text) so button-ui's own
237
+ [data-icon-only] rule already squares it to --button-height; pointing
238
+ --button-height at the nav size (not just literal height below) avoids
239
+ the min-width/min-height floor trap. Literal background/color below
240
+ out-specify button.css's own via the `button-ui` type-selector bump
241
+ (same technique as swiper's dots). */
242
+ calendar-picker-ui button-ui[data-cal-prev],
243
+ calendar-picker-ui button-ui[data-cal-next] {
244
+ --button-height: var(--calendar-picker-nav-size);
245
+ --a-icon-size: var(--calendar-picker-nav-icon-size);
246
+
237
247
  display: inline-flex;
238
248
  align-items: center;
239
249
  justify-content: center;
240
- width: var(--calendar-picker-nav-size);
241
250
  height: var(--calendar-picker-nav-size);
242
- padding: 0;
243
251
  border: none;
244
252
  border-radius: var(--calendar-picker-nav-radius);
245
253
  background: var(--calendar-picker-nav-bg);
@@ -248,10 +256,9 @@ calendar-picker-ui [data-cal-next] {
248
256
  transition:
249
257
  background var(--calendar-picker-duration) var(--calendar-picker-easing),
250
258
  color var(--calendar-picker-duration) var(--calendar-picker-easing);
251
- --a-icon-size: var(--calendar-picker-nav-icon-size);
252
259
  }
253
- calendar-picker-ui [data-cal-prev]:hover,
254
- calendar-picker-ui [data-cal-next]:hover {
260
+ calendar-picker-ui button-ui[data-cal-prev]:hover,
261
+ calendar-picker-ui button-ui[data-cal-next]:hover {
255
262
  background: var(--calendar-picker-nav-bg-hover);
256
263
  color: var(--calendar-picker-nav-fg-hover);
257
264
  }
@@ -281,8 +288,18 @@ calendar-picker-ui [data-cal-grid] {
281
288
  gap: var(--calendar-picker-day-grid-gap);
282
289
  }
283
290
 
284
- /* Day buttons */
285
- calendar-picker-ui [data-cal-day] {
291
+ /* Day buttons — stamped <button-ui variant="ghost" text="…"> (gh issue 276
292
+ wave 4). button-ui floors min-width/min-height at --button-height — point
293
+ it at the day-cell size (not just the literal width/height below) so the
294
+ floor never clamps a smaller [size] tier. The literal geometry/color
295
+ declarations below out-specify button-ui's own equivalents via the
296
+ `button-ui` type-selector bump (same technique as swiper's dots).
297
+ button-ui renders its label via `::after { content: attr(text) }` — the
298
+ today-indicator dot below therefore uses `::before` (kept free), not
299
+ `::after`, to avoid the two fighting over the same pseudo-element. */
300
+ calendar-picker-ui button-ui[data-cal-day] {
301
+ --button-height: var(--calendar-picker-day-size);
302
+
286
303
  display: flex;
287
304
  align-items: center;
288
305
  justify-content: center;
@@ -304,25 +321,25 @@ calendar-picker-ui [data-cal-day] {
304
321
  }
305
322
 
306
323
  /* ── State: hover ── */
307
- calendar-picker-ui [data-cal-day]:not([disabled]):not([data-outside]):hover {
324
+ calendar-picker-ui button-ui[data-cal-day]:not([disabled]):not([data-outside]):hover {
308
325
  background: var(--calendar-picker-day-bg-hover);
309
326
  color: var(--calendar-picker-day-fg-hover);
310
327
  }
311
328
 
312
329
  /* ── State: focus ── */
313
- calendar-picker-ui [data-cal-day]:not([disabled]):not([data-outside]):focus-visible,
314
- calendar-picker-ui [data-cal-day][data-focused] {
330
+ calendar-picker-ui button-ui[data-cal-day]:not([disabled]):not([data-outside]):focus-visible,
331
+ calendar-picker-ui button-ui[data-cal-day][data-focused] {
315
332
  outline: none;
316
333
  box-shadow: var(--calendar-picker-day-focus-ring);
317
334
  }
318
335
 
319
336
  /* ── State: selected ── */
320
- calendar-picker-ui [data-cal-day][data-selected] {
337
+ calendar-picker-ui button-ui[data-cal-day][data-selected] {
321
338
  background: var(--calendar-picker-day-bg-selected);
322
339
  color: var(--calendar-picker-day-fg-selected);
323
340
  font-weight: var(--calendar-picker-selected-weight);
324
341
  }
325
- calendar-picker-ui [data-cal-day][data-selected]:not([disabled]):hover {
342
+ calendar-picker-ui button-ui[data-cal-day][data-selected]:not([disabled]):hover {
326
343
  background: var(--calendar-picker-day-bg-selected-hover);
327
344
  color: var(--calendar-picker-day-fg-selected);
328
345
  }
@@ -330,12 +347,12 @@ calendar-picker-ui [data-cal-day][data-selected]:not([disabled]):hover {
330
347
  /* ── State: today (unselected) ──
331
348
  Use a small bottom dot so it does not compete with the rounded
332
349
  focus-ring box-shadow (that looked like a double outline). */
333
- calendar-picker-ui [data-cal-day][data-today]:not([data-selected]) {
350
+ calendar-picker-ui button-ui[data-cal-day][data-today]:not([data-selected]) {
334
351
  position: relative;
335
352
  color: var(--calendar-picker-day-today-border);
336
353
  font-weight: var(--calendar-picker-today-weight);
337
354
  }
338
- calendar-picker-ui [data-cal-day][data-today]:not([data-selected])::after {
355
+ calendar-picker-ui button-ui[data-cal-day][data-today]:not([data-selected])::before {
339
356
  content: "";
340
357
  position: absolute;
341
358
  left: 50%;
@@ -349,13 +366,16 @@ calendar-picker-ui [data-cal-day][data-today]:not([data-selected])::after {
349
366
  }
350
367
 
351
368
  /* ── State: outside month ── */
352
- calendar-picker-ui [data-cal-day][data-outside] {
369
+ calendar-picker-ui button-ui[data-cal-day][data-outside] {
353
370
  color: var(--calendar-picker-day-fg-outside);
354
371
  cursor: default;
355
372
  }
356
373
 
357
- /* ── State: disabled ── */
358
- calendar-picker-ui [data-cal-day]:disabled:not([data-outside]) {
374
+ /* ── State: disabled ──
375
+ `[disabled]` — NOT the `:disabled` pseudo-class, which only matches
376
+ native form controls; button-ui is a custom element, so `:disabled`
377
+ silently never matches it. */
378
+ calendar-picker-ui button-ui[data-cal-day][disabled]:not([data-outside]) {
359
379
  color: var(--calendar-picker-day-fg-disabled);
360
380
  cursor: not-allowed;
361
381
  }
@@ -11,6 +11,11 @@ description: >-
11
11
  supports min/max and disabled-date masks. Use for single-date input in
12
12
  forms; for date ranges compose two pickers or use a dedicated range
13
13
  component.
14
+ # Per ADR-0027 — primitives that programmatically create other primitives
15
+ # in their render() do NOT auto-import them. Consumer (or demo shell) must
16
+ # explicitly import each composed primitive.
17
+ composes:
18
+ - button-ui # day cells + month nav (gh issue 276 wave 4)
14
19
  props:
15
20
  name:
16
21
  description: Form field name
@@ -341,21 +341,24 @@ export class UIChart extends UIElement {
341
341
  this.addEventListener('pointerdown', this.#onPointerDown);
342
342
  this.addEventListener('click', this.#onClick);
343
343
 
344
- this.#resizeObs = new ResizeObserver((entries) => {
345
- const { inlineSize: w, blockSize: h } = entries[0].contentBoxSize[0];
346
- if (!this.#data.length) return;
347
- const rw = Math.round(w);
348
- const rh = Math.round(h);
349
- if (rw === this.#lastW && (!this.hasAttribute('resize') || rh === this.#lastH)) return;
350
- this.#lastW = rw;
351
- this.#lastH = rh;
352
- if (this.#resizeRaf) return;
353
- this.#resizeRaf = requestAnimationFrame(() => {
354
- this.#resizeRaf = null;
355
- this.#renderChart();
344
+ // gh#285 SSR DOM shims (linkedom) have no ResizeObserver global.
345
+ if (typeof ResizeObserver !== 'undefined') {
346
+ this.#resizeObs = new ResizeObserver((entries) => {
347
+ const { inlineSize: w, blockSize: h } = entries[0].contentBoxSize[0];
348
+ if (!this.#data.length) return;
349
+ const rw = Math.round(w);
350
+ const rh = Math.round(h);
351
+ if (rw === this.#lastW && (!this.hasAttribute('resize') || rh === this.#lastH)) return;
352
+ this.#lastW = rw;
353
+ this.#lastH = rh;
354
+ if (this.#resizeRaf) return;
355
+ this.#resizeRaf = requestAnimationFrame(() => {
356
+ this.#resizeRaf = null;
357
+ this.#renderChart();
358
+ });
356
359
  });
357
- });
358
- this.#resizeObs.observe(this);
360
+ this.#resizeObs.observe(this);
361
+ }
359
362
  }
360
363
 
361
364
  render() {
@@ -169,11 +169,14 @@ export class UIColorInput extends UIFormElement {
169
169
  // Store the observer in a #field so disconnected() can clean it up
170
170
  // — without the explicit reference, the observer survives the host
171
171
  // element across mount/unmount cycles (audit-lifecycle-leak).
172
- this.#popoverObserver = new MutationObserver(sync);
173
- this.#popoverObserver.observe(this.#popover, {
174
- attributes: true,
175
- attributeFilter: ['open'],
176
- });
172
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global.
173
+ if (typeof MutationObserver !== 'undefined') {
174
+ this.#popoverObserver = new MutationObserver(sync);
175
+ this.#popoverObserver.observe(this.#popover, {
176
+ attributes: true,
177
+ attributeFilter: ['open'],
178
+ });
179
+ }
177
180
  }
178
181
 
179
182
  #onPickerChange = (e) => {
@@ -362,9 +362,12 @@ export class UIColorPicker extends UIFormElement {
362
362
 
363
363
  this.#hueTrack.addEventListener('keydown', this.#onHueKeydown);
364
364
 
365
- // Observe area resize to redraw canvas
366
- this.#areaResizeObs = new ResizeObserver(() => this.#drawArea());
367
- this.#areaResizeObs.observe(this.#areaEl);
365
+ // Observe area resize to redraw canvas.
366
+ // gh#285 SSR DOM shims (linkedom) have no ResizeObserver global.
367
+ if (typeof ResizeObserver !== 'undefined') {
368
+ this.#areaResizeObs = new ResizeObserver(() => this.#drawArea());
369
+ this.#areaResizeObs.observe(this.#areaEl);
370
+ }
368
371
  }
369
372
 
370
373
  disconnected() {
@@ -95,13 +95,16 @@ export class UIField extends UIElement {
95
95
  this.#bindForToControl();
96
96
  this.#bindErrorListener();
97
97
  this.#labelEl?.addEventListener('click', this.#onLabelClick);
98
- this.#mo = new MutationObserver(() => {
99
- this.#bindForToControl();
100
- this.#bindErrorListener();
101
- this.#wireAriaDescribedBy();
102
- this.#syncErrorMessage();
103
- });
104
- this.#mo.observe(this, { childList: true });
98
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global.
99
+ if (typeof MutationObserver !== 'undefined') {
100
+ this.#mo = new MutationObserver(() => {
101
+ this.#bindForToControl();
102
+ this.#bindErrorListener();
103
+ this.#wireAriaDescribedBy();
104
+ this.#syncErrorMessage();
105
+ });
106
+ this.#mo.observe(this, { childList: true });
107
+ }
105
108
  this.#syncErrorMessage();
106
109
  }
107
110
 
@@ -43,6 +43,27 @@
43
43
  width: 100%;
44
44
  }
45
45
 
46
+ /* Exception: when a row-ui sibling is marked [grow], width:100% on the
47
+ OTHER fields becomes each one's flex main-size (the row's full width).
48
+ Two or more of those overflow the row, and under the negative-free-
49
+ space shrink algorithm the [grow] sibling's flex-basis:0% share gets
50
+ zeroed out entirely instead of receiving the leftover space (issue
51
+ 305). Scoped to :has(> field-ui[grow]) so rows with NO grow winner —
52
+ where every field intentionally shares the row evenly via this same
53
+ width:100% overflow-shrink split (e.g. a 2-up expiry/CVC pair) — keep
54
+ that existing, relied-upon behavior.
55
+
56
+ min-width is also needed here, not just width:auto: an empty control's
57
+ own content-based min size is ~0 (input-ui's [slot="text"] is a bare
58
+ contenteditable span — the placeholder renders via an out-of-flow
59
+ `::before`, contributing no intrinsic width), so without a floor this
60
+ field can still collapse past legibility once the [grow] sibling
61
+ starts claiming space. */
62
+ :where(row-ui):has(> field-ui[grow]) > :scope:not([inline]):not([grow]) {
63
+ width: auto;
64
+ min-width: 4.5rem;
65
+ }
66
+
46
67
  /* Gate `row-gap` on actual message presence — otherwise the grid
47
68
  reserves --field-gap (~8px) between the control row and a
48
69
  zero-content message row, making field-ui[inline] visibly taller
@@ -51,19 +51,22 @@ export class UIFields extends UIElement {
51
51
 
52
52
  connected() {
53
53
  this.#syncInline();
54
- this.#mo = new MutationObserver((records) => {
55
- // Only re-sync on childList changes that involve direct <field-ui>
56
- // children attribute mutations on grandchildren aren't ours to
57
- // care about.
58
- for (const r of records) {
59
- if (r.type !== 'childList') continue;
60
- if (this.#hasFieldChild(r.addedNodes) || this.#hasFieldChild(r.removedNodes)) {
61
- this.#syncInline();
62
- return;
54
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global.
55
+ if (typeof MutationObserver !== 'undefined') {
56
+ this.#mo = new MutationObserver((records) => {
57
+ // Only re-sync on childList changes that involve direct <field-ui>
58
+ // children attribute mutations on grandchildren aren't ours to
59
+ // care about.
60
+ for (const r of records) {
61
+ if (r.type !== 'childList') continue;
62
+ if (this.#hasFieldChild(r.addedNodes) || this.#hasFieldChild(r.removedNodes)) {
63
+ this.#syncInline();
64
+ return;
65
+ }
63
66
  }
64
- }
65
- });
66
- this.#mo.observe(this, { childList: true });
67
+ });
68
+ this.#mo.observe(this, { childList: true });
69
+ }
67
70
  }
68
71
 
69
72
  disconnected() {
@@ -30,13 +30,17 @@ function warnIfIconRegistryUnwired() {
30
30
  // eslint-disable-next-line no-console
31
31
  console.error(
32
32
  `[icon-ui] No icons are registered and no icon loaders were installed — every <icon-ui> renders blank.\n` +
33
- ` The zero-config import.meta.glob path does not work from inside a published dependency under Vite 8 / rolldown.\n` +
34
- ` Fix from your APP entry (where import.meta.glob is transformed):\n` +
33
+ ` Two known causes (gh#287): (1) Vite's dev-server optimizeDeps pre-bundled this package, which empties\n` +
34
+ ` the auto-discovery glob add to your Vite config:\n` +
35
+ ` optimizeDeps: { exclude: ['@adia-ai/web-components', '@adia-ai/web-modules'] }\n` +
36
+ ` (2) @phosphor-icons/core is missing or this file was re-nested by a packaging step (Yarn PnP, a custom\n` +
37
+ ` bundler). If neither applies, install loaders manually with plain imports from your APP entry:\n` +
35
38
  ` npm i @phosphor-icons/core\n` +
36
39
  ` import { installIconLoaders } from '@adia-ai/web-components/core/icons';\n` +
37
- ` installIconLoaders({ regular: import.meta.glob(\n` +
38
- ` '/node_modules/@phosphor-icons/core/assets/regular/*.svg',\n` +
39
- ` { query: '?raw', import: 'default', eager: true }) });\n` +
40
+ ` import caretRight from '@phosphor-icons/core/assets/regular/caret-right.svg?raw';\n` +
41
+ ` installIconLoaders({ regular: {\n` +
42
+ ` '/node_modules/@phosphor-icons/core/assets/regular/caret-right.svg': caretRight,\n` +
43
+ ` } });\n` +
40
44
  ` See USAGE.md § Icons.`,
41
45
  );
42
46
  }, 0);
@@ -58,6 +58,7 @@ export { UISwiper } from './swiper/swiper.js';
58
58
  export { UIUpload } from './upload/upload.js';
59
59
  export { UICard } from './card/card.js';
60
60
  export { UIAvatar, UIAvatarGroup } from './avatar/avatar.js';
61
+ export { UIAdiaMark } from './adia-mark/adia-mark.js';
61
62
  export { UIProgress } from './progress/progress.js';
62
63
  export { UIStepProgress } from './step-progress/step-progress.js';
63
64
  export { UISkeleton } from './skeleton/skeleton.js';
@@ -61,7 +61,8 @@ export class UINav extends UIElement {
61
61
  this.addEventListener('click', this.#onClick);
62
62
 
63
63
  // ResizeObserver only meaningful for primary variant — section is static.
64
- if (this.variant !== 'section') {
64
+ // gh#285 SSR DOM shims (linkedom) have no ResizeObserver global.
65
+ if (this.variant !== 'section' && typeof ResizeObserver !== 'undefined') {
65
66
  this.#ro = new ResizeObserver(() => this.#updateTooltips());
66
67
  this.#ro.observe(this);
67
68
  }
@@ -108,19 +108,23 @@ export class UINoodles extends UIElement {
108
108
  this.#svg.setAttribute('data-noodle-svg', '');
109
109
  this.prepend(this.#svg);
110
110
 
111
- // Observers for child layout changes
112
- this.#resizeObs = new ResizeObserver(() => this.#scheduleUpdate());
113
- this.#mutationObs = new MutationObserver(() => {
114
- this.#rebuildPortIndicators();
115
- this.#scheduleUpdate();
116
- });
117
-
118
- this.#resizeObs.observe(this);
111
+ // Observers for child layout changes.
112
+ // gh#285 SSR DOM shims (linkedom) have neither observer global.
113
+ if (typeof ResizeObserver !== 'undefined') {
114
+ this.#resizeObs = new ResizeObserver(() => this.#scheduleUpdate());
115
+ this.#resizeObs.observe(this);
116
+ }
117
+ if (typeof MutationObserver !== 'undefined') {
118
+ this.#mutationObs = new MutationObserver(() => {
119
+ this.#rebuildPortIndicators();
120
+ this.#scheduleUpdate();
121
+ });
122
+ }
119
123
  this.#observeMutations();
120
124
 
121
125
  // Observe each port-bearing child
122
126
  for (const child of this.#getPortChildren()) {
123
- this.#resizeObs.observe(child);
127
+ this.#resizeObs?.observe(child);
124
128
  }
125
129
 
126
130
  this.#rebuildPortIndicators();
@@ -181,7 +185,7 @@ export class UINoodles extends UIElement {
181
185
  // Sync resize observer with current port children
182
186
  const portChildren = this.#getPortChildren();
183
187
  for (const child of portChildren) {
184
- this.#resizeObs.observe(child);
188
+ this.#resizeObs?.observe(child);
185
189
  }
186
190
 
187
191
  // Update port indicator positions
@@ -78,13 +78,14 @@ export class UIPage extends UIElement {
78
78
  header.insertAdjacentElement('beforebegin', this.#sentinel);
79
79
  }
80
80
 
81
- if (!this.#observer) {
81
+ // gh#285 — SSR DOM shims (linkedom) have no IntersectionObserver global.
82
+ if (!this.#observer && typeof IntersectionObserver !== 'undefined') {
82
83
  this.#observer = new IntersectionObserver((entries) => {
83
84
  this.toggleAttribute('data-header-stuck', !entries[0].isIntersecting);
84
85
  }, { threshold: 0 });
85
86
  }
86
87
 
87
- this.#observer.observe(this.#sentinel);
88
+ this.#observer?.observe(this.#sentinel);
88
89
  }
89
90
 
90
91
  #teardownSticky() {
@@ -381,7 +381,8 @@ export class UISelect extends UIFormElement {
381
381
  // options are already parsed/set, and skip unless there's a real
382
382
  // <option>/<optgroup> to parse — so the component's own listbox/empty-state
383
383
  // renders (and #parseOptions's own option removals) don't re-enter or loop.
384
- if (!this.#optionObserver) {
384
+ // gh#285 — SSR DOM shims (linkedom) have no MutationObserver global.
385
+ if (!this.#optionObserver && typeof MutationObserver !== 'undefined') {
385
386
  this.#optionObserver = new MutationObserver(() => {
386
387
  if (this.#options.length) return;
387
388
  const kids = this.#logicalOptionChildren();
@@ -394,7 +395,7 @@ export class UISelect extends UIFormElement {
394
395
  }
395
396
  });
396
397
  }
397
- this.#optionObserver.observe(this, { childList: true, subtree: true });
398
+ this.#optionObserver?.observe(this, { childList: true, subtree: true });
398
399
  }
399
400
 
400
401
  render() {