@adia-ai/web-components 0.0.18 → 0.0.20

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 (90) hide show
  1. package/components/accordion/accordion.css +101 -102
  2. package/components/agent-feedback-bar/agent-feedback-bar.js +8 -8
  3. package/components/agent-questions/agent-questions.css +2 -1
  4. package/components/agent-questions/agent-questions.js +6 -6
  5. package/components/agent-reasoning/agent-reasoning.js +20 -5
  6. package/components/agent-trace/agent-trace.a2ui.json +5 -5
  7. package/components/agent-trace/agent-trace.js +7 -5
  8. package/components/agent-trace/agent-trace.yaml +2 -2
  9. package/components/alert/alert.a2ui.json +1 -2
  10. package/components/alert/alert.css +4 -4
  11. package/components/alert/alert.yaml +1 -2
  12. package/components/avatar/avatar.a2ui.json +3 -3
  13. package/components/avatar/avatar.js +10 -0
  14. package/components/avatar/avatar.yaml +6 -6
  15. package/components/button/button.a2ui.json +14 -2
  16. package/components/button/button.css +19 -2
  17. package/components/button/button.js +1 -0
  18. package/components/button/button.yaml +20 -2
  19. package/components/calendar-picker/calendar-picker.css +2 -1
  20. package/components/calendar-picker/calendar-picker.js +12 -1
  21. package/components/chart/chart.css +11 -11
  22. package/components/chart/chart.js +26 -18
  23. package/components/chart-legend/chart-legend.a2ui.json +2 -2
  24. package/components/chart-legend/chart-legend.js +4 -1
  25. package/components/chart-legend/chart-legend.yaml +2 -2
  26. package/components/chat/chat-input.js +13 -5
  27. package/components/chat/chat.a2ui.json +2 -2
  28. package/components/chat/chat.js +14 -3
  29. package/components/chat/chat.yaml +2 -2
  30. package/components/code/code.css +16 -6
  31. package/components/command/command.js +9 -1
  32. package/components/field/field.a2ui.json +0 -5
  33. package/components/field/field.css +2 -2
  34. package/components/field/field.js +53 -5
  35. package/components/field/field.yaml +5 -8
  36. package/components/heatmap/heatmap.css +32 -23
  37. package/components/input/input.js +30 -1
  38. package/components/kbd/kbd.a2ui.json +5 -1
  39. package/components/kbd/kbd.yaml +5 -1
  40. package/components/menu/menu.css +20 -8
  41. package/components/menu/menu.js +9 -1
  42. package/components/modal/modal.css +101 -108
  43. package/components/noodles/noodles.js +25 -8
  44. package/components/pipeline-status/pipeline-status.css +4 -4
  45. package/components/pipeline-status/pipeline-status.js +6 -4
  46. package/components/popover/popover.js +4 -0
  47. package/components/progress-row/progress-row.a2ui.json +3 -2
  48. package/components/progress-row/progress-row.yaml +2 -1
  49. package/components/range/range.js +7 -0
  50. package/components/richtext/richtext.css +2 -2
  51. package/components/richtext/richtext.js +4 -1
  52. package/components/segment/segment.css +1 -1
  53. package/components/segmented/segmented.js +7 -1
  54. package/components/select/select.css +7 -4
  55. package/components/slider/slider.js +15 -8
  56. package/components/stepper/stepper.css +181 -144
  57. package/components/stepper/stepper.js +5 -2
  58. package/components/swiper/swiper.a2ui.json +3 -3
  59. package/components/swiper/swiper.css +11 -77
  60. package/components/swiper/swiper.js +6 -5
  61. package/components/swiper/swiper.yaml +3 -3
  62. package/components/switch/switch.a2ui.json +8 -1
  63. package/components/switch/switch.yaml +8 -1
  64. package/components/table/table.js +9 -1
  65. package/components/table-toolbar/table-toolbar.a2ui.json +21 -21
  66. package/components/table-toolbar/table-toolbar.css +32 -91
  67. package/components/table-toolbar/table-toolbar.js +219 -86
  68. package/components/table-toolbar/table-toolbar.yaml +21 -12
  69. package/components/tabs/tabs.css +3 -2
  70. package/components/tabs/tabs.js +7 -1
  71. package/components/tag/tag.a2ui.json +2 -2
  72. package/components/tag/tag.yaml +2 -2
  73. package/components/timeline/timeline.css +244 -204
  74. package/components/timeline/timeline.js +1 -3
  75. package/components/toast/toast.a2ui.json +2 -3
  76. package/components/toast/toast.yaml +5 -3
  77. package/components/toolbar/toolbar.css +6 -1
  78. package/components/toolbar/toolbar.js +10 -2
  79. package/components/tooltip/tooltip.css +8 -2
  80. package/components/tooltip/tooltip.js +12 -14
  81. package/components/tree/tree.css +21 -0
  82. package/core/icons.js +14 -0
  83. package/core/polyfills.js +17 -7
  84. package/package.json +1 -1
  85. package/patterns/a2ui-root/a2ui-root.js +21 -14
  86. package/patterns/app-shell/css/app-shell.main.css +30 -1
  87. package/patterns/app-shell/css/app-shell.tokens.css +1 -0
  88. package/patterns/gen-ui/gen-ui.js +1 -1
  89. package/styles/colors/semantics.css +59 -2
  90. package/styles/tokens.css +16 -12
@@ -1,8 +1,9 @@
1
1
  /* ═══════════════════════════════════════════════════════════════
2
- ACCORDION-N + ACCORDION-ITEM-N
2
+ ACCORDION-UI + ACCORDION-ITEM-UI
3
3
 
4
- Two-element component. Container uses @scope for layout.
5
- Item tokens use :where() for zero specificity.
4
+ Two-element component. Each gets its own @scope block
5
+ accordion-item-ui is co-located in accordion.js but is a real
6
+ custom element and must follow the two-block @scope pattern.
6
7
  ═══════════════════════════════════════════════════════════════ */
7
8
 
8
9
  /* ── Container ── */
@@ -19,115 +20,113 @@
19
20
  }
20
21
  }
21
22
 
22
- /* ── Item tokens ── */
23
- :where(accordion-item-ui) {
24
- /* ── Colors ── */
25
- --accordion-border: var(--a-border-subtle);
26
- --accordion-header-fg: var(--a-fg-subtle);
27
- --accordion-header-fg-hover: var(--a-fg-strong);
28
- --accordion-header-bg-hover: var(--a-bg-muted);
29
- --accordion-caret-fg: var(--a-fg-muted);
30
- --accordion-caret-fg-hover: var(--a-fg-subtle);
31
-
32
- /* ── Layout ── */
33
- --accordion-radius: var(--a-radius-md);
34
- --accordion-px: var(--a-space-3);
35
- --accordion-py: var(--a-space-2);
36
- --accordion-header-gap: var(--a-space-2);
37
-
38
- /* ── Typography ── */
39
- --accordion-header-font: var(--a-ui-size);
40
- --accordion-header-weight: var(--a-weight-medium);
41
-
42
- /* ── Transition ── */
43
- --accordion-duration-fast: var(--a-duration-fast);
44
- --accordion-duration: var(--a-duration);
45
- --accordion-easing: var(--a-easing);
46
-
47
- /* ── State ── */
48
- --accordion-focus-ring: var(--a-focus-ring);
49
- }
50
-
51
- /* ── Item base ── */
52
- accordion-item-ui {
53
- box-sizing: border-box;
54
- display: block;
55
- border-bottom: 1px solid var(--accordion-border);
56
- }
23
+ /* ── Item ── */
24
+ @scope (accordion-item-ui) {
25
+ :where(:scope) {
26
+ /* ── Colors ── */
27
+ --accordion-item-border: var(--a-border-subtle);
28
+ --accordion-item-header-fg: var(--a-fg-subtle);
29
+ --accordion-item-header-fg-hover: var(--a-fg-strong);
30
+ --accordion-item-header-bg-hover: var(--a-bg-muted);
31
+ --accordion-item-caret-fg: var(--a-fg-muted);
32
+ --accordion-item-caret-fg-hover: var(--a-fg-subtle);
33
+
34
+ /* ── Layout ── */
35
+ --accordion-item-radius: var(--a-radius-md);
36
+ --accordion-item-px: var(--a-space-3);
37
+ --accordion-item-py: var(--a-space-2);
38
+ --accordion-item-header-gap: var(--a-space-2);
39
+
40
+ /* ── Typography ── */
41
+ --accordion-item-header-font: var(--a-ui-size);
42
+ --accordion-item-header-weight: var(--a-weight-medium);
43
+
44
+ /* ── Transition ── */
45
+ --accordion-item-duration-fast: var(--a-duration-fast);
46
+ --accordion-item-duration: var(--a-duration);
47
+ --accordion-item-easing: var(--a-easing);
48
+
49
+ /* ── State ── */
50
+ --accordion-item-focus-ring: var(--a-focus-ring);
51
+ }
57
52
 
58
- accordion-item-ui:last-child {
59
- border-bottom: none;
60
- }
53
+ :scope {
54
+ box-sizing: border-box;
55
+ display: block;
56
+ border-bottom: 1px solid var(--accordion-item-border);
57
+ }
61
58
 
62
- /* ── Header ── */
63
- accordion-item-ui [slot="header"] {
64
- box-sizing: border-box;
65
- display: flex;
66
- flex-direction: row;
67
- align-items: center;
68
- justify-content: space-between;
69
- gap: var(--accordion-header-gap);
70
- padding: var(--accordion-py) var(--accordion-px);
71
- border-radius: var(--accordion-radius);
72
- cursor: pointer;
73
- user-select: none;
74
- font-size: var(--accordion-header-font);
75
- font-weight: var(--accordion-header-weight);
76
- color: var(--accordion-header-fg);
77
- background: transparent;
78
- transition:
79
- color var(--accordion-duration-fast) var(--accordion-easing),
80
- background var(--accordion-duration-fast) var(--accordion-easing);
81
- outline: none;
82
- }
59
+ :scope:last-child {
60
+ border-bottom: none;
61
+ }
83
62
 
84
- accordion-item-ui [slot="header"]:hover {
85
- color: var(--accordion-header-fg-hover);
86
- background: var(--accordion-header-bg-hover);
87
- }
63
+ /* ── Header ── */
64
+ :scope [slot="header"] {
65
+ box-sizing: border-box;
66
+ display: flex;
67
+ flex-direction: row;
68
+ align-items: center;
69
+ justify-content: space-between;
70
+ gap: var(--accordion-item-header-gap);
71
+ padding: var(--accordion-item-py) var(--accordion-item-px);
72
+ border-radius: var(--accordion-item-radius);
73
+ cursor: pointer;
74
+ user-select: none;
75
+ font-size: var(--accordion-item-header-font);
76
+ font-weight: var(--accordion-item-header-weight);
77
+ color: var(--accordion-item-header-fg);
78
+ background: transparent;
79
+ transition:
80
+ color var(--accordion-item-duration-fast) var(--accordion-item-easing),
81
+ background var(--accordion-item-duration-fast) var(--accordion-item-easing);
82
+ outline: none;
83
+ }
88
84
 
89
- accordion-item-ui [slot="header"]:hover [slot="caret"] {
90
- color: var(--accordion-caret-fg-hover);
91
- }
85
+ :scope [slot="header"]:hover {
86
+ color: var(--accordion-item-header-fg-hover);
87
+ background: var(--accordion-item-header-bg-hover);
88
+ }
92
89
 
93
- accordion-item-ui [slot="header"]:focus-visible {
94
- box-shadow: var(--accordion-focus-ring);
95
- }
90
+ :scope [slot="header"]:hover [slot="caret"] {
91
+ color: var(--accordion-item-caret-fg-hover);
92
+ }
96
93
 
97
- accordion-item-ui[open] [slot="header"] {
98
- color: var(--accordion-header-fg-hover);
99
- }
94
+ :scope [slot="header"]:focus-visible {
95
+ box-shadow: var(--accordion-item-focus-ring);
96
+ }
100
97
 
101
- /* ── Header text ── */
102
- accordion-item-ui [slot="header-text"] {
103
- flex: 1;
104
- min-width: 0;
105
- }
98
+ :scope[open] [slot="header"] {
99
+ color: var(--accordion-item-header-fg-hover);
100
+ }
106
101
 
107
- /* ── Caret icon ── */
108
- accordion-item-ui [slot="caret"] {
109
- flex-shrink: 0;
110
- color: var(--accordion-caret-fg);
111
- transition:
112
- transform var(--accordion-duration) var(--accordion-easing),
113
- color var(--accordion-duration-fast) var(--accordion-easing);
114
- transform: rotate(0deg);
115
- }
102
+ /* ── Header text ── */
103
+ :scope [slot="header-text"] {
104
+ flex: 1;
105
+ min-width: 0;
106
+ }
116
107
 
117
- accordion-item-ui[open] [slot="caret"] {
118
- color: var(--accordion-caret-fg-hover);
119
- }
108
+ /* ── Caret icon ── */
109
+ :scope [slot="caret"] {
110
+ flex-shrink: 0;
111
+ color: var(--accordion-item-caret-fg);
112
+ transition:
113
+ transform var(--accordion-item-duration) var(--accordion-item-easing),
114
+ color var(--accordion-item-duration-fast) var(--accordion-item-easing);
115
+ transform: rotate(0deg);
116
+ }
120
117
 
121
- accordion-item-ui[open] [slot="caret"] {
122
- transform: rotate(180deg);
123
- }
118
+ :scope[open] [slot="caret"] {
119
+ color: var(--accordion-item-caret-fg-hover);
120
+ transform: rotate(180deg);
121
+ }
124
122
 
125
- /* ── Body content ── */
126
- accordion-item-ui [slot="body"] {
127
- display: none;
128
- }
123
+ /* ── Body content ── */
124
+ :scope [slot="body"] {
125
+ display: none;
126
+ }
129
127
 
130
- accordion-item-ui[open] [slot="body"] {
131
- display: block;
132
- padding: 0 var(--accordion-px) var(--accordion-py);
128
+ :scope[open] [slot="body"] {
129
+ display: block;
130
+ padding: 0 var(--accordion-item-px) var(--accordion-item-py);
131
+ }
133
132
  }
@@ -34,9 +34,9 @@ import { AdiaElement } from '../../core/element.js';
34
34
 
35
35
  class AdiaAgentFeedbackBar extends AdiaElement {
36
36
  static properties = {
37
- 'save-label': { type: String, default: '', attribute: 'save-label' },
38
- 'save-icon': { type: String, default: 'bookmark-simple', attribute: 'save-icon' },
39
- disabled: { type: Boolean, default: false, reflect: true },
37
+ saveLabel: { type: String, default: '', reflect: true, attribute: 'save-label' },
38
+ saveIcon: { type: String, default: 'bookmark-simple', reflect: true, attribute: 'save-icon' },
39
+ disabled: { type: Boolean, default: false, reflect: true },
40
40
  };
41
41
 
42
42
  static template = () => null;
@@ -104,8 +104,8 @@ class AdiaAgentFeedbackBar extends AdiaElement {
104
104
 
105
105
  render() {
106
106
  // Re-sync attributes (label/icon) that may have changed.
107
- const label = this['save-label'];
108
- const icon = this['save-icon'];
107
+ const label = this.saveLabel;
108
+ const icon = this.saveIcon;
109
109
  if (this.#saveEl) {
110
110
  if (label) {
111
111
  this.#saveEl.setAttribute('text', label);
@@ -123,10 +123,10 @@ class AdiaAgentFeedbackBar extends AdiaElement {
123
123
  this.#upEl = makeButton({ icon: 'thumbs-up' });
124
124
  this.#downEl = makeButton({ icon: 'thumbs-down' });
125
125
  this.#saveEl = makeButton({
126
- icon: this['save-icon'] || 'bookmark-simple',
127
- text: this['save-label'] || '',
126
+ icon: this.saveIcon || 'bookmark-simple',
127
+ text: this.saveLabel || '',
128
128
  });
129
- if (!this['save-label']) this.#saveEl.hidden = true;
129
+ if (!this.saveLabel) this.#saveEl.hidden = true;
130
130
 
131
131
  this.#upEl.addEventListener('press', this.#onUp);
132
132
  this.#downEl.addEventListener('press', this.#onDown);
@@ -27,6 +27,7 @@
27
27
  --agent-questions-option-padding: var(--a-space-3);
28
28
  --agent-questions-option-radius: var(--a-radius);
29
29
  --agent-questions-q-padding: var(--a-space-1);
30
+ --agent-questions-option-body-gap: var(--a-space-0-5);
30
31
  /* Component-intrinsic measurement; no --a-space-* equivalent */
31
32
  --agent-questions-check-size: 20px;
32
33
 
@@ -107,7 +108,7 @@
107
108
  min-width: 0;
108
109
  display: flex;
109
110
  flex-direction: column;
110
- gap: 2px;
111
+ gap: var(--agent-questions-option-body-gap);
111
112
  }
112
113
 
113
114
  [data-questions-option-label] {
@@ -30,10 +30,10 @@ import { AdiaElement } from '../../core/element.js';
30
30
 
31
31
  class AdiaAgentQuestions extends AdiaElement {
32
32
  static properties = {
33
- multi: { type: Boolean, default: false, reflect: true },
34
- question: { type: String, default: '', reflect: true },
35
- helper: { type: String, default: '', reflect: true },
36
- 'submit-label': { type: String, default: 'Continue', attribute: 'submit-label' },
33
+ multi: { type: Boolean, default: false, reflect: true },
34
+ question: { type: String, default: '', reflect: true },
35
+ helper: { type: String, default: '', reflect: true },
36
+ submitLabel: { type: String, default: 'Continue', reflect: true, attribute: 'submit-label' },
37
37
  };
38
38
 
39
39
  static template = () => null;
@@ -74,7 +74,7 @@ class AdiaAgentQuestions extends AdiaElement {
74
74
  this.#helperEl.hidden = !this.helper;
75
75
  }
76
76
  if (this.#submitEl) {
77
- this.#submitEl.setAttribute('text', this['submit-label'] || 'Continue');
77
+ this.#submitEl.setAttribute('text', this.submitLabel || 'Continue');
78
78
  this.#submitEl.hidden = !this.multi;
79
79
  }
80
80
  }
@@ -96,7 +96,7 @@ class AdiaAgentQuestions extends AdiaElement {
96
96
  this.#optionsEl.setAttribute('data-questions-options', '');
97
97
 
98
98
  this.#submitEl = document.createElement('button-ui');
99
- this.#submitEl.setAttribute('text', this['submit-label'] || 'Continue');
99
+ this.#submitEl.setAttribute('text', this.submitLabel || 'Continue');
100
100
  this.#submitEl.setAttribute('variant', 'primary');
101
101
  this.#submitEl.setAttribute('size', 'sm');
102
102
  this.#submitEl.setAttribute('disabled', '');
@@ -76,15 +76,29 @@ class AdiaAgentReasoning extends AdiaElement {
76
76
  #finishTimer = null;
77
77
  #summaryEl = null;
78
78
  #bodyEl = null;
79
+ #bound = false;
79
80
 
80
81
  get entries() { return this.#entries; }
81
82
 
82
83
  connected() {
84
+ if (this.#bound) return;
85
+ this.#bound = true;
83
86
  this.#startTime = Date.now();
84
87
  this.#timerInterval = setInterval(() => this.#tickTimers(), 1000);
85
88
  this.#buildShell();
86
89
  }
87
90
 
91
+ // Single delegated handler for every nested timeline-item's toggle event.
92
+ // Each step element carries its id on dataset.stepId so the handler can
93
+ // resolve which step fired without per-item closures.
94
+ #onStepToggle = (e) => {
95
+ const item = e.target.closest('timeline-item-ui[data-step-id]');
96
+ if (!item || !this.#bodyEl?.contains(item)) return;
97
+ this.dispatchEvent(new CustomEvent('reasoning-step-toggle', {
98
+ bubbles: true, detail: { stepId: item.dataset.stepId },
99
+ }));
100
+ };
101
+
88
102
  disconnected() {
89
103
  if (this.#timerInterval != null) {
90
104
  clearInterval(this.#timerInterval);
@@ -95,8 +109,10 @@ class AdiaAgentReasoning extends AdiaElement {
95
109
  this.#finishTimer = null;
96
110
  }
97
111
  this.#summaryEl?.removeEventListener('click', this.#onSummaryClick);
112
+ this.#bodyEl?.removeEventListener('timeline-toggle', this.#onStepToggle);
98
113
  this.#summaryEl = null;
99
114
  this.#bodyEl = null;
115
+ this.#bound = false;
100
116
  }
101
117
 
102
118
  // ── Public API ──
@@ -259,6 +275,7 @@ class AdiaAgentReasoning extends AdiaElement {
259
275
 
260
276
  this.#bodyEl = document.createElement('div');
261
277
  this.#bodyEl.setAttribute('data-reasoning-body', '');
278
+ this.#bodyEl.addEventListener('timeline-toggle', this.#onStepToggle);
262
279
  this.appendChild(this.#bodyEl);
263
280
 
264
281
  this.#render();
@@ -364,11 +381,9 @@ class AdiaAgentReasoning extends AdiaElement {
364
381
 
365
382
  if (step.outcomes?.length) item.outcomes = step.outcomes;
366
383
 
367
- item.addEventListener('timeline-toggle', () => {
368
- this.dispatchEvent(new CustomEvent('reasoning-step-toggle', {
369
- bubbles: true, detail: { stepId: step.id },
370
- }));
371
- });
384
+ // Step id stamped on dataset so the parent's delegated #onStepToggle
385
+ // listener (wired in #buildShell) can resolve which step fired.
386
+ item.dataset.stepId = step.id || '';
372
387
  return item;
373
388
  }
374
389
 
@@ -13,6 +13,11 @@
13
13
  }
14
14
  ],
15
15
  "properties": {
16
+ "collapsed": {
17
+ "description": "Hide the trace body. Default-visible disclosure (matches the agent-* family — agent-reasoning, agent-artifact). Set to opt out.",
18
+ "type": "boolean",
19
+ "default": false
20
+ },
16
21
  "component": {
17
22
  "const": "AgentTrace"
18
23
  },
@@ -20,11 +25,6 @@
20
25
  "description": "Fallback summary label.",
21
26
  "type": "string",
22
27
  "default": ""
23
- },
24
- "open": {
25
- "description": "Start expanded.",
26
- "type": "boolean",
27
- "default": false
28
28
  }
29
29
  },
30
30
  "required": [
@@ -38,8 +38,10 @@ import { AdiaElement } from '../../core/element.js';
38
38
 
39
39
  class AdiaAgentTrace extends AdiaElement {
40
40
  static properties = {
41
- open: { type: Boolean, default: false, reflect: true },
42
- label: { type: String, default: '', reflect: true },
41
+ // agent-* family is default-visible disclosure (see component-token-contract.md
42
+ // §"Toggle state naming"). Use `collapsed` to hide; bare element shows.
43
+ collapsed: { type: Boolean, default: false, reflect: true },
44
+ label: { type: String, default: '', reflect: true },
43
45
  };
44
46
 
45
47
  static template = () => null;
@@ -68,9 +70,9 @@ class AdiaAgentTrace extends AdiaElement {
68
70
  }
69
71
 
70
72
  #onToggle = () => {
71
- this.open = this.#rootEl.hasAttribute('open');
73
+ this.collapsed = !this.#rootEl.hasAttribute('open');
72
74
  this.dispatchEvent(new CustomEvent('trace-toggle', {
73
- bubbles: true, detail: { open: this.open },
75
+ bubbles: true, detail: { collapsed: this.collapsed },
74
76
  }));
75
77
  };
76
78
 
@@ -78,7 +80,7 @@ class AdiaAgentTrace extends AdiaElement {
78
80
  this.innerHTML = '';
79
81
  this.#rootEl = document.createElement('details');
80
82
  this.#rootEl.setAttribute('data-trace-root', '');
81
- if (this.open) this.#rootEl.setAttribute('open', '');
83
+ if (!this.collapsed) this.#rootEl.setAttribute('open', '');
82
84
  this.#rootEl.addEventListener('toggle', this.#onToggle);
83
85
  this.appendChild(this.#rootEl);
84
86
  this.#render();
@@ -12,8 +12,8 @@ props:
12
12
  description: Fallback summary label.
13
13
  type: string
14
14
  default: ""
15
- open:
16
- description: Start expanded.
15
+ collapsed:
16
+ description: Hide the trace body. Default-visible disclosure (matches the agent-* family — agent-reasoning, agent-artifact). Set to opt out.
17
17
  type: boolean
18
18
  default: false
19
19
  reflect: true
@@ -32,14 +32,13 @@
32
32
  "default": ""
33
33
  },
34
34
  "variant": {
35
- "description": "Semantic color variant. `error` kept as alias for `danger`.",
35
+ "description": "Semantic color variant.",
36
36
  "type": "string",
37
37
  "enum": [
38
38
  "default",
39
39
  "info",
40
40
  "success",
41
41
  "warning",
42
- "error",
43
42
  "danger",
44
43
  "muted",
45
44
  "neutral"
@@ -37,28 +37,28 @@
37
37
  --alert-bg: var(--a-info-muted);
38
38
  --alert-fg: var(--a-info-text);
39
39
  --alert-border: var(--a-info-border-subtle);
40
- --alert-icon-fg: var(--a-info);
40
+ --alert-icon-fg: var(--a-info-strong);
41
41
  }
42
42
 
43
43
  :scope[variant="success"] {
44
44
  --alert-bg: var(--a-success-muted);
45
45
  --alert-fg: var(--a-success-text);
46
46
  --alert-border: var(--a-success-border-subtle);
47
- --alert-icon-fg: var(--a-success);
47
+ --alert-icon-fg: var(--a-success-strong);
48
48
  }
49
49
 
50
50
  :scope[variant="warning"] {
51
51
  --alert-bg: var(--a-warning-muted);
52
52
  --alert-fg: var(--a-warning-text);
53
53
  --alert-border: var(--a-warning-border-subtle);
54
- --alert-icon-fg: var(--a-warning);
54
+ --alert-icon-fg: var(--a-warning-strong);
55
55
  }
56
56
 
57
57
  :scope[variant="danger"] {
58
58
  --alert-bg: var(--a-danger-muted);
59
59
  --alert-fg: var(--a-danger-text);
60
60
  --alert-border: var(--a-danger-border-subtle);
61
- --alert-icon-fg: var(--a-danger);
61
+ --alert-icon-fg: var(--a-danger-strong);
62
62
  }
63
63
 
64
64
  /* ── Slots ── */
@@ -21,7 +21,7 @@ props:
21
21
  type: string
22
22
  default: ""
23
23
  variant:
24
- description: Semantic color variant. `error` kept as alias for `danger`.
24
+ description: Semantic color variant.
25
25
  type: string
26
26
  default: default
27
27
  enum:
@@ -29,7 +29,6 @@ props:
29
29
  - info
30
30
  - success
31
31
  - warning
32
- - error
33
32
  - danger
34
33
  - muted
35
34
  - neutral
@@ -17,12 +17,12 @@
17
17
  "const": "Avatar"
18
18
  },
19
19
  "icon": {
20
- "description": "Phosphor icon name shown instead of initials when `src`/`name` are empty.",
20
+ "description": "Phosphor icon name shown instead of initials when `src`/`text` are empty.",
21
21
  "type": "string",
22
22
  "default": ""
23
23
  },
24
24
  "name": {
25
- "description": "User name for initials (first letter of each word, max 2).",
25
+ "description": "Deprecated alias for `text` (logs a one-shot console warning; will be removed in a future release). New code should use `text=` instead.",
26
26
  "type": "string",
27
27
  "default": ""
28
28
  },
@@ -57,7 +57,7 @@
57
57
  "default": ""
58
58
  },
59
59
  "text": {
60
- "description": "Display name (for initials)",
60
+ "description": "Display string (full name or initials). Initials derive from spaces — first letter of each word, max 2.",
61
61
  "type": "string",
62
62
  "default": ""
63
63
  }
@@ -32,12 +32,22 @@ class AdiaAvatar extends AdiaElement {
32
32
 
33
33
  static template = () => null;
34
34
 
35
+ static #nameWarned = false;
36
+
35
37
  #imgEl = null;
36
38
  #initialsEl = null;
37
39
  #iconEl = null;
38
40
 
39
41
  connected() {
40
42
  this.setAttribute('role', 'img');
43
+ if (this.name && !this.text && !AdiaAvatar.#nameWarned) {
44
+ AdiaAvatar.#nameWarned = true;
45
+ // eslint-disable-next-line no-console
46
+ console.warn(
47
+ `[AdiaUI] <avatar-ui name="…"> is deprecated — use text="…" instead. ` +
48
+ `Docs: https://ui-kit.exe.xyz/site/components/avatar`
49
+ );
50
+ }
41
51
  }
42
52
 
43
53
  render() {
@@ -8,12 +8,16 @@ category: display
8
8
  version: 1
9
9
  description: Avatar with image → initials → empty fallback chain.
10
10
  props:
11
+ text:
12
+ description: Display string (full name or initials). Initials derive from spaces — first letter of each word, max 2.
13
+ type: string
14
+ default: ""
11
15
  name:
12
- description: User name for initials (first letter of each word, max 2).
16
+ description: "Deprecated alias for `text` (logs a one-shot console warning; will be removed in a future release). New code should use `text=` instead."
13
17
  type: string
14
18
  default: ""
15
19
  icon:
16
- description: Phosphor icon name shown instead of initials when `src`/`name` are empty.
20
+ description: Phosphor icon name shown instead of initials when `src`/`text` are empty.
17
21
  type: string
18
22
  default: ""
19
23
  shape:
@@ -43,10 +47,6 @@ props:
43
47
  description: Image source URL. Falls back to initials on error.
44
48
  type: string
45
49
  default: ""
46
- text:
47
- description: Display name (for initials)
48
- type: string
49
- default: ""
50
50
  events: {}
51
51
  slots:
52
52
  icon:
@@ -18,6 +18,19 @@
18
18
  "type": "string",
19
19
  "default": "button"
20
20
  },
21
+ "color": {
22
+ "description": "Semantic intent — composes with [variant]. `<button-ui variant=\"solid\" color=\"danger\">` = filled destructive action; `<button-ui variant=\"outline\" color=\"success\">` = outlined success affordance.",
23
+ "type": "string",
24
+ "enum": [
25
+ "default",
26
+ "accent",
27
+ "info",
28
+ "success",
29
+ "warning",
30
+ "danger"
31
+ ],
32
+ "default": ""
33
+ },
21
34
  "component": {
22
35
  "const": "Button"
23
36
  },
@@ -54,14 +67,13 @@
54
67
  "default": ""
55
68
  },
56
69
  "variant": {
57
- "description": "Visual style variant. `default` is the base style; `link` renders the button as underlined text for inline actions.",
70
+ "description": "Visual style `solid` (default fill), `outline`, `ghost`, `link`. `default` / `primary` are aliases of `solid`. Style is independent of semantic intent — to express destructive / success / info / warning intent, set [color=\"…\"] alongside.",
58
71
  "type": "string",
59
72
  "enum": [
60
73
  "default",
61
74
  "solid",
62
75
  "outline",
63
76
  "ghost",
64
- "danger",
65
77
  "primary",
66
78
  "secondary",
67
79
  "soft",