@adia-ai/web-components 0.8.3 → 0.8.5

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 (95) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/USAGE.md +60 -25
  3. package/components/accordion/accordion.css +5 -0
  4. package/components/adia-mark/adia-mark.a2ui.json +123 -0
  5. package/components/adia-mark/adia-mark.class.js +64 -0
  6. package/components/adia-mark/adia-mark.css +48 -0
  7. package/components/adia-mark/adia-mark.d.ts +20 -0
  8. package/components/adia-mark/adia-mark.examples.md +26 -0
  9. package/components/adia-mark/adia-mark.js +17 -0
  10. package/components/adia-mark/adia-mark.test.js +69 -0
  11. package/components/adia-mark/adia-mark.yaml +121 -0
  12. package/components/agent-artifact/agent-artifact.css +1 -0
  13. package/components/agent-questions/agent-questions.a2ui.json +2 -1
  14. package/components/agent-questions/agent-questions.class.js +96 -53
  15. package/components/agent-questions/agent-questions.css +27 -106
  16. package/components/agent-questions/agent-questions.yaml +1 -0
  17. package/components/agent-reasoning/agent-reasoning.css +9 -5
  18. package/components/button/button.class.js +9 -2
  19. package/components/button/button.css +1 -1
  20. package/components/calendar-grid/calendar-grid.a2ui.json +3 -1
  21. package/components/calendar-grid/calendar-grid.class.js +11 -6
  22. package/components/calendar-grid/calendar-grid.css +42 -20
  23. package/components/calendar-grid/calendar-grid.yaml +5 -0
  24. package/components/calendar-picker/calendar-picker.a2ui.json +3 -1
  25. package/components/calendar-picker/calendar-picker.class.js +11 -6
  26. package/components/calendar-picker/calendar-picker.css +41 -19
  27. package/components/calendar-picker/calendar-picker.yaml +5 -0
  28. package/components/chart/chart.class.js +17 -14
  29. package/components/chat-thread/chat-input.a2ui.json +3 -1
  30. package/components/chat-thread/chat-input.css +12 -13
  31. package/components/chat-thread/chat-input.js +6 -2
  32. package/components/chat-thread/chat-input.yaml +3 -0
  33. package/components/check/check.css +1 -1
  34. package/components/color-input/color-input.class.js +8 -5
  35. package/components/color-picker/color-picker.class.js +6 -3
  36. package/components/combobox/combobox.a2ui.json +3 -1
  37. package/components/combobox/combobox.class.js +1 -3
  38. package/components/combobox/combobox.css +9 -12
  39. package/components/combobox/combobox.yaml +2 -0
  40. package/components/date-range-picker/date-range-picker.css +1 -0
  41. package/components/field/field.class.js +10 -7
  42. package/components/fields/fields.class.js +15 -12
  43. package/components/icon/icon.class.js +9 -5
  44. package/components/index.js +1 -0
  45. package/components/input/input.css +6 -2
  46. package/components/nav/nav.class.js +2 -1
  47. package/components/nav-group/nav-group.css +5 -6
  48. package/components/noodles/noodles.class.js +14 -10
  49. package/components/option-card/option-card.css +1 -0
  50. package/components/page/page.class.js +3 -2
  51. package/components/radio/radio.css +1 -1
  52. package/components/range/range.css +2 -0
  53. package/components/select/select.a2ui.json +2 -1
  54. package/components/select/select.class.js +12 -11
  55. package/components/select/select.css +29 -40
  56. package/components/select/select.test.js +6 -2
  57. package/components/select/select.yaml +1 -0
  58. package/components/swatch/swatch.a2ui.json +3 -1
  59. package/components/swatch/swatch.class.js +41 -32
  60. package/components/swatch/swatch.css +13 -18
  61. package/components/swatch/swatch.yaml +2 -0
  62. package/components/swiper/swiper.class.js +4 -1
  63. package/components/swiper/swiper.css +13 -4
  64. package/components/switch/switch.css +1 -1
  65. package/components/tag/tag.a2ui.json +4 -1
  66. package/components/tag/tag.class.js +3 -1
  67. package/components/tag/tag.css +13 -15
  68. package/components/tag/tag.yaml +3 -0
  69. package/components/tags-input/tags-input.css +1 -0
  70. package/components/textarea/textarea.css +2 -0
  71. package/components/time-picker/time-picker.css +2 -0
  72. package/components/timeline/timeline.a2ui.json +2 -1
  73. package/components/timeline/timeline.class.js +7 -8
  74. package/components/timeline/timeline.css +14 -26
  75. package/components/timeline/timeline.yaml +1 -0
  76. package/components/toggle-group/toggle-group.css +1 -0
  77. package/components/toolbar/toolbar.class.js +11 -6
  78. package/components/tree/tree.class.js +5 -2
  79. package/components/tree/tree.css +5 -2
  80. package/components/upload/upload.css +1 -0
  81. package/core/data-stream.js +21 -15
  82. package/core/element.js +36 -1
  83. package/core/element.test.js +67 -0
  84. package/core/icons-phosphor.js +86 -22
  85. package/core/icons.js +22 -8
  86. package/dist/theme-provider.min.js +2 -2
  87. package/dist/web-components.min.css +1 -1
  88. package/dist/web-components.min.js +109 -108
  89. package/dist/web-components.sheet.js +1 -1
  90. package/package.json +1 -5
  91. package/styles/colors/semantics/features.css +6 -1
  92. package/styles/components.css +1 -0
  93. package/traits/error-shake/error-shake.js +23 -17
  94. package/traits/fade-presence/fade-presence.js +19 -15
  95. package/traits/success-checkmark/success-checkmark.js +21 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",
@@ -61,10 +61,6 @@
61
61
  "types": "./css-module.d.ts",
62
62
  "default": "./components/*/*.css"
63
63
  },
64
- "./components/*/*.css": {
65
- "types": "./css-module.d.ts",
66
- "default": "./components/*/*.css"
67
- },
68
64
  "./components/*/css/*.css": {
69
65
  "types": "./css-module.d.ts",
70
66
  "default": "./components/*/css/*.css"
@@ -28,7 +28,12 @@
28
28
  consume either `--a-focus-ring` directly or an L3 alias like
29
29
  `--{component}-focus-ring: var(--a-focus-ring)` (the more common
30
30
  pattern — gives per-component override headroom without breaking
31
- the canonical default). */
31
+ the canonical default).
32
+
33
+ While the ring paints, the control's own border-color goes
34
+ transparent (operator ruling 2026-07-16): the ring is the single
35
+ focus affordance; a visible border under the ring double-draws
36
+ the edge. */
32
37
 
33
38
  --a-focus-color: var(--a-primary-strong);
34
39
  --a-focus-color-invalid: var(--a-danger);
@@ -49,6 +49,7 @@
49
49
  @import "../components/card/card.css";
50
50
  @import "../components/frame/frame.css";
51
51
  @import "../components/avatar/avatar.css";
52
+ @import "../components/adia-mark/adia-mark.css";
52
53
  @import "../components/progress/progress.css";
53
54
  @import "../components/skeleton/skeleton.css";
54
55
  @import "../components/alert/alert.css";
@@ -121,28 +121,34 @@ export const errorShake = defineTrait({
121
121
  // synchronously *before* dispatching `validated`, so the observer
122
122
  // and event listener can both fire — we de-dupe by tracking the
123
123
  // last-known invalid state and only triggering on false → true.
124
- const observer = new MutationObserver((muts) => {
125
- for (const m of muts) {
126
- if (m.attributeName === 'data-validation-invalid') {
127
- const nowInvalid = host.hasAttribute('data-validation-invalid');
128
- if (nowInvalid && !lastInvalid) shake();
129
- lastInvalid = nowInvalid;
130
- } else if (m.attributeName === 'data-error-shake-trigger') {
131
- // Toggle (any change) fires a shake. Empty-string and "" are
132
- // both treated as "present" — the convention for boolean attrs.
133
- if (host.hasAttribute('data-error-shake-trigger')) shake();
124
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global.
125
+ // Guard construction; the `validated` event listener below still
126
+ // covers the primary trigger path, so this degrades rather than crashes.
127
+ let observer = null;
128
+ if (typeof MutationObserver !== 'undefined') {
129
+ observer = new MutationObserver((muts) => {
130
+ for (const m of muts) {
131
+ if (m.attributeName === 'data-validation-invalid') {
132
+ const nowInvalid = host.hasAttribute('data-validation-invalid');
133
+ if (nowInvalid && !lastInvalid) shake();
134
+ lastInvalid = nowInvalid;
135
+ } else if (m.attributeName === 'data-error-shake-trigger') {
136
+ // Toggle (any change) fires a shake. Empty-string and "" are
137
+ // both treated as "present" — the convention for boolean attrs.
138
+ if (host.hasAttribute('data-error-shake-trigger')) shake();
139
+ }
134
140
  }
135
- }
136
- });
137
- observer.observe(host, {
138
- attributes: true,
139
- attributeFilter: ['data-validation-invalid', 'data-error-shake-trigger'],
140
- });
141
+ });
142
+ observer.observe(host, {
143
+ attributes: true,
144
+ attributeFilter: ['data-validation-invalid', 'data-error-shake-trigger'],
145
+ });
146
+ }
141
147
 
142
148
  host.addEventListener('validated', onValidated);
143
149
 
144
150
  return () => {
145
- observer.disconnect();
151
+ observer?.disconnect();
146
152
  host.removeEventListener('validated', onValidated);
147
153
  for (const t of activeTimers) clearTimeout(t);
148
154
  activeTimers.clear();
@@ -21,20 +21,24 @@ export const fadePresence = defineTrait({
21
21
  }
22
22
  }
23
23
 
24
- const observer = new MutationObserver(() => {
25
- const visible = host.hasAttribute('data-fade-presence-visible');
26
- if (visible) {
27
- host.setAttribute('data-fade-presence-entering', '');
28
- host.removeAttribute('data-fade-presence-exiting');
29
- host.style.opacity = '1';
30
- } else {
31
- host.setAttribute('data-fade-presence-exiting', '');
32
- host.removeAttribute('data-fade-presence-entering');
33
- host.style.opacity = '0';
34
- }
35
- });
36
-
37
- observer.observe(host, { attributes: true, attributeFilter: ['data-fade-presence-visible'] });
24
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global;
25
+ // skip construction rather than throwing (progressive enhancement).
26
+ let observer = null;
27
+ if (typeof MutationObserver !== 'undefined') {
28
+ observer = new MutationObserver(() => {
29
+ const visible = host.hasAttribute('data-fade-presence-visible');
30
+ if (visible) {
31
+ host.setAttribute('data-fade-presence-entering', '');
32
+ host.removeAttribute('data-fade-presence-exiting');
33
+ host.style.opacity = '1';
34
+ } else {
35
+ host.setAttribute('data-fade-presence-exiting', '');
36
+ host.removeAttribute('data-fade-presence-entering');
37
+ host.style.opacity = '0';
38
+ }
39
+ });
40
+ observer.observe(host, { attributes: true, attributeFilter: ['data-fade-presence-visible'] });
41
+ }
38
42
  host.addEventListener('transitionend', onTransitionEnd);
39
43
 
40
44
  // Apply initial state
@@ -43,7 +47,7 @@ export const fadePresence = defineTrait({
43
47
  }
44
48
 
45
49
  return () => {
46
- observer.disconnect();
50
+ observer?.disconnect();
47
51
  host.removeEventListener('transitionend', onTransitionEnd);
48
52
  host.style.opacity = '';
49
53
  host.style.transition = '';
@@ -188,27 +188,32 @@ export const successCheckmark = defineTrait({
188
188
  if (e?.detail && e.detail.valid === true) draw();
189
189
  }
190
190
 
191
- // Watch data-validation-valid (false true) + the manual trigger.
192
- const observer = new MutationObserver((muts) => {
193
- for (const m of muts) {
194
- if (m.attributeName === 'data-validation-valid') {
195
- const nowValid = host.hasAttribute('data-validation-valid');
196
- if (nowValid && !lastValid) draw();
197
- lastValid = nowValid;
198
- } else if (m.attributeName === 'data-success-checkmark-trigger') {
199
- if (host.hasAttribute('data-success-checkmark-trigger')) draw();
191
+ // gh#285 SSR DOM shims (linkedom) have no MutationObserver global.
192
+ // Guard construction; the `validated` event listener below still
193
+ // covers the primary trigger path, so this degrades rather than crashes.
194
+ let observer = null;
195
+ if (typeof MutationObserver !== 'undefined') {
196
+ observer = new MutationObserver((muts) => {
197
+ for (const m of muts) {
198
+ if (m.attributeName === 'data-validation-valid') {
199
+ const nowValid = host.hasAttribute('data-validation-valid');
200
+ if (nowValid && !lastValid) draw();
201
+ lastValid = nowValid;
202
+ } else if (m.attributeName === 'data-success-checkmark-trigger') {
203
+ if (host.hasAttribute('data-success-checkmark-trigger')) draw();
204
+ }
200
205
  }
201
- }
202
- });
203
- observer.observe(host, {
204
- attributes: true,
205
- attributeFilter: ['data-validation-valid', 'data-success-checkmark-trigger'],
206
- });
206
+ });
207
+ observer.observe(host, {
208
+ attributes: true,
209
+ attributeFilter: ['data-validation-valid', 'data-success-checkmark-trigger'],
210
+ });
211
+ }
207
212
 
208
213
  host.addEventListener('validated', onValidated);
209
214
 
210
215
  return () => {
211
- observer.disconnect();
216
+ observer?.disconnect();
212
217
  host.removeEventListener('validated', onValidated);
213
218
  for (const t of activeTimers) clearTimeout(t);
214
219
  activeTimers.clear();