@adia-ai/web-components 0.0.1 → 0.0.3
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/a2ui/index.js +23 -17
- package/components/accordion/accordion.js +1 -1
- package/components/action-list/action-list.js +1 -1
- package/components/agent-artifact/agent-artifact.js +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.js +1 -1
- package/components/agent-questions/agent-questions.js +1 -1
- package/components/agent-reasoning/agent-reasoning.a2ui.json +14 -8
- package/components/agent-reasoning/agent-reasoning.css +1 -1
- package/components/agent-reasoning/agent-reasoning.js +9 -9
- package/components/agent-reasoning/agent-reasoning.yaml +9 -6
- package/components/agent-suggestions/agent-suggestions.js +1 -1
- package/components/agent-trace/agent-trace.js +1 -1
- package/components/alert/alert.js +1 -1
- package/components/avatar/avatar.a2ui.json +0 -10
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/avatar.yaml +0 -8
- package/components/badge/badge.a2ui.json +6 -6
- package/components/badge/badge.js +22 -1
- package/components/badge/badge.yaml +8 -5
- package/components/block/block.js +1 -1
- package/components/breadcrumb/breadcrumb.js +1 -1
- package/components/button/button.a2ui.json +0 -11
- package/components/button/button.css +1 -1
- package/components/button/button.js +3 -3
- package/components/button/button.yaml +0 -11
- package/components/calendar-picker/calendar-picker.js +25 -19
- package/components/canvas/canvas.js +3 -3
- package/components/card/card.a2ui.json +0 -21
- package/components/card/card.js +2 -2
- package/components/card/card.yaml +0 -14
- package/components/chart/chart.a2ui.json +9 -8
- package/components/chart/chart.js +1 -1
- package/components/chart/chart.yaml +7 -5
- package/components/chat/chat-input.js +1 -1
- package/components/chat/chat.js +2 -2
- package/components/check/check.css +1 -1
- package/components/check/check.js +2 -2
- package/components/code/code.a2ui.json +0 -5
- package/components/code/code.js +1 -1
- package/components/code/code.yaml +0 -4
- package/components/col/col.a2ui.json +0 -20
- package/components/col/col.js +1 -1
- package/components/col/col.yaml +0 -20
- package/components/color-picker/color-picker.a2ui.json +1 -1
- package/components/color-picker/color-picker.js +5 -2
- package/components/color-picker/color-picker.yaml +1 -1
- package/components/command/command.js +22 -11
- package/components/description-list/description-list.js +1 -1
- package/components/divider/divider.a2ui.json +0 -19
- package/components/divider/divider.js +1 -1
- package/components/divider/divider.yaml +0 -12
- package/components/drawer/drawer.a2ui.json +2 -2
- package/components/drawer/drawer.css +1 -1
- package/components/drawer/drawer.js +2 -2
- package/components/drawer/drawer.yaml +3 -3
- package/components/embed/embed.js +1 -1
- package/components/empty-state/empty-state.a2ui.json +0 -13
- package/components/empty-state/empty-state.js +1 -1
- package/components/empty-state/empty-state.yaml +0 -5
- package/components/footer/footer.a2ui.json +1 -1
- package/components/footer/footer.yaml +1 -1
- package/components/grid/grid.a2ui.json +0 -5
- package/components/grid/grid.js +1 -1
- package/components/grid/grid.yaml +0 -4
- package/components/header/header.a2ui.json +1 -1
- package/components/header/header.yaml +1 -1
- package/components/heatmap/heatmap.a2ui.json +4 -4
- package/components/heatmap/heatmap.js +4 -4
- package/components/heatmap/heatmap.yaml +4 -4
- package/components/icon/icon.a2ui.json +13 -0
- package/components/icon/icon.js +2 -2
- package/components/icon/icon.yaml +6 -0
- package/components/image/image.a2ui.json +10 -21
- package/components/image/image.js +1 -1
- package/components/image/image.yaml +8 -16
- package/components/input/input.a2ui.json +0 -15
- package/components/input/input.js +2 -2
- package/components/input/input.yaml +0 -12
- package/components/inspector/inspector.a2ui.json +0 -5
- package/components/inspector/inspector.js +2 -2
- package/components/inspector/inspector.yaml +0 -4
- package/components/kbd/kbd.js +1 -1
- package/components/list/list.a2ui.json +0 -33
- package/components/list/list.js +1 -1
- package/components/list/list.yaml +0 -27
- package/components/menu/menu.a2ui.json +0 -10
- package/components/menu/menu.js +9 -3
- package/components/menu/menu.yaml +0 -8
- package/components/modal/modal.a2ui.json +1 -25
- package/components/modal/modal.js +1 -1
- package/components/modal/modal.yaml +1 -22
- package/components/noodles/noodles.a2ui.json +0 -5
- package/components/noodles/noodles.js +1 -1
- package/components/noodles/noodles.yaml +0 -5
- package/components/otp-input/otp-input.a2ui.json +0 -5
- package/components/otp-input/otp-input.js +1 -1
- package/components/otp-input/otp-input.yaml +0 -4
- package/components/pagination/pagination.a2ui.json +3 -13
- package/components/pagination/pagination.css +1 -1
- package/components/pagination/pagination.js +1 -1
- package/components/pagination/pagination.yaml +5 -14
- package/components/pane/pane.a2ui.json +0 -10
- package/components/pane/pane.js +1 -1
- package/components/pane/pane.yaml +0 -9
- package/components/pipeline-status/pipeline-status.js +1 -1
- package/components/popover/popover.a2ui.json +0 -14
- package/components/popover/popover.js +9 -3
- package/components/popover/popover.yaml +0 -11
- package/components/progress/progress.a2ui.json +2 -12
- package/components/progress/progress.js +1 -1
- package/components/progress/progress.yaml +2 -11
- package/components/progress-row/progress-row.a2ui.json +3 -13
- package/components/progress-row/progress-row.js +1 -1
- package/components/progress-row/progress-row.yaml +3 -11
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.js +2 -2
- package/components/range/range.js +1 -1
- package/components/rating/rating.js +1 -1
- package/components/richtext/richtext.js +2 -2
- package/components/row/row.a2ui.json +0 -5
- package/components/row/row.js +2 -2
- package/components/row/row.yaml +0 -4
- package/components/search/search.a2ui.json +0 -5
- package/components/search/search.js +1 -1
- package/components/search/search.yaml +0 -4
- package/components/section/section.a2ui.json +1 -1
- package/components/section/section.yaml +1 -1
- package/components/segment/segment.js +1 -1
- package/components/segmented/segmented.css +1 -1
- package/components/segmented/segmented.js +1 -1
- package/components/select/select.a2ui.json +5 -0
- package/components/select/select.js +13 -3
- package/components/select/select.yaml +5 -0
- package/components/skeleton/skeleton.a2ui.json +0 -11
- package/components/skeleton/skeleton.js +1 -1
- package/components/skeleton/skeleton.yaml +0 -5
- package/components/slider/slider.a2ui.json +0 -5
- package/components/slider/slider.js +1 -1
- package/components/slider/slider.yaml +0 -5
- package/components/stack/stack.js +1 -1
- package/components/stat/stat.js +1 -1
- package/components/stepper/stepper.js +1 -1
- package/components/stream/stream.js +1 -1
- package/components/swiper/swiper.a2ui.json +7 -7
- package/components/swiper/swiper.js +2 -2
- package/components/swiper/swiper.yaml +8 -6
- package/components/switch/switch.css +1 -1
- package/components/switch/switch.js +2 -2
- package/components/table/table.js +1 -1
- package/components/tabs/tab.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.a2ui.json +0 -5
- package/components/tag/tag.js +1 -1
- package/components/tag/tag.yaml +0 -4
- package/components/text/text.a2ui.json +5 -0
- package/components/text/text.css +2 -2
- package/components/text/text.js +1 -1
- package/components/text/text.yaml +5 -0
- package/components/textarea/textarea.js +1 -1
- package/components/timeline/timeline.a2ui.json +8 -13
- package/components/timeline/timeline.js +1 -1
- package/components/timeline/timeline.yaml +6 -11
- package/components/toast/toast.a2ui.json +0 -15
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.yaml +0 -13
- package/components/toggle-group/toggle-group.js +1 -1
- package/components/toolbar/toolbar.a2ui.json +0 -23
- package/components/toolbar/toolbar.js +13 -3
- package/components/toolbar/toolbar.yaml +0 -19
- package/components/tooltip/tooltip.a2ui.json +0 -10
- package/components/tooltip/tooltip.js +2 -2
- package/components/tooltip/tooltip.yaml +0 -8
- package/components/tree/tree.js +1 -1
- package/components/upload/upload.js +1 -1
- package/core/markdown.js +1 -1
- package/core/provider.js +2 -2
- package/package.json +7 -3
- package/patterns/a2ui-root/a2ui-root.a2ui.json +118 -0
- package/{a2ui/root.js → patterns/a2ui-root/a2ui-root.js} +9 -4
- package/patterns/a2ui-root/a2ui-root.yaml +76 -0
- package/patterns/adia-chat/adia-chat.js +3 -3
- package/patterns/adia-chat/css/adia-chat.streaming.css +2 -2
- package/patterns/adia-editor/adia-editor.js +1 -1
- package/patterns/app-nav/app-nav.js +1 -1
- package/patterns/app-nav-group/app-nav-group.js +2 -2
- package/patterns/app-nav-item/app-nav-item.js +1 -1
- package/patterns/app-shell/app-shell.js +1 -1
- package/patterns/gen-ui/gen-ui.css +3 -3
- package/patterns/gen-ui/gen-ui.js +1 -1
- package/patterns/index.js +1 -0
- package/patterns/section-nav/section-nav.js +1 -1
- package/patterns/section-nav-group/section-nav-group.js +1 -1
- package/patterns/section-nav-item/section-nav-item.js +1 -1
- package/traits/define.js +1 -1
- package/a2ui/dockables/action.js +0 -152
- package/a2ui/dockables/base.js +0 -30
- package/a2ui/dockables/controller.js +0 -97
- package/a2ui/dockables/data-source.js +0 -103
- package/a2ui/dockables/index.js +0 -6
- package/a2ui/dockables/lifecycle.js +0 -84
- package/a2ui/dockables/provider.js +0 -59
- package/a2ui/manifest-runtime.js +0 -226
- package/a2ui/registry.js +0 -200
- package/a2ui/renderer.js +0 -361
- package/a2ui/stream.js +0 -243
- package/a2ui/surface-manifest.js +0 -294
- package/a2ui/surface.js +0 -222
- package/a2ui/wire-factory.js +0 -134
- package/a2ui/wiring-engine.js +0 -209
- package/a2ui/wiring-registry.js +0 -342
package/a2ui/index.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* DEPRECATED — the `@adia-ai/web-components/a2ui` subpath.
|
|
3
|
+
*
|
|
4
|
+
* The A2UI runtime was extracted into its own package `@adia-ai/a2ui-utils`
|
|
5
|
+
* in 0.0.3. This file is a temporary re-export shim for one release so
|
|
6
|
+
* existing consumers don't break on upgrade. It will be removed in 0.1.0.
|
|
7
|
+
*
|
|
8
|
+
* Migrate:
|
|
9
|
+
* - import { A2UIRenderer } from '@adia-ai/web-components/a2ui';
|
|
10
|
+
* + import { A2UIRenderer } from '@adia-ai/a2ui-utils';
|
|
11
|
+
*
|
|
12
|
+
* The declarative `<a2ui-root>` custom element also moved — it now lives
|
|
13
|
+
* in the patterns directory. Import it via:
|
|
14
|
+
* import '@adia-ai/web-components/patterns/a2ui-root/a2ui-root.js';
|
|
15
|
+
*/
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
17
|
+
if (typeof console !== 'undefined' && !globalThis.__a2ui_subpath_warned) {
|
|
18
|
+
globalThis.__a2ui_subpath_warned = true;
|
|
19
|
+
console.warn(
|
|
20
|
+
'[@adia-ai/web-components] The `/a2ui` subpath export is deprecated and will be removed in 0.1.0. ' +
|
|
21
|
+
'Import from `@adia-ai/a2ui-utils` instead.'
|
|
22
|
+
);
|
|
23
|
+
}
|
|
11
24
|
|
|
12
|
-
|
|
13
|
-
export { A2UIValidator } from './validator.js';
|
|
14
|
-
export { A2UIGenerator } from './generator.js';
|
|
15
|
-
export { savePattern, importPattern, buildPatternJSON } from './pattern-export.js';
|
|
16
|
-
export * from './retrieval/index.js';
|
|
17
|
-
|
|
18
|
-
// Learning
|
|
19
|
-
export { feedbackStore } from './retrieval/feedback-store.js';
|
|
25
|
+
export * from '@adia-ai/a2ui-utils';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* or activated via keyboard (Enter / Space). Keyboard nav: ArrowUp/Down, Home/End.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { AdiaElement } from '
|
|
18
|
+
import { AdiaElement } from '../../core/element.js';
|
|
19
19
|
|
|
20
20
|
class AdiaActionList extends AdiaElement {
|
|
21
21
|
static properties = {};
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* questions-answer — detail: { selected: string[], option: chosen | null }
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import { AdiaElement } from '
|
|
29
|
+
import { AdiaElement } from '../../core/element.js';
|
|
30
30
|
|
|
31
31
|
class AdiaAgentQuestions extends AdiaElement {
|
|
32
32
|
static properties = {
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
-
"autocollapse": {
|
|
17
|
-
"description": "Auto-collapse after finish().",
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"default": true
|
|
20
|
-
},
|
|
21
16
|
"collapsed": {
|
|
22
17
|
"description": "Start collapsed.",
|
|
23
18
|
"type": "boolean",
|
|
@@ -31,10 +26,21 @@
|
|
|
31
26
|
"type": "string",
|
|
32
27
|
"default": ""
|
|
33
28
|
},
|
|
34
|
-
"
|
|
35
|
-
"description": "
|
|
29
|
+
"noAutocollapse": {
|
|
30
|
+
"description": "Disable auto-collapse after finish().",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
34
|
+
"status": {
|
|
35
|
+
"description": "Drives the status icon — idle, active (spinner), done (check), error (warning).",
|
|
36
36
|
"type": "string",
|
|
37
|
-
"
|
|
37
|
+
"enum": [
|
|
38
|
+
"idle",
|
|
39
|
+
"active",
|
|
40
|
+
"done",
|
|
41
|
+
"error"
|
|
42
|
+
],
|
|
43
|
+
"default": "active"
|
|
38
44
|
}
|
|
39
45
|
},
|
|
40
46
|
"required": [
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
* r.finish('2 iterations · 94/100 · 7s');
|
|
34
34
|
*
|
|
35
35
|
* Attributes:
|
|
36
|
-
* collapsed
|
|
37
|
-
* autocollapse
|
|
38
|
-
* heading
|
|
36
|
+
* collapsed — start collapsed
|
|
37
|
+
* no-autocollapse — disable auto-collapse 1.2s after finish (default: false — auto-collapse on)
|
|
38
|
+
* heading — fallback summary label while active
|
|
39
39
|
* status — 'idle' | 'active' | 'done' | 'error' (default: 'active')
|
|
40
40
|
* Drives the status icon: spinner / check-circle / warning-circle
|
|
41
41
|
*
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* reasoning-finish — .finish() was called (detail: { summary, status })
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
|
-
import { AdiaElement } from '
|
|
48
|
+
import { AdiaElement } from '../../core/element.js';
|
|
49
49
|
|
|
50
50
|
// Status lifecycle for the reasoning surface as a whole.
|
|
51
51
|
// active — still thinking (default; renders the spinner)
|
|
@@ -56,10 +56,10 @@ const REASONING_STATUSES = new Set(['idle', 'active', 'done', 'error']);
|
|
|
56
56
|
|
|
57
57
|
class AdiaAgentReasoning extends AdiaElement {
|
|
58
58
|
static properties = {
|
|
59
|
-
collapsed:
|
|
60
|
-
|
|
61
|
-
heading:
|
|
62
|
-
status:
|
|
59
|
+
collapsed: { type: Boolean, default: false, reflect: true },
|
|
60
|
+
noAutocollapse: { type: Boolean, default: false, reflect: true, attribute: 'no-autocollapse' },
|
|
61
|
+
heading: { type: String, default: '', reflect: true },
|
|
62
|
+
status: { type: String, default: 'active', reflect: true },
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
static template = () => null;
|
|
@@ -202,7 +202,7 @@ class AdiaAgentReasoning extends AdiaElement {
|
|
|
202
202
|
}));
|
|
203
203
|
|
|
204
204
|
if (this.#finishTimer != null) clearTimeout(this.#finishTimer);
|
|
205
|
-
if (this.
|
|
205
|
+
if (!this.noAutocollapse && !isError) {
|
|
206
206
|
this.#finishTimer = setTimeout(() => {
|
|
207
207
|
this.#finishTimer = null;
|
|
208
208
|
this.collapsed = true;
|
|
@@ -8,10 +8,11 @@ category: agent
|
|
|
8
8
|
version: 1
|
|
9
9
|
description: Agent inner monologue + pipeline viewer with steps, thoughts, plans, and iterations.
|
|
10
10
|
props:
|
|
11
|
-
|
|
12
|
-
description:
|
|
11
|
+
noAutocollapse:
|
|
12
|
+
description: Disable auto-collapse after finish().
|
|
13
13
|
type: boolean
|
|
14
|
-
default:
|
|
14
|
+
default: false
|
|
15
|
+
attribute: no-autocollapse
|
|
15
16
|
collapsed:
|
|
16
17
|
description: Start collapsed.
|
|
17
18
|
type: boolean
|
|
@@ -20,10 +21,12 @@ props:
|
|
|
20
21
|
description: Fallback summary label.
|
|
21
22
|
type: string
|
|
22
23
|
default: ""
|
|
23
|
-
|
|
24
|
-
description:
|
|
24
|
+
status:
|
|
25
|
+
description: Drives the status icon — idle, active (spinner), done (check), error (warning).
|
|
25
26
|
type: string
|
|
26
|
-
default:
|
|
27
|
+
default: active
|
|
28
|
+
reflect: true
|
|
29
|
+
enum: [idle, active, done, error]
|
|
27
30
|
events:
|
|
28
31
|
reasoning-finish:
|
|
29
32
|
description: "Fired on reasoning-finish."
|
|
@@ -21,11 +21,6 @@
|
|
|
21
21
|
"type": "string",
|
|
22
22
|
"default": ""
|
|
23
23
|
},
|
|
24
|
-
"initials": {
|
|
25
|
-
"description": "Explicit initials override. When set, takes precedence over `name`.",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": ""
|
|
28
|
-
},
|
|
29
24
|
"name": {
|
|
30
25
|
"description": "User name for initials (first letter of each word, max 2).",
|
|
31
26
|
"type": "string",
|
|
@@ -65,11 +60,6 @@
|
|
|
65
60
|
"description": "Display name (for initials)",
|
|
66
61
|
"type": "string",
|
|
67
62
|
"default": ""
|
|
68
|
-
},
|
|
69
|
-
"variant": {
|
|
70
|
-
"description": "Color/emphasis variant for the placeholder background + initials foreground.",
|
|
71
|
-
"type": "string",
|
|
72
|
-
"default": "default"
|
|
73
63
|
}
|
|
74
64
|
},
|
|
75
65
|
"required": [
|
|
@@ -12,10 +12,6 @@ props:
|
|
|
12
12
|
description: User name for initials (first letter of each word, max 2).
|
|
13
13
|
type: string
|
|
14
14
|
default: ""
|
|
15
|
-
initials:
|
|
16
|
-
description: Explicit initials override. When set, takes precedence over `name`.
|
|
17
|
-
type: string
|
|
18
|
-
default: ""
|
|
19
15
|
icon:
|
|
20
16
|
description: Phosphor icon name shown instead of initials when `src`/`name` are empty.
|
|
21
17
|
type: string
|
|
@@ -27,10 +23,6 @@ props:
|
|
|
27
23
|
enum:
|
|
28
24
|
- circle
|
|
29
25
|
- square
|
|
30
|
-
variant:
|
|
31
|
-
description: Color/emphasis variant for the placeholder background + initials foreground.
|
|
32
|
-
type: string
|
|
33
|
-
default: default
|
|
34
26
|
size:
|
|
35
27
|
description: >-
|
|
36
28
|
Avatar size. Canonical scale (xs/sm/md/lg/xl); long-form aliases
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"default": "md"
|
|
35
35
|
},
|
|
36
36
|
"status": {
|
|
37
|
-
"description": "Semantic status shorthand. Auto-maps to variant and sets text.",
|
|
37
|
+
"description": "Semantic status shorthand. Auto-maps to variant and sets text. `new` → success \"New\"; `updated` → info \"Updated\"; `deprecated` → warning \"Deprecated\"; `removed` → danger \"Removed\"; `beta` → accent \"Beta\". Use `variant` + `text` directly for custom chips.",
|
|
38
38
|
"type": "string",
|
|
39
39
|
"enum": [
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
40
|
+
"new",
|
|
41
|
+
"updated",
|
|
42
|
+
"deprecated",
|
|
43
|
+
"removed",
|
|
44
|
+
"beta"
|
|
45
45
|
],
|
|
46
46
|
"default": ""
|
|
47
47
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* <badge-ui text="New" variant="accent"></badge-ui>
|
|
3
3
|
* <badge-ui text="3" variant="danger" size="sm"></badge-ui>
|
|
4
4
|
* <badge-ui text="Organic" variant="accent" icon="dot"></badge-ui> ← chart legend chip
|
|
5
|
+
* <badge-ui status="beta"></badge-ui> ← status shorthand
|
|
5
6
|
*
|
|
6
7
|
* Inline badge / tag. Pill-shaped, text rendered via CSS attr().
|
|
7
8
|
*
|
|
@@ -10,9 +11,18 @@
|
|
|
10
11
|
* Icon: optional leading icon (any registered icon name; "dot" for legend
|
|
11
12
|
* markers). Inherits the variant's foreground color so legend chips
|
|
12
13
|
* read as a single visual unit instead of icon + label collage.
|
|
14
|
+
* Status: semantic shorthand that auto-maps variant + text.
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
|
-
import { AdiaElement } from '
|
|
17
|
+
import { AdiaElement } from '../../core/element.js';
|
|
18
|
+
|
|
19
|
+
const STATUS_MAP = {
|
|
20
|
+
new: { variant: 'success', text: 'New' },
|
|
21
|
+
updated: { variant: 'info', text: 'Updated' },
|
|
22
|
+
deprecated: { variant: 'warning', text: 'Deprecated' },
|
|
23
|
+
removed: { variant: 'danger', text: 'Removed' },
|
|
24
|
+
beta: { variant: 'accent', text: 'Beta' },
|
|
25
|
+
};
|
|
16
26
|
|
|
17
27
|
class AdiaBadge extends AdiaElement {
|
|
18
28
|
static properties = {
|
|
@@ -20,6 +30,7 @@ class AdiaBadge extends AdiaElement {
|
|
|
20
30
|
variant: { type: String, default: 'default', reflect: true },
|
|
21
31
|
size: { type: String, default: 'md', reflect: true },
|
|
22
32
|
icon: { type: String, default: '', reflect: true },
|
|
33
|
+
status: { type: String, default: '', reflect: true },
|
|
23
34
|
};
|
|
24
35
|
|
|
25
36
|
static template = () => null;
|
|
@@ -29,6 +40,16 @@ class AdiaBadge extends AdiaElement {
|
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
render() {
|
|
43
|
+
// Status shorthand wins over explicit variant/text while it's set —
|
|
44
|
+
// mixing is unsupported. Converges in one extra render pass.
|
|
45
|
+
if (this.status) {
|
|
46
|
+
const entry = STATUS_MAP[this.status];
|
|
47
|
+
if (entry) {
|
|
48
|
+
if (this.variant !== entry.variant) this.variant = entry.variant;
|
|
49
|
+
if (this.text !== entry.text) this.text = entry.text;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
if (this.text) this.setAttribute('aria-label', this.text);
|
|
33
54
|
|
|
34
55
|
// Stamp / update the leading icon. Pattern mirrors button-ui so the same
|
|
@@ -25,14 +25,17 @@ props:
|
|
|
25
25
|
- xl
|
|
26
26
|
status:
|
|
27
27
|
description: Semantic status shorthand. Auto-maps to variant and sets text.
|
|
28
|
+
`new` → success "New"; `updated` → info "Updated"; `deprecated` → warning
|
|
29
|
+
"Deprecated"; `removed` → danger "Removed"; `beta` → accent "Beta".
|
|
30
|
+
Use `variant` + `text` directly for custom chips.
|
|
28
31
|
type: string
|
|
29
32
|
default: ""
|
|
30
33
|
enum:
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
34
|
+
- new
|
|
35
|
+
- updated
|
|
36
|
+
- deprecated
|
|
37
|
+
- removed
|
|
38
|
+
- beta
|
|
36
39
|
text:
|
|
37
40
|
description: Badge text content. Falls back to existing textContent.
|
|
38
41
|
type: string
|
|
@@ -18,11 +18,6 @@
|
|
|
18
18
|
"type": "string",
|
|
19
19
|
"default": "button"
|
|
20
20
|
},
|
|
21
|
-
"active": {
|
|
22
|
-
"description": "Indicates an active/pressed toggle state (for group-buttons and segmented controls).",
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": false
|
|
25
|
-
},
|
|
26
21
|
"component": {
|
|
27
22
|
"const": "Button"
|
|
28
23
|
},
|
|
@@ -36,11 +31,6 @@
|
|
|
36
31
|
"type": "string",
|
|
37
32
|
"default": ""
|
|
38
33
|
},
|
|
39
|
-
"iconRight": {
|
|
40
|
-
"description": "Trailing Phosphor icon name (rendered after text).",
|
|
41
|
-
"type": "string",
|
|
42
|
-
"default": ""
|
|
43
|
-
},
|
|
44
34
|
"size": {
|
|
45
35
|
"description": "Sizing scale (xs/sm/md/lg/xl).",
|
|
46
36
|
"type": "string",
|
|
@@ -70,7 +60,6 @@
|
|
|
70
60
|
"default",
|
|
71
61
|
"solid",
|
|
72
62
|
"outline",
|
|
73
|
-
"outlined",
|
|
74
63
|
"ghost",
|
|
75
64
|
"danger",
|
|
76
65
|
"primary",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
--button-fg-hover: var(--a-ui-text-hover);
|
|
14
14
|
--button-border-hover: transparent;
|
|
15
15
|
--button-bg-primary: var(--a-primary);
|
|
16
|
-
--button-fg-primary:
|
|
16
|
+
--button-fg-primary: var(--a-chrome-light);
|
|
17
17
|
--button-bg-outline: transparent;
|
|
18
18
|
--button-fg-outline: var(--a-fg);
|
|
19
19
|
--button-border-outline: var(--a-ui-border);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdiaElement, signal, html } from '
|
|
2
|
-
import { getIcon } from '
|
|
1
|
+
import { AdiaElement, signal, html } from '../../core/element.js';
|
|
2
|
+
import { getIcon } from '../../core/icons.js';
|
|
3
3
|
|
|
4
4
|
class AdiaButton extends AdiaElement {
|
|
5
5
|
static properties = {
|
|
@@ -37,7 +37,7 @@ class AdiaButton extends AdiaElement {
|
|
|
37
37
|
#onClick = (e) => {
|
|
38
38
|
if (this.disabled) { e.stopPropagation(); return; }
|
|
39
39
|
if (this.type === 'submit') {
|
|
40
|
-
const form = this.closest('form
|
|
40
|
+
const form = this.closest('form');
|
|
41
41
|
if (form?.requestSubmit) form.requestSubmit();
|
|
42
42
|
}
|
|
43
43
|
this.dispatchEvent(new Event('press', { bubbles: true }));
|
|
@@ -12,11 +12,6 @@ props:
|
|
|
12
12
|
description: HTML button type (button, submit, reset)
|
|
13
13
|
type: string
|
|
14
14
|
default: button
|
|
15
|
-
active:
|
|
16
|
-
description: Indicates an active/pressed toggle state (for group-buttons and segmented controls).
|
|
17
|
-
type: boolean
|
|
18
|
-
default: false
|
|
19
|
-
reflect: true
|
|
20
15
|
stretch:
|
|
21
16
|
description: "Makes the button stretch to fill the parent's width"
|
|
22
17
|
type: boolean
|
|
@@ -31,11 +26,6 @@ props:
|
|
|
31
26
|
description: Leading Phosphor icon name (rendered before text).
|
|
32
27
|
type: string
|
|
33
28
|
default: ""
|
|
34
|
-
iconRight:
|
|
35
|
-
description: Trailing Phosphor icon name (rendered after text).
|
|
36
|
-
type: string
|
|
37
|
-
default: ""
|
|
38
|
-
attribute: icon-right
|
|
39
29
|
size:
|
|
40
30
|
description: "Sizing scale (xs/sm/md/lg/xl)."
|
|
41
31
|
type: string
|
|
@@ -58,7 +48,6 @@ props:
|
|
|
58
48
|
- default
|
|
59
49
|
- solid
|
|
60
50
|
- outline
|
|
61
|
-
- outlined
|
|
62
51
|
- ghost
|
|
63
52
|
- danger
|
|
64
53
|
- primary
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* Keyboard: Arrow keys navigate days, Enter selects, Escape closes.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { AdiaFormElement } from '
|
|
19
|
-
import { anchorPopover } from '
|
|
18
|
+
import { AdiaFormElement } from '../../core/form.js';
|
|
19
|
+
import { anchorPopover } from '../../core/anchor.js';
|
|
20
20
|
|
|
21
21
|
const DAYS = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
|
|
22
22
|
const MONTHS_SHORT = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -58,6 +58,18 @@ class AdiaCalendarPicker extends AdiaFormElement {
|
|
|
58
58
|
#viewYear = new Date().getFullYear();
|
|
59
59
|
#viewMonth = new Date().getMonth();
|
|
60
60
|
#focusedDay = null;
|
|
61
|
+
#popoverClickBound = false;
|
|
62
|
+
|
|
63
|
+
#onPopoverClick = (e) => {
|
|
64
|
+
const target = e.target instanceof Element ? e.target : null;
|
|
65
|
+
if (!target) return;
|
|
66
|
+
const prev = target.closest('[data-cal-prev]');
|
|
67
|
+
if (prev) { e.stopPropagation(); this.#navigate(-1); return; }
|
|
68
|
+
const next = target.closest('[data-cal-next]');
|
|
69
|
+
if (next) { e.stopPropagation(); this.#navigate(1); return; }
|
|
70
|
+
const day = target.closest('[data-cal-day][data-date]:not([disabled])');
|
|
71
|
+
if (day) { e.stopPropagation(); this.#selectDate(day.dataset.date); }
|
|
72
|
+
};
|
|
61
73
|
|
|
62
74
|
connected() {
|
|
63
75
|
super.connected();
|
|
@@ -88,6 +100,8 @@ class AdiaCalendarPicker extends AdiaFormElement {
|
|
|
88
100
|
this.#popover.setAttribute('slot', 'popover');
|
|
89
101
|
this.#popover.setAttribute('popover', 'manual');
|
|
90
102
|
this.appendChild(this.#popover);
|
|
103
|
+
this.#popover.addEventListener('click', this.#onPopoverClick);
|
|
104
|
+
this.#popoverClickBound = true;
|
|
91
105
|
} else {
|
|
92
106
|
const display = this.querySelector('[slot="display"]');
|
|
93
107
|
if (display) display.textContent = this.#displayText();
|
|
@@ -95,6 +109,10 @@ class AdiaCalendarPicker extends AdiaFormElement {
|
|
|
95
109
|
|
|
96
110
|
if (!this.#popover) this.#popover = this.querySelector('[slot="popover"]');
|
|
97
111
|
if (!this.#trigger) this.#trigger = this.querySelector('[slot="trigger"]');
|
|
112
|
+
if (this.#popover && !this.#popoverClickBound) {
|
|
113
|
+
this.#popover.addEventListener('click', this.#onPopoverClick);
|
|
114
|
+
this.#popoverClickBound = true;
|
|
115
|
+
}
|
|
98
116
|
|
|
99
117
|
// Toggle popover
|
|
100
118
|
if (this.open) {
|
|
@@ -195,23 +213,7 @@ class AdiaCalendarPicker extends AdiaFormElement {
|
|
|
195
213
|
h += '</div>';
|
|
196
214
|
|
|
197
215
|
this.#popover.innerHTML = h;
|
|
198
|
-
|
|
199
|
-
// Wire events
|
|
200
|
-
this.#popover.querySelector('[data-cal-prev]')?.addEventListener('click', (e) => {
|
|
201
|
-
e.stopPropagation();
|
|
202
|
-
this.#navigate(-1);
|
|
203
|
-
});
|
|
204
|
-
this.#popover.querySelector('[data-cal-next]')?.addEventListener('click', (e) => {
|
|
205
|
-
e.stopPropagation();
|
|
206
|
-
this.#navigate(1);
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
for (const btn of this.#popover.querySelectorAll('[data-cal-day][data-date]:not([disabled])')) {
|
|
210
|
-
btn.addEventListener('click', (e) => {
|
|
211
|
-
e.stopPropagation();
|
|
212
|
-
this.#selectDate(btn.dataset.date);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
216
|
+
// Events are delegated on #popover (see #onPopoverClick) — no per-element wiring.
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
#navigate(delta) {
|
|
@@ -312,6 +314,10 @@ class AdiaCalendarPicker extends AdiaFormElement {
|
|
|
312
314
|
this.removeEventListener('click', this.#onClick);
|
|
313
315
|
this.removeEventListener('keydown', this.#onKey);
|
|
314
316
|
document.removeEventListener('pointerdown', this.#onOutside);
|
|
317
|
+
if (this.#popover && this.#popoverClickBound) {
|
|
318
|
+
this.#popover.removeEventListener('click', this.#onPopoverClick);
|
|
319
|
+
}
|
|
320
|
+
this.#popoverClickBound = false;
|
|
315
321
|
this.#anchorCleanup?.();
|
|
316
322
|
this.#anchorCleanup = null;
|
|
317
323
|
this.#popover?.hidePopover?.();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdiaElement } from '
|
|
2
|
-
import '../../a2ui/root.js';
|
|
1
|
+
import { AdiaElement } from '../../core/element.js';
|
|
2
|
+
import '../../patterns/a2ui-root/a2ui-root.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* <canvas-ui> — A2UI rendering surface.
|
|
@@ -89,7 +89,7 @@ export class AdiaCanvas extends AdiaElement {
|
|
|
89
89
|
this.#rootEl = document.createElement('a2ui-root');
|
|
90
90
|
|
|
91
91
|
if (this.theme) {
|
|
92
|
-
const themeEl = document.createElement('theme-
|
|
92
|
+
const themeEl = document.createElement('theme-ui');
|
|
93
93
|
themeEl.setAttribute('preset', this.theme);
|
|
94
94
|
themeEl.appendChild(this.#rootEl);
|
|
95
95
|
this.#rootContainer.appendChild(themeEl);
|