@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
|
@@ -16,17 +16,6 @@
|
|
|
16
16
|
"component": {
|
|
17
17
|
"const": "Card"
|
|
18
18
|
},
|
|
19
|
-
"density": {
|
|
20
|
-
"description": "Interior density — compact/comfortable/spacious. Tightens or loosens padding + gap.",
|
|
21
|
-
"type": "string",
|
|
22
|
-
"enum": [
|
|
23
|
-
"",
|
|
24
|
-
"compact",
|
|
25
|
-
"comfortable",
|
|
26
|
-
"spacious"
|
|
27
|
-
],
|
|
28
|
-
"default": ""
|
|
29
|
-
},
|
|
30
19
|
"draggable": {
|
|
31
20
|
"description": "Enables drag handle + cursor:grab. Wires the draggable trait; dispatches drag-end.",
|
|
32
21
|
"type": "boolean",
|
|
@@ -43,21 +32,11 @@
|
|
|
43
32
|
],
|
|
44
33
|
"default": 1
|
|
45
34
|
},
|
|
46
|
-
"interactive": {
|
|
47
|
-
"description": "Marks the card as clickable — enables hover elevation, pointer cursor, and focus ring.",
|
|
48
|
-
"type": "boolean",
|
|
49
|
-
"default": false
|
|
50
|
-
},
|
|
51
35
|
"padding": {
|
|
52
36
|
"description": "Interior padding scale (overrides --card-padding). Accepts the named scale (none/xs/sm/md/lg/xl) or a numeric rung (\"1\"…\"16\").",
|
|
53
37
|
"type": "string",
|
|
54
38
|
"default": "md"
|
|
55
39
|
},
|
|
56
|
-
"radius": {
|
|
57
|
-
"description": "Border radius preset (overrides --card-radius). Named (none/sm/md/lg/round) or numeric.",
|
|
58
|
-
"type": "string",
|
|
59
|
-
"default": ""
|
|
60
|
-
},
|
|
61
40
|
"raw": {
|
|
62
41
|
"description": "Strips background, border, and shadow. Parent owns the surface. Content structure still applies.",
|
|
63
42
|
"type": "boolean",
|
package/components/card/card.js
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* draggable — enables drag handle + cursor:grab; wires the draggable trait
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import { AdiaElement } from '
|
|
27
|
-
import { draggable } from '
|
|
26
|
+
import { AdiaElement } from '../../core/element.js';
|
|
27
|
+
import { draggable } from '../../traits/draggable.js';
|
|
28
28
|
|
|
29
29
|
class AdiaCard extends AdiaElement {
|
|
30
30
|
static properties = {
|
|
@@ -22,20 +22,6 @@ props:
|
|
|
22
22
|
scale (none/xs/sm/md/lg/xl) or a numeric rung ("1"…"16").
|
|
23
23
|
type: string
|
|
24
24
|
default: md
|
|
25
|
-
interactive:
|
|
26
|
-
description: Marks the card as clickable — enables hover elevation, pointer cursor, and focus ring.
|
|
27
|
-
type: boolean
|
|
28
|
-
default: false
|
|
29
|
-
reflect: true
|
|
30
|
-
radius:
|
|
31
|
-
description: Border radius preset (overrides --card-radius). Named (none/sm/md/lg/round) or numeric.
|
|
32
|
-
type: string
|
|
33
|
-
default: ""
|
|
34
|
-
density:
|
|
35
|
-
description: Interior density — compact/comfortable/spacious. Tightens or loosens padding + gap.
|
|
36
|
-
type: string
|
|
37
|
-
default: ""
|
|
38
|
-
enum: ["", compact, comfortable, spacious]
|
|
39
25
|
draggable:
|
|
40
26
|
description: Enables drag handle + cursor:grab. Wires the draggable trait; dispatches drag-end.
|
|
41
27
|
type: boolean
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
-
"title": {
|
|
17
|
-
"description": "Chart title above the canvas",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"default": ""
|
|
20
|
-
},
|
|
21
16
|
"type": {
|
|
22
17
|
"description": "Chart type. Only 'bar' is built-in.",
|
|
23
18
|
"type": "string",
|
|
@@ -38,11 +33,12 @@
|
|
|
38
33
|
"description": "Aspect ratio",
|
|
39
34
|
"type": "string",
|
|
40
35
|
"enum": [
|
|
36
|
+
"std",
|
|
41
37
|
"wide",
|
|
42
38
|
"square",
|
|
43
39
|
"tall"
|
|
44
40
|
],
|
|
45
|
-
"default": "
|
|
41
|
+
"default": "std"
|
|
46
42
|
},
|
|
47
43
|
"color": {
|
|
48
44
|
"description": "Color scheme",
|
|
@@ -59,6 +55,11 @@
|
|
|
59
55
|
"component": {
|
|
60
56
|
"const": "Chart"
|
|
61
57
|
},
|
|
58
|
+
"heading": {
|
|
59
|
+
"description": "Chart heading text rendered above the canvas.",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"default": ""
|
|
62
|
+
},
|
|
62
63
|
"hideAverage": {
|
|
63
64
|
"description": "When true, suppress the overlaid average line",
|
|
64
65
|
"type": "boolean",
|
|
@@ -75,9 +76,9 @@
|
|
|
75
76
|
"default": false
|
|
76
77
|
},
|
|
77
78
|
"radius": {
|
|
78
|
-
"description": "Bar corner radius",
|
|
79
|
+
"description": "Bar corner radius (null = let CSS tokens decide)",
|
|
79
80
|
"type": "number",
|
|
80
|
-
"default":
|
|
81
|
+
"default": null
|
|
81
82
|
},
|
|
82
83
|
"size": {
|
|
83
84
|
"description": "Chart size",
|
|
@@ -26,8 +26,9 @@ props:
|
|
|
26
26
|
aspect:
|
|
27
27
|
description: Aspect ratio
|
|
28
28
|
type: string
|
|
29
|
-
default:
|
|
29
|
+
default: std
|
|
30
30
|
enum:
|
|
31
|
+
- std
|
|
31
32
|
- wide
|
|
32
33
|
- square
|
|
33
34
|
- tall
|
|
@@ -57,9 +58,9 @@ props:
|
|
|
57
58
|
default: false
|
|
58
59
|
attribute: hide-values
|
|
59
60
|
radius:
|
|
60
|
-
description: Bar corner radius
|
|
61
|
+
description: Bar corner radius (null = let CSS tokens decide)
|
|
61
62
|
type: number
|
|
62
|
-
default:
|
|
63
|
+
default: null
|
|
63
64
|
size:
|
|
64
65
|
description: Chart size
|
|
65
66
|
type: string
|
|
@@ -72,10 +73,11 @@ props:
|
|
|
72
73
|
description: Line smoothing factor
|
|
73
74
|
type: number
|
|
74
75
|
default: 0.4
|
|
75
|
-
|
|
76
|
-
description: Chart
|
|
76
|
+
heading:
|
|
77
|
+
description: Chart heading text rendered above the canvas.
|
|
77
78
|
type: string
|
|
78
79
|
default: ""
|
|
80
|
+
reflect: true
|
|
79
81
|
x:
|
|
80
82
|
description: Data key for x-axis (category) values
|
|
81
83
|
type: string
|
package/components/chat/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdiaElement } from '
|
|
2
|
-
import { renderMarkdown } from '
|
|
1
|
+
import { AdiaElement } from '../../core/element.js';
|
|
2
|
+
import { renderMarkdown } from '../../core/markdown.js';
|
|
3
3
|
|
|
4
4
|
function escapeHTML(s) {
|
|
5
5
|
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/* ── State: checked ── */
|
|
25
25
|
--check-bg-checked: var(--a-primary);
|
|
26
26
|
--check-border-checked: var(--a-primary);
|
|
27
|
-
--check-fg-checked:
|
|
27
|
+
--check-fg-checked: var(--a-chrome-light);
|
|
28
28
|
--check-bg-checked-hover: var(--a-primary-hover);
|
|
29
29
|
|
|
30
30
|
/* ── State: disabled ── */
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Pure CSS checkmark via border trick on [slot="box"]::after. No SVG.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { AdiaFormElement } from '
|
|
7
|
-
import { html } from '
|
|
6
|
+
import { AdiaFormElement } from '../../core/form.js';
|
|
7
|
+
import { html } from '../../core/element.js';
|
|
8
8
|
|
|
9
9
|
class AdiaCheck extends AdiaFormElement {
|
|
10
10
|
static properties = {
|
package/components/code/code.js
CHANGED
|
@@ -13,21 +13,11 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
-
"active": {
|
|
17
|
-
"description": "Marks this column as the active one in a tab-panel layout.",
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"default": false
|
|
20
|
-
},
|
|
21
16
|
"align": {
|
|
22
17
|
"description": "Align items",
|
|
23
18
|
"type": "string",
|
|
24
19
|
"default": "stretch"
|
|
25
20
|
},
|
|
26
|
-
"basis": {
|
|
27
|
-
"description": "Flex basis override (CSS length or keyword like \"auto\"/\"content\").",
|
|
28
|
-
"type": "string",
|
|
29
|
-
"default": ""
|
|
30
|
-
},
|
|
31
21
|
"component": {
|
|
32
22
|
"const": "Column"
|
|
33
23
|
},
|
|
@@ -40,16 +30,6 @@
|
|
|
40
30
|
"description": "Justify content",
|
|
41
31
|
"type": "string",
|
|
42
32
|
"default": "start"
|
|
43
|
-
},
|
|
44
|
-
"span": {
|
|
45
|
-
"description": "Column span — consumed by a parent Grid to make this column wrap multiple grid tracks. Accepts a numeric rung (\"1\"..\"6\") or \"full\".",
|
|
46
|
-
"type": "string",
|
|
47
|
-
"default": ""
|
|
48
|
-
},
|
|
49
|
-
"wrap": {
|
|
50
|
-
"description": "Allow children to wrap onto multiple lines (default is flex nowrap).",
|
|
51
|
-
"type": "boolean",
|
|
52
|
-
"default": false
|
|
53
33
|
}
|
|
54
34
|
},
|
|
55
35
|
"required": [
|
package/components/col/col.js
CHANGED
package/components/col/col.yaml
CHANGED
|
@@ -22,26 +22,6 @@ props:
|
|
|
22
22
|
description: Justify content
|
|
23
23
|
type: string
|
|
24
24
|
default: start
|
|
25
|
-
span:
|
|
26
|
-
description: >-
|
|
27
|
-
Column span — consumed by a parent Grid to make this column wrap multiple
|
|
28
|
-
grid tracks. Accepts a numeric rung ("1".."6") or "full".
|
|
29
|
-
type: string
|
|
30
|
-
default: ""
|
|
31
|
-
wrap:
|
|
32
|
-
description: Allow children to wrap onto multiple lines (default is flex nowrap).
|
|
33
|
-
type: boolean
|
|
34
|
-
default: false
|
|
35
|
-
reflect: true
|
|
36
|
-
basis:
|
|
37
|
-
description: Flex basis override (CSS length or keyword like "auto"/"content").
|
|
38
|
-
type: string
|
|
39
|
-
default: ""
|
|
40
|
-
active:
|
|
41
|
-
description: Marks this column as the active one in a tab-panel layout.
|
|
42
|
-
type: boolean
|
|
43
|
-
default: false
|
|
44
|
-
reflect: true
|
|
45
25
|
events: {}
|
|
46
26
|
slots:
|
|
47
27
|
default:
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Form-associated via AdiaFormElement + ElementInternals.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { AdiaFormElement } from '
|
|
19
|
+
import { AdiaFormElement } from '../../core/form.js';
|
|
20
20
|
|
|
21
21
|
// ── OKLCH ↔ sRGB conversion ──────────────────────────────
|
|
22
22
|
|
|
@@ -426,7 +426,10 @@ class AdiaColorPicker extends AdiaFormElement {
|
|
|
426
426
|
};
|
|
427
427
|
|
|
428
428
|
if (navigator.clipboard?.writeText) {
|
|
429
|
-
navigator.clipboard.writeText(text).then(
|
|
429
|
+
navigator.clipboard.writeText(text).then(
|
|
430
|
+
() => { if (!this.isConnected) return; onDone(true); },
|
|
431
|
+
() => { if (!this.isConnected) return; onDone(false); },
|
|
432
|
+
);
|
|
430
433
|
} else {
|
|
431
434
|
const ta = Object.assign(document.createElement('textarea'), { value: text });
|
|
432
435
|
ta.style.cssText = 'position:fixed;opacity:0';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdiaElement } from '
|
|
1
|
+
import { AdiaElement } from '../../core/element.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* <command-ui> — Searchable command palette.
|
|
@@ -34,6 +34,21 @@ class AdiaCommand extends AdiaElement {
|
|
|
34
34
|
#listEl = null;
|
|
35
35
|
#footerEl = null;
|
|
36
36
|
#bound = false;
|
|
37
|
+
#itemByEl = new WeakMap();
|
|
38
|
+
|
|
39
|
+
#onListClick = (e) => {
|
|
40
|
+
const el = e.target instanceof Element ? e.target.closest('[role="option"]:not([aria-disabled])') : null;
|
|
41
|
+
if (!el) return;
|
|
42
|
+
const item = this.#itemByEl.get(el);
|
|
43
|
+
if (item) this.#select(item);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
#onListPointerOver = (e) => {
|
|
47
|
+
const el = e.target instanceof Element ? e.target.closest('[role="option"]:not([aria-disabled])') : null;
|
|
48
|
+
if (!el) return;
|
|
49
|
+
const idx = parseInt(el.dataset.idx);
|
|
50
|
+
if (Number.isFinite(idx) && idx !== this.#activeIdx) this.#activate(idx);
|
|
51
|
+
};
|
|
37
52
|
|
|
38
53
|
connected() {
|
|
39
54
|
if (!this.#bound) {
|
|
@@ -66,6 +81,9 @@ class AdiaCommand extends AdiaElement {
|
|
|
66
81
|
this.#footerEl = this.querySelector('footer');
|
|
67
82
|
|
|
68
83
|
this.#inputEl.addEventListener('input', this.#onInput);
|
|
84
|
+
// Delegated item handlers — handler identity is stable so teardown is symmetric.
|
|
85
|
+
this.#listEl.addEventListener('click', this.#onListClick);
|
|
86
|
+
this.#listEl.addEventListener('pointerover', this.#onListPointerOver);
|
|
69
87
|
this.#renderItems();
|
|
70
88
|
}
|
|
71
89
|
|
|
@@ -173,16 +191,7 @@ class AdiaCommand extends AdiaElement {
|
|
|
173
191
|
${item.shortcut ? `<span data-shortcut>${item.shortcut}</span>` : ''}
|
|
174
192
|
`;
|
|
175
193
|
|
|
176
|
-
|
|
177
|
-
if (item.disabled) return;
|
|
178
|
-
this.#select(item);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
el.addEventListener('pointerenter', () => {
|
|
182
|
-
if (item.disabled) return;
|
|
183
|
-
this.#activate(idx);
|
|
184
|
-
});
|
|
185
|
-
|
|
194
|
+
this.#itemByEl.set(el, item);
|
|
186
195
|
return el;
|
|
187
196
|
}
|
|
188
197
|
|
|
@@ -273,6 +282,8 @@ class AdiaCommand extends AdiaElement {
|
|
|
273
282
|
disconnected() {
|
|
274
283
|
this.removeEventListener('keydown', this.#onKeydown);
|
|
275
284
|
this.#inputEl?.removeEventListener('input', this.#onInput);
|
|
285
|
+
this.#listEl?.removeEventListener('click', this.#onListClick);
|
|
286
|
+
this.#listEl?.removeEventListener('pointerover', this.#onListPointerOver);
|
|
276
287
|
this.#inputEl = null;
|
|
277
288
|
this.#listEl = null;
|
|
278
289
|
this.#footerEl = null;
|
|
@@ -13,15 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
-
"axis": {
|
|
17
|
-
"description": "Divider orientation.",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"enum": [
|
|
20
|
-
"horizontal",
|
|
21
|
-
"vertical"
|
|
22
|
-
],
|
|
23
|
-
"default": "horizontal"
|
|
24
|
-
},
|
|
25
16
|
"component": {
|
|
26
17
|
"const": "Divider"
|
|
27
18
|
},
|
|
@@ -30,16 +21,6 @@
|
|
|
30
21
|
"type": "string",
|
|
31
22
|
"default": ""
|
|
32
23
|
},
|
|
33
|
-
"orientation": {
|
|
34
|
-
"description": "Alias for `axis` — accepted for back-compat.",
|
|
35
|
-
"type": "string",
|
|
36
|
-
"enum": [
|
|
37
|
-
"",
|
|
38
|
-
"horizontal",
|
|
39
|
-
"vertical"
|
|
40
|
-
],
|
|
41
|
-
"default": ""
|
|
42
|
-
},
|
|
43
24
|
"vertical": {
|
|
44
25
|
"description": "Vertical orientation",
|
|
45
26
|
"type": "boolean",
|
|
@@ -8,18 +8,6 @@ category: display
|
|
|
8
8
|
version: 1
|
|
9
9
|
description: Horizontal or vertical divider with optional label.
|
|
10
10
|
props:
|
|
11
|
-
axis:
|
|
12
|
-
description: Divider orientation.
|
|
13
|
-
type: string
|
|
14
|
-
default: horizontal
|
|
15
|
-
enum:
|
|
16
|
-
- horizontal
|
|
17
|
-
- vertical
|
|
18
|
-
orientation:
|
|
19
|
-
description: Alias for `axis` — accepted for back-compat.
|
|
20
|
-
type: string
|
|
21
|
-
default: ""
|
|
22
|
-
enum: ["", horizontal, vertical]
|
|
23
11
|
label:
|
|
24
12
|
description: Center label text
|
|
25
13
|
type: string
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://adiaui.dev/a2ui/v0_9/components/Drawer.json",
|
|
4
4
|
"title": "Drawer",
|
|
5
|
-
"description": "Slide-out panel anchored to a viewport edge. Uses native <dialog> for focus trap, Escape dismiss, and ::backdrop. Panel is a flex column that scrolls as a whole — the header and footer stick to the top/bottom of the panel when the body overflows. Authors can compose content with either card-
|
|
5
|
+
"description": "Slide-out panel anchored to a viewport edge. Uses native <dialog> for focus trap, Escape dismiss, and ::backdrop. Panel is a flex column that scrolls as a whole — the header and footer stick to the top/bottom of the panel when the body overflows. Authors can compose content with either card-ui-style bare tags (<header>, <section>, <footer>) or explicit [slot=\"header|body|footer\"] attributes; multiple <section> siblings are allowed and stack in author order between the sticky header and footer. The header activates a card-ui-aligned 3-column grid (icon | heading+description | action+close) when any direct [slot=\"icon|heading|description|action\"] child is present.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"allOf": [
|
|
8
8
|
{
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"description": "Optional sticky action row pinned to the bottom of the panel. Only mounted if the author supplies a bare <footer> tag or [slot=\"footer\"]. Inner [slot=\"description\"] + [slot=\"action\"] triggers space-between layout, matching card-ui footer semantics."
|
|
113
113
|
},
|
|
114
114
|
"header": {
|
|
115
|
-
"description": "Title bar — pinned to the top of the panel via position:sticky. Accepts either a bare <header> tag or [slot=\"header\"]. When any direct child has [slot=\"icon|heading|description|action\"], the header activates a card-
|
|
115
|
+
"description": "Title bar — pinned to the top of the panel via position:sticky. Accepts either a bare <header> tag or [slot=\"header\"]. When any direct child has [slot=\"icon|heading|description|action\"], the header activates a card-ui-aligned 3-column grid; otherwise renders as a block with the close button appended."
|
|
116
116
|
},
|
|
117
117
|
"heading": {
|
|
118
118
|
"description": "Direct child of <header> — grid row 1. Also accepts bare <h1>-<h6> tags. Renders as a flex container, so inline badges/metadata sit alongside the title. If the drawer has a [text] attribute and no author-supplied heading, a <span slot=\"heading\" data-stamped> is stamped with the text value."
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
transform: translateY(-100%); opacity: 0;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
/* ═══════ Header — card-
|
|
170
|
+
/* ═══════ Header — card-ui-aligned grid ═══════
|
|
171
171
|
Block by default (fallback for empty/free-form content).
|
|
172
172
|
Grid activates when any slotted child is present. Column template
|
|
173
173
|
adapts to the presence of [slot="icon"] and [slot="action"|"close"]. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Content panel slides in/out with CSS transitions.
|
|
6
6
|
* Exit animation plays before dialog.close() via [data-closing].
|
|
7
7
|
*
|
|
8
|
-
* Authoring — card-
|
|
8
|
+
* Authoring — card-ui-style tags (recommended):
|
|
9
9
|
* <drawer-ui side="right" size="md">
|
|
10
10
|
* <header>Title block</header>
|
|
11
11
|
* <section>Body content</section>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* close — fired after the drawer finishes closing
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
import { AdiaElement } from '
|
|
32
|
+
import { AdiaElement } from '../../core/element.js';
|
|
33
33
|
|
|
34
34
|
class AdiaDrawer extends AdiaElement {
|
|
35
35
|
#bound = false;
|
|
@@ -10,10 +10,10 @@ description: >-
|
|
|
10
10
|
Slide-out panel anchored to a viewport edge. Uses native <dialog> for focus trap,
|
|
11
11
|
Escape dismiss, and ::backdrop. Panel is a flex column that scrolls as a whole — the
|
|
12
12
|
header and footer stick to the top/bottom of the panel when the body overflows.
|
|
13
|
-
Authors can compose content with either card-
|
|
13
|
+
Authors can compose content with either card-ui-style bare tags (<header>, <section>,
|
|
14
14
|
<footer>) or explicit [slot="header|body|footer"] attributes; multiple <section>
|
|
15
15
|
siblings are allowed and stack in author order between the sticky header and footer.
|
|
16
|
-
The header activates a card-
|
|
16
|
+
The header activates a card-ui-aligned 3-column grid (icon | heading+description |
|
|
17
17
|
action+close) when any direct [slot="icon|heading|description|action"] child is
|
|
18
18
|
present.
|
|
19
19
|
props:
|
|
@@ -59,7 +59,7 @@ slots:
|
|
|
59
59
|
description: >-
|
|
60
60
|
Title bar — pinned to the top of the panel via position:sticky. Accepts either
|
|
61
61
|
a bare <header> tag or [slot="header"]. When any direct child has
|
|
62
|
-
[slot="icon|heading|description|action"], the header activates a card-
|
|
62
|
+
[slot="icon|heading|description|action"], the header activates a card-ui-aligned
|
|
63
63
|
3-column grid; otherwise renders as a block with the close button appended.
|
|
64
64
|
body:
|
|
65
65
|
description: >-
|
|
@@ -30,19 +30,6 @@
|
|
|
30
30
|
"description": "Icon name displayed above the heading",
|
|
31
31
|
"type": "string",
|
|
32
32
|
"default": ""
|
|
33
|
-
},
|
|
34
|
-
"variant": {
|
|
35
|
-
"description": "Semantic variant — colors the icon and sets the border tone (default, info, success, warning, danger).",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"enum": [
|
|
38
|
-
"default",
|
|
39
|
-
"info",
|
|
40
|
-
"success",
|
|
41
|
-
"warning",
|
|
42
|
-
"danger",
|
|
43
|
-
"muted"
|
|
44
|
-
],
|
|
45
|
-
"default": "default"
|
|
46
33
|
}
|
|
47
34
|
},
|
|
48
35
|
"required": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Note: Uses 'heading' attribute instead of 'title' to avoid native tooltip.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { AdiaElement } from '
|
|
12
|
+
import { AdiaElement } from '../../core/element.js';
|
|
13
13
|
|
|
14
14
|
class AdiaEmptyState extends AdiaElement {
|
|
15
15
|
static properties = {
|
|
@@ -20,11 +20,6 @@ props:
|
|
|
20
20
|
description: Icon name displayed above the heading
|
|
21
21
|
type: string
|
|
22
22
|
default: ""
|
|
23
|
-
variant:
|
|
24
|
-
description: Semantic variant — colors the icon and sets the border tone (default, info, success, warning, danger).
|
|
25
|
-
type: string
|
|
26
|
-
default: default
|
|
27
|
-
enum: [default, info, success, warning, danger, muted]
|
|
28
23
|
events: {}
|
|
29
24
|
slots:
|
|
30
25
|
action:
|