@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.
Files changed (99) hide show
  1. package/dist/0.8/components/ComponentRenderer.d.ts +1 -19
  2. package/dist/0.8/components/ComponentRenderer.js +21 -63
  3. package/dist/0.8/components/UnknownComponent.d.ts +3 -3
  4. package/dist/0.8/components/display/AudioPlayerComponent.d.ts +3 -2
  5. package/dist/0.8/components/display/DividerComponent.d.ts +3 -2
  6. package/dist/0.8/components/display/IconComponent.d.ts +3 -2
  7. package/dist/0.8/components/display/ImageComponent.d.ts +3 -2
  8. package/dist/0.8/components/display/TextComponent.d.ts +3 -2
  9. package/dist/0.8/components/display/VideoComponent.d.ts +3 -2
  10. package/dist/0.8/components/display/index.d.ts +1 -1
  11. package/dist/0.8/components/index.d.ts +2 -2
  12. package/dist/0.8/components/interactive/ButtonComponent.d.ts +3 -2
  13. package/dist/0.8/components/interactive/CheckBoxComponent.d.ts +3 -2
  14. package/dist/0.8/components/interactive/DateTimeInputComponent.d.ts +3 -2
  15. package/dist/0.8/components/interactive/MultipleChoiceComponent.d.ts +3 -2
  16. package/dist/0.8/components/interactive/SliderComponent.d.ts +3 -2
  17. package/dist/0.8/components/interactive/TextFieldComponent.d.ts +3 -2
  18. package/dist/0.8/components/interactive/index.d.ts +1 -1
  19. package/dist/0.8/components/layout/CardComponent.d.ts +3 -2
  20. package/dist/0.8/components/layout/ColumnComponent.d.ts +3 -2
  21. package/dist/0.8/components/layout/ListComponent.d.ts +3 -2
  22. package/dist/0.8/components/layout/ModalComponent.d.ts +3 -2
  23. package/dist/0.8/components/layout/RowComponent.d.ts +3 -2
  24. package/dist/0.8/components/layout/TabsComponent.d.ts +3 -2
  25. package/dist/0.8/components/layout/index.d.ts +1 -1
  26. package/dist/0.8/components/types.d.ts +8 -0
  27. package/dist/0.8/contexts/A2UIProvider.d.ts +37 -23
  28. package/dist/0.8/contexts/A2UIProvider.js +16 -22
  29. package/dist/0.8/contexts/ActionContext.js +5 -5
  30. package/dist/0.8/contexts/ComponentsMapContext.d.ts +8 -21
  31. package/dist/0.8/contexts/ComponentsMapContext.js +12 -16
  32. package/dist/0.8/contexts/DataModelContext.js +3 -3
  33. package/dist/0.8/index.d.ts +5 -3
  34. package/dist/0.8/index.js +11 -9
  35. package/dist/0.8/standard-catalog/index.d.ts +57 -0
  36. package/dist/0.8/standard-catalog/index.js +66 -0
  37. package/dist/0.9/A2UIRenderer.d.ts +9 -29
  38. package/dist/0.9/A2UIRenderer.js +27 -26
  39. package/dist/0.9/components/ComponentRenderer.d.ts +5 -19
  40. package/dist/0.9/components/ComponentRenderer.js +30 -17
  41. package/dist/0.9/components/UnknownComponent.d.ts +8 -2
  42. package/dist/0.9/components/UnknownComponent.js +13 -11
  43. package/dist/0.9/components/display/AudioPlayerComponent.d.ts +3 -2
  44. package/dist/0.9/components/display/AudioPlayerComponent.js +16 -14
  45. package/dist/0.9/components/display/DividerComponent.d.ts +3 -2
  46. package/dist/0.9/components/display/DividerComponent.js +4 -5
  47. package/dist/0.9/components/display/IconComponent.d.ts +3 -2
  48. package/dist/0.9/components/display/IconComponent.js +12 -12
  49. package/dist/0.9/components/display/ImageComponent.d.ts +3 -2
  50. package/dist/0.9/components/display/ImageComponent.js +18 -15
  51. package/dist/0.9/components/display/TextComponent.d.ts +3 -2
  52. package/dist/0.9/components/display/TextComponent.js +10 -8
  53. package/dist/0.9/components/display/VideoComponent.d.ts +3 -2
  54. package/dist/0.9/components/display/VideoComponent.js +7 -6
  55. package/dist/0.9/components/index.d.ts +4 -8
  56. package/dist/0.9/components/interactive/ButtonComponent.d.ts +3 -2
  57. package/dist/0.9/components/interactive/ButtonComponent.js +25 -20
  58. package/dist/0.9/components/interactive/CheckBoxComponent.d.ts +3 -2
  59. package/dist/0.9/components/interactive/CheckBoxComponent.js +33 -29
  60. package/dist/0.9/components/interactive/ChoicePickerComponent.d.ts +3 -2
  61. package/dist/0.9/components/interactive/ChoicePickerComponent.js +59 -53
  62. package/dist/0.9/components/interactive/DateTimeInputComponent.d.ts +3 -2
  63. package/dist/0.9/components/interactive/DateTimeInputComponent.js +32 -26
  64. package/dist/0.9/components/interactive/SliderComponent.d.ts +3 -2
  65. package/dist/0.9/components/interactive/SliderComponent.js +38 -32
  66. package/dist/0.9/components/interactive/TextFieldComponent.d.ts +3 -2
  67. package/dist/0.9/components/interactive/TextFieldComponent.js +41 -40
  68. package/dist/0.9/components/layout/CardComponent.d.ts +3 -2
  69. package/dist/0.9/components/layout/CardComponent.js +11 -10
  70. package/dist/0.9/components/layout/ColumnComponent.d.ts +3 -2
  71. package/dist/0.9/components/layout/ColumnComponent.js +26 -23
  72. package/dist/0.9/components/layout/ListComponent.d.ts +3 -2
  73. package/dist/0.9/components/layout/ListComponent.js +30 -27
  74. package/dist/0.9/components/layout/ModalComponent.d.ts +3 -2
  75. package/dist/0.9/components/layout/ModalComponent.js +11 -22
  76. package/dist/0.9/components/layout/RowComponent.d.ts +3 -2
  77. package/dist/0.9/components/layout/RowComponent.js +31 -28
  78. package/dist/0.9/components/layout/TabsComponent.d.ts +3 -2
  79. package/dist/0.9/components/layout/TabsComponent.js +21 -21
  80. package/dist/0.9/components/types.d.ts +8 -0
  81. package/dist/0.9/contexts/A2UIProvider.d.ts +45 -28
  82. package/dist/0.9/contexts/A2UIProvider.js +18 -26
  83. package/dist/0.9/contexts/ActionContext.js +5 -5
  84. package/dist/0.9/contexts/ComponentsMapContext.d.ts +8 -31
  85. package/dist/0.9/contexts/ComponentsMapContext.js +12 -16
  86. package/dist/0.9/contexts/ScopeContext.js +3 -3
  87. package/dist/0.9/contexts/SurfaceContext.d.ts +3 -3
  88. package/dist/0.9/contexts/SurfaceContext.js +3 -3
  89. package/dist/0.9/hooks/useComponent.d.ts +2 -2
  90. package/dist/0.9/hooks/useDataBinding.js +3 -3
  91. package/dist/0.9/index.d.ts +6 -4
  92. package/dist/0.9/index.js +12 -10
  93. package/dist/0.9/standard-catalog/index.d.ts +61 -0
  94. package/dist/0.9/standard-catalog/index.js +69 -0
  95. package/dist/components/ui/button.d.ts +1 -1
  96. package/dist/lib/utils.d.ts +5 -0
  97. package/dist/lib/utils.js +6 -4
  98. package/package.json +14 -5
  99. package/dist/0.9/components/index.js +0 -68
@@ -1,6 +1,7 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 i } from "react/jsx-runtime";
2
- import { memo as g, useCallback as v } from "react";
3
- import { useStringBinding as S, useFormBinding as b } from "../../hooks/useDataBinding.js";
4
- import { useValidation as C } from "../../hooks/useValidation.js";
5
- import { Slider as N } from "../../../components/ui/slider.js";
6
- import { Label as w } from "../../../components/ui/label.js";
7
- import { cn as y } from "../../../lib/utils.js";
8
- const V = g(function({
9
- surfaceId: n,
10
- component: p
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 e = p, o = S(n, e.label, ""), l = e.min ?? 0, r = e.max ?? 100, { valid: h, errors: s } = C(n, e.checks), [m, a] = b(
13
- n,
14
- e.value,
18
+ const o = b(t, f, ""), { valid: x, errors: s } = V(t, h), [d, a] = y(
19
+ t,
20
+ u,
15
21
  l
16
- ), f = v(
17
- (t) => {
18
- t.length > 0 && a(t[0]);
22
+ ), g = N(
23
+ (r) => {
24
+ r.length > 0 && a(r[0]);
19
25
  },
20
26
  [a]
21
- ), d = `slider-${e.id}`, x = e.weight ? { flexGrow: e.weight } : void 0;
22
- return /* @__PURE__ */ c("div", { className: y("flex flex-col gap-2 py-2"), style: x, children: [
23
- o && /* @__PURE__ */ i(w, { htmlFor: d, children: o }),
24
- /* @__PURE__ */ i(
25
- N,
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: d,
28
- value: [m],
29
- onValueChange: f,
33
+ id: m,
34
+ value: [d],
35
+ onValueChange: g,
30
36
  min: l,
31
- max: r,
37
+ max: i,
32
38
  step: 1,
33
- "aria-invalid": !h
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__ */ i("span", { children: l }),
38
- /* @__PURE__ */ i("span", { className: "font-medium text-foreground", children: m }),
39
- /* @__PURE__ */ i("span", { children: r })
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__ */ i("div", { className: "text-sm text-destructive", children: s.map((t, u) => /* @__PURE__ */ i("p", { children: t }, u)) })
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
- V.displayName = "A2UI.Slider";
50
+ k.displayName = "A2UI.Slider";
45
51
  export {
46
- V as SliderComponent
52
+ k as SliderComponent
47
53
  };
@@ -1,5 +1,6 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 T, jsx as t } from "react/jsx-runtime";
2
- import { memo as f, useCallback as b } from "react";
3
- import { useStringBinding as C, useFormBinding as F } from "../../hooks/useDataBinding.js";
4
- import { useValidation as y } from "../../hooks/useValidation.js";
5
- import { Input as N } from "../../../components/ui/input.js";
6
- import { Textarea as w } from "../../../components/ui/textarea.js";
7
- import { Label as j } from "../../../components/ui/label.js";
8
- import { cn as a } from "../../../lib/utils.js";
9
- const k = {
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
- }, B = f(function({
16
- surfaceId: n,
17
- component: x
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 e = x, s = C(n, e.label, ""), [l, m] = F(
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
- m(r.target.value);
26
+ d(r.target.value);
26
27
  },
27
- [m]
28
- ), i = `textfield-${e.id}`, p = e.variant ?? "shortText", u = k[p] || "text", h = p === "longText", g = e.weight ? { flexGrow: e.weight } : void 0;
29
- return /* @__PURE__ */ T("div", { className: a("flex flex-col gap-2"), style: g, children: [
30
- s && /* @__PURE__ */ t(j, { htmlFor: i, children: s }),
31
- h ? /* @__PURE__ */ t(
32
- w,
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: i,
35
- value: l,
36
- onChange: d,
37
- className: a("min-h-[100px]", !o && "border-destructive"),
38
- "aria-invalid": !o
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__ */ t(
41
- N,
41
+ ) : /* @__PURE__ */ e(
42
+ L,
42
43
  {
43
- id: i,
44
- type: u,
45
- value: l,
46
- onChange: d,
47
- className: a(!o && "border-destructive"),
48
- "aria-invalid": !o
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__ */ t("div", { className: "text-sm text-destructive", children: c.map((r, v) => /* @__PURE__ */ t("p", { children: r }, v)) })
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
- B.displayName = "A2UI.TextField";
55
+ A.displayName = "A2UI.TextField";
55
56
  export {
56
- B as TextFieldComponent
57
+ A as TextFieldComponent
57
58
  };
@@ -1,5 +1,6 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 r } from "react/jsx-runtime";
2
- import { memo as d } from "react";
3
- import { Card as n, CardContent as i } from "../../../components/ui/card.js";
4
- import { ComponentRenderer as p } from "../ComponentRenderer.js";
5
- const c = d(function({
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
- component: m
7
+ child: r,
8
+ weight: n
8
9
  }) {
9
- const o = m, e = o.weight ? { flexGrow: o.weight } : void 0;
10
- return o.child ? /* @__PURE__ */ r(n, { style: e, children: /* @__PURE__ */ r(i, { className: "p-4", children: /* @__PURE__ */ r(p, { surfaceId: t, componentId: o.child }) }) }) : /* @__PURE__ */ r(n, { style: e });
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
- c.displayName = "A2UI.Card";
13
+ C.displayName = "A2UI.Card";
13
14
  export {
14
- c as CardComponent
15
+ C as CardComponent
15
16
  };
@@ -1,6 +1,7 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 n } from "react/jsx-runtime";
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 d } from "../../../lib/utils.js";
6
- import { ComponentRenderer as j } from "../ComponentRenderer.js";
7
- import { TemplateRenderer as h } from "./TemplateRenderer.js";
8
- const C = {
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
- }, g = {
16
+ }, C = {
17
17
  start: "items-start",
18
18
  center: "items-center",
19
19
  end: "items-end",
20
20
  stretch: "items-stretch"
21
- }, v = f(function({
21
+ }, x = f(function({
22
22
  surfaceId: o,
23
- component: m
23
+ children: t,
24
+ justify: i = "start",
25
+ align: a = "stretch",
26
+ weight: s
24
27
  }) {
25
- const e = m, c = u(o), { basePath: a } = y(), l = e.justify ?? "start", p = e.align ?? "stretch", r = d(
28
+ const p = u(o), { basePath: c } = y(), n = l(
26
29
  "flex flex-col gap-4",
27
- C[l],
28
- g[p]
29
- ), s = e.weight ? { flexGrow: e.weight } : void 0, t = e.children;
30
- return Array.isArray(t) ? /* @__PURE__ */ n("div", { className: r, style: s, children: t.map((i) => /* @__PURE__ */ n(
31
- j,
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: i
37
+ componentId: m
35
38
  },
36
- i
37
- )) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ n("div", { className: r, style: s, children: /* @__PURE__ */ n(
38
- h,
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: c,
43
- basePath: a
45
+ dataModel: p,
46
+ basePath: c
44
47
  }
45
- ) }) : /* @__PURE__ */ n("div", { className: r, style: s });
48
+ ) }) : /* @__PURE__ */ e("div", { className: n, style: r });
46
49
  });
47
- v.displayName = "A2UI.Column";
50
+ x.displayName = "A2UI.Column";
48
51
  export {
49
- v as ColumnComponent
52
+ x as ColumnComponent
50
53
  };
@@ -1,4 +1,5 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 o } from "react/jsx-runtime";
2
- import { memo as d } from "react";
3
- import { useDataModel as f } from "../../hooks/useDataBinding.js";
4
- import { useScope as h } from "../../contexts/ScopeContext.js";
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 g } from "../ComponentRenderer.js";
7
- import { TemplateRenderer as v } from "./TemplateRenderer.js";
8
- const y = {
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
- }, w = d(function({
14
- surfaceId: r,
15
- component: s
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 e = s, c = f(r), { basePath: l } = h(), a = e.direction ?? "vertical", p = e.align ?? "stretch", n = x(
20
+ const a = l(o), { basePath: c } = d(), r = x(
18
21
  "flex gap-3",
19
- a === "vertical" ? "flex-col" : "flex-row flex-wrap",
20
- y[p]
21
- ), i = e.weight ? { flexGrow: e.weight } : void 0, t = e.children;
22
- return Array.isArray(t) ? /* @__PURE__ */ o("div", { className: n, style: i, children: t.map((m) => /* @__PURE__ */ o(
23
- g,
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: r,
26
- componentId: m
28
+ surfaceId: o,
29
+ componentId: s
27
30
  },
28
- m
29
- )) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ o("div", { className: n, style: i, children: /* @__PURE__ */ o(
30
- v,
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: r,
35
+ surfaceId: o,
33
36
  template: t,
34
- dataModel: c,
35
- basePath: l
37
+ dataModel: a,
38
+ basePath: c
36
39
  }
37
- ) }) : /* @__PURE__ */ o("div", { className: n, style: i });
40
+ ) }) : /* @__PURE__ */ e("div", { className: r, style: m });
38
41
  });
39
- w.displayName = "A2UI.List";
42
+ A.displayName = "A2UI.List";
40
43
  export {
41
- w as ListComponent
44
+ A as ListComponent
42
45
  };
@@ -1,5 +1,6 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 c, DialogTrigger as d, DialogContent as s } from "../../../components/ui/dialog.js";
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 g = p(function({
6
- surfaceId: e,
7
- component: r
5
+ const f = p(function({
6
+ surfaceId: n,
7
+ trigger: e,
8
+ content: r
8
9
  }) {
9
- const n = r, [i, m] = a(!1);
10
- return !n.trigger || !n.content ? null : /* @__PURE__ */ l(c, { open: i, onOpenChange: m, children: [
11
- /* @__PURE__ */ o(d, { asChild: !0, children: /* @__PURE__ */ o("div", { className: "cursor-pointer", children: /* @__PURE__ */ o(
12
- t,
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
- g.displayName = "A2UI.Modal";
16
+ f.displayName = "A2UI.Modal";
28
17
  export {
29
- g as ModalComponent
18
+ f as ModalComponent
30
19
  };
@@ -1,6 +1,7 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 o } from "react/jsx-runtime";
2
- import { memo as l } from "react";
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 d } from "../../contexts/ScopeContext.js";
5
- import { cn as u } from "../../../lib/utils.js";
6
- import { ComponentRenderer as j } from "../ComponentRenderer.js";
7
- import { TemplateRenderer as h } from "./TemplateRenderer.js";
8
- const w = {
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
- }, g = {
16
+ }, w = {
17
17
  start: "items-start",
18
18
  center: "items-center",
19
19
  end: "items-end",
20
20
  stretch: "items-stretch"
21
- }, v = l(function({
22
- surfaceId: n,
23
- component: c
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 e = c, m = y(n), { basePath: a } = d(), p = e.justify ?? "start", f = e.align ?? "stretch", r = u(
28
+ const p = y(o), { basePath: c } = u(), r = d(
26
29
  "flex flex-row gap-3",
27
- w[p],
28
- g[f]
29
- ), s = e.weight ? { flexGrow: e.weight } : void 0, t = e.children;
30
- return Array.isArray(t) ? /* @__PURE__ */ o("div", { className: r, style: s, children: t.map((i) => /* @__PURE__ */ o(
31
- j,
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: n,
34
- componentId: i
36
+ surfaceId: o,
37
+ componentId: m
35
38
  },
36
- i
37
- )) }) : t && typeof t == "object" && "componentId" in t ? /* @__PURE__ */ o("div", { className: r, style: s, children: /* @__PURE__ */ o(
38
- h,
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: n,
43
+ surfaceId: o,
41
44
  template: t,
42
- dataModel: m,
43
- basePath: a
45
+ dataModel: p,
46
+ basePath: c
44
47
  }
45
- ) }) : /* @__PURE__ */ o("div", { className: r, style: s });
48
+ ) }) : /* @__PURE__ */ e("div", { className: r, style: s });
46
49
  });
47
- v.displayName = "A2UI.Row";
50
+ x.displayName = "A2UI.Row";
48
51
  export {
49
- v as RowComponent
52
+ x as RowComponent
50
53
  };
@@ -1,5 +1,6 @@
1
- import { A2UIComponentProps } from '../../contexts/ComponentsMapContext';
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 m, jsx as n, Fragment as d } from "react/jsx-runtime";
2
- import { memo as h } from "react";
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 b, TabsList as T, TabsTrigger as u, TabsContent as f } from "../../../components/ui/tabs.js";
5
- import { ComponentRenderer as g } from "../ComponentRenderer.js";
6
- function x({
7
- surfaceId: r,
8
- title: l,
9
- index: i
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 e = p(r, l, `Tab ${i + 1}`);
12
- return /* @__PURE__ */ n(d, { children: e });
11
+ const r = p(t, o, `Tab ${n + 1}`);
12
+ return /* @__PURE__ */ l(m, { children: r });
13
13
  }
14
- const C = h(function({
15
- surfaceId: l,
16
- component: i
14
+ const x = s(function({
15
+ surfaceId: o,
16
+ tabs: n,
17
+ weight: r
17
18
  }) {
18
- const e = i, o = e.tabs;
19
- if (!o || o.length === 0)
19
+ if (!n || n.length === 0)
20
20
  return null;
21
- const a = e.weight ? { flexGrow: e.weight } : void 0, s = o[0].child;
22
- return /* @__PURE__ */ m(b, { defaultValue: s, className: "w-full", style: a, children: [
23
- /* @__PURE__ */ n(T, { children: o.map((t, c) => /* @__PURE__ */ n(u, { value: t.child, children: /* @__PURE__ */ n(x, { surfaceId: l, title: t.title, index: c }) }, t.child)) }),
24
- o.map((t) => /* @__PURE__ */ n(f, { value: t.child, children: /* @__PURE__ */ n(g, { surfaceId: l, componentId: t.child }) }, t.child))
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
- C.displayName = "A2UI.Tabs";
27
+ x.displayName = "A2UI.Tabs";
28
28
  export {
29
- C as TabsComponent
29
+ x as TabsComponent
30
30
  };