@adia-ai/web-components 0.0.29 → 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/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 +4 -4
- 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 +12 -3
- package/components/feed/feed.js +22 -22
- 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/components/nav-group/nav-group.css +317 -0
- package/components/nav-group/nav-group.js +142 -0
- package/components/nav-group/nav-group.yaml +69 -0
- package/components/nav-item/nav-item.a2ui.json +106 -0
- package/components/nav-item/nav-item.css +194 -0
- 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 +18 -18
- 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 +1 -1
- package/index.js +10 -8
- package/package.json +1 -1
- package/styles/components.css +10 -6
- package/styles/resets.css +1 -1
- package/traits/define.js +2 -2
- /package/components/{chat → chat-thread}/chat-input.css +0 -0
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
* .outcomes = string[] // renders an expandable sub-list under the row
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
|
-
import {
|
|
45
|
+
import { UIElement } from '../../core/element.js';
|
|
46
46
|
|
|
47
47
|
// ── Container ──────────────────────────────────────────────────
|
|
48
48
|
|
|
49
|
-
class
|
|
49
|
+
class UITimeline extends UIElement {
|
|
50
50
|
static properties = {
|
|
51
51
|
orientation: { type: String, default: 'vertical', reflect: true },
|
|
52
52
|
size: { type: String, default: 'md', reflect: true },
|
|
@@ -62,11 +62,11 @@ class AdiaTimeline extends AdiaElement {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
customElements.define('timeline-ui',
|
|
65
|
+
customElements.define('timeline-ui', UITimeline);
|
|
66
66
|
|
|
67
67
|
// ── Item ───────────────────────────────────────────────────────
|
|
68
68
|
|
|
69
|
-
class
|
|
69
|
+
class UITimelineItem extends UIElement {
|
|
70
70
|
static properties = {
|
|
71
71
|
text: { type: String, default: '', reflect: true },
|
|
72
72
|
description: { type: String, default: '', reflect: true },
|
|
@@ -166,6 +166,6 @@ class AdiaTimelineItem extends AdiaElement {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
customElements.define('timeline-item-ui',
|
|
169
|
+
customElements.define('timeline-item-ui', UITimelineItem);
|
|
170
170
|
|
|
171
|
-
export {
|
|
171
|
+
export { UITimeline, UITimelineItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UITimeline
|
|
5
5
|
tag: timeline-ui
|
|
6
6
|
component: Timeline
|
|
7
7
|
category: display
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* <toast-ui> — Thin facade over `<feed-ui>` / `
|
|
2
|
+
* <toast-ui> — Thin facade over `<feed-ui>` / `UIFeed.post()`.
|
|
3
3
|
*
|
|
4
4
|
* Phase 4 of `docs/specs/feed-channel.md` (SPEC-FEED-CHANNEL-001) —
|
|
5
5
|
* toast-ui no longer owns its own per-position container. Both
|
|
6
|
-
* declarative `<toast-ui>` and imperative `
|
|
7
|
-
* route through `
|
|
6
|
+
* declarative `<toast-ui>` and imperative `UIToast.show()` paths
|
|
7
|
+
* route through `UIFeed`. The element exists for back-compat:
|
|
8
8
|
* authoring `<toast-ui text="…">` still produces a feed item.
|
|
9
9
|
*
|
|
10
|
-
* // Imperative API (delegates to
|
|
11
|
-
*
|
|
10
|
+
* // Imperative API (delegates to UIFeed.post)
|
|
11
|
+
* UIToast.show({ text: 'Saved!', variant: 'success' });
|
|
12
12
|
*
|
|
13
13
|
* // Global event channel — same shape, same delegation.
|
|
14
14
|
* window.dispatchEvent(new CustomEvent('toast', {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
* `<feed-ui>` (see ../feed/feed.js).
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
26
|
+
import { UIElement, html } from '../../core/element.js';
|
|
27
|
+
import { UIFeed } from '../feed/feed.js';
|
|
28
28
|
|
|
29
|
-
class
|
|
29
|
+
class UIToast extends UIElement {
|
|
30
30
|
static properties = {
|
|
31
31
|
text: { type: String, default: '', reflect: true },
|
|
32
32
|
variant: { type: String, default: 'info', reflect: true },
|
|
@@ -37,13 +37,13 @@ class AdiaToast extends AdiaElement {
|
|
|
37
37
|
static template = () => html``;
|
|
38
38
|
|
|
39
39
|
connected() {
|
|
40
|
-
/* Declarative path: post into
|
|
40
|
+
/* Declarative path: post into UIFeed and remove self. The
|
|
41
41
|
element is fire-and-forget — its only job is to forward the
|
|
42
42
|
authored attributes to the feed, then dissolve. Re-entrant
|
|
43
43
|
guard keeps this safe under HMR / dev-mode re-attachment. */
|
|
44
44
|
if (this.__routedToFeed) return;
|
|
45
45
|
this.__routedToFeed = true;
|
|
46
|
-
|
|
46
|
+
UIFeed.post({
|
|
47
47
|
text: this.text,
|
|
48
48
|
variant: this.variant === 'error' ? 'danger' : this.variant,
|
|
49
49
|
duration: this.duration,
|
|
@@ -55,9 +55,9 @@ class AdiaToast extends AdiaElement {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Static facade — delegates to
|
|
58
|
+
* Static facade — delegates to UIFeed.post(). Kept for back-compat
|
|
59
59
|
* with consumer code shaped like `customElements.get('toast-ui').show(...)`
|
|
60
|
-
* or `
|
|
60
|
+
* or `UIToast.show(...)`. New code should call UIFeed.post()
|
|
61
61
|
* directly.
|
|
62
62
|
*
|
|
63
63
|
* @param {Object} opts
|
|
@@ -69,7 +69,7 @@ class AdiaToast extends AdiaElement {
|
|
|
69
69
|
*/
|
|
70
70
|
static show(opts = {}) {
|
|
71
71
|
const { text, variant = 'info', duration = 4000, position = 'bottom-right' } = opts;
|
|
72
|
-
return
|
|
72
|
+
return UIFeed.post({
|
|
73
73
|
text,
|
|
74
74
|
variant: variant === 'error' ? 'danger' : variant,
|
|
75
75
|
duration,
|
|
@@ -81,15 +81,15 @@ class AdiaToast extends AdiaElement {
|
|
|
81
81
|
/* Idempotent install of the global 'toast' CustomEvent listener.
|
|
82
82
|
Same shape as the historical channel — code that posts via
|
|
83
83
|
`window.dispatchEvent(new CustomEvent('toast', {detail:{…}}))`
|
|
84
|
-
keeps working. The listener delegates to
|
|
85
|
-
delegates to
|
|
84
|
+
keeps working. The listener delegates to UIToast.show(), which
|
|
85
|
+
delegates to UIFeed.post(). */
|
|
86
86
|
if (typeof window !== 'undefined' && !window.__adiaToastListenerInstalled) {
|
|
87
87
|
window.__adiaToastListenerInstalled = true;
|
|
88
88
|
window.addEventListener('toast', (e) => {
|
|
89
|
-
if (e?.detail && typeof e.detail === 'object')
|
|
89
|
+
if (e?.detail && typeof e.detail === 'object') UIToast.show(e.detail);
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
customElements.define('toast-ui',
|
|
93
|
+
customElements.define('toast-ui', UIToast);
|
|
94
94
|
|
|
95
|
-
export {
|
|
95
|
+
export { UIToast };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UIToast
|
|
5
5
|
tag: toast-ui
|
|
6
6
|
component: Toast
|
|
7
7
|
category: container
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* single — restrict to one active option at a time (default false: multi-select)
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { UIElement } from '../../core/element.js';
|
|
16
16
|
|
|
17
17
|
// ── Toggle Option ──
|
|
18
18
|
//
|
|
@@ -22,7 +22,7 @@ import { AdiaElement } from '../../core/element.js';
|
|
|
22
22
|
// group's comma-separated `value` list. Consistent with native `<option>`
|
|
23
23
|
// inside `<select>`.
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class UIToggleOption extends UIElement {
|
|
26
26
|
static properties = {
|
|
27
27
|
value: { type: String, default: '', reflect: true },
|
|
28
28
|
text: { type: String, default: '', reflect: true },
|
|
@@ -59,11 +59,11 @@ class AdiaToggleOption extends AdiaElement {
|
|
|
59
59
|
this.#stamped = false;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
customElements.define('toggle-option-ui',
|
|
62
|
+
customElements.define('toggle-option-ui', UIToggleOption);
|
|
63
63
|
|
|
64
64
|
// ── Toggle Group ──
|
|
65
65
|
|
|
66
|
-
class
|
|
66
|
+
class UIToggleGroup extends UIElement {
|
|
67
67
|
static properties = {
|
|
68
68
|
value: { type: String, default: '', reflect: true },
|
|
69
69
|
single: { type: Boolean, default: false, reflect: true },
|
|
@@ -142,6 +142,6 @@ class AdiaToggleGroup extends AdiaElement {
|
|
|
142
142
|
this.#bound = false;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
customElements.define('toggle-group-ui',
|
|
145
|
+
customElements.define('toggle-group-ui', UIToggleGroup);
|
|
146
146
|
|
|
147
|
-
export {
|
|
147
|
+
export { UIToggleGroup, UIToggleOption };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UIToggleGroup
|
|
5
5
|
tag: toggle-group-ui
|
|
6
6
|
component: ToggleGroup
|
|
7
7
|
category: navigation
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* Platform: Popover API (top-layer) + CSS Anchor Positioning via @core/anchor.js.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { UIElement } from '../../core/element.js';
|
|
24
24
|
import { anchorPopover } from '../../core/anchor.js';
|
|
25
25
|
|
|
26
26
|
const SPILLOVER_ATTR = 'data-toolbar-spillover';
|
|
@@ -32,7 +32,7 @@ const SPILLOVER_MENU_ATTR = 'data-toolbar-spillover-menu';
|
|
|
32
32
|
touch the toolbar's right edge. */
|
|
33
33
|
const OVERFLOW_BUFFER = 8;
|
|
34
34
|
|
|
35
|
-
class
|
|
35
|
+
class UIToolbar extends UIElement {
|
|
36
36
|
static properties = {
|
|
37
37
|
gap: { type: String, default: 'sm', reflect: true },
|
|
38
38
|
align: { type: String, default: 'start', reflect: true },
|
|
@@ -322,20 +322,20 @@ class AdiaToolbar extends AdiaElement {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
customElements.define('toolbar-ui',
|
|
325
|
+
customElements.define('toolbar-ui', UIToolbar);
|
|
326
326
|
|
|
327
327
|
/**
|
|
328
328
|
* <toolbar-group-ui> — atomic group within a toolbar.
|
|
329
329
|
* Its children are displayed together with matching gap and, during overflow,
|
|
330
330
|
* are moved to the spillover menu as a single unit.
|
|
331
331
|
*/
|
|
332
|
-
class
|
|
332
|
+
class UIToolbarGroup extends UIElement {
|
|
333
333
|
static template = () => null;
|
|
334
334
|
connected() {
|
|
335
335
|
this.setAttribute('role', 'group');
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
customElements.define('toolbar-group-ui',
|
|
338
|
+
customElements.define('toolbar-group-ui', UIToolbarGroup);
|
|
339
339
|
|
|
340
340
|
function isDivider(el) {
|
|
341
341
|
return el?.tagName && el.tagName.toLowerCase() === 'divider-ui';
|
|
@@ -381,4 +381,4 @@ function outerWidth(el) {
|
|
|
381
381
|
return r.width + ml + mr;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
export {
|
|
384
|
+
export { UIToolbar, UIToolbarGroup };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UIToolbar
|
|
5
5
|
tag: toolbar-ui
|
|
6
6
|
component: Toolbar
|
|
7
7
|
category: layout
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
* No click interaction — hover/focus only.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { UIElement } from '../../core/element.js';
|
|
22
22
|
import { anchorPopover } from '../../core/anchor.js';
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class UITooltip extends UIElement {
|
|
25
25
|
static properties = {
|
|
26
26
|
text: { type: String, default: '', reflect: true },
|
|
27
27
|
placement: { type: String, default: 'top', reflect: true },
|
|
@@ -128,10 +128,10 @@ class AdiaTooltip extends AdiaElement {
|
|
|
128
128
|
this.#target = (root && root.getElementById) ? root.getElementById(this.for) : document.getElementById(this.for);
|
|
129
129
|
if (!this.#target) {
|
|
130
130
|
// Warn once per (element, id) pair
|
|
131
|
-
if (!
|
|
132
|
-
if (!
|
|
131
|
+
if (!UITooltip._warnedMissing) UITooltip._warnedMissing = new WeakSet();
|
|
132
|
+
if (!UITooltip._warnedMissing.has(this)) {
|
|
133
133
|
console.warn(`[tooltip-ui] follows="pointer" [for="${this.for}"] did not resolve to an element.`);
|
|
134
|
-
|
|
134
|
+
UITooltip._warnedMissing.add(this);
|
|
135
135
|
}
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
@@ -284,6 +284,6 @@ class AdiaTooltip extends AdiaElement {
|
|
|
284
284
|
.replace(/"/g, '"');
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
customElements.define('tooltip-ui',
|
|
287
|
+
customElements.define('tooltip-ui', UITooltip);
|
|
288
288
|
|
|
289
|
-
export {
|
|
289
|
+
export { UITooltip };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UITooltip
|
|
5
5
|
tag: tooltip-ui
|
|
6
6
|
component: Tooltip
|
|
7
7
|
category: container
|
package/components/tree/tree.js
CHANGED
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
* tree-select — fired on tree-ui when an item is selected (detail: { item, text, value })
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { UIElement } from '../../core/element.js';
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class UITree extends UIElement {
|
|
25
25
|
static template = () => null;
|
|
26
26
|
|
|
27
27
|
connected() {
|
|
@@ -144,7 +144,7 @@ class AdiaTree extends AdiaElement {
|
|
|
144
144
|
this.removeEventListener('keydown', this.#onKey);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
customElements.define('tree-ui',
|
|
147
|
+
customElements.define('tree-ui', UITree);
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
/**
|
|
@@ -163,7 +163,7 @@ customElements.define('tree-ui', AdiaTree);
|
|
|
163
163
|
* actions — right-aligned action icons (eye, lock, etc.)
|
|
164
164
|
* children — nested tree-item-ns (auto-detected)
|
|
165
165
|
*/
|
|
166
|
-
class
|
|
166
|
+
class UITreeItem extends UIElement {
|
|
167
167
|
static properties = {
|
|
168
168
|
text: { type: String, default: '', reflect: true },
|
|
169
169
|
icon: { type: String, default: '', reflect: true },
|
|
@@ -248,6 +248,6 @@ class AdiaTreeItem extends AdiaElement {
|
|
|
248
248
|
if (textEl && this.text) textEl.textContent = this.text;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
customElements.define('tree-item-ui',
|
|
251
|
+
customElements.define('tree-item-ui', UITreeItem);
|
|
252
252
|
|
|
253
|
-
export {
|
|
253
|
+
export { UITree, UITreeItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UITree
|
|
5
5
|
tag: tree-ui
|
|
6
6
|
component: Tree
|
|
7
7
|
category: data
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* <upload-ui> — File upload with drag-and-drop.
|
|
3
3
|
* Uses showOpenFilePicker (modern) with <input type="file"> fallback.
|
|
4
|
-
* Form-associated via
|
|
4
|
+
* Form-associated via UIFormElement + ElementInternals.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { UIFormElement } from '../../core/form.js';
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class UIUpload extends UIFormElement {
|
|
10
10
|
static properties = {
|
|
11
|
-
...
|
|
11
|
+
...UIFormElement.properties,
|
|
12
12
|
label: { type: String, default: '', reflect: true },
|
|
13
13
|
accept: { type: String, default: '', reflect: true },
|
|
14
14
|
multiple: { type: Boolean, default: false, reflect: true },
|
|
@@ -184,6 +184,6 @@ class AdiaUpload extends AdiaFormElement {
|
|
|
184
184
|
this.#dropzoneEl = null;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
customElements.define('upload-ui',
|
|
187
|
+
customElements.define('upload-ui', UIUpload);
|
|
188
188
|
|
|
189
|
-
export {
|
|
189
|
+
export { UIUpload };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UIUpload
|
|
5
5
|
tag: upload-ui
|
|
6
6
|
component: Upload
|
|
7
7
|
category: input
|
package/core/element.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* AdiaUI Core — Light DOM web component base class.
|
|
3
3
|
*
|
|
4
4
|
* Re-exports reactivity and rendering for backward compatibility:
|
|
5
|
-
* import {
|
|
5
|
+
* import { UIElement, signal, computed, effect, html, repeat } from './element.js';
|
|
6
6
|
*
|
|
7
7
|
* Or import each layer directly:
|
|
8
8
|
* import { signal, computed, effect } from './signals.js';
|
|
9
9
|
* import { html, css, repeat } from './template.js';
|
|
10
|
-
* import {
|
|
10
|
+
* import { UIElement } from './element.js';
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
// Re-export reactivity primitives
|
|
@@ -16,7 +16,7 @@ export { signal, computed, effect, batch, untracked, isSignal } from './signals.
|
|
|
16
16
|
// Re-export rendering
|
|
17
17
|
export { html, css, repeat } from './template.js';
|
|
18
18
|
|
|
19
|
-
// Internal imports for
|
|
19
|
+
// Internal imports for UIElement
|
|
20
20
|
import { signal, computed, effect, untracked } from './signals.js';
|
|
21
21
|
import { stamp, disposeParts, KEY_MAP } from './template.js';
|
|
22
22
|
|
|
@@ -79,7 +79,7 @@ function prepareParts(ctor) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export class
|
|
82
|
+
export class UIElement extends HTMLElement {
|
|
83
83
|
static get properties() { return {}; }
|
|
84
84
|
static get traits() { return []; }
|
|
85
85
|
static get observedAttributes() {
|
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);
|