@shawnjs/a2ui-vue 0.1.0

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.
Files changed (38) hide show
  1. package/README.md +68 -0
  2. package/dist/A2UIAudio-Dk04owGa.cjs +1 -0
  3. package/dist/A2UIAudio-WmrsVVdB.js +33 -0
  4. package/dist/A2UIButton-BMHO6K6u.js +35 -0
  5. package/dist/A2UIButton-DwvJiYmv.cjs +1 -0
  6. package/dist/A2UICard--_T_isvU.cjs +1 -0
  7. package/dist/A2UICard-Cq5q3ZgF.js +34 -0
  8. package/dist/A2UICheckbox-C6okxLrX.js +44 -0
  9. package/dist/A2UICheckbox-CaRtMj7t.cjs +1 -0
  10. package/dist/A2UIDateTimeInput-BdcHcmk1.cjs +1 -0
  11. package/dist/A2UIDateTimeInput-BwL6Ejy1.js +60 -0
  12. package/dist/A2UIDivider-BB5LjXlM.js +22 -0
  13. package/dist/A2UIDivider-BGrs9_ef.cjs +1 -0
  14. package/dist/A2UIIcon-Bcd0cbht.cjs +1 -0
  15. package/dist/A2UIIcon-C45CAVyd.js +32 -0
  16. package/dist/A2UIImage-BSUuRZUD.cjs +1 -0
  17. package/dist/A2UIImage-DFu1Sj-k.js +43 -0
  18. package/dist/A2UIList-BqdYBWRw.cjs +1 -0
  19. package/dist/A2UIList-CHIcUerI.js +36 -0
  20. package/dist/A2UIModal-BF1VvRqK.js +59 -0
  21. package/dist/A2UIModal-DrlSVixf.cjs +1 -0
  22. package/dist/A2UIMultipleChoice-BgozRN_k.cjs +1 -0
  23. package/dist/A2UIMultipleChoice-D0L-7Jol.js +52 -0
  24. package/dist/A2UISlider--Vdoo1SX.cjs +1 -0
  25. package/dist/A2UISlider-PkQlrUwf.js +55 -0
  26. package/dist/A2UITabs-BOBp5yGv.cjs +1 -0
  27. package/dist/A2UITabs-CfJUet-J.js +47 -0
  28. package/dist/A2UITextField-78jRsRX-.js +47 -0
  29. package/dist/A2UITextField-Ba85Y1ag.cjs +1 -0
  30. package/dist/A2UIVideo-BBH-3hgb.js +32 -0
  31. package/dist/A2UIVideo-BlJlTrZ9.cjs +1 -0
  32. package/dist/a2ui-vue.css +1 -0
  33. package/dist/index-BOrHKsf8.cjs +435 -0
  34. package/dist/index-BpE-uBH2.js +8060 -0
  35. package/dist/index.d.ts +104 -0
  36. package/dist/index.js +1 -0
  37. package/dist/index.mjs +12 -0
  38. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # @a2ui/vue
2
+
3
+ A Vue 3 renderer for A2UI (Agent-to-UI) protocol.
4
+
5
+ ## Usage
6
+
7
+ ```vue
8
+ <script setup lang="ts">
9
+ import { A2UISurface, useMessageProcessor, provideA2UI, DEFAULT_CATALOG, defaultTheme } from '@a2ui/vue';
10
+ import '@a2ui/vue/dist/vue.css';
11
+ // Provide A2UI configuration
12
+ provideA2UI({
13
+ catalog: DEFAULT_CATALOG,
14
+ theme: defaultTheme,
15
+ });
16
+
17
+ const processor = useMessageProcessor();
18
+
19
+ // Process messages from your agent
20
+ processor.processMessages(messages);
21
+
22
+ // Get surfaces to render
23
+ const surfaces = processor.getSurfaces();
24
+ </script>
25
+
26
+ <template>
27
+ <A2UISurface
28
+ v-for="[surfaceId, surface] in surfaces"
29
+ :key="surfaceId"
30
+ :surface-id="surfaceId"
31
+ :surface="surface"
32
+ />
33
+ </template>
34
+ ```
35
+
36
+ ## Components
37
+
38
+ The library provides the following components:
39
+
40
+ - `A2UISurface` - The main surface component
41
+ - `A2UIRenderer` - Dynamic component renderer
42
+ - Layout: `A2UIRow`, `A2UIColumn`, `A2UICard`, `A2UIList`
43
+ - Content: `A2UIText`, `A2UIImage`, `A2UIIcon`, `A2UIVideo`, `A2UIAudio`
44
+ - Input: `A2UIButton`, `A2UITextField`, `A2UICheckbox`, `A2UISlider`, `A2UIMultipleChoice`, `A2UIDateTimeInput`
45
+ - Navigation: `A2UITabs`, `A2UIModal`
46
+ - Utility: `A2UIDivider`
47
+
48
+ ## Development & Examples
49
+
50
+ To view interactive examples of all components:
51
+
52
+ ```bash
53
+ # Install dependencies
54
+ npm install
55
+
56
+ # Start development server with examples
57
+ npm run dev
58
+
59
+ ```
60
+
61
+ The examples will be available at http://localhost:5173
62
+
63
+ ### Building
64
+
65
+ ```bash
66
+ # Build the library
67
+ npm run build
68
+ ```
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BOrHKsf8.cjs"),u=["src"],a=e.defineComponent({__name:"A2UIAudio",props:{surfaceId:{},component:{},weight:{},url:{}},setup(r){e.useCssVars(l=>({cec1fb52:o.weight}));const o=r,{theme:t,resolvePrimitive:s}=c.useDynamicComponent(o),n=e.computed(()=>s(o.url));return(l,d)=>(e.openBlock(),e.createElementBlock("a2ui-audio",null,[n.value?(e.openBlock(),e.createElementBlock("section",{key:0,class:e.normalizeClass(e.unref(t).components.AudioPlayer),style:e.normalizeStyle(e.unref(t).additionalStyles?.AudioPlayer)},[e.createElementVNode("audio",{is:"audio",controls:"",src:n.value},null,8,u)],6)):e.createCommentVNode("",!0)]))}}),i=c._export_sfc(a,[["__scopeId","data-v-829d1205"]]);exports.default=i;
@@ -0,0 +1,33 @@
1
+ import { defineComponent as i, useCssVars as u, computed as d, openBlock as s, createElementBlock as n, normalizeStyle as m, unref as r, normalizeClass as p, createElementVNode as _, createCommentVNode as f } from "vue";
2
+ import { u as y, a as v } from "./index-BpE-uBH2.js";
3
+ const A = ["src"], h = /* @__PURE__ */ i({
4
+ __name: "A2UIAudio",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ url: {}
10
+ },
11
+ setup(a) {
12
+ u((l) => ({
13
+ cec1fb52: e.weight
14
+ }));
15
+ const e = a, { theme: o, resolvePrimitive: c } = y(e), t = d(() => c(e.url));
16
+ return (l, C) => (s(), n("a2ui-audio", null, [
17
+ t.value ? (s(), n("section", {
18
+ key: 0,
19
+ class: p(r(o).components.AudioPlayer),
20
+ style: m(r(o).additionalStyles?.AudioPlayer)
21
+ }, [
22
+ _("audio", {
23
+ is: "audio",
24
+ controls: "",
25
+ src: t.value
26
+ }, null, 8, A)
27
+ ], 6)) : f("", !0)
28
+ ]));
29
+ }
30
+ }), k = /* @__PURE__ */ v(h, [["__scopeId", "data-v-829d1205"]]);
31
+ export {
32
+ k as default
33
+ };
@@ -0,0 +1,35 @@
1
+ import { defineComponent as i, useCssVars as r, openBlock as u, createElementBlock as l, createElementVNode as m, normalizeStyle as d, unref as c, normalizeClass as p, createVNode as f } from "vue";
2
+ import { u as _, _ as h, a as B } from "./index-BpE-uBH2.js";
3
+ const C = /* @__PURE__ */ i({
4
+ __name: "A2UIButton",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ action: {}
10
+ },
11
+ setup(e) {
12
+ r((o) => ({
13
+ v57ca72c8: o.weight
14
+ }));
15
+ const t = e, { theme: n, sendAction: a } = _(t);
16
+ function s() {
17
+ t.action && a(t.action);
18
+ }
19
+ return (o, I) => (u(), l("a2ui-button", null, [
20
+ m("button", {
21
+ class: p(c(n).components.Button),
22
+ style: d(c(n).additionalStyles?.Button),
23
+ onClick: s
24
+ }, [
25
+ f(h, {
26
+ "surface-id": e.surfaceId,
27
+ component: e.component.properties.child
28
+ }, null, 8, ["surface-id", "component"])
29
+ ], 6)
30
+ ]));
31
+ }
32
+ }), x = /* @__PURE__ */ B(C, [["__scopeId", "data-v-ac5ef68d"]]);
33
+ export {
34
+ x as default
35
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BOrHKsf8.cjs"),u=e.defineComponent({__name:"A2UIButton",props:{surfaceId:{},component:{},weight:{},action:{}},setup(t){e.useCssVars(a=>({v57ca72c8:a.weight}));const n=t,{theme:c,sendAction:s}=o.useDynamicComponent(n);function i(){n.action&&s(n.action)}return(a,l)=>(e.openBlock(),e.createElementBlock("a2ui-button",null,[e.createElementVNode("button",{class:e.normalizeClass(e.unref(c).components.Button),style:e.normalizeStyle(e.unref(c).additionalStyles?.Button),onClick:i},[e.createVNode(o._sfc_main,{"surface-id":t.surfaceId,component:t.component.properties.child},null,8,["surface-id","component"])],6)]))}}),r=o._export_sfc(u,[["__scopeId","data-v-ac5ef68d"]]);exports.default=r;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BOrHKsf8.cjs"),u=e.defineComponent({__name:"A2UICard",props:{surfaceId:{},component:{},weight:{}},setup(c){e.useCssVars(n=>({v98a62c34:t.weight}));const t=c,{theme:s}=r.useDynamicComponent(t),a=e.computed(()=>{const n=t.component.properties;return n.children||[n.child]});return(n,d)=>(e.openBlock(),e.createElementBlock("a2ui-card",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(s).components.Card),style:e.normalizeStyle(e.unref(s).additionalStyles?.Card)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(o,l)=>(e.openBlock(),e.createBlock(r._sfc_main,{key:o.id||o.type+"-"+l,"surface-id":c.surfaceId,component:o},null,8,["surface-id","component"]))),128))],6)]))}}),i=r._export_sfc(u,[["__scopeId","data-v-f7d01a5b"]]);exports.default=i;
@@ -0,0 +1,34 @@
1
+ import { defineComponent as p, useCssVars as d, computed as i, openBlock as r, createElementBlock as c, createElementVNode as u, normalizeStyle as f, unref as s, normalizeClass as _, Fragment as C, renderList as y, createBlock as h } from "vue";
2
+ import { u as I, _ as k, a as x } from "./index-BpE-uBH2.js";
3
+ const g = /* @__PURE__ */ p({
4
+ __name: "A2UICard",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {}
9
+ },
10
+ setup(o) {
11
+ d((e) => ({
12
+ v98a62c34: t.weight
13
+ }));
14
+ const t = o, { theme: a } = I(t), l = i(() => {
15
+ const e = t.component.properties;
16
+ return e.children || [e.child];
17
+ });
18
+ return (e, v) => (r(), c("a2ui-card", null, [
19
+ u("section", {
20
+ class: _(s(a).components.Card),
21
+ style: f(s(a).additionalStyles?.Card)
22
+ }, [
23
+ (r(!0), c(C, null, y(l.value, (n, m) => (r(), h(k, {
24
+ key: n.id || n.type + "-" + m,
25
+ "surface-id": o.surfaceId,
26
+ component: n
27
+ }, null, 8, ["surface-id", "component"]))), 128))
28
+ ], 6)
29
+ ]));
30
+ }
31
+ }), z = /* @__PURE__ */ x(g, [["__scopeId", "data-v-f7d01a5b"]]);
32
+ export {
33
+ z as default
34
+ };
@@ -0,0 +1,44 @@
1
+ import { defineComponent as k, useCssVars as _, computed as r, openBlock as x, createElementBlock as C, createElementVNode as a, normalizeStyle as b, unref as t, normalizeClass as s, toDisplayString as v } from "vue";
2
+ import { u as g, a as I } from "./index-BpE-uBH2.js";
3
+ const y = ["id", "checked"], B = ["for"], D = /* @__PURE__ */ k({
4
+ __name: "A2UICheckbox",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ value: {},
10
+ label: {}
11
+ },
12
+ setup(p) {
13
+ _((c) => ({
14
+ v475d4c56: e.weight
15
+ }));
16
+ const e = p, { theme: o, resolvePrimitive: l, getUniqueId: u, setData: h } = g(e), m = r(() => l(e.value) ?? !1), d = r(() => l(e.label)), i = u("a2ui-checkbox");
17
+ function f(c) {
18
+ const n = e.value?.path;
19
+ !(c.target instanceof HTMLInputElement) || !n || h(e.component, n, c.target.checked, e.surfaceId);
20
+ }
21
+ return (c, n) => (x(), C("a2ui-checkbox", null, [
22
+ a("section", {
23
+ class: s(t(o).components.CheckBox.container),
24
+ style: b(t(o).additionalStyles?.CheckBox)
25
+ }, [
26
+ a("input", {
27
+ autocomplete: "off",
28
+ type: "checkbox",
29
+ id: t(i),
30
+ checked: m.value,
31
+ class: s(t(o).components.CheckBox.element),
32
+ onChange: f
33
+ }, null, 42, y),
34
+ a("label", {
35
+ for: t(i),
36
+ class: s(t(o).components.CheckBox.label)
37
+ }, v(d.value), 11, B)
38
+ ], 6)
39
+ ]));
40
+ }
41
+ }), U = /* @__PURE__ */ I(D, [["__scopeId", "data-v-295ec633"]]);
42
+ export {
43
+ U as default
44
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-BOrHKsf8.cjs"),h=["id","checked"],f=["for"],k=e.defineComponent({__name:"A2UICheckbox",props:{surfaceId:{},component:{},weight:{},value:{},label:{}},setup(r){e.useCssVars(o=>({v475d4c56:t.weight}));const t=r,{theme:n,resolvePrimitive:a,getUniqueId:u,setData:i}=l.useDynamicComponent(t),d=e.computed(()=>a(t.value)??!1),p=e.computed(()=>a(t.label)),s=u("a2ui-checkbox");function m(o){const c=t.value?.path;!(o.target instanceof HTMLInputElement)||!c||i(t.component,c,o.target.checked,t.surfaceId)}return(o,c)=>(e.openBlock(),e.createElementBlock("a2ui-checkbox",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(n).components.CheckBox.container),style:e.normalizeStyle(e.unref(n).additionalStyles?.CheckBox)},[e.createElementVNode("input",{autocomplete:"off",type:"checkbox",id:e.unref(s),checked:d.value,class:e.normalizeClass(e.unref(n).components.CheckBox.element),onChange:m},null,42,h),e.createElementVNode("label",{for:e.unref(s),class:e.normalizeClass(e.unref(n).components.CheckBox.label)},e.toDisplayString(p.value),11,f)],6)]))}}),C=l._export_sfc(k,[["__scopeId","data-v-295ec633"]]);exports.default=C;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("./index-BOrHKsf8.cjs"),b=["for"],h=["type","id","value"],$=e.defineComponent({__name:"A2UIDateTimeInput",props:{surfaceId:{},component:{},weight:{},value:{},enableDate:{type:Boolean},enableTime:{type:Boolean}},setup(v){e.useCssVars(t=>({v6c13f311:a.weight}));const a=v,{theme:r,resolvePrimitive:y,getUniqueId:D,setData:I}=f.useDynamicComponent(a),i=D("a2ui-datetime-input"),s=e.computed(()=>{const t=a.enableDate,n=a.enableTime;return t&&n?"datetime-local":t?"date":n?"time":"datetime-local"}),T=e.computed(()=>{const t=s.value;return t==="date"?"Date":t==="time"?"Time":"Date & Time"}),g=e.computed(()=>{const t=s.value,n=y(a.value)||"",o=n?new Date(n):null;if(!o||isNaN(o.getTime()))return"";const l=u(o.getFullYear()),c=u(o.getMonth()+1),m=u(o.getDate()),p=u(o.getHours()),d=u(o.getMinutes());return t==="date"?`${l}-${c}-${m}`:t==="time"?`${p}:${d}`:`${l}-${c}-${m}T${p}:${d}`});function u(t){return t.toString().padStart(2,"0")}function _(t){const n=a.value?.path;!(t.target instanceof HTMLInputElement)||!n||I(a.component,n,t.target.value,a.surfaceId)}return(t,n)=>(e.openBlock(),e.createElementBlock("a2ui-datetime-input",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(r).components.DateTimeInput.container)},[e.createElementVNode("label",{for:e.unref(i),class:e.normalizeClass(e.unref(r).components.DateTimeInput.label)},e.toDisplayString(T.value),11,b),e.createElementVNode("input",{autocomplete:"off",type:s.value,id:e.unref(i),class:e.normalizeClass(e.unref(r).components.DateTimeInput.element),style:e.normalizeStyle(e.unref(r).additionalStyles?.DateTimeInput),value:g.value,onInput:_},null,46,h)],2)]))}}),S=f._export_sfc($,[["__scopeId","data-v-7d80ddaa"]]);exports.default=S;
@@ -0,0 +1,60 @@
1
+ import { defineComponent as $, useCssVars as S, computed as l, openBlock as x, createElementBlock as B, createElementVNode as r, normalizeClass as c, unref as o, toDisplayString as C, normalizeStyle as N } from "vue";
2
+ import { u as w, a as E } from "./index-BpE-uBH2.js";
3
+ const M = ["for"], U = ["type", "id", "value"], V = /* @__PURE__ */ $({
4
+ __name: "A2UIDateTimeInput",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ value: {},
10
+ enableDate: { type: Boolean },
11
+ enableTime: { type: Boolean }
12
+ },
13
+ setup(T) {
14
+ S((e) => ({
15
+ v6c13f311: n.weight
16
+ }));
17
+ const n = T, { theme: i, resolvePrimitive: _, getUniqueId: v, setData: y } = w(n), p = v("a2ui-datetime-input"), u = l(() => {
18
+ const e = n.enableDate, t = n.enableTime;
19
+ return e && t ? "datetime-local" : e ? "date" : t ? "time" : "datetime-local";
20
+ }), g = l(() => {
21
+ const e = u.value;
22
+ return e === "date" ? "Date" : e === "time" ? "Time" : "Date & Time";
23
+ }), h = l(() => {
24
+ const e = u.value, t = _(n.value) || "", a = t ? new Date(t) : null;
25
+ if (!a || isNaN(a.getTime()))
26
+ return "";
27
+ const m = s(a.getFullYear()), d = s(a.getMonth() + 1), f = s(a.getDate()), D = s(a.getHours()), I = s(a.getMinutes());
28
+ return e === "date" ? `${m}-${d}-${f}` : e === "time" ? `${D}:${I}` : `${m}-${d}-${f}T${D}:${I}`;
29
+ });
30
+ function s(e) {
31
+ return e.toString().padStart(2, "0");
32
+ }
33
+ function b(e) {
34
+ const t = n.value?.path;
35
+ !(e.target instanceof HTMLInputElement) || !t || y(n.component, t, e.target.value, n.surfaceId);
36
+ }
37
+ return (e, t) => (x(), B("a2ui-datetime-input", null, [
38
+ r("section", {
39
+ class: c(o(i).components.DateTimeInput.container)
40
+ }, [
41
+ r("label", {
42
+ for: o(p),
43
+ class: c(o(i).components.DateTimeInput.label)
44
+ }, C(g.value), 11, M),
45
+ r("input", {
46
+ autocomplete: "off",
47
+ type: u.value,
48
+ id: o(p),
49
+ class: c(o(i).components.DateTimeInput.element),
50
+ style: N(o(i).additionalStyles?.DateTimeInput),
51
+ value: h.value,
52
+ onInput: b
53
+ }, null, 46, U)
54
+ ], 2)
55
+ ]));
56
+ }
57
+ }), A = /* @__PURE__ */ E(V, [["__scopeId", "data-v-7d80ddaa"]]);
58
+ export {
59
+ A as default
60
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as r, openBlock as s, createElementBlock as a, createElementVNode as i, normalizeStyle as c, unref as o, normalizeClass as l } from "vue";
2
+ import { u as m, a as d } from "./index-BpE-uBH2.js";
3
+ const p = /* @__PURE__ */ r({
4
+ __name: "A2UIDivider",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {}
9
+ },
10
+ setup(t) {
11
+ const n = t, { theme: e } = m(n);
12
+ return (u, _) => (s(), a("a2ui-divider", null, [
13
+ i("hr", {
14
+ class: l(o(e).components.Divider),
15
+ style: c(o(e).additionalStyles?.Divider)
16
+ }, null, 6)
17
+ ]));
18
+ }
19
+ }), D = /* @__PURE__ */ d(p, [["__scopeId", "data-v-d7e7f57c"]]);
20
+ export {
21
+ D as default
22
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("./index-BOrHKsf8.cjs"),i=e.defineComponent({__name:"A2UIDivider",props:{surfaceId:{},component:{},weight:{}},setup(o){const r=o,{theme:n}=t.useDynamicComponent(r);return(s,l)=>(e.openBlock(),e.createElementBlock("a2ui-divider",null,[e.createElementVNode("hr",{class:e.normalizeClass(e.unref(n).components.Divider),style:e.normalizeStyle(e.unref(n).additionalStyles?.Divider)},null,6)]))}}),c=t._export_sfc(i,[["__scopeId","data-v-d7e7f57c"]]);exports.default=c;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BOrHKsf8.cjs"),i={"aria-hidden":"true",tabindex:"-1"},l={class:"g-icon"},m=e.defineComponent({__name:"A2UIIcon",props:{surfaceId:{},component:{},weight:{},name:{}},setup(s){e.useCssVars(r=>({v6ac4842f:t.weight}));const t=s,{theme:n,resolvePrimitive:a}=c.useDynamicComponent(t),o=e.computed(()=>a(t.name));return(r,d)=>(e.openBlock(),e.createElementBlock("a2ui-icon",i,[o.value?(e.openBlock(),e.createElementBlock("section",{key:0,class:e.normalizeClass(e.unref(n).components.Icon),style:e.normalizeStyle(e.unref(n).additionalStyles?.Icon)},[e.createElementVNode("span",l,e.toDisplayString(o.value),1)],6)):e.createCommentVNode("",!0)]))}}),u=c._export_sfc(m,[["__scopeId","data-v-b7e12202"]]);exports.default=u;
@@ -0,0 +1,32 @@
1
+ import { defineComponent as m, useCssVars as l, computed as p, openBlock as n, createElementBlock as s, normalizeStyle as d, unref as a, normalizeClass as u, createElementVNode as _, toDisplayString as f, createCommentVNode as I } from "vue";
2
+ import { u as h, a as v } from "./index-BpE-uBH2.js";
3
+ const y = {
4
+ "aria-hidden": "true",
5
+ tabindex: "-1"
6
+ }, x = { class: "g-icon" }, C = /* @__PURE__ */ m({
7
+ __name: "A2UIIcon",
8
+ props: {
9
+ surfaceId: {},
10
+ component: {},
11
+ weight: {},
12
+ name: {}
13
+ },
14
+ setup(c) {
15
+ l((i) => ({
16
+ v6ac4842f: e.weight
17
+ }));
18
+ const e = c, { theme: o, resolvePrimitive: r } = h(e), t = p(() => r(e.name));
19
+ return (i, g) => (n(), s("a2ui-icon", y, [
20
+ t.value ? (n(), s("section", {
21
+ key: 0,
22
+ class: u(a(o).components.Icon),
23
+ style: d(a(o).additionalStyles?.Icon)
24
+ }, [
25
+ _("span", x, f(t.value), 1)
26
+ ], 6)) : I("", !0)
27
+ ]));
28
+ }
29
+ }), S = /* @__PURE__ */ v(C, [["__scopeId", "data-v-b7e12202"]]);
30
+ export {
31
+ S as default
32
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BOrHKsf8.cjs"),m=["src","alt"],i=e.defineComponent({__name:"A2UIImage",props:{surfaceId:{},component:{},weight:{},url:{},altText:{},usageHint:{}},setup(l){e.useCssVars(t=>({v2c130bb2:o.weight}));const o=l,{theme:n,resolvePrimitive:a}=s.useDynamicComponent(o),c=e.computed(()=>a(o.url)),r=e.computed(()=>{const t=o.altText;return t?a(t):""}),u=e.computed(()=>{const t=o.usageHint;return s.merge(n.components.Image.all,t?n.components.Image[t]:{})});return(t,p)=>(e.openBlock(),e.createElementBlock("a2ui-image",null,[c.value?(e.openBlock(),e.createElementBlock("section",{key:0,class:e.normalizeClass(u.value),style:e.normalizeStyle(e.unref(n).additionalStyles?.Image)},[e.createElementVNode("img",{src:c.value,alt:r.value??""},null,8,m)],6)):e.createCommentVNode("",!0)]))}}),d=s._export_sfc(i,[["__scopeId","data-v-a9a59223"]]);exports.default=d;
@@ -0,0 +1,43 @@
1
+ import { defineComponent as i, useCssVars as p, computed as a, openBlock as r, createElementBlock as l, normalizeStyle as d, unref as g, normalizeClass as _, createElementVNode as v, createCommentVNode as I } from "vue";
2
+ import { u as f, m as x, a as h } from "./index-BpE-uBH2.js";
3
+ const y = ["src", "alt"], C = /* @__PURE__ */ i({
4
+ __name: "A2UIImage",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ url: {},
10
+ altText: {},
11
+ usageHint: {}
12
+ },
13
+ setup(c) {
14
+ p((e) => ({
15
+ v2c130bb2: t.weight
16
+ }));
17
+ const t = c, { theme: s, resolvePrimitive: o } = f(t), n = a(() => o(t.url)), m = a(() => {
18
+ const e = t.altText;
19
+ return e ? o(e) : "";
20
+ }), u = a(() => {
21
+ const e = t.usageHint;
22
+ return x(
23
+ s.components.Image.all,
24
+ e ? s.components.Image[e] : {}
25
+ );
26
+ });
27
+ return (e, k) => (r(), l("a2ui-image", null, [
28
+ n.value ? (r(), l("section", {
29
+ key: 0,
30
+ class: _(u.value),
31
+ style: d(g(s).additionalStyles?.Image)
32
+ }, [
33
+ v("img", {
34
+ src: n.value,
35
+ alt: m.value ?? ""
36
+ }, null, 8, y)
37
+ ], 6)) : I("", !0)
38
+ ]));
39
+ }
40
+ }), H = /* @__PURE__ */ h(C, [["__scopeId", "data-v-a9a59223"]]);
41
+ export {
42
+ H as default
43
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BOrHKsf8.cjs"),a=["data-direction"],l={class:"a2ui-list-item"},d=e.defineComponent({__name:"A2UIList",props:{surfaceId:{},component:{},weight:{},direction:{}},setup(t){e.useCssVars(s=>({c5f7ed34:o.weight}));const o=t,{theme:c}=n.useDynamicComponent(o);return(s,m)=>(e.openBlock(),e.createElementBlock("a2ui-list",{"data-direction":t.direction??"vertical"},[e.createElementVNode("section",{class:e.normalizeClass(e.unref(c).components.List),style:e.normalizeStyle(e.unref(c).additionalStyles?.List)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.component.properties.children,(i,r)=>(e.openBlock(),e.createElementBlock("div",l,[(e.openBlock(),e.createBlock(n._sfc_main,{key:i.id||r,"surface-id":t.surfaceId,component:i},null,8,["surface-id","component"]))]))),256))],6)],8,a))}}),u=n._export_sfc(d,[["__scopeId","data-v-e51293b1"]]);exports.default=u;
@@ -0,0 +1,36 @@
1
+ import { defineComponent as d, useCssVars as l, openBlock as t, createElementBlock as n, createElementVNode as m, normalizeStyle as u, unref as i, normalizeClass as p, Fragment as f, renderList as _, createBlock as h } from "vue";
2
+ import { u as y, _ as I, a as L } from "./index-BpE-uBH2.js";
3
+ const k = ["data-direction"], x = { class: "a2ui-list-item" }, C = /* @__PURE__ */ d({
4
+ __name: "A2UIList",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ direction: {}
10
+ },
11
+ setup(e) {
12
+ l((a) => ({
13
+ c5f7ed34: s.weight
14
+ }));
15
+ const s = e, { theme: o } = y(s);
16
+ return (a, g) => (t(), n("a2ui-list", {
17
+ "data-direction": e.direction ?? "vertical"
18
+ }, [
19
+ m("section", {
20
+ class: p(i(o).components.List),
21
+ style: u(i(o).additionalStyles?.List)
22
+ }, [
23
+ (t(!0), n(f, null, _(e.component.properties.children, (c, r) => (t(), n("div", x, [
24
+ (t(), h(I, {
25
+ key: c.id || r,
26
+ "surface-id": e.surfaceId,
27
+ component: c
28
+ }, null, 8, ["surface-id", "component"]))
29
+ ]))), 256))
30
+ ], 6)
31
+ ], 8, k));
32
+ }
33
+ }), w = /* @__PURE__ */ L(C, [["__scopeId", "data-v-e51293b1"]]);
34
+ export {
35
+ w as default
36
+ };
@@ -0,0 +1,59 @@
1
+ import { defineComponent as C, ref as r, watch as v, nextTick as y, openBlock as d, createElementBlock as u, Fragment as M, normalizeClass as m, unref as s, createElementVNode as e, normalizeStyle as I, createVNode as f, createCommentVNode as h } from "vue";
2
+ import { u as w, _ as p, a as D } from "./index-BpE-uBH2.js";
3
+ const x = /* @__PURE__ */ C({
4
+ __name: "A2UIModal",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {}
9
+ },
10
+ setup(o) {
11
+ const g = o, { theme: c } = w(g), n = r(!1), t = r(null);
12
+ v(n, async (a) => {
13
+ a && (await y(), t.value?.showModal());
14
+ });
15
+ function k(a) {
16
+ a.target instanceof HTMLDialogElement && i();
17
+ }
18
+ function i() {
19
+ t.value?.open && t.value.close(), n.value = !1;
20
+ }
21
+ return (a, l) => (d(), u(M, null, [
22
+ n.value ? (d(), u("dialog", {
23
+ key: 0,
24
+ ref_key: "dialogRef",
25
+ ref: t,
26
+ class: m(s(c).components.Modal.backdrop),
27
+ onClick: k
28
+ }, [
29
+ e("section", {
30
+ class: m(s(c).components.Modal.element),
31
+ style: I(s(c).additionalStyles?.Modal)
32
+ }, [
33
+ e("div", { class: "controls" }, [
34
+ e("button", { onClick: i }, [...l[1] || (l[1] = [
35
+ e("span", { class: "g-icon" }, "close", -1)
36
+ ])])
37
+ ]),
38
+ f(p, {
39
+ "surface-id": o.surfaceId,
40
+ component: o.component.properties.contentChild
41
+ }, null, 8, ["surface-id", "component"])
42
+ ], 6)
43
+ ], 2)) : h("", !0),
44
+ e("a2ui-modal", null, [
45
+ e("section", {
46
+ onClick: l[0] || (l[0] = (E) => n.value = !0)
47
+ }, [
48
+ f(p, {
49
+ "surface-id": o.surfaceId,
50
+ component: o.component.properties.entryPointChild
51
+ }, null, 8, ["surface-id", "component"])
52
+ ])
53
+ ])
54
+ ], 64));
55
+ }
56
+ }), b = /* @__PURE__ */ D(x, [["__scopeId", "data-v-8d9f325d"]]);
57
+ export {
58
+ b as default
59
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BOrHKsf8.cjs"),u=e.defineComponent({__name:"A2UIModal",props:{surfaceId:{},component:{},weight:{}},setup(n){const r=n,{theme:s}=c.useDynamicComponent(r),o=e.ref(!1),t=e.ref(null);e.watch(o,async l=>{l&&(await e.nextTick(),t.value?.showModal())});function d(l){l.target instanceof HTMLDialogElement&&i()}function i(){t.value?.open&&t.value.close(),o.value=!1}return(l,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createElementBlock("dialog",{key:0,ref_key:"dialogRef",ref:t,class:e.normalizeClass(e.unref(s).components.Modal.backdrop),onClick:d},[e.createElementVNode("section",{class:e.normalizeClass(e.unref(s).components.Modal.element),style:e.normalizeStyle(e.unref(s).additionalStyles?.Modal)},[e.createElementVNode("div",{class:"controls"},[e.createElementVNode("button",{onClick:i},[...a[1]||(a[1]=[e.createElementVNode("span",{class:"g-icon"},"close",-1)])])]),e.createVNode(c._sfc_main,{"surface-id":n.surfaceId,component:n.component.properties.contentChild},null,8,["surface-id","component"])],6)],2)):e.createCommentVNode("",!0),e.createElementVNode("a2ui-modal",null,[e.createElementVNode("section",{onClick:a[0]||(a[0]=f=>o.value=!0)},[e.createVNode(c._sfc_main,{"surface-id":n.surfaceId,component:n.component.properties.entryPointChild},null,8,["surface-id","component"])])])],64))}}),m=c._export_sfc(u,[["__scopeId","data-v-8d9f325d"]]);exports.default=m;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BOrHKsf8.cjs"),h=["for"],f=["id","value"],v=["value"],C=e.defineComponent({__name:"A2UIMultipleChoice",props:{surfaceId:{},component:{},weight:{},options:{},value:{},description:{}},setup(l){e.useCssVars(n=>({f0bbd890:t.weight}));const t=l,{theme:o,resolvePrimitive:s,getUniqueId:p,processor:i}=u.useDynamicComponent(t),r=p("a2ui-multiple-choice"),m=e.computed(()=>s(t.value));function d(n){const c=t.value?.path;!(n.target instanceof HTMLSelectElement)||!n.target.value||!c||i.setData(t.component,i.resolvePath(c,t.component.dataContextPath),n.target.value)}return(n,c)=>(e.openBlock(),e.createElementBlock("a2ui-multiple-choice",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(o).components.MultipleChoice.container)},[e.createElementVNode("label",{class:e.normalizeClass(e.unref(o).components.MultipleChoice.label),for:e.unref(r)},e.toDisplayString(l.description),11,h),e.createElementVNode("select",{onChange:d,id:e.unref(r),value:m.value,class:e.normalizeClass(e.unref(o).components.MultipleChoice.element),style:e.normalizeStyle(e.unref(o).additionalStyles?.MultipleChoice)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,a=>(e.openBlock(),e.createElementBlock("option",{key:a.value,value:a.value},e.toDisplayString(e.unref(s)(a.label)),9,v))),128))],46,f)],2)]))}}),g=u._export_sfc(C,[["__scopeId","data-v-87d123dc"]]);exports.default=g;
@@ -0,0 +1,52 @@
1
+ import { defineComponent as _, useCssVars as g, computed as M, openBlock as s, createElementBlock as i, createElementVNode as u, normalizeClass as r, unref as e, toDisplayString as h, normalizeStyle as y, Fragment as I, renderList as b } from "vue";
2
+ import { u as x, a as S } from "./index-BpE-uBH2.js";
3
+ const k = ["for"], D = ["id", "value"], E = ["value"], P = /* @__PURE__ */ _({
4
+ __name: "A2UIMultipleChoice",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ options: {},
10
+ value: {},
11
+ description: {}
12
+ },
13
+ setup(n) {
14
+ g((o) => ({
15
+ f0bbd890: t.weight
16
+ }));
17
+ const t = n, { theme: l, resolvePrimitive: p, getUniqueId: f, processor: m } = x(t), d = f("a2ui-multiple-choice"), v = M(() => p(t.value));
18
+ function C(o) {
19
+ const a = t.value?.path;
20
+ !(o.target instanceof HTMLSelectElement) || !o.target.value || !a || m.setData(
21
+ t.component,
22
+ m.resolvePath(a, t.component.dataContextPath),
23
+ o.target.value
24
+ );
25
+ }
26
+ return (o, a) => (s(), i("a2ui-multiple-choice", null, [
27
+ u("section", {
28
+ class: r(e(l).components.MultipleChoice.container)
29
+ }, [
30
+ u("label", {
31
+ class: r(e(l).components.MultipleChoice.label),
32
+ for: e(d)
33
+ }, h(n.description), 11, k),
34
+ u("select", {
35
+ onChange: C,
36
+ id: e(d),
37
+ value: v.value,
38
+ class: r(e(l).components.MultipleChoice.element),
39
+ style: y(e(l).additionalStyles?.MultipleChoice)
40
+ }, [
41
+ (s(!0), i(I, null, b(n.options, (c) => (s(), i("option", {
42
+ key: c.value,
43
+ value: c.value
44
+ }, h(e(p)(c.label)), 9, E))), 128))
45
+ ], 46, D)
46
+ ], 2)
47
+ ]));
48
+ }
49
+ }), w = /* @__PURE__ */ S(P, [["__scopeId", "data-v-87d123dc"]]);
50
+ export {
51
+ w as default
52
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("./index-BOrHKsf8.cjs"),x=["for"],V=["value","min","max","id"],h=e.defineComponent({__name:"A2UISlider",props:{surfaceId:{},component:{},weight:{},value:{},label:{},minValue:{},maxValue:{}},setup(l){e.useCssVars(n=>({v7cd6127a:t.weight}));const t=l,{theme:o,resolvePrimitive:d,getUniqueId:p,setData:f}=m.useDynamicComponent(t),c=p("a2ui-slider"),u=e.computed(()=>d(t.value)??0),v=e.computed(()=>i(u.value));function i(n){const a=t.minValue??0,r=(t.maxValue??100)-a;return r>0?Math.max(0,Math.min(100,(n-a)/r*100)):0}function g(n){const a=t.value?.path;if(!(n.target instanceof HTMLInputElement))return;const s=n.target.valueAsNumber,r=i(s);n.target.style.setProperty("--slider-percent",r+"%"),a&&f(t.component,a,s,t.surfaceId)}return(n,a)=>(e.openBlock(),e.createElementBlock("a2ui-slider",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(o).components.Slider.container)},[e.createElementVNode("label",{class:e.normalizeClass(e.unref(o).components.Slider.label),for:e.unref(c)},e.toDisplayString(l.label),11,x),e.createElementVNode("input",{autocomplete:"off",type:"range",value:u.value,min:l.minValue,max:l.maxValue,id:e.unref(c),onInput:g,class:e.normalizeClass(e.unref(o).components.Slider.element),style:e.normalizeStyle([e.unref(o).additionalStyles?.Slider,{"--slider-percent":v.value+"%"}])},null,46,V)],2)]))}}),S=m._export_sfc(h,[["__scopeId","data-v-a8446ae1"]]);exports.default=S;
@@ -0,0 +1,55 @@
1
+ import { defineComponent as I, useCssVars as V, computed as d, openBlock as S, createElementBlock as _, createElementVNode as r, normalizeClass as i, unref as a, toDisplayString as y, normalizeStyle as b } from "vue";
2
+ import { u as C, a as w } from "./index-BpE-uBH2.js";
3
+ const A = ["for"], D = ["value", "min", "max", "id"], E = /* @__PURE__ */ I({
4
+ __name: "A2UISlider",
5
+ props: {
6
+ surfaceId: {},
7
+ component: {},
8
+ weight: {},
9
+ value: {},
10
+ label: {},
11
+ minValue: {},
12
+ maxValue: {}
13
+ },
14
+ setup(l) {
15
+ V((t) => ({
16
+ v7cd6127a: e.weight
17
+ }));
18
+ const e = l, { theme: o, resolvePrimitive: f, getUniqueId: v, setData: x } = C(e), u = v("a2ui-slider"), m = d(() => f(e.value) ?? 0), h = d(() => p(m.value));
19
+ function p(t) {
20
+ const n = e.minValue ?? 0, s = (e.maxValue ?? 100) - n;
21
+ return s > 0 ? Math.max(0, Math.min(100, (t - n) / s * 100)) : 0;
22
+ }
23
+ function g(t) {
24
+ const n = e.value?.path;
25
+ if (!(t.target instanceof HTMLInputElement))
26
+ return;
27
+ const c = t.target.valueAsNumber, s = p(c);
28
+ t.target.style.setProperty("--slider-percent", s + "%"), n && x(e.component, n, c, e.surfaceId);
29
+ }
30
+ return (t, n) => (S(), _("a2ui-slider", null, [
31
+ r("section", {
32
+ class: i(a(o).components.Slider.container)
33
+ }, [
34
+ r("label", {
35
+ class: i(a(o).components.Slider.label),
36
+ for: a(u)
37
+ }, y(l.label), 11, A),
38
+ r("input", {
39
+ autocomplete: "off",
40
+ type: "range",
41
+ value: m.value,
42
+ min: l.minValue,
43
+ max: l.maxValue,
44
+ id: a(u),
45
+ onInput: g,
46
+ class: i(a(o).components.Slider.element),
47
+ style: b([a(o).additionalStyles?.Slider, { "--slider-percent": h.value + "%" }])
48
+ }, null, 46, D)
49
+ ], 2)
50
+ ]));
51
+ }
52
+ }), U = /* @__PURE__ */ w(E, [["__scopeId", "data-v-a8446ae1"]]);
53
+ export {
54
+ U as default
55
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BOrHKsf8.cjs"),d=["onClick","disabled"],b=e.defineComponent({__name:"A2UITabs",props:{surfaceId:{},component:{},weight:{},tabs:{}},setup(n){e.useCssVars(l=>({d731f76a:c.weight}));const c=n,{theme:t,resolvePrimitive:u}=a.useDynamicComponent(c),s=e.ref(0),i=e.computed(()=>{const l=s.value;return c.tabs.map((m,r)=>r===l?a.merge(t.components.Tabs.controls.all,t.components.Tabs.controls.selected):t.components.Tabs.controls.all)});return(l,m)=>(e.openBlock(),e.createElementBlock("a2ui-tabs",null,[e.createElementVNode("section",{class:e.normalizeClass(e.unref(t).components.Tabs.container),style:e.normalizeStyle(e.unref(t).additionalStyles?.Tabs)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).components.Tabs.element)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabs,(r,o)=>(e.openBlock(),e.createElementBlock("button",{key:o,onClick:f=>s.value=o,disabled:s.value===o,class:e.normalizeClass(i.value[o])},e.toDisplayString(e.unref(u)(r.title)),11,d))),128))],2),e.createVNode(a._sfc_main,{"surface-id":n.surfaceId,component:n.tabs[s.value].child},null,8,["surface-id","component"])],6)]))}}),p=a._export_sfc(b,[["__scopeId","data-v-036075bf"]]);exports.default=p;