@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/components/feed/feed.js
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* (no auto-dismiss when `duration` is null/0; close button
|
|
13
13
|
* surfaces when `dismissible` is set) but the action-required
|
|
14
14
|
* focus-trap is deferred.
|
|
15
|
-
* - Static API:
|
|
15
|
+
* - Static API: UIFeed.post() / .get() / .clear() / .purge()
|
|
16
16
|
* — `purge()` directly addresses the audit's L-B4 container-leak
|
|
17
17
|
* finding by giving consumers a tear-down hook.
|
|
18
18
|
* - Global event channel: window.dispatchEvent(new CustomEvent(
|
|
19
19
|
* 'feed', { detail: { text, position, ... } })) — same shape as
|
|
20
|
-
*
|
|
20
|
+
* UIFeed.post() so any code can post without importing the
|
|
21
21
|
* module directly. Idempotent listener install (HMR-safe).
|
|
22
22
|
*
|
|
23
23
|
* Toast migration (spec § 2.5) is deferred — toast-ui keeps its own
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
* surface has soaked.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import {
|
|
28
|
+
import { UIElement, html } from '../../core/element.js';
|
|
29
29
|
|
|
30
30
|
/* ── Container — one per position, mounted into document.body ── */
|
|
31
31
|
|
|
32
|
-
class
|
|
32
|
+
class UIFeedContainer extends UIElement {
|
|
33
33
|
static properties = {
|
|
34
34
|
position: { type: String, default: 'bottom-right', reflect: true },
|
|
35
35
|
max: { type: Number, default: 5, reflect: true },
|
|
@@ -42,11 +42,11 @@ class AdiaFeedContainer extends AdiaElement {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
customElements.define('feed-ui',
|
|
45
|
+
customElements.define('feed-ui', UIFeedContainer);
|
|
46
46
|
|
|
47
47
|
/* ── Item — one per posted message ── */
|
|
48
48
|
|
|
49
|
-
class
|
|
49
|
+
class UIFeedItem extends UIElement {
|
|
50
50
|
#timer = null;
|
|
51
51
|
#removing = false;
|
|
52
52
|
#closeTimer = null;
|
|
@@ -59,6 +59,11 @@ class AdiaFeedItem extends AdiaElement {
|
|
|
59
59
|
variant: { type: String, default: 'default', reflect: true },
|
|
60
60
|
duration: { type: Number, default: 4000, reflect: true },
|
|
61
61
|
dismissible: { type: Boolean, default: false, reflect: true },
|
|
62
|
+
// Phase 2: action-required policy. When set, the item carries an
|
|
63
|
+
// action button that the user MUST click (or dismiss) before the
|
|
64
|
+
// item goes away. Spec §2.3 — action-required role=alertdialog,
|
|
65
|
+
// focus is trapped until choice is made.
|
|
66
|
+
action: { type: String, default: '', reflect: true },
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
static parts = {
|
|
@@ -67,9 +72,21 @@ class AdiaFeedItem extends AdiaElement {
|
|
|
67
72
|
static template = () => html``;
|
|
68
73
|
|
|
69
74
|
#onPress = (e) => {
|
|
70
|
-
if (e.target.closest('[data-feed-close]')) this.dismiss();
|
|
75
|
+
if (e.target.closest('[data-feed-close]')) { this.dismiss(); return; }
|
|
76
|
+
// Phase 2: action button — fires the action callback (if registered
|
|
77
|
+
// via FeedHandle.update with onAction) then dismisses. The handle's
|
|
78
|
+
// .update({onAction: fn}) populates this.#onAction below.
|
|
79
|
+
if (e.target.closest('[data-feed-action]')) {
|
|
80
|
+
try { this.#onAction?.(); } catch (err) { console.warn('[feed-item] action handler threw:', err); }
|
|
81
|
+
this.dismiss();
|
|
82
|
+
}
|
|
71
83
|
};
|
|
72
84
|
|
|
85
|
+
// Phase 2 focus-trap state — only used when the policy is action-required.
|
|
86
|
+
#onAction = null;
|
|
87
|
+
#focusTrapPrev = null;
|
|
88
|
+
#onTrapKeydown = null;
|
|
89
|
+
|
|
73
90
|
connected() {
|
|
74
91
|
this.addEventListener('press', this.#onPress);
|
|
75
92
|
}
|
|
@@ -95,17 +112,22 @@ class AdiaFeedItem extends AdiaElement {
|
|
|
95
112
|
}
|
|
96
113
|
|
|
97
114
|
/* Inferred policy roles per spec §2.4. Auto-fade gets `status`;
|
|
98
|
-
sticky danger/warning gets `alert`; action-required
|
|
99
|
-
`alertdialog`
|
|
115
|
+
sticky danger/warning gets `alert`; action-required (sticky +
|
|
116
|
+
has [action]) gets `alertdialog` and a focus trap. */
|
|
100
117
|
const isSticky = !this.duration || this.duration <= 0;
|
|
101
118
|
const isLoud = this.variant === 'danger' || this.variant === 'warning';
|
|
119
|
+
const isActionRequired = isSticky && !!this.action;
|
|
102
120
|
let role = 'status';
|
|
103
|
-
if (
|
|
121
|
+
if (isActionRequired) role = 'alertdialog';
|
|
122
|
+
else if (isSticky && isLoud) role = 'alert';
|
|
104
123
|
this.setAttribute('role', role);
|
|
105
|
-
this.setAttribute('aria-live', role === 'alert' ? 'assertive' : 'polite');
|
|
124
|
+
this.setAttribute('aria-live', role === 'alert' || role === 'alertdialog' ? 'assertive' : 'polite');
|
|
125
|
+
if (isActionRequired) this.setAttribute('aria-modal', 'false'); // not page-blocking; focus-trap only
|
|
106
126
|
|
|
107
127
|
/* Render dismiss button for sticky items (spec §2.2 — default true
|
|
108
|
-
for sticky, false for auto-fade).
|
|
128
|
+
for sticky, false for auto-fade). Action-required items still
|
|
129
|
+
allow Escape to dismiss for safety; the action button is not the
|
|
130
|
+
only escape. */
|
|
109
131
|
const wantsClose = this.dismissible || isSticky;
|
|
110
132
|
let close = this.querySelector(':scope > [data-feed-close]');
|
|
111
133
|
if (wantsClose && !close) {
|
|
@@ -120,6 +142,27 @@ class AdiaFeedItem extends AdiaElement {
|
|
|
120
142
|
close.remove();
|
|
121
143
|
}
|
|
122
144
|
|
|
145
|
+
/* Phase 2 — render the action button when [action] is set. Sits
|
|
146
|
+
between the body and the close button. */
|
|
147
|
+
let actionBtn = this.querySelector(':scope > [data-feed-action]');
|
|
148
|
+
if (this.action) {
|
|
149
|
+
if (!actionBtn) {
|
|
150
|
+
actionBtn = document.createElement('button-ui');
|
|
151
|
+
actionBtn.setAttribute('data-feed-action', '');
|
|
152
|
+
actionBtn.setAttribute('variant', 'ghost');
|
|
153
|
+
actionBtn.setAttribute('size', 'sm');
|
|
154
|
+
if (close && close.parentElement === this) this.insertBefore(actionBtn, close);
|
|
155
|
+
else this.appendChild(actionBtn);
|
|
156
|
+
}
|
|
157
|
+
actionBtn.setAttribute('text', this.action);
|
|
158
|
+
} else if (actionBtn) {
|
|
159
|
+
actionBtn.remove();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Focus-trap activation for action-required. */
|
|
163
|
+
if (isActionRequired) this.#installFocusTrap();
|
|
164
|
+
else this.#uninstallFocusTrap();
|
|
165
|
+
|
|
123
166
|
if (!this.hasAttribute('data-open') && !this.#removing) {
|
|
124
167
|
this.#openRaf = requestAnimationFrame(() => {
|
|
125
168
|
this.#openRaf = null;
|
|
@@ -147,31 +190,72 @@ class AdiaFeedItem extends AdiaElement {
|
|
|
147
190
|
const container = this.parentElement;
|
|
148
191
|
this.dispatchEvent(new Event('close', { bubbles: true }));
|
|
149
192
|
this.remove();
|
|
150
|
-
if (container?.matches?.('feed-ui'))
|
|
193
|
+
if (container?.matches?.('feed-ui')) UIFeed.releaseContainerIfEmpty(container);
|
|
151
194
|
}, this.#getDuration());
|
|
152
195
|
}
|
|
153
196
|
|
|
154
197
|
update(patch) {
|
|
155
198
|
if (!patch || typeof patch !== 'object') return;
|
|
156
199
|
for (const k of Object.keys(patch)) {
|
|
157
|
-
if (k in
|
|
200
|
+
if (k in UIFeedItem.properties) this[k] = patch[k];
|
|
158
201
|
}
|
|
202
|
+
// Phase 2: handle is set via the FeedHandle's update(); not a
|
|
203
|
+
// reflected attribute, so it lives outside the property loop.
|
|
204
|
+
if (typeof patch.onAction === 'function') this.#onAction = patch.onAction;
|
|
159
205
|
this.#scheduleAutoDismiss();
|
|
160
206
|
}
|
|
161
207
|
|
|
208
|
+
// Phase 2 focus-trap. Installs on action-required items; saves the
|
|
209
|
+
// previously-focused element so we can return focus on dismiss; cycles
|
|
210
|
+
// Tab/Shift-Tab between focusable descendants; Escape dismisses.
|
|
211
|
+
#installFocusTrap() {
|
|
212
|
+
if (this.#onTrapKeydown) return; // already installed
|
|
213
|
+
this.#focusTrapPrev = document.activeElement;
|
|
214
|
+
const focusables = () => [...this.querySelectorAll('button, button-ui, [tabindex]:not([tabindex="-1"]), input, [data-feed-action], [data-feed-close]')]
|
|
215
|
+
.filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);
|
|
216
|
+
this.#onTrapKeydown = (e) => {
|
|
217
|
+
if (e.key === 'Escape') { e.stopPropagation(); this.dismiss(); return; }
|
|
218
|
+
if (e.key !== 'Tab') return;
|
|
219
|
+
const els = focusables();
|
|
220
|
+
if (!els.length) return;
|
|
221
|
+
const first = els[0];
|
|
222
|
+
const last = els[els.length - 1];
|
|
223
|
+
const active = document.activeElement;
|
|
224
|
+
if (e.shiftKey && active === first) { e.preventDefault(); last.focus(); }
|
|
225
|
+
else if (!e.shiftKey && active === last) { e.preventDefault(); first.focus(); }
|
|
226
|
+
};
|
|
227
|
+
this.addEventListener('keydown', this.#onTrapKeydown, true);
|
|
228
|
+
// Move focus into the item — prefer the action button.
|
|
229
|
+
queueMicrotask(() => {
|
|
230
|
+
const els = focusables();
|
|
231
|
+
const action = this.querySelector('[data-feed-action]');
|
|
232
|
+
(action || els[0])?.focus?.();
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
#uninstallFocusTrap() {
|
|
237
|
+
if (!this.#onTrapKeydown) return;
|
|
238
|
+
this.removeEventListener('keydown', this.#onTrapKeydown, true);
|
|
239
|
+
this.#onTrapKeydown = null;
|
|
240
|
+
// Restore focus to whatever had it before the trap engaged.
|
|
241
|
+
try { this.#focusTrapPrev?.focus?.(); } catch { /* element may have been removed */ }
|
|
242
|
+
this.#focusTrapPrev = null;
|
|
243
|
+
}
|
|
244
|
+
|
|
162
245
|
disconnected() {
|
|
163
246
|
this.removeEventListener('press', this.#onPress);
|
|
164
247
|
if (this.#timer) { clearTimeout(this.#timer); this.#timer = null; }
|
|
165
248
|
if (this.#closeTimer) { clearTimeout(this.#closeTimer); this.#closeTimer = null; }
|
|
166
249
|
if (this.#openRaf != null) { cancelAnimationFrame(this.#openRaf); this.#openRaf = null; }
|
|
250
|
+
this.#uninstallFocusTrap();
|
|
167
251
|
}
|
|
168
252
|
}
|
|
169
253
|
|
|
170
|
-
customElements.define('feed-item-ui',
|
|
254
|
+
customElements.define('feed-item-ui', UIFeedItem);
|
|
171
255
|
|
|
172
|
-
/* ── Static API —
|
|
256
|
+
/* ── Static API — UIFeed ── */
|
|
173
257
|
|
|
174
|
-
class
|
|
258
|
+
class UIFeed {
|
|
175
259
|
static #containers = new Map();
|
|
176
260
|
|
|
177
261
|
/**
|
|
@@ -182,14 +266,14 @@ class AdiaFeed {
|
|
|
182
266
|
* top-right + another in bottom-center) without collision.
|
|
183
267
|
*/
|
|
184
268
|
static get(position = 'bottom-right') {
|
|
185
|
-
let el =
|
|
269
|
+
let el = UIFeed.#containers.get(position);
|
|
186
270
|
if (el && el.isConnected) return el;
|
|
187
271
|
el = document.createElement('feed-ui');
|
|
188
272
|
el.setAttribute('position', position);
|
|
189
273
|
if ('popover' in HTMLElement.prototype) el.setAttribute('popover', 'manual');
|
|
190
274
|
document.body.appendChild(el);
|
|
191
275
|
try { el.showPopover?.(); } catch { /* graceful fallback */ }
|
|
192
|
-
|
|
276
|
+
UIFeed.#containers.set(position, el);
|
|
193
277
|
return el;
|
|
194
278
|
}
|
|
195
279
|
|
|
@@ -205,6 +289,12 @@ class AdiaFeed {
|
|
|
205
289
|
* @param {string} [opts.position='bottom-right']
|
|
206
290
|
* @param {boolean} [opts.dismissible] override default (true for sticky, false for auto)
|
|
207
291
|
* @param {string} [opts.id]
|
|
292
|
+
* @param {string} [opts.action] Phase 2 — action button label. When set,
|
|
293
|
+
* duration is forced to null (sticky); the
|
|
294
|
+
* item gets role=alertdialog + focus trap.
|
|
295
|
+
* @param {function} [opts.onAction] Phase 2 — callback invoked when the
|
|
296
|
+
* action button is pressed. Item dismisses
|
|
297
|
+
* after the callback returns.
|
|
208
298
|
*/
|
|
209
299
|
static post(opts = {}) {
|
|
210
300
|
const {
|
|
@@ -216,18 +306,30 @@ class AdiaFeed {
|
|
|
216
306
|
position = 'bottom-right',
|
|
217
307
|
dismissible,
|
|
218
308
|
id,
|
|
309
|
+
action = '',
|
|
310
|
+
onAction,
|
|
219
311
|
} = opts;
|
|
220
312
|
const v = variant === 'error' ? 'danger' : variant; // documented alias
|
|
221
|
-
const container =
|
|
313
|
+
const container = UIFeed.get(position);
|
|
314
|
+
// Phase 2 max-queue: items above [max] queue with [data-queued] and
|
|
315
|
+
// become visible as visible items dismiss.
|
|
316
|
+
const max = parseInt(container.getAttribute('max') || '5', 10);
|
|
317
|
+
const visibleCount = [...container.children].filter((c) =>
|
|
318
|
+
c.tagName === 'FEED-ITEM-UI' && !c.hasAttribute('data-queued')
|
|
319
|
+
).length;
|
|
222
320
|
const item = document.createElement('feed-item-ui');
|
|
223
321
|
if (id) item.setAttribute('data-id', id);
|
|
224
322
|
item.text = text;
|
|
225
323
|
item.heading = heading;
|
|
226
324
|
item.icon = icon;
|
|
227
325
|
item.variant = v;
|
|
228
|
-
|
|
326
|
+
// Action-required forces sticky.
|
|
327
|
+
item.duration = action ? 0 : duration;
|
|
229
328
|
if (dismissible != null) item.dismissible = !!dismissible;
|
|
329
|
+
if (action) item.action = action;
|
|
330
|
+
if (visibleCount >= max) item.setAttribute('data-queued', '');
|
|
230
331
|
container.appendChild(item);
|
|
332
|
+
if (typeof onAction === 'function') item.update({ onAction });
|
|
231
333
|
return {
|
|
232
334
|
id: id ?? null,
|
|
233
335
|
dismiss: () => item.dismiss(),
|
|
@@ -237,7 +339,7 @@ class AdiaFeed {
|
|
|
237
339
|
|
|
238
340
|
/** Clear all items in a single lane. */
|
|
239
341
|
static clear(position = 'bottom-right') {
|
|
240
|
-
const el =
|
|
342
|
+
const el = UIFeed.#containers.get(position);
|
|
241
343
|
if (!el) return;
|
|
242
344
|
for (const item of [...el.children]) {
|
|
243
345
|
if (item.tagName === 'FEED-ITEM-UI') item.dismiss?.();
|
|
@@ -246,31 +348,38 @@ class AdiaFeed {
|
|
|
246
348
|
|
|
247
349
|
/** Tear down ALL containers. Test cleanup; addresses audit L-B4. */
|
|
248
350
|
static purge() {
|
|
249
|
-
for (const el of
|
|
351
|
+
for (const el of UIFeed.#containers.values()) {
|
|
250
352
|
try { el.hidePopover?.(); } catch { /* noop */ }
|
|
251
353
|
el.remove();
|
|
252
354
|
}
|
|
253
|
-
|
|
355
|
+
UIFeed.#containers.clear();
|
|
254
356
|
}
|
|
255
357
|
|
|
256
|
-
/** Internal: drop a lane when its last item exits.
|
|
358
|
+
/** Internal: drop a lane when its last item exits. Also rotates the
|
|
359
|
+
* Phase 2 max-queue: when a visible item leaves, promote the oldest
|
|
360
|
+
* queued sibling so the visible-count returns to [max]. */
|
|
257
361
|
static releaseContainerIfEmpty(container) {
|
|
258
|
-
if (!container
|
|
362
|
+
if (!container) return;
|
|
363
|
+
// Promote the oldest queued sibling (if any) before deciding whether
|
|
364
|
+
// to release. The queue is FIFO; queued items live at the tail.
|
|
365
|
+
const queued = container.querySelector('feed-item-ui[data-queued]');
|
|
366
|
+
if (queued) queued.removeAttribute('data-queued');
|
|
367
|
+
if (container.children.length > 0) return;
|
|
259
368
|
try { container.hidePopover?.(); } catch { /* noop */ }
|
|
260
369
|
container.remove();
|
|
261
|
-
for (const [pos, el] of
|
|
262
|
-
if (el === container)
|
|
370
|
+
for (const [pos, el] of UIFeed.#containers) {
|
|
371
|
+
if (el === container) UIFeed.#containers.delete(pos);
|
|
263
372
|
}
|
|
264
373
|
}
|
|
265
374
|
}
|
|
266
375
|
|
|
267
|
-
/* Global 'feed' CustomEvent listener — same shape as
|
|
376
|
+
/* Global 'feed' CustomEvent listener — same shape as UIFeed.post().
|
|
268
377
|
Idempotent (HMR-safe via window flag). */
|
|
269
378
|
if (typeof window !== 'undefined' && !window.__adiaFeedListenerInstalled) {
|
|
270
379
|
window.__adiaFeedListenerInstalled = true;
|
|
271
380
|
window.addEventListener('feed', (e) => {
|
|
272
|
-
if (e?.detail && typeof e.detail === 'object')
|
|
381
|
+
if (e?.detail && typeof e.detail === 'object') UIFeed.post(e.detail);
|
|
273
382
|
});
|
|
274
383
|
}
|
|
275
384
|
|
|
276
|
-
export {
|
|
385
|
+
export { UIFeedContainer, UIFeedItem, UIFeed };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Generated alongside feed.js — kept in sync by hand for now (feed
|
|
2
2
|
# is a Phase-1 skeleton; once it stabilizes, run the regen pipeline).
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
4
|
+
name: UIFeedContainer
|
|
5
5
|
tag: feed-ui
|
|
6
6
|
component: Feed
|
|
7
7
|
category: container
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
Shared top-layer feed channel. Per docs/specs/feed-channel.md
|
|
11
11
|
(SPEC-FEED-CHANNEL-001). Per-position singletons mounted lazily into
|
|
12
12
|
document.body via Popover API; consumers post via the static API
|
|
13
|
-
(`
|
|
13
|
+
(`UIFeed.post()`) or the global 'feed' CustomEvent.
|
|
14
14
|
props:
|
|
15
15
|
position:
|
|
16
16
|
description: Lane the feed renders into
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
* MutationObserver watches childList so a swapped-in control gets its
|
|
33
33
|
* `for=` and `aria-describedby` rebound.
|
|
34
34
|
*/
|
|
35
|
-
import {
|
|
35
|
+
import { UIElement } from '../../core/element.js';
|
|
36
36
|
|
|
37
|
-
class
|
|
37
|
+
class UIField extends UIElement {
|
|
38
38
|
static properties = {
|
|
39
39
|
label: { type: String, default: '', reflect: true },
|
|
40
40
|
hint: { type: String, default: '', reflect: true },
|
|
@@ -42,7 +42,7 @@ class AdiaField extends AdiaElement {
|
|
|
42
42
|
inline: { type: Boolean, default: false, reflect: true },
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// The validation message lives on the child control (
|
|
45
|
+
// The validation message lives on the child control (UIFormElement.error
|
|
46
46
|
// is the single source of truth — validity is a property of the value, not
|
|
47
47
|
// of the layout wrapper). field-ui mirrors the child's error string into
|
|
48
48
|
// its own [data-field-error] slot so the validation message renders below
|
|
@@ -184,7 +184,7 @@ class AdiaField extends AdiaElement {
|
|
|
184
184
|
const el = document.createElement('div');
|
|
185
185
|
el.setAttribute('slot', 'hint');
|
|
186
186
|
el.setAttribute('data-field-hint', '');
|
|
187
|
-
el.setAttribute('id',
|
|
187
|
+
el.setAttribute('id', UIField.#nextMsgId('hint'));
|
|
188
188
|
el.hidden = true;
|
|
189
189
|
this.appendChild(el);
|
|
190
190
|
this.#hintEl = el;
|
|
@@ -196,7 +196,7 @@ class AdiaField extends AdiaElement {
|
|
|
196
196
|
const el = document.createElement('div');
|
|
197
197
|
el.setAttribute('slot', 'error');
|
|
198
198
|
el.setAttribute('data-field-error', '');
|
|
199
|
-
el.setAttribute('id',
|
|
199
|
+
el.setAttribute('id', UIField.#nextMsgId('err'));
|
|
200
200
|
el.setAttribute('role', 'alert');
|
|
201
201
|
el.hidden = true;
|
|
202
202
|
this.appendChild(el);
|
|
@@ -210,7 +210,7 @@ class AdiaField extends AdiaElement {
|
|
|
210
210
|
this.#labelEl.removeAttribute('for');
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
if (!control.id) control.id =
|
|
213
|
+
if (!control.id) control.id = UIField.#nextId();
|
|
214
214
|
this.#labelEl.setAttribute('for', control.id);
|
|
215
215
|
}
|
|
216
216
|
|
|
@@ -247,10 +247,10 @@ class AdiaField extends AdiaElement {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
static #idSeq = 0;
|
|
250
|
-
static #nextId() { return `field-ctl-${++
|
|
250
|
+
static #nextId() { return `field-ctl-${++UIField.#idSeq}`; }
|
|
251
251
|
static #msgSeq = 0;
|
|
252
|
-
static #nextMsgId(kind) { return `field-${kind}-${++
|
|
252
|
+
static #nextMsgId(kind) { return `field-${kind}-${++UIField.#msgSeq}`; }
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
customElements.define('field-ui',
|
|
256
|
-
export {
|
|
255
|
+
customElements.define('field-ui', UIField);
|
|
256
|
+
export { UIField };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
2
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
-
name:
|
|
3
|
+
name: UIField
|
|
4
4
|
tag: field-ui
|
|
5
5
|
component: Field
|
|
6
6
|
category: form
|
|
@@ -29,7 +29,7 @@ props:
|
|
|
29
29
|
default: ""
|
|
30
30
|
reflect: true
|
|
31
31
|
# `error` is mirrored from the slotted control's `error` property.
|
|
32
|
-
#
|
|
32
|
+
# UIFormElement.error is the source of truth; field-ui renders the
|
|
33
33
|
# message below the control in danger style, role="alert" so screen
|
|
34
34
|
# readers announce changes. There is no field-level error attribute —
|
|
35
35
|
# set the message on the control: `<field-ui><input-ui error="…"></input-ui></field-ui>`.
|
|
@@ -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: UIFooter
|
|
5
5
|
tag: footer-ui
|
|
6
6
|
component: Footer
|
|
7
7
|
category: container
|
package/components/grid/grid.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* <grid-ui columns="2" column-gap="2" row-gap="4">...</grid-ui>
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { UIElement } from '../../core/element.js';
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class UIGrid extends UIElement {
|
|
11
11
|
static properties = {
|
|
12
12
|
columns: { type: String, default: '3', reflect: true },
|
|
13
13
|
gap: { type: String, default: 'md', reflect: true },
|
|
@@ -16,6 +16,6 @@ class AdiaGrid extends AdiaElement {
|
|
|
16
16
|
};
|
|
17
17
|
static template = () => null;
|
|
18
18
|
}
|
|
19
|
-
customElements.define('grid-ui',
|
|
19
|
+
customElements.define('grid-ui', UIGrid);
|
|
20
20
|
|
|
21
|
-
export {
|
|
21
|
+
export { UIGrid };
|
|
@@ -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: UIGrid
|
|
5
5
|
tag: grid-ui
|
|
6
6
|
component: Grid
|
|
7
7
|
category: layout
|
|
@@ -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: UIHeader
|
|
5
5
|
tag: header-ui
|
|
6
6
|
component: Header
|
|
7
7
|
category: container
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
* title — optional header title
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { UIElement } from '../../core/element.js';
|
|
24
24
|
|
|
25
25
|
const MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class UIHeatmap extends UIElement {
|
|
28
28
|
static properties = {
|
|
29
29
|
type: { type: String, default: 'matrix', reflect: true },
|
|
30
30
|
rows: { type: Number, default: 7, reflect: true },
|
|
@@ -291,5 +291,5 @@ class AdiaHeatmap extends AdiaElement {
|
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
customElements.define('heatmap-ui',
|
|
295
|
-
export {
|
|
294
|
+
customElements.define('heatmap-ui', UIHeatmap);
|
|
295
|
+
export { UIHeatmap };
|
|
@@ -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: UIHeatmap
|
|
5
5
|
tag: heatmap-ui
|
|
6
6
|
component: Heatmap
|
|
7
7
|
category: data-display
|
package/components/icon/icon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIElement, signal, html } from '../../core/element.js';
|
|
2
2
|
import { getIcon } from '../../core/icons.js';
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class UIIcon extends UIElement {
|
|
5
5
|
static properties = {
|
|
6
6
|
name: { type: String, default: '', reflect: true },
|
|
7
7
|
size: { type: String, default: '', reflect: true },
|
|
@@ -39,6 +39,6 @@ class AdiaIcon extends AdiaElement {
|
|
|
39
39
|
return /^\d+(\.\d+)?$/.test(s) ? `${s}px` : s;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
customElements.define('icon-ui',
|
|
42
|
+
customElements.define('icon-ui', UIIcon);
|
|
43
43
|
|
|
44
|
-
export {
|
|
44
|
+
export { UIIcon };
|
|
@@ -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: UIIcon
|
|
5
5
|
tag: icon-ui
|
|
6
6
|
component: Icon
|
|
7
7
|
category: display
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* Raw: strips chrome (no background, no radius) for edge-to-edge rendering
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { UIElement } from '../../core/element.js';
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class UIImage extends UIElement {
|
|
20
20
|
static properties = {
|
|
21
21
|
src: { type: String, default: '', reflect: true },
|
|
22
22
|
alt: { type: String, default: '', reflect: true },
|
|
@@ -97,6 +97,6 @@ class AdiaImage extends AdiaElement {
|
|
|
97
97
|
this.#skeleton = null;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
customElements.define('image-ui',
|
|
100
|
+
customElements.define('image-ui', UIImage);
|
|
101
101
|
|
|
102
|
-
export {
|
|
102
|
+
export { UIImage };
|
|
@@ -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: UIImage
|
|
5
5
|
tag: image-ui
|
|
6
6
|
component: Image
|
|
7
7
|
category: display
|