@a2ui-sdk/react 0.1.0 → 0.2.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.
- package/dist/0.8/components/ComponentRenderer.d.ts +1 -19
- package/dist/0.8/components/ComponentRenderer.js +21 -63
- package/dist/0.8/components/UnknownComponent.d.ts +3 -3
- package/dist/0.8/components/display/AudioPlayerComponent.d.ts +3 -2
- package/dist/0.8/components/display/DividerComponent.d.ts +3 -2
- package/dist/0.8/components/display/IconComponent.d.ts +3 -2
- package/dist/0.8/components/display/ImageComponent.d.ts +3 -2
- package/dist/0.8/components/display/TextComponent.d.ts +3 -2
- package/dist/0.8/components/display/VideoComponent.d.ts +3 -2
- package/dist/0.8/components/display/index.d.ts +1 -1
- package/dist/0.8/components/index.d.ts +2 -2
- package/dist/0.8/components/interactive/ButtonComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/CheckBoxComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/DateTimeInputComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/MultipleChoiceComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/SliderComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/TextFieldComponent.d.ts +3 -2
- package/dist/0.8/components/interactive/index.d.ts +1 -1
- package/dist/0.8/components/layout/CardComponent.d.ts +3 -2
- package/dist/0.8/components/layout/ColumnComponent.d.ts +3 -2
- package/dist/0.8/components/layout/ListComponent.d.ts +3 -2
- package/dist/0.8/components/layout/ModalComponent.d.ts +3 -2
- package/dist/0.8/components/layout/RowComponent.d.ts +3 -2
- package/dist/0.8/components/layout/TabsComponent.d.ts +3 -2
- package/dist/0.8/components/layout/index.d.ts +1 -1
- package/dist/0.8/components/types.d.ts +8 -0
- package/dist/0.8/contexts/A2UIProvider.d.ts +37 -23
- package/dist/0.8/contexts/A2UIProvider.js +16 -22
- package/dist/0.8/contexts/ActionContext.js +5 -5
- package/dist/0.8/contexts/ComponentsMapContext.d.ts +8 -21
- package/dist/0.8/contexts/ComponentsMapContext.js +12 -16
- package/dist/0.8/contexts/DataModelContext.js +3 -3
- package/dist/0.8/index.d.ts +5 -3
- package/dist/0.8/index.js +11 -9
- package/dist/0.8/standard-catalog/index.d.ts +57 -0
- package/dist/0.8/standard-catalog/index.js +66 -0
- package/dist/0.9/A2UIRenderer.d.ts +9 -29
- package/dist/0.9/A2UIRenderer.js +27 -26
- package/dist/0.9/components/ComponentRenderer.d.ts +5 -19
- package/dist/0.9/components/ComponentRenderer.js +30 -17
- package/dist/0.9/components/UnknownComponent.d.ts +8 -2
- package/dist/0.9/components/UnknownComponent.js +13 -11
- package/dist/0.9/components/display/AudioPlayerComponent.d.ts +3 -2
- package/dist/0.9/components/display/AudioPlayerComponent.js +16 -14
- package/dist/0.9/components/display/DividerComponent.d.ts +3 -2
- package/dist/0.9/components/display/DividerComponent.js +4 -5
- package/dist/0.9/components/display/IconComponent.d.ts +3 -2
- package/dist/0.9/components/display/IconComponent.js +12 -12
- package/dist/0.9/components/display/ImageComponent.d.ts +3 -2
- package/dist/0.9/components/display/ImageComponent.js +18 -15
- package/dist/0.9/components/display/TextComponent.d.ts +3 -2
- package/dist/0.9/components/display/TextComponent.js +10 -8
- package/dist/0.9/components/display/VideoComponent.d.ts +3 -2
- package/dist/0.9/components/display/VideoComponent.js +7 -6
- package/dist/0.9/components/index.d.ts +4 -8
- package/dist/0.9/components/interactive/ButtonComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/ButtonComponent.js +25 -20
- package/dist/0.9/components/interactive/CheckBoxComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/CheckBoxComponent.js +33 -29
- package/dist/0.9/components/interactive/ChoicePickerComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/ChoicePickerComponent.js +59 -53
- package/dist/0.9/components/interactive/DateTimeInputComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/DateTimeInputComponent.js +32 -26
- package/dist/0.9/components/interactive/SliderComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/SliderComponent.js +38 -32
- package/dist/0.9/components/interactive/TextFieldComponent.d.ts +3 -2
- package/dist/0.9/components/interactive/TextFieldComponent.js +41 -40
- package/dist/0.9/components/layout/CardComponent.d.ts +3 -2
- package/dist/0.9/components/layout/CardComponent.js +11 -10
- package/dist/0.9/components/layout/ColumnComponent.d.ts +3 -2
- package/dist/0.9/components/layout/ColumnComponent.js +26 -23
- package/dist/0.9/components/layout/ListComponent.d.ts +3 -2
- package/dist/0.9/components/layout/ListComponent.js +30 -27
- package/dist/0.9/components/layout/ModalComponent.d.ts +3 -2
- package/dist/0.9/components/layout/ModalComponent.js +11 -22
- package/dist/0.9/components/layout/RowComponent.d.ts +3 -2
- package/dist/0.9/components/layout/RowComponent.js +31 -28
- package/dist/0.9/components/layout/TabsComponent.d.ts +3 -2
- package/dist/0.9/components/layout/TabsComponent.js +21 -21
- package/dist/0.9/components/types.d.ts +8 -0
- package/dist/0.9/contexts/A2UIProvider.d.ts +45 -28
- package/dist/0.9/contexts/A2UIProvider.js +18 -26
- package/dist/0.9/contexts/ActionContext.js +5 -5
- package/dist/0.9/contexts/ComponentsMapContext.d.ts +8 -31
- package/dist/0.9/contexts/ComponentsMapContext.js +12 -16
- package/dist/0.9/contexts/ScopeContext.js +3 -3
- package/dist/0.9/contexts/SurfaceContext.d.ts +3 -3
- package/dist/0.9/contexts/SurfaceContext.js +3 -3
- package/dist/0.9/hooks/useComponent.d.ts +2 -2
- package/dist/0.9/hooks/useDataBinding.js +3 -3
- package/dist/0.9/index.d.ts +6 -4
- package/dist/0.9/index.js +12 -10
- package/dist/0.9/standard-catalog/index.d.ts +61 -0
- package/dist/0.9/standard-catalog/index.js +69 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +6 -4
- package/package.json +14 -5
- package/dist/0.9/components/index.js +0 -68
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SliderComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Slider component - range slider input.
|
|
4
5
|
* Note: In 0.9, minValue/maxValue are renamed to min/max.
|
|
5
6
|
*/
|
|
6
|
-
export declare const SliderComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
7
|
+
export declare const SliderComponent: import('react').NamedExoticComponent<A2UIComponentProps<SliderComponentProps>>;
|
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useStringBinding as
|
|
4
|
-
import { useValidation as
|
|
5
|
-
import { Slider as
|
|
6
|
-
import { Label as
|
|
7
|
-
import { cn as
|
|
8
|
-
const
|
|
9
|
-
surfaceId:
|
|
10
|
-
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as C, useCallback as N } from "react";
|
|
3
|
+
import { useStringBinding as b, useFormBinding as y } from "../../hooks/useDataBinding.js";
|
|
4
|
+
import { useValidation as V } from "../../hooks/useValidation.js";
|
|
5
|
+
import { Slider as j } from "../../../components/ui/slider.js";
|
|
6
|
+
import { Label as B } from "../../../components/ui/label.js";
|
|
7
|
+
import { cn as F } from "../../../lib/utils.js";
|
|
8
|
+
const k = C(function({
|
|
9
|
+
surfaceId: t,
|
|
10
|
+
componentId: p,
|
|
11
|
+
label: f,
|
|
12
|
+
min: l = 0,
|
|
13
|
+
max: i = 100,
|
|
14
|
+
value: u,
|
|
15
|
+
checks: h,
|
|
16
|
+
weight: n
|
|
11
17
|
}) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
const o = b(t, f, ""), { valid: x, errors: s } = V(t, h), [d, a] = y(
|
|
19
|
+
t,
|
|
20
|
+
u,
|
|
15
21
|
l
|
|
16
|
-
),
|
|
17
|
-
(
|
|
18
|
-
|
|
22
|
+
), g = N(
|
|
23
|
+
(r) => {
|
|
24
|
+
r.length > 0 && a(r[0]);
|
|
19
25
|
},
|
|
20
26
|
[a]
|
|
21
|
-
),
|
|
22
|
-
return /* @__PURE__ */ c("div", { className:
|
|
23
|
-
o && /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
27
|
+
), m = `slider-${p}`, v = n ? { flexGrow: n } : void 0;
|
|
28
|
+
return /* @__PURE__ */ c("div", { className: F("flex flex-col gap-2 py-2"), style: v, children: [
|
|
29
|
+
o && /* @__PURE__ */ e(B, { htmlFor: m, children: o }),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
j,
|
|
26
32
|
{
|
|
27
|
-
id:
|
|
28
|
-
value: [
|
|
29
|
-
onValueChange:
|
|
33
|
+
id: m,
|
|
34
|
+
value: [d],
|
|
35
|
+
onValueChange: g,
|
|
30
36
|
min: l,
|
|
31
|
-
max:
|
|
37
|
+
max: i,
|
|
32
38
|
step: 1,
|
|
33
|
-
"aria-invalid": !
|
|
39
|
+
"aria-invalid": !x
|
|
34
40
|
}
|
|
35
41
|
),
|
|
36
42
|
/* @__PURE__ */ c("div", { className: "flex justify-between text-sm text-muted-foreground", children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ e("span", { children: l }),
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: d }),
|
|
45
|
+
/* @__PURE__ */ e("span", { children: i })
|
|
40
46
|
] }),
|
|
41
|
-
s.length > 0 && /* @__PURE__ */
|
|
47
|
+
s.length > 0 && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: s.map((r, S) => /* @__PURE__ */ e("p", { children: r }, S)) })
|
|
42
48
|
] });
|
|
43
49
|
});
|
|
44
|
-
|
|
50
|
+
k.displayName = "A2UI.Slider";
|
|
45
51
|
export {
|
|
46
|
-
|
|
52
|
+
k as SliderComponent
|
|
47
53
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextFieldComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* TextField component - text input with label.
|
|
4
5
|
*/
|
|
5
|
-
export declare const TextFieldComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
6
|
+
export declare const TextFieldComponent: import('react').NamedExoticComponent<A2UIComponentProps<TextFieldComponentProps>>;
|
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useStringBinding as
|
|
4
|
-
import { useValidation as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Textarea as
|
|
7
|
-
import { Label as
|
|
8
|
-
import { cn as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as y, useCallback as F } from "react";
|
|
3
|
+
import { useStringBinding as N, useFormBinding as j } from "../../hooks/useDataBinding.js";
|
|
4
|
+
import { useValidation as B } from "../../hooks/useValidation.js";
|
|
5
|
+
import { Input as L } from "../../../components/ui/input.js";
|
|
6
|
+
import { Textarea as V } from "../../../components/ui/textarea.js";
|
|
7
|
+
import { Label as k } from "../../../components/ui/label.js";
|
|
8
|
+
import { cn as i } from "../../../lib/utils.js";
|
|
9
|
+
const w = {
|
|
10
10
|
shortText: "text",
|
|
11
11
|
longText: "text",
|
|
12
12
|
// Uses textarea
|
|
13
13
|
number: "number",
|
|
14
14
|
obscured: "password"
|
|
15
|
-
},
|
|
16
|
-
surfaceId:
|
|
17
|
-
|
|
15
|
+
}, A = y(function({
|
|
16
|
+
surfaceId: o,
|
|
17
|
+
componentId: x,
|
|
18
|
+
label: u,
|
|
19
|
+
value: h,
|
|
20
|
+
variant: s = "shortText",
|
|
21
|
+
checks: T,
|
|
22
|
+
weight: l
|
|
18
23
|
}) {
|
|
19
|
-
const
|
|
20
|
-
n,
|
|
21
|
-
e.value,
|
|
22
|
-
""
|
|
23
|
-
), { valid: o, errors: c } = y(n, e.checks), d = b(
|
|
24
|
+
const a = N(o, u, ""), [m, d] = j(o, h, ""), { valid: t, errors: c } = B(o, T), p = F(
|
|
24
25
|
(r) => {
|
|
25
|
-
|
|
26
|
+
d(r.target.value);
|
|
26
27
|
},
|
|
27
|
-
[
|
|
28
|
-
),
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
[d]
|
|
29
|
+
), n = `textfield-${x}`, f = w[s] || "text", g = s === "longText", v = l ? { flexGrow: l } : void 0;
|
|
30
|
+
return /* @__PURE__ */ C("div", { className: i("flex flex-col gap-2"), style: v, children: [
|
|
31
|
+
a && /* @__PURE__ */ e(k, { htmlFor: n, children: a }),
|
|
32
|
+
g ? /* @__PURE__ */ e(
|
|
33
|
+
V,
|
|
33
34
|
{
|
|
34
|
-
id:
|
|
35
|
-
value:
|
|
36
|
-
onChange:
|
|
37
|
-
className:
|
|
38
|
-
"aria-invalid": !
|
|
35
|
+
id: n,
|
|
36
|
+
value: m,
|
|
37
|
+
onChange: p,
|
|
38
|
+
className: i("min-h-[100px]", !t && "border-destructive"),
|
|
39
|
+
"aria-invalid": !t
|
|
39
40
|
}
|
|
40
|
-
) : /* @__PURE__ */
|
|
41
|
-
|
|
41
|
+
) : /* @__PURE__ */ e(
|
|
42
|
+
L,
|
|
42
43
|
{
|
|
43
|
-
id:
|
|
44
|
-
type:
|
|
45
|
-
value:
|
|
46
|
-
onChange:
|
|
47
|
-
className:
|
|
48
|
-
"aria-invalid": !
|
|
44
|
+
id: n,
|
|
45
|
+
type: f,
|
|
46
|
+
value: m,
|
|
47
|
+
onChange: p,
|
|
48
|
+
className: i(!t && "border-destructive"),
|
|
49
|
+
"aria-invalid": !t
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
|
-
c.length > 0 && /* @__PURE__ */
|
|
52
|
+
c.length > 0 && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: c.map((r, b) => /* @__PURE__ */ e("p", { children: r }, b)) })
|
|
52
53
|
] });
|
|
53
54
|
});
|
|
54
|
-
|
|
55
|
+
A.displayName = "A2UI.TextField";
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
A as TextFieldComponent
|
|
57
58
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CardComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Card component - container with card styling.
|
|
4
5
|
*/
|
|
5
|
-
export declare const CardComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
6
|
+
export declare const CardComponent: import('react').NamedExoticComponent<A2UIComponentProps<CardComponentProps>>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Card as
|
|
4
|
-
import { ComponentRenderer as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as p } from "react";
|
|
3
|
+
import { Card as m, CardContent as d } from "../../../components/ui/card.js";
|
|
4
|
+
import { ComponentRenderer as a } from "../ComponentRenderer.js";
|
|
5
|
+
const C = p(function({
|
|
6
6
|
surfaceId: t,
|
|
7
|
-
|
|
7
|
+
child: r,
|
|
8
|
+
weight: n
|
|
8
9
|
}) {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
10
|
+
const e = n ? { flexGrow: n } : void 0;
|
|
11
|
+
return r ? /* @__PURE__ */ o(m, { style: e, children: /* @__PURE__ */ o(d, { className: "p-4", children: /* @__PURE__ */ o(a, { surfaceId: t, componentId: r }) }) }) : /* @__PURE__ */ o(m, { style: e });
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
+
C.displayName = "A2UI.Card";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
C as CardComponent
|
|
15
16
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Column component - vertical flex container.
|
|
4
5
|
* Supports both static children and template binding for dynamic children.
|
|
5
6
|
*/
|
|
6
|
-
export declare const ColumnComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
7
|
+
export declare const ColumnComponent: import('react').NamedExoticComponent<A2UIComponentProps<ColumnComponentProps>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as f } from "react";
|
|
3
3
|
import { useDataModel as u } from "../../hooks/useDataBinding.js";
|
|
4
4
|
import { useScope as y } from "../../contexts/ScopeContext.js";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ComponentRenderer as
|
|
7
|
-
import { TemplateRenderer as
|
|
8
|
-
const
|
|
5
|
+
import { cn as l } from "../../../lib/utils.js";
|
|
6
|
+
import { ComponentRenderer as d } from "../ComponentRenderer.js";
|
|
7
|
+
import { TemplateRenderer as j } from "./TemplateRenderer.js";
|
|
8
|
+
const v = {
|
|
9
9
|
start: "justify-start",
|
|
10
10
|
center: "justify-center",
|
|
11
11
|
end: "justify-end",
|
|
@@ -13,38 +13,41 @@ const C = {
|
|
|
13
13
|
spaceAround: "justify-around",
|
|
14
14
|
spaceEvenly: "justify-evenly",
|
|
15
15
|
stretch: "justify-stretch"
|
|
16
|
-
},
|
|
16
|
+
}, C = {
|
|
17
17
|
start: "items-start",
|
|
18
18
|
center: "items-center",
|
|
19
19
|
end: "items-end",
|
|
20
20
|
stretch: "items-stretch"
|
|
21
|
-
},
|
|
21
|
+
}, x = f(function({
|
|
22
22
|
surfaceId: o,
|
|
23
|
-
|
|
23
|
+
children: t,
|
|
24
|
+
justify: i = "start",
|
|
25
|
+
align: a = "stretch",
|
|
26
|
+
weight: s
|
|
24
27
|
}) {
|
|
25
|
-
const
|
|
28
|
+
const p = u(o), { basePath: c } = y(), n = l(
|
|
26
29
|
"flex flex-col gap-4",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
),
|
|
30
|
-
return Array.isArray(t) ? /* @__PURE__ */
|
|
31
|
-
|
|
30
|
+
v[i],
|
|
31
|
+
C[a]
|
|
32
|
+
), r = s ? { flexGrow: s } : void 0;
|
|
33
|
+
return Array.isArray(t) ? /* @__PURE__ */ e("div", { className: n, style: r, children: t.map((m) => /* @__PURE__ */ e(
|
|
34
|
+
d,
|
|
32
35
|
{
|
|
33
36
|
surfaceId: o,
|
|
34
|
-
componentId:
|
|
37
|
+
componentId: m
|
|
35
38
|
},
|
|
36
|
-
|
|
37
|
-
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */
|
|
38
|
-
|
|
39
|
+
m
|
|
40
|
+
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ e("div", { className: n, style: r, children: /* @__PURE__ */ e(
|
|
41
|
+
j,
|
|
39
42
|
{
|
|
40
43
|
surfaceId: o,
|
|
41
44
|
template: t,
|
|
42
|
-
dataModel:
|
|
43
|
-
basePath:
|
|
45
|
+
dataModel: p,
|
|
46
|
+
basePath: c
|
|
44
47
|
}
|
|
45
|
-
) }) : /* @__PURE__ */
|
|
48
|
+
) }) : /* @__PURE__ */ e("div", { className: n, style: r });
|
|
46
49
|
});
|
|
47
|
-
|
|
50
|
+
x.displayName = "A2UI.Column";
|
|
48
51
|
export {
|
|
49
|
-
|
|
52
|
+
x as ColumnComponent
|
|
50
53
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* List component - displays children in a list layout.
|
|
4
5
|
* Supports both static children and template binding for dynamic children.
|
|
@@ -14,4 +15,4 @@ import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
|
|
|
14
15
|
* children: { componentId: "item-template", path: "/items" }
|
|
15
16
|
* }
|
|
16
17
|
*/
|
|
17
|
-
export declare const ListComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
18
|
+
export declare const ListComponent: import('react').NamedExoticComponent<A2UIComponentProps<ListComponentProps>>;
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useDataModel as
|
|
4
|
-
import { useScope as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as f } from "react";
|
|
3
|
+
import { useDataModel as l } from "../../hooks/useDataBinding.js";
|
|
4
|
+
import { useScope as d } from "../../contexts/ScopeContext.js";
|
|
5
5
|
import { cn as x } from "../../../lib/utils.js";
|
|
6
|
-
import { ComponentRenderer as
|
|
7
|
-
import { TemplateRenderer as
|
|
8
|
-
const
|
|
6
|
+
import { ComponentRenderer as v } from "../ComponentRenderer.js";
|
|
7
|
+
import { TemplateRenderer as y } from "./TemplateRenderer.js";
|
|
8
|
+
const u = {
|
|
9
9
|
start: "items-start",
|
|
10
10
|
center: "items-center",
|
|
11
11
|
end: "items-end",
|
|
12
12
|
stretch: "items-stretch"
|
|
13
|
-
},
|
|
14
|
-
surfaceId:
|
|
15
|
-
|
|
13
|
+
}, A = f(function({
|
|
14
|
+
surfaceId: o,
|
|
15
|
+
children: t,
|
|
16
|
+
direction: i = "vertical",
|
|
17
|
+
align: p = "stretch",
|
|
18
|
+
weight: n
|
|
16
19
|
}) {
|
|
17
|
-
const
|
|
20
|
+
const a = l(o), { basePath: c } = d(), r = x(
|
|
18
21
|
"flex gap-3",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
return Array.isArray(t) ? /* @__PURE__ */
|
|
23
|
-
|
|
22
|
+
i === "vertical" ? "flex-col" : "flex-row flex-wrap",
|
|
23
|
+
u[p]
|
|
24
|
+
), m = n ? { flexGrow: n } : void 0;
|
|
25
|
+
return Array.isArray(t) ? /* @__PURE__ */ e("div", { className: r, style: m, children: t.map((s) => /* @__PURE__ */ e(
|
|
26
|
+
v,
|
|
24
27
|
{
|
|
25
|
-
surfaceId:
|
|
26
|
-
componentId:
|
|
28
|
+
surfaceId: o,
|
|
29
|
+
componentId: s
|
|
27
30
|
},
|
|
28
|
-
|
|
29
|
-
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */
|
|
30
|
-
|
|
31
|
+
s
|
|
32
|
+
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ e("div", { className: r, style: m, children: /* @__PURE__ */ e(
|
|
33
|
+
y,
|
|
31
34
|
{
|
|
32
|
-
surfaceId:
|
|
35
|
+
surfaceId: o,
|
|
33
36
|
template: t,
|
|
34
|
-
dataModel:
|
|
35
|
-
basePath:
|
|
37
|
+
dataModel: a,
|
|
38
|
+
basePath: c
|
|
36
39
|
}
|
|
37
|
-
) }) : /* @__PURE__ */
|
|
40
|
+
) }) : /* @__PURE__ */ e("div", { className: r, style: m });
|
|
38
41
|
});
|
|
39
|
-
|
|
42
|
+
A.displayName = "A2UI.List";
|
|
40
43
|
export {
|
|
41
|
-
|
|
44
|
+
A as ListComponent
|
|
42
45
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Modal component - dialog container with trigger.
|
|
4
5
|
*/
|
|
5
|
-
export declare const ModalComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
6
|
+
export declare const ModalComponent: import('react').NamedExoticComponent<A2UIComponentProps<ModalComponentProps>>;
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { memo as p, useState as a } from "react";
|
|
3
|
-
import { Dialog as
|
|
3
|
+
import { Dialog as d, DialogTrigger as s, DialogContent as c } from "../../../components/ui/dialog.js";
|
|
4
4
|
import { ComponentRenderer as t } from "../ComponentRenderer.js";
|
|
5
|
-
const
|
|
6
|
-
surfaceId:
|
|
7
|
-
|
|
5
|
+
const f = p(function({
|
|
6
|
+
surfaceId: n,
|
|
7
|
+
trigger: e,
|
|
8
|
+
content: r
|
|
8
9
|
}) {
|
|
9
|
-
const
|
|
10
|
-
return !
|
|
11
|
-
/* @__PURE__ */ o(
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
surfaceId: e,
|
|
15
|
-
componentId: n.trigger
|
|
16
|
-
}
|
|
17
|
-
) }) }),
|
|
18
|
-
/* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
|
|
19
|
-
t,
|
|
20
|
-
{
|
|
21
|
-
surfaceId: e,
|
|
22
|
-
componentId: n.content
|
|
23
|
-
}
|
|
24
|
-
) })
|
|
10
|
+
const [i, m] = a(!1);
|
|
11
|
+
return !e || !r ? null : /* @__PURE__ */ l(d, { open: i, onOpenChange: m, children: [
|
|
12
|
+
/* @__PURE__ */ o(s, { asChild: !0, children: /* @__PURE__ */ o("div", { className: "cursor-pointer", children: /* @__PURE__ */ o(t, { surfaceId: n, componentId: e }) }) }),
|
|
13
|
+
/* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(t, { surfaceId: n, componentId: r }) })
|
|
25
14
|
] });
|
|
26
15
|
});
|
|
27
|
-
|
|
16
|
+
f.displayName = "A2UI.Modal";
|
|
28
17
|
export {
|
|
29
|
-
|
|
18
|
+
f as ModalComponent
|
|
30
19
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Row component - horizontal flex container.
|
|
4
5
|
* Supports both static children and template binding for dynamic children.
|
|
5
6
|
*/
|
|
6
|
-
export declare const RowComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
7
|
+
export declare const RowComponent: import('react').NamedExoticComponent<A2UIComponentProps<RowComponentProps>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as f } from "react";
|
|
3
3
|
import { useDataModel as y } from "../../hooks/useDataBinding.js";
|
|
4
|
-
import { useScope as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ComponentRenderer as
|
|
7
|
-
import { TemplateRenderer as
|
|
8
|
-
const
|
|
4
|
+
import { useScope as u } from "../../contexts/ScopeContext.js";
|
|
5
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
6
|
+
import { ComponentRenderer as l } from "../ComponentRenderer.js";
|
|
7
|
+
import { TemplateRenderer as j } from "./TemplateRenderer.js";
|
|
8
|
+
const v = {
|
|
9
9
|
start: "justify-start",
|
|
10
10
|
center: "justify-center",
|
|
11
11
|
end: "justify-end",
|
|
@@ -13,38 +13,41 @@ const w = {
|
|
|
13
13
|
spaceAround: "justify-around",
|
|
14
14
|
spaceEvenly: "justify-evenly",
|
|
15
15
|
stretch: "justify-stretch"
|
|
16
|
-
},
|
|
16
|
+
}, w = {
|
|
17
17
|
start: "items-start",
|
|
18
18
|
center: "items-center",
|
|
19
19
|
end: "items-end",
|
|
20
20
|
stretch: "items-stretch"
|
|
21
|
-
},
|
|
22
|
-
surfaceId:
|
|
23
|
-
|
|
21
|
+
}, x = f(function({
|
|
22
|
+
surfaceId: o,
|
|
23
|
+
children: t,
|
|
24
|
+
justify: i = "start",
|
|
25
|
+
align: a = "stretch",
|
|
26
|
+
weight: n
|
|
24
27
|
}) {
|
|
25
|
-
const
|
|
28
|
+
const p = y(o), { basePath: c } = u(), r = d(
|
|
26
29
|
"flex flex-row gap-3",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
), s =
|
|
30
|
-
return Array.isArray(t) ? /* @__PURE__ */
|
|
31
|
-
|
|
30
|
+
v[i],
|
|
31
|
+
w[a]
|
|
32
|
+
), s = n ? { flexGrow: n } : void 0;
|
|
33
|
+
return Array.isArray(t) ? /* @__PURE__ */ e("div", { className: r, style: s, children: t.map((m) => /* @__PURE__ */ e(
|
|
34
|
+
l,
|
|
32
35
|
{
|
|
33
|
-
surfaceId:
|
|
34
|
-
componentId:
|
|
36
|
+
surfaceId: o,
|
|
37
|
+
componentId: m
|
|
35
38
|
},
|
|
36
|
-
|
|
37
|
-
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */
|
|
38
|
-
|
|
39
|
+
m
|
|
40
|
+
)) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ e("div", { className: r, style: s, children: /* @__PURE__ */ e(
|
|
41
|
+
j,
|
|
39
42
|
{
|
|
40
|
-
surfaceId:
|
|
43
|
+
surfaceId: o,
|
|
41
44
|
template: t,
|
|
42
|
-
dataModel:
|
|
43
|
-
basePath:
|
|
45
|
+
dataModel: p,
|
|
46
|
+
basePath: c
|
|
44
47
|
}
|
|
45
|
-
) }) : /* @__PURE__ */
|
|
48
|
+
) }) : /* @__PURE__ */ e("div", { className: r, style: s });
|
|
46
49
|
});
|
|
47
|
-
|
|
50
|
+
x.displayName = "A2UI.Row";
|
|
48
51
|
export {
|
|
49
|
-
|
|
52
|
+
x as RowComponent
|
|
50
53
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TabsComponentProps } from '@a2ui-sdk/types/0.9/standard-catalog';
|
|
2
|
+
import { A2UIComponentProps } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Tabs component - tabbed content container.
|
|
4
5
|
*/
|
|
5
|
-
export declare const TabsComponent: import('react').NamedExoticComponent<A2UIComponentProps
|
|
6
|
+
export declare const TabsComponent: import('react').NamedExoticComponent<A2UIComponentProps<TabsComponentProps>>;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as d, jsx as l, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { memo as s } from "react";
|
|
3
3
|
import { useStringBinding as p } from "../../hooks/useDataBinding.js";
|
|
4
|
-
import { Tabs as
|
|
5
|
-
import { ComponentRenderer as
|
|
6
|
-
function
|
|
7
|
-
surfaceId:
|
|
8
|
-
title:
|
|
9
|
-
index:
|
|
4
|
+
import { Tabs as T, TabsList as u, TabsTrigger as f, TabsContent as h } from "../../../components/ui/tabs.js";
|
|
5
|
+
import { ComponentRenderer as b } from "../ComponentRenderer.js";
|
|
6
|
+
function g({
|
|
7
|
+
surfaceId: t,
|
|
8
|
+
title: o,
|
|
9
|
+
index: n
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
const r = p(t, o, `Tab ${n + 1}`);
|
|
12
|
+
return /* @__PURE__ */ l(m, { children: r });
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
surfaceId:
|
|
16
|
-
|
|
14
|
+
const x = s(function({
|
|
15
|
+
surfaceId: o,
|
|
16
|
+
tabs: n,
|
|
17
|
+
weight: r
|
|
17
18
|
}) {
|
|
18
|
-
|
|
19
|
-
if (!o || o.length === 0)
|
|
19
|
+
if (!n || n.length === 0)
|
|
20
20
|
return null;
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
21
|
+
const i = r ? { flexGrow: r } : void 0, c = n[0].child;
|
|
22
|
+
return /* @__PURE__ */ d(T, { defaultValue: c, className: "w-full", style: i, children: [
|
|
23
|
+
/* @__PURE__ */ l(u, { children: n.map((e, a) => /* @__PURE__ */ l(f, { value: e.child, children: /* @__PURE__ */ l(g, { surfaceId: o, title: e.title, index: a }) }, e.child)) }),
|
|
24
|
+
n.map((e) => /* @__PURE__ */ l(h, { value: e.child, children: /* @__PURE__ */ l(b, { surfaceId: o, componentId: e.child }) }, e.child))
|
|
25
25
|
] });
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
x.displayName = "A2UI.Tabs";
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
x as TabsComponent
|
|
30
30
|
};
|