@adia-ai/web-components 0.0.28 → 0.0.33
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/README.md +4 -8
- package/a2ui/index.js +1 -1
- package/components/accordion/accordion.a2ui.json +1 -1
- package/components/accordion/accordion.js +6 -6
- package/components/accordion/accordion.yaml +1 -1
- package/components/action-list/action-list.a2ui.json +1 -1
- package/components/action-list/action-list.js +6 -6
- package/components/action-list/action-list.yaml +1 -1
- package/components/agent-artifact/agent-artifact.a2ui.json +1 -1
- package/components/agent-artifact/agent-artifact.js +4 -4
- package/components/agent-artifact/agent-artifact.yaml +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.js +4 -4
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +1 -1
- package/components/agent-questions/agent-questions.a2ui.json +1 -1
- package/components/agent-questions/agent-questions.js +4 -4
- package/components/agent-questions/agent-questions.yaml +1 -1
- package/components/agent-reasoning/agent-reasoning.a2ui.json +3 -3
- package/components/agent-reasoning/agent-reasoning.js +4 -4
- package/components/agent-reasoning/agent-reasoning.yaml +3 -3
- package/components/agent-suggestions/agent-suggestions.a2ui.json +1 -1
- package/components/agent-suggestions/agent-suggestions.js +4 -4
- package/components/agent-suggestions/agent-suggestions.yaml +1 -1
- package/components/agent-trace/agent-trace.a2ui.json +1 -1
- package/components/agent-trace/agent-trace.js +4 -4
- package/components/agent-trace/agent-trace.yaml +1 -1
- package/components/alert/alert.a2ui.json +1 -1
- package/components/alert/alert.js +4 -4
- package/components/alert/alert.yaml +1 -1
- package/components/aside/aside.a2ui.json +1 -1
- package/components/aside/aside.yaml +1 -1
- package/components/avatar/avatar.a2ui.json +1 -1
- package/components/avatar/avatar.js +8 -8
- package/components/avatar/avatar.yaml +1 -1
- package/components/badge/badge.a2ui.json +1 -1
- package/components/badge/badge.js +4 -4
- package/components/badge/badge.yaml +1 -1
- package/components/block/block.a2ui.json +1 -1
- package/components/block/block.js +4 -4
- package/components/block/block.yaml +1 -1
- package/components/breadcrumb/breadcrumb.a2ui.json +1 -1
- package/components/breadcrumb/breadcrumb.js +4 -4
- package/components/breadcrumb/breadcrumb.yaml +1 -1
- package/components/button/button.a2ui.json +1 -1
- package/components/button/button.js +4 -4
- package/components/button/button.yaml +1 -1
- package/components/calendar-picker/calendar-picker.a2ui.json +1 -1
- package/components/calendar-picker/calendar-picker.js +6 -6
- package/components/calendar-picker/calendar-picker.yaml +1 -1
- package/components/canvas/canvas.a2ui.json +1 -1
- package/components/canvas/canvas.js +5 -5
- package/components/canvas/canvas.yaml +1 -1
- package/components/card/card.a2ui.json +1 -1
- package/components/card/card.js +4 -4
- package/components/card/card.yaml +1 -1
- package/components/chart/chart.a2ui.json +1 -1
- package/components/chart/chart.js +5 -5
- package/components/chart/chart.yaml +1 -1
- package/components/chart-legend/chart-legend.a2ui.json +1 -1
- package/components/chart-legend/chart-legend.js +7 -7
- package/components/chart-legend/chart-legend.yaml +1 -1
- package/components/{chat → chat-thread}/chat-input.js +5 -5
- package/components/{chat/chat.a2ui.json → chat-thread/chat-thread.a2ui.json} +6 -6
- package/components/{chat/chat.css → chat-thread/chat-thread.css} +2 -2
- package/components/{chat/chat.js → chat-thread/chat-thread.js} +7 -7
- package/components/{chat/chat.yaml → chat-thread/chat-thread.yaml} +4 -4
- package/components/check/check.a2ui.json +1 -1
- package/components/check/check.js +5 -5
- package/components/check/check.yaml +1 -1
- package/components/code/code.a2ui.json +1 -1
- package/components/code/code.js +4 -4
- package/components/code/code.yaml +1 -1
- package/components/col/col.a2ui.json +1 -1
- package/components/col/col.js +4 -4
- package/components/col/col.yaml +1 -1
- package/components/color-picker/color-picker.a2ui.json +1 -1
- package/components/color-picker/color-picker.js +6 -6
- package/components/color-picker/color-picker.yaml +1 -1
- package/components/command/command.a2ui.json +1 -1
- package/components/command/command.js +5 -5
- package/components/command/command.yaml +1 -1
- package/components/description-list/description-list.a2ui.json +1 -1
- package/components/description-list/description-list.js +4 -4
- package/components/description-list/description-list.yaml +1 -1
- package/components/divider/divider.a2ui.json +1 -1
- package/components/divider/divider.js +4 -4
- package/components/divider/divider.yaml +1 -1
- package/components/drawer/drawer.a2ui.json +1 -1
- package/components/drawer/drawer.js +4 -4
- package/components/drawer/drawer.yaml +1 -1
- package/components/embed/embed.a2ui.json +1 -1
- package/components/embed/embed.js +4 -4
- package/components/embed/embed.yaml +1 -1
- package/components/empty-state/empty-state.a2ui.json +1 -1
- package/components/empty-state/empty-state.js +4 -4
- package/components/empty-state/empty-state.yaml +1 -1
- package/components/feed/feed-item.yaml +2 -2
- package/components/feed/feed.a2ui.json +2 -2
- package/components/feed/feed.css +21 -3
- package/components/feed/feed.js +140 -31
- package/components/feed/feed.yaml +2 -2
- package/components/field/field.a2ui.json +1 -1
- package/components/field/field.js +10 -10
- package/components/field/field.yaml +2 -2
- package/components/footer/footer.a2ui.json +1 -1
- package/components/footer/footer.yaml +1 -1
- package/components/grid/grid.a2ui.json +1 -1
- package/components/grid/grid.js +4 -4
- package/components/grid/grid.yaml +1 -1
- package/components/header/header.a2ui.json +1 -1
- package/components/header/header.yaml +1 -1
- package/components/heatmap/heatmap.a2ui.json +1 -1
- package/components/heatmap/heatmap.js +4 -4
- package/components/heatmap/heatmap.yaml +1 -1
- package/components/icon/icon.a2ui.json +1 -1
- package/components/icon/icon.js +4 -4
- package/components/icon/icon.yaml +1 -1
- package/components/image/image.a2ui.json +1 -1
- package/components/image/image.js +4 -4
- package/components/image/image.yaml +1 -1
- package/components/index.js +88 -85
- package/components/input/input.a2ui.json +1 -1
- package/components/input/input.js +7 -7
- package/components/input/input.yaml +1 -1
- package/components/inspector/inspector.a2ui.json +1 -1
- package/components/inspector/inspector.js +4 -4
- package/components/inspector/inspector.yaml +1 -1
- package/components/kbd/kbd.a2ui.json +1 -1
- package/components/kbd/kbd.js +4 -4
- package/components/kbd/kbd.yaml +1 -1
- package/components/list/list.a2ui.json +1 -1
- package/components/list/list.js +6 -6
- package/components/list/list.yaml +1 -1
- package/components/menu/menu.a2ui.json +1 -1
- package/components/menu/menu.js +8 -8
- package/components/menu/menu.yaml +1 -1
- package/components/modal/modal.a2ui.json +1 -1
- package/components/modal/modal.js +4 -4
- package/components/modal/modal.yaml +1 -1
- package/components/nav/nav.a2ui.json +98 -0
- package/components/nav/nav.css +133 -0
- package/components/nav/nav.js +140 -0
- package/components/nav/nav.test.js +428 -0
- package/components/nav/nav.yaml +114 -0
- package/components/nav-group/nav-group.a2ui.json +100 -0
- package/{patterns/app-nav-group/app-nav-group.css → components/nav-group/nav-group.css} +71 -18
- package/{patterns/app-nav-group/app-nav-group.js → components/nav-group/nav-group.js} +51 -25
- package/components/nav-group/nav-group.yaml +69 -0
- package/components/nav-item/nav-item.a2ui.json +106 -0
- package/{patterns/app-nav-item/app-nav-item.css → components/nav-item/nav-item.css} +42 -10
- package/components/nav-item/nav-item.js +76 -0
- package/components/nav-item/nav-item.yaml +73 -0
- package/components/noodles/noodles.a2ui.json +1 -1
- package/components/noodles/noodles.js +4 -4
- package/components/noodles/noodles.yaml +1 -1
- package/components/option-card/option-card.a2ui.json +1 -1
- package/components/option-card/option-card.js +6 -6
- package/components/option-card/option-card.yaml +1 -1
- package/components/otp-input/otp-input.a2ui.json +1 -1
- package/components/otp-input/otp-input.js +5 -5
- package/components/otp-input/otp-input.yaml +1 -1
- package/components/page/page.a2ui.json +3 -3
- package/components/page/page.js +4 -4
- package/components/page/page.yaml +3 -3
- package/components/pagination/pagination.a2ui.json +1 -1
- package/components/pagination/pagination.js +4 -4
- package/components/pagination/pagination.yaml +1 -1
- package/components/pane/pane.a2ui.json +1 -1
- package/components/pane/pane.js +4 -4
- package/components/pane/pane.yaml +1 -1
- package/components/pipeline-status/pipeline-status.a2ui.json +1 -1
- package/components/pipeline-status/pipeline-status.js +4 -4
- package/components/pipeline-status/pipeline-status.yaml +1 -1
- package/components/popover/popover.a2ui.json +1 -1
- package/components/popover/popover.js +4 -4
- package/components/popover/popover.yaml +1 -1
- package/components/progress/progress.a2ui.json +1 -1
- package/components/progress/progress.js +4 -4
- package/components/progress/progress.yaml +1 -1
- package/components/progress-row/progress-row.a2ui.json +1 -1
- package/components/progress-row/progress-row.js +4 -4
- package/components/progress-row/progress-row.yaml +1 -1
- package/components/radio/radio.a2ui.json +1 -1
- package/components/radio/radio.js +5 -5
- package/components/radio/radio.yaml +1 -1
- package/components/range/range.a2ui.json +1 -1
- package/components/range/range.js +7 -7
- package/components/range/range.yaml +1 -1
- package/components/rating/rating.a2ui.json +1 -1
- package/components/rating/rating.js +6 -6
- package/components/rating/rating.yaml +1 -1
- package/components/richtext/richtext.a2ui.json +1 -1
- package/components/richtext/richtext.js +4 -4
- package/components/richtext/richtext.yaml +1 -1
- package/components/row/row.a2ui.json +1 -1
- package/components/row/row.js +4 -4
- package/components/row/row.yaml +1 -1
- package/components/search/search.a2ui.json +1 -1
- package/components/search/search.js +5 -5
- package/components/search/search.yaml +1 -1
- package/components/section/section.a2ui.json +1 -1
- package/components/section/section.yaml +1 -1
- package/components/segment/segment.a2ui.json +1 -1
- package/components/segment/segment.js +4 -4
- package/components/segment/segment.yaml +1 -1
- package/components/segmented/segmented.a2ui.json +1 -1
- package/components/segmented/segmented.css +6 -0
- package/components/segmented/segmented.js +7 -7
- package/components/segmented/segmented.yaml +1 -1
- package/components/select/select.a2ui.json +1 -1
- package/components/select/select.js +5 -5
- package/components/select/select.yaml +1 -1
- package/components/skeleton/skeleton.a2ui.json +1 -1
- package/components/skeleton/skeleton.js +4 -4
- package/components/skeleton/skeleton.yaml +1 -1
- package/components/slider/slider.a2ui.json +1 -1
- package/components/slider/slider.js +7 -7
- package/components/slider/slider.yaml +1 -1
- package/components/stack/stack.a2ui.json +1 -1
- package/components/stack/stack.js +4 -4
- package/components/stack/stack.yaml +1 -1
- package/components/stat/stat.a2ui.json +1 -1
- package/components/stat/stat.js +4 -4
- package/components/stat/stat.yaml +1 -1
- package/components/stepper/stepper.a2ui.json +1 -1
- package/components/stepper/stepper.js +6 -6
- package/components/stepper/stepper.yaml +1 -1
- package/components/stream/stream.a2ui.json +1 -1
- package/components/stream/stream.js +4 -4
- package/components/stream/stream.yaml +1 -1
- package/components/swatch/swatch.a2ui.json +1 -1
- package/components/swatch/swatch.js +4 -4
- package/components/swatch/swatch.yaml +1 -1
- package/components/swiper/swiper.a2ui.json +1 -1
- package/components/swiper/swiper.js +4 -4
- package/components/swiper/swiper.yaml +1 -1
- package/components/switch/switch.a2ui.json +1 -1
- package/components/switch/switch.js +5 -5
- package/components/switch/switch.yaml +1 -1
- package/components/table/table.a2ui.json +1 -1
- package/components/table/table.js +4 -4
- package/components/table/table.yaml +1 -1
- package/components/table-toolbar/table-toolbar.a2ui.json +1 -1
- package/components/table-toolbar/table-toolbar.js +4 -4
- package/components/table-toolbar/table-toolbar.yaml +1 -1
- package/components/tabs/tab.js +4 -4
- package/components/tabs/tabs.a2ui.json +1 -1
- package/components/tabs/tabs.js +5 -5
- package/components/tabs/tabs.yaml +1 -1
- package/components/tag/tag.a2ui.json +1 -1
- package/components/tag/tag.js +4 -4
- package/components/tag/tag.yaml +1 -1
- package/components/text/text.a2ui.json +1 -1
- package/components/text/text.js +4 -4
- package/components/text/text.yaml +1 -1
- package/components/textarea/textarea.a2ui.json +1 -1
- package/components/textarea/textarea.js +5 -5
- package/components/textarea/textarea.yaml +1 -1
- package/components/timeline/timeline.a2ui.json +1 -1
- package/components/timeline/timeline.js +6 -6
- package/components/timeline/timeline.yaml +1 -1
- package/components/toast/toast.a2ui.json +1 -1
- package/components/toast/toast.js +54 -184
- package/components/toast/toast.yaml +1 -1
- package/components/toggle-group/toggle-group.a2ui.json +1 -1
- package/components/toggle-group/toggle-group.js +6 -6
- package/components/toggle-group/toggle-group.yaml +1 -1
- package/components/toolbar/toolbar.a2ui.json +1 -1
- package/components/toolbar/toolbar.js +6 -6
- package/components/toolbar/toolbar.yaml +1 -1
- package/components/tooltip/tooltip.a2ui.json +1 -1
- package/components/tooltip/tooltip.js +7 -7
- package/components/tooltip/tooltip.yaml +1 -1
- package/components/tree/tree.a2ui.json +1 -1
- package/components/tree/tree.js +6 -6
- package/components/tree/tree.yaml +1 -1
- package/components/upload/upload.a2ui.json +1 -1
- package/components/upload/upload.js +6 -6
- package/components/upload/upload.yaml +1 -1
- package/core/element.js +4 -4
- package/core/element.test.js +18 -18
- package/core/form.js +9 -9
- package/core/index.js +2 -2
- package/core/provider.js +7 -7
- package/core/template.js +1 -1
- package/index.css +3 -2
- package/index.js +17 -7
- package/package.json +1 -5
- package/styles/components.css +10 -6
- package/styles/resets.css +1 -1
- package/traits/define.js +2 -2
- package/patterns/a2ui-root/a2ui-root.a2ui.json +0 -125
- package/patterns/a2ui-root/a2ui-root.js +0 -191
- package/patterns/a2ui-root/a2ui-root.yaml +0 -87
- package/patterns/adia-chat/adia-chat.a2ui.json +0 -149
- package/patterns/adia-chat/adia-chat.css +0 -10
- package/patterns/adia-chat/adia-chat.js +0 -297
- package/patterns/adia-chat/adia-chat.yaml +0 -118
- package/patterns/adia-chat/css/adia-chat.empty.css +0 -12
- package/patterns/adia-chat/css/adia-chat.layout.css +0 -60
- package/patterns/adia-chat/css/adia-chat.markdown.css +0 -74
- package/patterns/adia-chat/css/adia-chat.messages.css +0 -87
- package/patterns/adia-chat/css/adia-chat.streaming.css +0 -30
- package/patterns/adia-chat/css/adia-chat.tokens.css +0 -95
- package/patterns/adia-editor/adia-editor.a2ui.json +0 -73
- package/patterns/adia-editor/adia-editor.css +0 -6
- package/patterns/adia-editor/adia-editor.js +0 -56
- package/patterns/adia-editor/adia-editor.yaml +0 -59
- package/patterns/adia-editor/css/adia-editor.layout.css +0 -171
- package/patterns/adia-editor/css/adia-editor.tokens.css +0 -28
- package/patterns/app-nav/app-nav.a2ui.json +0 -89
- package/patterns/app-nav/app-nav.css +0 -92
- package/patterns/app-nav/app-nav.js +0 -112
- package/patterns/app-nav/app-nav.yaml +0 -54
- package/patterns/app-nav-group/app-nav-group.a2ui.json +0 -82
- package/patterns/app-nav-group/app-nav-group.yaml +0 -59
- package/patterns/app-nav-item/app-nav-item.a2ui.json +0 -83
- package/patterns/app-nav-item/app-nav-item.js +0 -42
- package/patterns/app-nav-item/app-nav-item.yaml +0 -62
- package/patterns/app-shell/app-shell.a2ui.json +0 -129
- package/patterns/app-shell/app-shell.css +0 -14
- package/patterns/app-shell/app-shell.js +0 -251
- package/patterns/app-shell/app-shell.yaml +0 -89
- package/patterns/app-shell/css/app-shell.collapsed.css +0 -86
- package/patterns/app-shell/css/app-shell.helpers.css +0 -42
- package/patterns/app-shell/css/app-shell.main.css +0 -172
- package/patterns/app-shell/css/app-shell.shell.css +0 -44
- package/patterns/app-shell/css/app-shell.sidebar.css +0 -161
- package/patterns/app-shell/css/app-shell.templates.css +0 -214
- package/patterns/app-shell/css/app-shell.tokens.css +0 -119
- package/patterns/gen-ui/gen-ui.a2ui.json +0 -72
- package/patterns/gen-ui/gen-ui.css +0 -83
- package/patterns/gen-ui/gen-ui.js +0 -136
- package/patterns/gen-ui/gen-ui.yaml +0 -43
- package/patterns/index.js +0 -11
- package/patterns/section-nav/section-nav.a2ui.json +0 -91
- package/patterns/section-nav/section-nav.css +0 -60
- package/patterns/section-nav/section-nav.js +0 -42
- package/patterns/section-nav/section-nav.yaml +0 -58
- package/patterns/section-nav-group/section-nav-group.a2ui.json +0 -95
- package/patterns/section-nav-group/section-nav-group.css +0 -74
- package/patterns/section-nav-group/section-nav-group.js +0 -84
- package/patterns/section-nav-group/section-nav-group.yaml +0 -66
- package/patterns/section-nav-item/section-nav-item.a2ui.json +0 -97
- package/patterns/section-nav-item/section-nav-item.css +0 -106
- package/patterns/section-nav-item/section-nav-item.js +0 -66
- package/patterns/section-nav-item/section-nav-item.yaml +0 -70
- package/styles/layouts/admin.css +0 -7
- /package/components/{chat → chat-thread}/chat-input.css +0 -0
package/core/element.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import { UIElement, signal, effect } from './element.js';
|
|
3
3
|
|
|
4
4
|
// ── Shared helpers ──
|
|
5
5
|
|
|
@@ -21,12 +21,12 @@ function mount(tag, attrs = {}) {
|
|
|
21
21
|
// effects settle after a mutation.
|
|
22
22
|
const tick = () => new Promise((r) => queueMicrotask(r));
|
|
23
23
|
|
|
24
|
-
describe('
|
|
24
|
+
describe('UIElement — construction + lifecycle', () => {
|
|
25
25
|
beforeEach(() => { document.body.innerHTML = ''; });
|
|
26
26
|
|
|
27
27
|
it('instantiates and calls connected() on mount, disconnected() on remove', () => {
|
|
28
28
|
const events = [];
|
|
29
|
-
class El extends
|
|
29
|
+
class El extends UIElement {
|
|
30
30
|
connected() { events.push('connected'); }
|
|
31
31
|
disconnected() { events.push('disconnected'); }
|
|
32
32
|
}
|
|
@@ -39,7 +39,7 @@ describe('AdiaElement — construction + lifecycle', () => {
|
|
|
39
39
|
|
|
40
40
|
it('remount after disconnect re-runs connected()', () => {
|
|
41
41
|
const events = [];
|
|
42
|
-
class El extends
|
|
42
|
+
class El extends UIElement {
|
|
43
43
|
connected() { events.push('connected'); }
|
|
44
44
|
disconnected() { events.push('disconnected'); }
|
|
45
45
|
}
|
|
@@ -51,11 +51,11 @@ describe('AdiaElement — construction + lifecycle', () => {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
describe('
|
|
54
|
+
describe('UIElement — properties', () => {
|
|
55
55
|
beforeEach(() => { document.body.innerHTML = ''; });
|
|
56
56
|
|
|
57
57
|
it('reads default value from static properties', () => {
|
|
58
|
-
class El extends
|
|
58
|
+
class El extends UIElement {
|
|
59
59
|
static properties = { label: { type: String, default: 'hi' } };
|
|
60
60
|
}
|
|
61
61
|
const tag = registerTestElement(El);
|
|
@@ -64,7 +64,7 @@ describe('AdiaElement — properties', () => {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('reflects Boolean properties to HTML attributes when reflect: true', () => {
|
|
67
|
-
class El extends
|
|
67
|
+
class El extends UIElement {
|
|
68
68
|
static properties = { disabled: { type: Boolean, default: false, reflect: true } };
|
|
69
69
|
}
|
|
70
70
|
const tag = registerTestElement(El);
|
|
@@ -77,7 +77,7 @@ describe('AdiaElement — properties', () => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
it('reflects String properties as attribute values', () => {
|
|
80
|
-
class El extends
|
|
80
|
+
class El extends UIElement {
|
|
81
81
|
static properties = { variant: { type: String, default: 'neutral', reflect: true } };
|
|
82
82
|
}
|
|
83
83
|
const tag = registerTestElement(El);
|
|
@@ -87,7 +87,7 @@ describe('AdiaElement — properties', () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('parses incoming attributes back into typed properties', () => {
|
|
90
|
-
class El extends
|
|
90
|
+
class El extends UIElement {
|
|
91
91
|
static properties = {
|
|
92
92
|
count: { type: Number, default: 0 },
|
|
93
93
|
active: { type: Boolean, default: false },
|
|
@@ -100,7 +100,7 @@ describe('AdiaElement — properties', () => {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
it('does NOT reflect when reflect: false / omitted', () => {
|
|
103
|
-
class El extends
|
|
103
|
+
class El extends UIElement {
|
|
104
104
|
static properties = { internal: { type: String, default: 'x' } };
|
|
105
105
|
}
|
|
106
106
|
const tag = registerTestElement(El);
|
|
@@ -110,12 +110,12 @@ describe('AdiaElement — properties', () => {
|
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
describe('
|
|
113
|
+
describe('UIElement — reactive effect', () => {
|
|
114
114
|
beforeEach(() => { document.body.innerHTML = ''; });
|
|
115
115
|
|
|
116
116
|
it('calls render() on mount and when a reactive property changes', async () => {
|
|
117
117
|
let renders = 0;
|
|
118
|
-
class El extends
|
|
118
|
+
class El extends UIElement {
|
|
119
119
|
static properties = { label: { type: String, default: 'a' } };
|
|
120
120
|
render() { renders++; void this.label; }
|
|
121
121
|
}
|
|
@@ -130,7 +130,7 @@ describe('AdiaElement — reactive effect', () => {
|
|
|
130
130
|
|
|
131
131
|
it('stops re-rendering after disconnect', async () => {
|
|
132
132
|
let renders = 0;
|
|
133
|
-
class El extends
|
|
133
|
+
class El extends UIElement {
|
|
134
134
|
static properties = { label: { type: String, default: 'a' } };
|
|
135
135
|
render() { renders++; void this.label; }
|
|
136
136
|
}
|
|
@@ -144,7 +144,7 @@ describe('AdiaElement — reactive effect', () => {
|
|
|
144
144
|
});
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
describe('
|
|
147
|
+
describe('UIElement — subscription-leak guard (0.0.10 regression)', () => {
|
|
148
148
|
beforeEach(() => { document.body.innerHTML = ''; });
|
|
149
149
|
|
|
150
150
|
it('child connected() reads do NOT subscribe an outer effect', async () => {
|
|
@@ -155,7 +155,7 @@ describe('AdiaElement — subscription-leak guard (0.0.10 regression)', () => {
|
|
|
155
155
|
// prop would spuriously re-run the parent effect.
|
|
156
156
|
//
|
|
157
157
|
// Fix: connected() is now wrapped in untracked(…).
|
|
158
|
-
class Child extends
|
|
158
|
+
class Child extends UIElement {
|
|
159
159
|
static properties = { value: { type: String, default: 'initial', reflect: true } };
|
|
160
160
|
connected() {
|
|
161
161
|
// Read our own reactive prop exactly the way template-literal
|
|
@@ -197,7 +197,7 @@ describe('AdiaElement — subscription-leak guard (0.0.10 regression)', () => {
|
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
describe('
|
|
200
|
+
describe('UIElement — addTrait', () => {
|
|
201
201
|
beforeEach(() => { document.body.innerHTML = ''; });
|
|
202
202
|
|
|
203
203
|
it('applies a trait once, idempotent on repeat', () => {
|
|
@@ -207,7 +207,7 @@ describe('AdiaElement — addTrait', () => {
|
|
|
207
207
|
disconnect() {},
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
class El extends
|
|
210
|
+
class El extends UIElement {}
|
|
211
211
|
const tag = registerTestElement(El);
|
|
212
212
|
const el = mount(tag);
|
|
213
213
|
el.addTrait(myTrait);
|
|
@@ -221,7 +221,7 @@ describe('AdiaElement — addTrait', () => {
|
|
|
221
221
|
connect() { connects++; },
|
|
222
222
|
disconnect() { disconnects++; },
|
|
223
223
|
});
|
|
224
|
-
class El extends
|
|
224
|
+
class El extends UIElement {
|
|
225
225
|
static traits = [myTrait];
|
|
226
226
|
}
|
|
227
227
|
const tag = registerTestElement(El);
|
package/core/form.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* UIFormElement — Form-participating base class.
|
|
3
3
|
*
|
|
4
|
-
* Extends
|
|
4
|
+
* Extends UIElement with ElementInternals form participation,
|
|
5
5
|
* constraint validation (required, pattern, minlength, maxlength),
|
|
6
6
|
* and auto-validation UX (submit, blur, input re-validation).
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* import {
|
|
9
|
+
* import { UIFormElement } from './form.js';
|
|
10
10
|
*
|
|
11
|
-
* class MyField extends
|
|
11
|
+
* class MyField extends UIFormElement {
|
|
12
12
|
* static properties = {
|
|
13
|
-
* ...
|
|
13
|
+
* ...UIFormElement.properties,
|
|
14
14
|
* placeholder: { type: String, default: '', reflect: true },
|
|
15
15
|
* };
|
|
16
16
|
* }
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* el.syncValue(val) → update form value + run constraints
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import {
|
|
37
|
+
import { UIElement } from './element.js';
|
|
38
38
|
|
|
39
|
-
export class
|
|
39
|
+
export class UIFormElement extends UIElement {
|
|
40
40
|
static formAssociated = true;
|
|
41
41
|
|
|
42
42
|
static get properties() {
|
|
@@ -199,8 +199,8 @@ export class AdiaFormElement extends AdiaElement {
|
|
|
199
199
|
if (ctor.labelDeprecated === false) return;
|
|
200
200
|
if (!ctor.properties?.label) return;
|
|
201
201
|
if (!this.hasAttribute('label')) return;
|
|
202
|
-
if (
|
|
203
|
-
|
|
202
|
+
if (UIFormElement.#labelWarned.has(ctor)) return;
|
|
203
|
+
UIFormElement.#labelWarned.add(ctor);
|
|
204
204
|
// eslint-disable-next-line no-console
|
|
205
205
|
console.warn(
|
|
206
206
|
`[AdiaUI] <${this.localName} label="…"> is deprecated — wrap in ` +
|
package/core/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* core barrel — re-exports every public core module.
|
|
3
3
|
*
|
|
4
|
-
* Consumers who want to build on
|
|
4
|
+
* Consumers who want to build on UIElement or use the reactive
|
|
5
5
|
* signal system directly do:
|
|
6
6
|
*
|
|
7
|
-
* import {
|
|
7
|
+
* import { UIElement } from '@adia-ai/web-components/core';
|
|
8
8
|
* import { signal, effect } from '@adia-ai/web-components/core';
|
|
9
9
|
*
|
|
10
10
|
* Exports are flat — every symbol from the re-exported files is
|
package/core/provider.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* AdiaUI Router — Self-contained vanilla JS bundle.
|
|
3
3
|
* Includes: RouteController + router-ui component.
|
|
4
4
|
*
|
|
5
|
-
* Depends on: core.js (
|
|
5
|
+
* Depends on: core.js (UIElement), controllers.js (BaseController)
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* import {
|
|
9
|
-
* import {
|
|
8
|
+
* import { UIElement } from './core.js';
|
|
9
|
+
* import { UIRouter, RouteController } from './router.js';
|
|
10
10
|
*
|
|
11
11
|
* // Option 1: Declarative routes
|
|
12
12
|
* const router = document.querySelector('router-ui');
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
* ctrl.commands.navigate('/about');
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { UIElement } from './element.js';
|
|
26
26
|
import { BaseController } from './controller.js';
|
|
27
27
|
|
|
28
28
|
// ═══════════════════════════════════════════════════════════════
|
|
29
29
|
// ADIA PROVIDER (inline — tiny base class)
|
|
30
30
|
// ═══════════════════════════════════════════════════════════════
|
|
31
31
|
|
|
32
|
-
class
|
|
32
|
+
class UIProvider extends UIElement {
|
|
33
33
|
static template = () => null;
|
|
34
34
|
#abort = null;
|
|
35
35
|
get abort() { if (!this.#abort) this.#abort = new AbortController(); return this.#abort; }
|
|
@@ -161,7 +161,7 @@ export class RouteController extends BaseController {
|
|
|
161
161
|
// ROUTER-UI — content fragment renderer
|
|
162
162
|
// ═══════════════════════════════════════════════════════════════
|
|
163
163
|
|
|
164
|
-
export class
|
|
164
|
+
export class UIRouter extends UIProvider {
|
|
165
165
|
#cache = new Map();
|
|
166
166
|
#ownCtrl = null;
|
|
167
167
|
#lastPath = null;
|
|
@@ -260,4 +260,4 @@ export class AdiaRouter extends AdiaProvider {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
customElements.define('router-ui',
|
|
263
|
+
customElements.define('router-ui', UIRouter);
|
package/core/template.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* AdiaUI Template — Tagged template literal rendering.
|
|
3
3
|
*
|
|
4
4
|
* Lightweight lit-html-style rendering with reactive bindings.
|
|
5
|
-
* Depends on DOM but not on
|
|
5
|
+
* Depends on DOM but not on UIElement — usable standalone.
|
|
6
6
|
*
|
|
7
7
|
* import { html, repeat } from './template.js';
|
|
8
8
|
*
|
package/index.css
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* + typography — via the colors tree) → component styles → global
|
|
8
8
|
* resets.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Composite-element CSS (chat-shell, editor-shell, admin-shell, etc.)
|
|
11
|
+
* lives in the sibling `@adia-ai/web-modules` package as of 0.0.29
|
|
12
|
+
* (see ADR-0012). Each page links its own cluster CSS explicitly.
|
|
12
13
|
* Opinionated theme overrides live in `./styles/themes.css`; link
|
|
13
14
|
* them separately when you want the 8 named themes.
|
|
14
15
|
*
|
package/index.js
CHANGED
|
@@ -2,17 +2,27 @@
|
|
|
2
2
|
* @adia-ai/web-components — main entry.
|
|
3
3
|
*
|
|
4
4
|
* import '@adia-ai/web-components';
|
|
5
|
-
* import {
|
|
5
|
+
* import { UIButton } from '@adia-ai/web-components';
|
|
6
6
|
*
|
|
7
|
-
* Loading this file registers every
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Loading this file registers every primitive (side effect of each
|
|
8
|
+
* module's `customElements.define(...)` call). Pair with
|
|
9
|
+
* `@adia-ai/web-components/css` (the all-in-one stylesheet) or link
|
|
10
|
+
* tokens/components/resets individually.
|
|
11
11
|
*
|
|
12
12
|
* If you only want a subset, use the subpath imports:
|
|
13
13
|
* import '@adia-ai/web-components/components/button';
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* Composite elements (admin-shell, chat-shell, editor-shell, gen-root,
|
|
16
|
+
* a2ui-root) shipped here as `patterns/` until 0.0.28 — they now live
|
|
17
|
+
* in `@adia-ai/web-modules` (see ADR-0012). The nav family was
|
|
18
|
+
* subsequently consolidated back into web-components as primitives
|
|
19
|
+
* (see ADR-0015 § Nav consolidation).
|
|
20
|
+
*
|
|
21
|
+
* import '@adia-ai/web-modules'; // every cluster
|
|
22
|
+
* import '@adia-ai/web-modules/shell'; // admin-shell
|
|
23
|
+
* import '@adia-ai/web-modules/chat'; // chat-shell
|
|
24
|
+
* import '@adia-ai/web-modules/editor'; // editor-shell
|
|
25
|
+
* import '@adia-ai/web-modules/runtime'; // gen-root, a2ui-root
|
|
15
26
|
*/
|
|
16
27
|
|
|
17
28
|
export * from './components/index.js';
|
|
18
|
-
export * from './patterns/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
"./core/*": "./core/*.js",
|
|
12
12
|
"./components": "./components/index.js",
|
|
13
13
|
"./components/*": "./components/*/*.js",
|
|
14
|
-
"./patterns": "./patterns/index.js",
|
|
15
|
-
"./patterns/*": "./patterns/*/*.js",
|
|
16
14
|
"./styles/*": "./styles/*",
|
|
17
15
|
"./traits": "./traits/index.js",
|
|
18
16
|
"./traits/*": "./traits/*.js",
|
|
@@ -23,7 +21,6 @@
|
|
|
23
21
|
"components/",
|
|
24
22
|
"styles/",
|
|
25
23
|
"traits/",
|
|
26
|
-
"patterns/",
|
|
27
24
|
"a2ui/",
|
|
28
25
|
"index.js",
|
|
29
26
|
"index.css"
|
|
@@ -32,7 +29,6 @@
|
|
|
32
29
|
"*.css",
|
|
33
30
|
"./index.js",
|
|
34
31
|
"./components/**/*.js",
|
|
35
|
-
"./patterns/**/*.js",
|
|
36
32
|
"./core/provider.js"
|
|
37
33
|
],
|
|
38
34
|
"dependencies": {
|
package/styles/components.css
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Components barrel — imports every component's CSS, in stamp order.
|
|
3
3
|
*
|
|
4
4
|
* This file is *only* the `packages/web-components/components/**`
|
|
5
|
-
* stylesheet set.
|
|
6
|
-
*
|
|
7
|
-
* page links its own
|
|
8
|
-
* `resets.css` and must be linked separately.
|
|
5
|
+
* stylesheet set. Modules in `@adia-ai/web-modules` (chat-shell,
|
|
6
|
+
* editor-shell, admin-shell, gen-root, a2ui-root, etc.) are NOT
|
|
7
|
+
* imported here — each page links its own modules explicitly.
|
|
8
|
+
* Global resets live in `resets.css` and must be linked separately.
|
|
9
9
|
*
|
|
10
10
|
* All components use Light DOM — styles target tag names directly.
|
|
11
11
|
*/
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
@import "../components/tree/tree.css";
|
|
28
28
|
@import "../components/pane/pane.css";
|
|
29
29
|
@import "../components/page/page.css";
|
|
30
|
-
@import "../components/chat/chat-input.css";
|
|
31
|
-
@import "../components/chat/chat.css";
|
|
30
|
+
@import "../components/chat-thread/chat-input.css";
|
|
31
|
+
@import "../components/chat-thread/chat-thread.css";
|
|
32
32
|
@import "../components/drawer/drawer.css";
|
|
33
33
|
@import "../components/modal/modal.css";
|
|
34
|
+
@import "../components/feed/feed.css";
|
|
34
35
|
@import "../components/toast/toast.css";
|
|
35
36
|
@import "../components/tabs/tabs.css";
|
|
36
37
|
@import "../components/tooltip/tooltip.css";
|
|
@@ -66,6 +67,9 @@
|
|
|
66
67
|
@import "../components/list/list.css";
|
|
67
68
|
@import "../components/menu/menu.css";
|
|
68
69
|
@import "../components/toolbar/toolbar.css";
|
|
70
|
+
@import "../components/nav/nav.css";
|
|
71
|
+
@import "../components/nav-group/nav-group.css";
|
|
72
|
+
@import "../components/nav-item/nav-item.css";
|
|
69
73
|
@import "../components/otp-input/otp-input.css";
|
|
70
74
|
@import "../components/image/image.css";
|
|
71
75
|
@import "../components/search/search.css";
|
package/styles/resets.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Imported from styles.css (the barrel). Targets document-level
|
|
6
6
|
* defaults and universal selectors; component-scoped rules live in
|
|
7
|
-
* each component's own CSS under `@scope (component-
|
|
7
|
+
* each component's own CSS under `@scope (component-ui)`.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
*,
|
package/traits/define.js
CHANGED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/A2UIRoot.json",
|
|
4
|
-
"title": "A2UIRoot",
|
|
5
|
-
"description": "A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"allOf": [
|
|
8
|
-
{
|
|
9
|
-
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"properties": {
|
|
16
|
-
"active": {
|
|
17
|
-
"description": "True while the stream is connected and receiving messages.",
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"default": false
|
|
20
|
-
},
|
|
21
|
-
"batch": {
|
|
22
|
-
"description": "Batch renderer updates via requestAnimationFrame for large fan-in.",
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": false
|
|
25
|
-
},
|
|
26
|
-
"component": {
|
|
27
|
-
"const": "A2UIRoot"
|
|
28
|
-
},
|
|
29
|
-
"doc": {
|
|
30
|
-
"description": "Author-driven mode — set to an array of A2UI messages and the renderer resets + replays them. No network/transport involvement. Setting to a new array triggers a full re-render. Use this for editors, previews, tests, and any static-doc authoring loop. When both `src` and `doc` are set, `doc` wins (the stream is not opened). Pass as a JS property; not reflected to an attribute.",
|
|
31
|
-
"type": "array"
|
|
32
|
-
},
|
|
33
|
-
"loading": {
|
|
34
|
-
"description": "True while the stream is connecting.",
|
|
35
|
-
"type": "boolean",
|
|
36
|
-
"default": false
|
|
37
|
-
},
|
|
38
|
-
"src": {
|
|
39
|
-
"description": "Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"default": ""
|
|
42
|
-
},
|
|
43
|
-
"transport": {
|
|
44
|
-
"description": "Stream transport to use.",
|
|
45
|
-
"type": "string",
|
|
46
|
-
"enum": [
|
|
47
|
-
"sse",
|
|
48
|
-
"ws",
|
|
49
|
-
"websocket",
|
|
50
|
-
"jsonl",
|
|
51
|
-
"mcp"
|
|
52
|
-
],
|
|
53
|
-
"default": "sse"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": [
|
|
57
|
-
"component"
|
|
58
|
-
],
|
|
59
|
-
"unevaluatedProperties": false,
|
|
60
|
-
"x-adiaui": {
|
|
61
|
-
"anti_patterns": [],
|
|
62
|
-
"category": "container",
|
|
63
|
-
"events": {
|
|
64
|
-
"a2ui-action": {
|
|
65
|
-
"description": "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
66
|
-
},
|
|
67
|
-
"a2ui-closed": {
|
|
68
|
-
"description": "Fired when the stream ends."
|
|
69
|
-
},
|
|
70
|
-
"a2ui-connected": {
|
|
71
|
-
"description": "Fired when the stream is established."
|
|
72
|
-
},
|
|
73
|
-
"a2ui-error": {
|
|
74
|
-
"description": "Fired when the stream errors. detail: { error }"
|
|
75
|
-
},
|
|
76
|
-
"a2ui-message": {
|
|
77
|
-
"description": "Fired for each A2UI message received. detail: { message }"
|
|
78
|
-
},
|
|
79
|
-
"doc-replaced": {
|
|
80
|
-
"description": "Fired after a full doc reset + replay in author-driven mode. detail: { count }"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"examples": [],
|
|
84
|
-
"keywords": [
|
|
85
|
-
"a2ui",
|
|
86
|
-
"protocol",
|
|
87
|
-
"renderer",
|
|
88
|
-
"stream",
|
|
89
|
-
"surface",
|
|
90
|
-
"sse",
|
|
91
|
-
"websocket",
|
|
92
|
-
"jsonl",
|
|
93
|
-
"mcp"
|
|
94
|
-
],
|
|
95
|
-
"name": "AdiaA2UIRoot",
|
|
96
|
-
"related": [
|
|
97
|
-
"canvas",
|
|
98
|
-
"inspector"
|
|
99
|
-
],
|
|
100
|
-
"slots": {
|
|
101
|
-
"default": {
|
|
102
|
-
"description": "The rendered surface. Children are stamped by the A2UI renderer."
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"states": [
|
|
106
|
-
{
|
|
107
|
-
"description": "Default, ready to connect.",
|
|
108
|
-
"name": "idle"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"description": "Stream is connecting.",
|
|
112
|
-
"name": "loading"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"description": "Stream is connected and receiving messages.",
|
|
116
|
-
"name": "active"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"synonyms": {},
|
|
120
|
-
"tag": "a2ui-root",
|
|
121
|
-
"tokens": {},
|
|
122
|
-
"traits": [],
|
|
123
|
-
"version": 1
|
|
124
|
-
}
|
|
125
|
-
}
|