@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.
- package/components/accordion/accordion.css +101 -102
- package/components/agent-feedback-bar/agent-feedback-bar.js +8 -8
- package/components/agent-questions/agent-questions.css +2 -1
- package/components/agent-questions/agent-questions.js +6 -6
- package/components/agent-reasoning/agent-reasoning.js +20 -5
- package/components/agent-trace/agent-trace.a2ui.json +5 -5
- package/components/agent-trace/agent-trace.js +7 -5
- package/components/agent-trace/agent-trace.yaml +2 -2
- package/components/alert/alert.a2ui.json +1 -2
- package/components/alert/alert.css +4 -4
- package/components/alert/alert.yaml +1 -2
- package/components/avatar/avatar.a2ui.json +3 -3
- package/components/avatar/avatar.js +10 -0
- package/components/avatar/avatar.yaml +6 -6
- package/components/button/button.a2ui.json +14 -2
- package/components/button/button.css +19 -2
- package/components/button/button.js +1 -0
- package/components/button/button.yaml +20 -2
- package/components/calendar-picker/calendar-picker.css +2 -1
- package/components/calendar-picker/calendar-picker.js +12 -1
- package/components/chart/chart.css +11 -11
- package/components/chart/chart.js +26 -18
- package/components/chart-legend/chart-legend.a2ui.json +2 -2
- package/components/chart-legend/chart-legend.js +4 -1
- package/components/chart-legend/chart-legend.yaml +2 -2
- package/components/chat/chat-input.js +13 -5
- package/components/chat/chat.a2ui.json +2 -2
- package/components/chat/chat.js +14 -3
- package/components/chat/chat.yaml +2 -2
- package/components/code/code.css +16 -6
- package/components/command/command.js +9 -1
- package/components/field/field.a2ui.json +0 -5
- package/components/field/field.css +2 -2
- package/components/field/field.js +53 -5
- package/components/field/field.yaml +5 -8
- package/components/heatmap/heatmap.css +32 -23
- package/components/input/input.js +30 -1
- package/components/kbd/kbd.a2ui.json +5 -1
- package/components/kbd/kbd.yaml +5 -1
- package/components/menu/menu.css +20 -8
- package/components/menu/menu.js +9 -1
- package/components/modal/modal.css +101 -108
- package/components/noodles/noodles.js +25 -8
- package/components/pipeline-status/pipeline-status.css +4 -4
- package/components/pipeline-status/pipeline-status.js +6 -4
- package/components/popover/popover.js +4 -0
- package/components/progress-row/progress-row.a2ui.json +3 -2
- package/components/progress-row/progress-row.yaml +2 -1
- package/components/range/range.js +7 -0
- package/components/richtext/richtext.css +2 -2
- package/components/richtext/richtext.js +4 -1
- package/components/segment/segment.css +1 -1
- package/components/segmented/segmented.js +7 -1
- package/components/select/select.css +7 -4
- package/components/slider/slider.js +15 -8
- package/components/stepper/stepper.css +181 -144
- package/components/stepper/stepper.js +5 -2
- package/components/swiper/swiper.a2ui.json +3 -3
- package/components/swiper/swiper.css +11 -77
- package/components/swiper/swiper.js +6 -5
- package/components/swiper/swiper.yaml +3 -3
- package/components/switch/switch.a2ui.json +8 -1
- package/components/switch/switch.yaml +8 -1
- package/components/table/table.js +9 -1
- package/components/table-toolbar/table-toolbar.a2ui.json +21 -21
- package/components/table-toolbar/table-toolbar.css +32 -91
- package/components/table-toolbar/table-toolbar.js +219 -86
- package/components/table-toolbar/table-toolbar.yaml +21 -12
- package/components/tabs/tabs.css +3 -2
- package/components/tabs/tabs.js +7 -1
- package/components/tag/tag.a2ui.json +2 -2
- package/components/tag/tag.yaml +2 -2
- package/components/timeline/timeline.css +244 -204
- package/components/timeline/timeline.js +1 -3
- package/components/toast/toast.a2ui.json +2 -3
- package/components/toast/toast.yaml +5 -3
- package/components/toolbar/toolbar.css +6 -1
- package/components/toolbar/toolbar.js +10 -2
- package/components/tooltip/tooltip.css +8 -2
- package/components/tooltip/tooltip.js +12 -14
- package/components/tree/tree.css +21 -0
- package/core/icons.js +14 -0
- package/core/polyfills.js +17 -7
- package/package.json +1 -1
- package/patterns/a2ui-root/a2ui-root.js +21 -14
- package/patterns/app-shell/css/app-shell.main.css +30 -1
- package/patterns/app-shell/css/app-shell.tokens.css +1 -0
- package/patterns/gen-ui/gen-ui.js +1 -1
- package/styles/colors/semantics.css +59 -2
- package/styles/tokens.css +16 -12
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
-
ACCORDION-
|
|
2
|
+
ACCORDION-UI + ACCORDION-ITEM-UI
|
|
3
3
|
|
|
4
|
-
Two-element component.
|
|
5
|
-
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
:scope {
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
display: block;
|
|
56
|
+
border-bottom: 1px solid var(--accordion-item-border);
|
|
57
|
+
}
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
90
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
90
|
+
:scope [slot="header"]:hover [slot="caret"] {
|
|
91
|
+
color: var(--accordion-item-caret-fg-hover);
|
|
92
|
+
}
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
94
|
+
:scope [slot="header"]:focus-visible {
|
|
95
|
+
box-shadow: var(--accordion-item-focus-ring);
|
|
96
|
+
}
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
accordion-item-
|
|
103
|
-
|
|
104
|
-
min-width: 0;
|
|
105
|
-
}
|
|
98
|
+
:scope[open] [slot="header"] {
|
|
99
|
+
color: var(--accordion-item-header-fg-hover);
|
|
100
|
+
}
|
|
106
101
|
|
|
107
|
-
/* ──
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
122
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
123
|
+
/* ── Body content ── */
|
|
124
|
+
:scope [slot="body"] {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
disabled:
|
|
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
|
|
108
|
-
const icon = this
|
|
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
|
|
127
|
-
text: this
|
|
126
|
+
icon: this.saveIcon || 'bookmark-simple',
|
|
127
|
+
text: this.saveLabel || '',
|
|
128
128
|
});
|
|
129
|
-
if (!this
|
|
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:
|
|
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:
|
|
34
|
-
question:
|
|
35
|
-
helper:
|
|
36
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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.
|
|
73
|
+
this.collapsed = !this.#rootEl.hasAttribute('open');
|
|
72
74
|
this.dispatchEvent(new CustomEvent('trace-toggle', {
|
|
73
|
-
bubbles: true, detail: {
|
|
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.
|
|
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
|
-
|
|
16
|
-
description:
|
|
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.
|
|
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.
|
|
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`/`
|
|
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": "
|
|
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
|
|
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:
|
|
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`/`
|
|
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
|
|
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",
|