@lynx-js/genui 0.0.1-rc.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 (254) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +170 -0
  3. package/a2ui/README.md +140 -0
  4. package/a2ui/dist/catalog/Button/catalog.json +156 -0
  5. package/a2ui/dist/catalog/Button/index.d.ts +35 -0
  6. package/a2ui/dist/catalog/Button/index.js +35 -0
  7. package/a2ui/dist/catalog/Button/index.js.map +1 -0
  8. package/a2ui/dist/catalog/Card/catalog.json +24 -0
  9. package/a2ui/dist/catalog/Card/index.d.ts +11 -0
  10. package/a2ui/dist/catalog/Card/index.js +19 -0
  11. package/a2ui/dist/catalog/Card/index.js.map +1 -0
  12. package/a2ui/dist/catalog/CheckBox/catalog.json +170 -0
  13. package/a2ui/dist/catalog/CheckBox/index.d.ts +32 -0
  14. package/a2ui/dist/catalog/CheckBox/index.js +24 -0
  15. package/a2ui/dist/catalog/CheckBox/index.js.map +1 -0
  16. package/a2ui/dist/catalog/Column/catalog.json +57 -0
  17. package/a2ui/dist/catalog/Column/index.d.ts +15 -0
  18. package/a2ui/dist/catalog/Column/index.js +55 -0
  19. package/a2ui/dist/catalog/Column/index.js.map +1 -0
  20. package/a2ui/dist/catalog/Divider/catalog.json +14 -0
  21. package/a2ui/dist/catalog/Divider/index.d.ts +9 -0
  22. package/a2ui/dist/catalog/Divider/index.js +8 -0
  23. package/a2ui/dist/catalog/Divider/index.js.map +1 -0
  24. package/a2ui/dist/catalog/Icon/catalog.json +45 -0
  25. package/a2ui/dist/catalog/Icon/index.d.ts +14 -0
  26. package/a2ui/dist/catalog/Icon/index.js +11 -0
  27. package/a2ui/dist/catalog/Icon/index.js.map +1 -0
  28. package/a2ui/dist/catalog/Image/catalog.json +62 -0
  29. package/a2ui/dist/catalog/Image/index.d.ts +16 -0
  30. package/a2ui/dist/catalog/Image/index.js +30 -0
  31. package/a2ui/dist/catalog/Image/index.js.map +1 -0
  32. package/a2ui/dist/catalog/LineChart/catalog.json +98 -0
  33. package/a2ui/dist/catalog/LineChart/index.d.ts +31 -0
  34. package/a2ui/dist/catalog/LineChart/index.js +195 -0
  35. package/a2ui/dist/catalog/LineChart/index.js.map +1 -0
  36. package/a2ui/dist/catalog/List/catalog.json +52 -0
  37. package/a2ui/dist/catalog/List/index.d.ts +15 -0
  38. package/a2ui/dist/catalog/List/index.js +53 -0
  39. package/a2ui/dist/catalog/List/index.js.map +1 -0
  40. package/a2ui/dist/catalog/Modal/catalog.json +18 -0
  41. package/a2ui/dist/catalog/Modal/index.d.ts +12 -0
  42. package/a2ui/dist/catalog/Modal/index.js +33 -0
  43. package/a2ui/dist/catalog/Modal/index.js.map +1 -0
  44. package/a2ui/dist/catalog/PieChart/catalog.json +87 -0
  45. package/a2ui/dist/catalog/PieChart/index.d.ts +37 -0
  46. package/a2ui/dist/catalog/PieChart/index.js +131 -0
  47. package/a2ui/dist/catalog/PieChart/index.js.map +1 -0
  48. package/a2ui/dist/catalog/RadioGroup/catalog.json +184 -0
  49. package/a2ui/dist/catalog/RadioGroup/index.d.ts +36 -0
  50. package/a2ui/dist/catalog/RadioGroup/index.js +36 -0
  51. package/a2ui/dist/catalog/RadioGroup/index.js.map +1 -0
  52. package/a2ui/dist/catalog/Row/catalog.json +57 -0
  53. package/a2ui/dist/catalog/Row/index.d.ts +15 -0
  54. package/a2ui/dist/catalog/Row/index.js +28 -0
  55. package/a2ui/dist/catalog/Row/index.js.map +1 -0
  56. package/a2ui/dist/catalog/Slider/catalog.json +183 -0
  57. package/a2ui/dist/catalog/Slider/index.d.ts +41 -0
  58. package/a2ui/dist/catalog/Slider/index.js +39 -0
  59. package/a2ui/dist/catalog/Slider/index.js.map +1 -0
  60. package/a2ui/dist/catalog/Slider/utils.d.ts +11 -0
  61. package/a2ui/dist/catalog/Slider/utils.js +58 -0
  62. package/a2ui/dist/catalog/Slider/utils.js.map +1 -0
  63. package/a2ui/dist/catalog/Tabs/catalog.json +28 -0
  64. package/a2ui/dist/catalog/Tabs/index.d.ts +12 -0
  65. package/a2ui/dist/catalog/Tabs/index.js +32 -0
  66. package/a2ui/dist/catalog/Tabs/index.js.map +1 -0
  67. package/a2ui/dist/catalog/Text/catalog.json +74 -0
  68. package/a2ui/dist/catalog/Text/index.d.ts +18 -0
  69. package/a2ui/dist/catalog/Text/index.js +27 -0
  70. package/a2ui/dist/catalog/Text/index.js.map +1 -0
  71. package/a2ui/dist/catalog/TextField/catalog.json +147 -0
  72. package/a2ui/dist/catalog/TextField/index.d.ts +35 -0
  73. package/a2ui/dist/catalog/TextField/index.js +43 -0
  74. package/a2ui/dist/catalog/TextField/index.js.map +1 -0
  75. package/a2ui/dist/catalog/TextField/utils.d.ts +7 -0
  76. package/a2ui/dist/catalog/TextField/utils.js +51 -0
  77. package/a2ui/dist/catalog/TextField/utils.js.map +1 -0
  78. package/a2ui/dist/catalog/defineCatalog.d.ts +119 -0
  79. package/a2ui/dist/catalog/defineCatalog.js +196 -0
  80. package/a2ui/dist/catalog/defineCatalog.js.map +1 -0
  81. package/a2ui/dist/catalog/index.d.ts +20 -0
  82. package/a2ui/dist/catalog/index.js +26 -0
  83. package/a2ui/dist/catalog/index.js.map +1 -0
  84. package/a2ui/dist/catalog/utils/chart.d.ts +3 -0
  85. package/a2ui/dist/catalog/utils/chart.js +28 -0
  86. package/a2ui/dist/catalog/utils/chart.js.map +1 -0
  87. package/a2ui/dist/functions/index.d.ts +19 -0
  88. package/a2ui/dist/functions/index.js +87 -0
  89. package/a2ui/dist/functions/index.js.map +1 -0
  90. package/a2ui/dist/index.d.ts +11 -0
  91. package/a2ui/dist/index.js +35 -0
  92. package/a2ui/dist/index.js.map +1 -0
  93. package/a2ui/dist/react/A2UI.d.ts +77 -0
  94. package/a2ui/dist/react/A2UI.js +159 -0
  95. package/a2ui/dist/react/A2UI.js.map +1 -0
  96. package/a2ui/dist/react/A2UIProvider.d.ts +25 -0
  97. package/a2ui/dist/react/A2UIProvider.js +20 -0
  98. package/a2ui/dist/react/A2UIProvider.js.map +1 -0
  99. package/a2ui/dist/react/A2UIRenderer.d.ts +34 -0
  100. package/a2ui/dist/react/A2UIRenderer.js +161 -0
  101. package/a2ui/dist/react/A2UIRenderer.js.map +1 -0
  102. package/a2ui/dist/react/FormContext.d.ts +10 -0
  103. package/a2ui/dist/react/FormContext.js +12 -0
  104. package/a2ui/dist/react/FormContext.js.map +1 -0
  105. package/a2ui/dist/react/index.d.ts +8 -0
  106. package/a2ui/dist/react/index.js +23 -0
  107. package/a2ui/dist/react/index.js.map +1 -0
  108. package/a2ui/dist/react/useA2UIContext.d.ts +7 -0
  109. package/a2ui/dist/react/useA2UIContext.js +19 -0
  110. package/a2ui/dist/react/useA2UIContext.js.map +1 -0
  111. package/a2ui/dist/react/useAction.d.ts +9 -0
  112. package/a2ui/dist/react/useAction.js +38 -0
  113. package/a2ui/dist/react/useAction.js.map +1 -0
  114. package/a2ui/dist/react/useCatalog.d.ts +7 -0
  115. package/a2ui/dist/react/useCatalog.js +13 -0
  116. package/a2ui/dist/react/useCatalog.js.map +1 -0
  117. package/a2ui/dist/react/useChecks.d.ts +27 -0
  118. package/a2ui/dist/react/useChecks.js +76 -0
  119. package/a2ui/dist/react/useChecks.js.map +1 -0
  120. package/a2ui/dist/react/useDataBinding.d.ts +10 -0
  121. package/a2ui/dist/react/useDataBinding.js +175 -0
  122. package/a2ui/dist/react/useDataBinding.js.map +1 -0
  123. package/a2ui/dist/store/FormController.d.ts +23 -0
  124. package/a2ui/dist/store/FormController.js +40 -0
  125. package/a2ui/dist/store/FormController.js.map +1 -0
  126. package/a2ui/dist/store/FunctionRegistry.d.ts +47 -0
  127. package/a2ui/dist/store/FunctionRegistry.js +23 -0
  128. package/a2ui/dist/store/FunctionRegistry.js.map +1 -0
  129. package/a2ui/dist/store/MessageProcessor.d.ts +28 -0
  130. package/a2ui/dist/store/MessageProcessor.js +408 -0
  131. package/a2ui/dist/store/MessageProcessor.js.map +1 -0
  132. package/a2ui/dist/store/MessageStore.d.ts +38 -0
  133. package/a2ui/dist/store/MessageStore.js +37 -0
  134. package/a2ui/dist/store/MessageStore.js.map +1 -0
  135. package/a2ui/dist/store/Resource.d.ts +45 -0
  136. package/a2ui/dist/store/Resource.js +80 -0
  137. package/a2ui/dist/store/Resource.js.map +1 -0
  138. package/a2ui/dist/store/SignalStore.d.ts +10 -0
  139. package/a2ui/dist/store/SignalStore.js +29 -0
  140. package/a2ui/dist/store/SignalStore.js.map +1 -0
  141. package/a2ui/dist/store/index.d.ts +14 -0
  142. package/a2ui/dist/store/index.js +15 -0
  143. package/a2ui/dist/store/index.js.map +1 -0
  144. package/a2ui/dist/store/payloadNormalizer.d.ts +27 -0
  145. package/a2ui/dist/store/payloadNormalizer.js +179 -0
  146. package/a2ui/dist/store/payloadNormalizer.js.map +1 -0
  147. package/a2ui/dist/store/resolveFunctionCall.d.ts +18 -0
  148. package/a2ui/dist/store/resolveFunctionCall.js +131 -0
  149. package/a2ui/dist/store/resolveFunctionCall.js.map +1 -0
  150. package/a2ui/dist/store/types.d.ts +68 -0
  151. package/a2ui/dist/store/types.js +2 -0
  152. package/a2ui/dist/store/types.js.map +1 -0
  153. package/a2ui/dist/tsconfig.build.tsbuildinfo +1 -0
  154. package/a2ui/styles/catalog/Button.css +83 -0
  155. package/a2ui/styles/catalog/Card.css +49 -0
  156. package/a2ui/styles/catalog/CheckBox.css +46 -0
  157. package/a2ui/styles/catalog/Column.css +89 -0
  158. package/a2ui/styles/catalog/Divider.css +20 -0
  159. package/a2ui/styles/catalog/Icon.css +39 -0
  160. package/a2ui/styles/catalog/Image.css +54 -0
  161. package/a2ui/styles/catalog/LineChart.css +116 -0
  162. package/a2ui/styles/catalog/List.css +38 -0
  163. package/a2ui/styles/catalog/Modal.css +60 -0
  164. package/a2ui/styles/catalog/PieChart.css +109 -0
  165. package/a2ui/styles/catalog/RadioGroup.css +123 -0
  166. package/a2ui/styles/catalog/Row.css +83 -0
  167. package/a2ui/styles/catalog/Slider.css +96 -0
  168. package/a2ui/styles/catalog/Tabs.css +46 -0
  169. package/a2ui/styles/catalog/Text.css +121 -0
  170. package/a2ui/styles/catalog/TextField.css +48 -0
  171. package/a2ui/styles/theme.css +62 -0
  172. package/a2ui-catalog-extractor/README.md +605 -0
  173. package/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js +6 -0
  174. package/a2ui-catalog-extractor/dist/cli.d.ts +12 -0
  175. package/a2ui-catalog-extractor/dist/cli.js +171 -0
  176. package/a2ui-catalog-extractor/dist/cli.js.map +1 -0
  177. package/a2ui-catalog-extractor/dist/index.d.ts +140 -0
  178. package/a2ui-catalog-extractor/dist/index.js +755 -0
  179. package/a2ui-catalog-extractor/dist/index.js.map +1 -0
  180. package/a2ui-catalog-extractor/dist/tsconfig.build.tsbuildinfo +1 -0
  181. package/a2ui-catalog-extractor/skills/a2ui-catalog-extractor/SKILL.md +30 -0
  182. package/a2ui-prompt/README.md +65 -0
  183. package/a2ui-prompt/dist/index.d.ts +91 -0
  184. package/a2ui-prompt/dist/index.js +767 -0
  185. package/cli/README.md +88 -0
  186. package/cli/bin/cli.js +271 -0
  187. package/dist/index.d.ts +10 -0
  188. package/dist/index.js +10 -0
  189. package/dist/index.js.map +1 -0
  190. package/dist/tsconfig.build.tsbuildinfo +1 -0
  191. package/index.ts +114 -0
  192. package/openui/README.md +211 -0
  193. package/openui/dist/catalog/Action/index.d.ts +20 -0
  194. package/openui/dist/catalog/Action/index.js +23 -0
  195. package/openui/dist/catalog/Action/index.js.map +1 -0
  196. package/openui/dist/catalog/Button/index.d.ts +64 -0
  197. package/openui/dist/catalog/Button/index.js +75 -0
  198. package/openui/dist/catalog/Button/index.js.map +1 -0
  199. package/openui/dist/catalog/Card/index.d.ts +34 -0
  200. package/openui/dist/catalog/Card/index.js +69 -0
  201. package/openui/dist/catalog/Card/index.js.map +1 -0
  202. package/openui/dist/catalog/CardHeader/index.d.ts +5 -0
  203. package/openui/dist/catalog/CardHeader/index.js +18 -0
  204. package/openui/dist/catalog/CardHeader/index.js.map +1 -0
  205. package/openui/dist/catalog/Separator/index.d.ts +2 -0
  206. package/openui/dist/catalog/Separator/index.js +13 -0
  207. package/openui/dist/catalog/Separator/index.js.map +1 -0
  208. package/openui/dist/catalog/Stack/index.d.ts +29 -0
  209. package/openui/dist/catalog/Stack/index.js +61 -0
  210. package/openui/dist/catalog/Stack/index.js.map +1 -0
  211. package/openui/dist/catalog/Tag/index.d.ts +4 -0
  212. package/openui/dist/catalog/Tag/index.js +15 -0
  213. package/openui/dist/catalog/Tag/index.js.map +1 -0
  214. package/openui/dist/catalog/TextContent/index.d.ts +11 -0
  215. package/openui/dist/catalog/TextContent/index.js +33 -0
  216. package/openui/dist/catalog/TextContent/index.js.map +1 -0
  217. package/openui/dist/catalog/index.d.ts +7 -0
  218. package/openui/dist/catalog/index.js +11 -0
  219. package/openui/dist/catalog/index.js.map +1 -0
  220. package/openui/dist/catalog/utils.d.ts +2 -0
  221. package/openui/dist/catalog/utils.js +17 -0
  222. package/openui/dist/catalog/utils.js.map +1 -0
  223. package/openui/dist/core/context.d.ts +112 -0
  224. package/openui/dist/core/context.js +99 -0
  225. package/openui/dist/core/context.js.map +1 -0
  226. package/openui/dist/core/createLibrary.d.ts +10 -0
  227. package/openui/dist/core/createLibrary.js +36 -0
  228. package/openui/dist/core/createLibrary.js.map +1 -0
  229. package/openui/dist/core/hooks/index.d.ts +4 -0
  230. package/openui/dist/core/hooks/index.js +6 -0
  231. package/openui/dist/core/hooks/index.js.map +1 -0
  232. package/openui/dist/core/hooks/useFormValidation.d.ts +13 -0
  233. package/openui/dist/core/hooks/useFormValidation.js +76 -0
  234. package/openui/dist/core/hooks/useFormValidation.js.map +1 -0
  235. package/openui/dist/core/hooks/useOpenUIState.d.ts +33 -0
  236. package/openui/dist/core/hooks/useOpenUIState.js +413 -0
  237. package/openui/dist/core/hooks/useOpenUIState.js.map +1 -0
  238. package/openui/dist/core/hooks/useStateField.d.ts +2 -0
  239. package/openui/dist/core/hooks/useStateField.js +11 -0
  240. package/openui/dist/core/hooks/useStateField.js.map +1 -0
  241. package/openui/dist/core/index.d.ts +7 -0
  242. package/openui/dist/core/index.js +8 -0
  243. package/openui/dist/core/index.js.map +1 -0
  244. package/openui/dist/core/library.d.ts +20 -0
  245. package/openui/dist/core/library.js +13 -0
  246. package/openui/dist/core/library.js.map +1 -0
  247. package/openui/dist/core/renderer.css +271 -0
  248. package/openui/dist/core/renderer.d.ts +9 -0
  249. package/openui/dist/core/renderer.js +139 -0
  250. package/openui/dist/core/renderer.js.map +1 -0
  251. package/openui/dist/core/utils.d.ts +1 -0
  252. package/openui/dist/core/utils.js +76 -0
  253. package/openui/dist/core/utils.js.map +1 -0
  254. package/package.json +120 -0
@@ -0,0 +1,35 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/Button.css';
3
+ /**
4
+ * @a2uiCatalog Button
5
+ */
6
+ export interface ButtonProps extends GenericComponentProps {
7
+ child: string;
8
+ variant?: 'primary' | 'borderless';
9
+ isValid?: boolean;
10
+ /** v0.9 actions should use the `event` wrapper for server-dispatched clicks. */
11
+ action: {
12
+ event: {
13
+ name: string;
14
+ /** Context is a JSON object map in v0.9. */
15
+ context?: Record<string, unknown>;
16
+ };
17
+ } | {
18
+ functionCall: {
19
+ call: string;
20
+ args: Record<string, unknown>;
21
+ returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void';
22
+ };
23
+ };
24
+ checks?: Array<{
25
+ condition: boolean | {
26
+ path: string;
27
+ } | {
28
+ call: string;
29
+ args: Record<string, unknown>;
30
+ returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void';
31
+ };
32
+ message: string;
33
+ }>;
34
+ }
35
+ export declare function Button(props: ButtonProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@lynx-js/react/jsx-runtime";
2
+ // Copyright 2026 The Lynx Authors. All rights reserved.
3
+ // Licensed under the Apache License Version 2.0 that can be found in the
4
+ // LICENSE file in the root directory of this source tree.
5
+ import { A2UIRenderer } from '../../react/A2UIRenderer.js';
6
+ import { useChecks } from '../../react/useChecks.js';
7
+ import '../../../styles/catalog/Button.css';
8
+ export function Button(props) {
9
+ const { action, child, id, isValid = true, surface, sendAction, variant = 'primary', dataContextPath, } = props;
10
+ const checks = props.checks;
11
+ const { ok, firstFailureMessage } = useChecks({
12
+ checks,
13
+ componentId: id ?? '',
14
+ surface,
15
+ dataContextPath,
16
+ });
17
+ // The button is interactive only when both gates pass: `isValid` (the
18
+ // agent's imperative "disabled" signal) and `ok` (the data-driven result
19
+ // of evaluating the `checks` array).
20
+ const enabled = isValid && ok;
21
+ const handleClick = () => {
22
+ if (enabled && action) {
23
+ void sendAction?.(action);
24
+ }
25
+ };
26
+ const childResource = child
27
+ ? surface.resources.get(child)
28
+ : undefined;
29
+ return (_jsxs(_Fragment, { children: [_jsx("view", { className: `button button-${variant}${isValid ? '' : ' button-disabled'}${ok ? '' : ' button-invalid'}`, bindtap: enabled ? handleClick : undefined, children: childResource
30
+ ? _jsx(A2UIRenderer, { resource: childResource })
31
+ : _jsx("text", { className: 'button-fallback', children: "Button" }) }), !ok && firstFailureMessage
32
+ ? _jsx("text", { className: 'button-error', children: firstFailureMessage })
33
+ : null] }));
34
+ }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/Button/index.tsx"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,OAAO,oCAAoC,CAAC;AA+C5C,MAAM,UAAU,MAAM,CACpB,KAAkB;IAElB,MAAM,EACJ,MAAM,EACN,KAAK,EACL,EAAE,EACF,OAAO,GAAG,IAAI,EACd,OAAO,EACP,UAAU,EACV,OAAO,GAAG,SAAS,EACnB,eAAe,GAChB,GAAG,KAAK,CAAC;IACV,MAAM,MAAM,GAAG,KAAK,CAAC,MAAiC,CAAC;IACvD,MAAM,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAC;QAC5C,MAAM;QACN,WAAW,EAAE,EAAE,IAAI,EAAE;QACrB,OAAO;QACP,eAAe;KAChB,CAAC,CAAC;IAEH,sEAAsE;IACtE,yEAAyE;IACzE,qCAAqC;IACrC,MAAM,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAE9B,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,KAAK,UAAU,EAAE,CAAC,MAAiC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK;QACzB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC;QAC9B,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,CACL,8BACE,eACE,SAAS,EAAE,iBAAiB,OAAO,GACjC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBACjB,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,YAEzC,aAAa;oBACZ,CAAC,CAAC,KAAC,YAAY,IAAC,QAAQ,EAAE,aAAa,GAAI;oBAC3C,CAAC,CAAC,eAAM,SAAS,EAAC,iBAAiB,uBAAc,GAC9C,EACN,CAAC,EAAE,IAAI,mBAAmB;gBACzB,CAAC,CAAC,eAAM,SAAS,EAAC,cAAc,YAAE,mBAAmB,GAAQ;gBAC7D,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ {
2
+ "Card": {
3
+ "properties": {
4
+ "child": {
5
+ "type": "string"
6
+ },
7
+ "variant": {
8
+ "type": "string",
9
+ "enum": [
10
+ "elevated",
11
+ "outlined",
12
+ "filled",
13
+ "ghost"
14
+ ]
15
+ },
16
+ "weight": {
17
+ "type": "number"
18
+ }
19
+ },
20
+ "required": [
21
+ "child"
22
+ ]
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/Card.css';
3
+ /**
4
+ * @a2uiCatalog Card
5
+ */
6
+ export interface CardProps extends GenericComponentProps {
7
+ child: string;
8
+ variant?: 'elevated' | 'outlined' | 'filled' | 'ghost';
9
+ weight?: number;
10
+ }
11
+ export declare function Card(props: CardProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "@lynx-js/react/jsx-runtime";
2
+ // Copyright 2026 The Lynx Authors. All rights reserved.
3
+ // Licensed under the Apache License Version 2.0 that can be found in the
4
+ // LICENSE file in the root directory of this source tree.
5
+ import { NodeRenderer } from '../../react/A2UIRenderer.js';
6
+ import '../../../styles/catalog/Card.css';
7
+ export function Card(props) {
8
+ const { child: childId, surface, dataContextPath } = props;
9
+ const childComponent = surface.components.get(childId);
10
+ const childWithContext = childComponent && dataContextPath
11
+ ? { ...childComponent, dataContextPath }
12
+ : childComponent;
13
+ const variant = props.variant ?? 'elevated';
14
+ const weightClass = typeof props.weight === 'number'
15
+ ? 'card-weighted'
16
+ : '';
17
+ return (_jsx("view", { className: `card card-${variant} ${weightClass}`.trim(), children: childWithContext && (_jsx(NodeRenderer, { component: childWithContext, surface: surface })) }));
18
+ }
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/Card/index.tsx"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,kCAAkC,CAAC;AAW1C,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,cAAc,IAAI,eAAe;QACxD,CAAC,CAAC,EAAE,GAAG,cAAc,EAAE,eAAe,EAAE;QACxC,CAAC,CAAC,cAAc,CAAC;IACnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC;IAC5C,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAClD,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,CACL,eAAM,SAAS,EAAE,aAAa,OAAO,IAAI,WAAW,EAAE,CAAC,IAAI,EAAE,YAC1D,gBAAgB,IAAI,CACnB,KAAC,YAAY,IAAC,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAI,CAChE,GACI,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,170 @@
1
+ {
2
+ "CheckBox": {
3
+ "properties": {
4
+ "label": {
5
+ "oneOf": [
6
+ {
7
+ "type": "string"
8
+ },
9
+ {
10
+ "type": "object",
11
+ "properties": {
12
+ "path": {
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "path"
18
+ ],
19
+ "additionalProperties": false
20
+ },
21
+ {
22
+ "type": "object",
23
+ "properties": {
24
+ "call": {
25
+ "type": "string"
26
+ },
27
+ "args": {
28
+ "type": "object",
29
+ "additionalProperties": true
30
+ },
31
+ "returnType": {
32
+ "type": "string",
33
+ "enum": [
34
+ "string",
35
+ "number",
36
+ "boolean",
37
+ "object",
38
+ "array",
39
+ "any",
40
+ "void"
41
+ ]
42
+ }
43
+ },
44
+ "required": [
45
+ "call",
46
+ "args"
47
+ ],
48
+ "additionalProperties": false
49
+ }
50
+ ]
51
+ },
52
+ "value": {
53
+ "oneOf": [
54
+ {
55
+ "type": "boolean"
56
+ },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "path": {
61
+ "type": "string"
62
+ }
63
+ },
64
+ "required": [
65
+ "path"
66
+ ],
67
+ "additionalProperties": false
68
+ },
69
+ {
70
+ "type": "object",
71
+ "properties": {
72
+ "call": {
73
+ "type": "string"
74
+ },
75
+ "args": {
76
+ "type": "object",
77
+ "additionalProperties": true
78
+ },
79
+ "returnType": {
80
+ "type": "string",
81
+ "enum": [
82
+ "string",
83
+ "number",
84
+ "boolean",
85
+ "object",
86
+ "array",
87
+ "any",
88
+ "void"
89
+ ]
90
+ }
91
+ },
92
+ "required": [
93
+ "call",
94
+ "args"
95
+ ],
96
+ "additionalProperties": false
97
+ }
98
+ ]
99
+ },
100
+ "checks": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "object",
104
+ "properties": {
105
+ "condition": {
106
+ "oneOf": [
107
+ {
108
+ "type": "boolean"
109
+ },
110
+ {
111
+ "type": "object",
112
+ "properties": {
113
+ "path": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "required": [
118
+ "path"
119
+ ],
120
+ "additionalProperties": false
121
+ },
122
+ {
123
+ "type": "object",
124
+ "properties": {
125
+ "call": {
126
+ "type": "string"
127
+ },
128
+ "args": {
129
+ "type": "object",
130
+ "additionalProperties": true
131
+ },
132
+ "returnType": {
133
+ "type": "string",
134
+ "enum": [
135
+ "string",
136
+ "number",
137
+ "boolean",
138
+ "object",
139
+ "array",
140
+ "any",
141
+ "void"
142
+ ]
143
+ }
144
+ },
145
+ "required": [
146
+ "call",
147
+ "args"
148
+ ],
149
+ "additionalProperties": false
150
+ }
151
+ ]
152
+ },
153
+ "message": {
154
+ "type": "string"
155
+ }
156
+ },
157
+ "required": [
158
+ "condition",
159
+ "message"
160
+ ],
161
+ "additionalProperties": false
162
+ }
163
+ }
164
+ },
165
+ "required": [
166
+ "label",
167
+ "value"
168
+ ]
169
+ }
170
+ }
@@ -0,0 +1,32 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/CheckBox.css';
3
+ /**
4
+ * @a2uiCatalog CheckBox
5
+ */
6
+ export interface CheckBoxProps extends GenericComponentProps {
7
+ label: string | {
8
+ path: string;
9
+ } | {
10
+ call: string;
11
+ args: Record<string, unknown>;
12
+ returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void';
13
+ };
14
+ value: boolean | {
15
+ path: string;
16
+ } | {
17
+ call: string;
18
+ args: Record<string, unknown>;
19
+ returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void';
20
+ };
21
+ checks?: Array<{
22
+ condition: boolean | {
23
+ path: string;
24
+ } | {
25
+ call: string;
26
+ args: Record<string, unknown>;
27
+ returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void';
28
+ };
29
+ message: string;
30
+ }>;
31
+ }
32
+ export declare function CheckBox(props: CheckBoxProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@lynx-js/react/jsx-runtime";
2
+ // Copyright 2026 The Lynx Authors. All rights reserved.
3
+ // Licensed under the Apache License Version 2.0 that can be found in the
4
+ // LICENSE file in the root directory of this source tree.
5
+ import { useChecks } from '../../react/useChecks.js';
6
+ import '../../../styles/catalog/CheckBox.css';
7
+ export function CheckBox(props) {
8
+ const { id, label = 'CheckBox', value, setValue, surface, dataContextPath, } = props;
9
+ const checks = props.checks;
10
+ const { ok, firstFailureMessage } = useChecks({
11
+ checks,
12
+ componentId: id ?? '',
13
+ surface,
14
+ dataContextPath,
15
+ });
16
+ const handleChange = () => {
17
+ setValue?.('value', !value);
18
+ };
19
+ return (_jsxs("view", { className: `checkbox-row${ok ? '' : ' checkbox-row-invalid'}`, bindtap: handleChange, children: [_jsx("view", { className: `checkbox-input ${value ? 'checkbox-input-checked' : ''}`
20
+ .trim(), children: !!value && _jsx("text", { children: "\u2713" }) }), _jsx("text", { className: 'checkbox-label', children: label }), !ok && firstFailureMessage
21
+ ? _jsx("text", { className: 'checkbox-error', children: firstFailureMessage })
22
+ : null] }, id));
23
+ }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/CheckBox/index.tsx"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,OAAO,sCAAsC,CAAC;AA+C9C,MAAM,UAAU,QAAQ,CACtB,KAAoB;IAEpB,MAAM,EACJ,EAAE,EACF,KAAK,GAAG,UAAU,EAClB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,eAAe,GAChB,GAAG,KAAK,CAAC;IACV,MAAM,MAAM,GAAG,KAAK,CAAC,MAAiC,CAAC;IAEvD,MAAM,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAC;QAC5C,MAAM;QACN,WAAW,EAAE,EAAE,IAAI,EAAE;QACrB,OAAO;QACP,eAAe;KAChB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,CACL,gBAEE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,EAC7D,OAAO,EAAE,YAAY,aAErB,eACE,SAAS,EAAE,kBAAkB,KAAK,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,EAAE;qBACjE,IAAI,EAAE,YAER,CAAC,CAAC,KAAK,IAAI,oCAAc,GACrB,EACP,eAAM,SAAS,EAAC,gBAAgB,YAAE,KAAe,GAAQ,EACxD,CAAC,EAAE,IAAI,mBAAmB;gBACzB,CAAC,CAAC,eAAM,SAAS,EAAC,gBAAgB,YAAE,mBAAmB,GAAQ;gBAC/D,CAAC,CAAC,IAAI,KAbH,EAAE,CAcF,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,57 @@
1
+ {
2
+ "Column": {
3
+ "properties": {
4
+ "children": {
5
+ "oneOf": [
6
+ {
7
+ "type": "array",
8
+ "items": {
9
+ "type": "string"
10
+ }
11
+ },
12
+ {
13
+ "type": "object",
14
+ "properties": {
15
+ "componentId": {
16
+ "type": "string"
17
+ },
18
+ "path": {
19
+ "type": "string"
20
+ }
21
+ },
22
+ "required": [
23
+ "componentId",
24
+ "path"
25
+ ],
26
+ "additionalProperties": false
27
+ }
28
+ ],
29
+ "description": "Static child IDs array or template object."
30
+ },
31
+ "align": {
32
+ "type": "string",
33
+ "enum": [
34
+ "start",
35
+ "center",
36
+ "end",
37
+ "stretch"
38
+ ]
39
+ },
40
+ "justify": {
41
+ "type": "string",
42
+ "enum": [
43
+ "start",
44
+ "center",
45
+ "end",
46
+ "stretch",
47
+ "spaceBetween",
48
+ "spaceAround",
49
+ "spaceEvenly"
50
+ ]
51
+ }
52
+ },
53
+ "required": [
54
+ "children"
55
+ ]
56
+ }
57
+ }
@@ -0,0 +1,15 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/Column.css';
3
+ /**
4
+ * @a2uiCatalog Column
5
+ */
6
+ export interface ColumnProps extends GenericComponentProps {
7
+ /** Static child IDs array or template object. */
8
+ children: string[] | {
9
+ componentId: string;
10
+ path: string;
11
+ };
12
+ align?: 'start' | 'center' | 'end' | 'stretch';
13
+ justify?: 'start' | 'center' | 'end' | 'stretch' | 'spaceBetween' | 'spaceAround' | 'spaceEvenly';
14
+ }
15
+ export declare function Column(props: ColumnProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "@lynx-js/react/jsx-runtime";
2
+ // Copyright 2026 The Lynx Authors. All rights reserved.
3
+ // Licensed under the Apache License Version 2.0 that can be found in the
4
+ // LICENSE file in the root directory of this source tree.
5
+ import { useMemo } from '@lynx-js/react';
6
+ import { NodeRenderer } from '../../react/A2UIRenderer.js';
7
+ import { useDataBinding } from '../../react/useDataBinding.js';
8
+ import '../../../styles/catalog/Column.css';
9
+ const buildChild = (surface, childId, dataContextPath, childPath, key = childId) => {
10
+ const child = surface.components.get(childId);
11
+ if (!child)
12
+ return null;
13
+ let childWithContext = child;
14
+ if (childPath) {
15
+ childWithContext = { ...child, dataContextPath: childPath };
16
+ }
17
+ else if (dataContextPath) {
18
+ childWithContext = { ...child, dataContextPath };
19
+ }
20
+ return {
21
+ key,
22
+ component: childWithContext,
23
+ };
24
+ };
25
+ export function Column(props) {
26
+ const { children, surface, dataContextPath, justify = 'start', align = 'stretch', } = props;
27
+ const isDynamic = children && !Array.isArray(children)
28
+ && typeof children === 'object';
29
+ const template = isDynamic
30
+ ? children
31
+ : undefined;
32
+ const [columnData, , fullPath] = useDataBinding(template ? { path: template.path } : undefined, surface, dataContextPath, []);
33
+ const childList = useMemo(() => {
34
+ if (Array.isArray(children)) {
35
+ return children.map((childId) => buildChild(surface, childId, dataContextPath));
36
+ }
37
+ return (Array.isArray(columnData) ? columnData : []).map((item, index) => {
38
+ const key = item && typeof item === 'object' && 'key' in item
39
+ ? String(item['key'])
40
+ : `${index}`;
41
+ const itemPath = `${fullPath}/${index}`;
42
+ return buildChild(surface, template?.componentId ?? '', dataContextPath, itemPath, key);
43
+ });
44
+ }, [children, surface, dataContextPath, columnData, fullPath, template]);
45
+ return (_jsx("view", { className: `column alignment-${align} distribution-${justify}`, children: childList.map((item) => {
46
+ if (!item)
47
+ return null;
48
+ const weight = item.component.weight;
49
+ if (typeof weight === 'number' && weight > 0) {
50
+ return (_jsx("view", { className: `column-weighted-item column-weighted-item-${weight}`, style: { flex: `${weight} ${weight} 0`, minHeight: 0 }, children: _jsx(NodeRenderer, { component: item.component, surface: surface }) }, item.key));
51
+ }
52
+ return (_jsx(NodeRenderer, { component: item.component, surface: surface }, item.key));
53
+ }) }));
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/Column/index.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ {
2
+ "Divider": {
3
+ "properties": {
4
+ "axis": {
5
+ "type": "string",
6
+ "enum": [
7
+ "horizontal",
8
+ "vertical"
9
+ ]
10
+ }
11
+ },
12
+ "required": []
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/Divider.css';
3
+ /**
4
+ * @a2uiCatalog Divider
5
+ */
6
+ export interface DividerProps extends GenericComponentProps {
7
+ axis?: 'horizontal' | 'vertical';
8
+ }
9
+ export declare function Divider(props: DividerProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "@lynx-js/react/jsx-runtime";
2
+ import '../../../styles/catalog/Divider.css';
3
+ export function Divider(props) {
4
+ const id = props.id;
5
+ const axis = props.axis ?? 'horizontal';
6
+ return _jsx("view", { className: `divider divider-${axis}` }, id);
7
+ }
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/Divider/index.tsx"],"names":[],"mappings":";AAKA,OAAO,qCAAqC,CAAC;AAS7C,MAAM,UAAU,OAAO,CACrB,KAAmB;IAEnB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,IAAI,GAAG,KAAK,CAAC,IAA0B,IAAI,YAAY,CAAC;IAC9D,OAAO,eAAe,SAAS,EAAE,mBAAmB,IAAI,EAAE,IAAxC,EAAE,CAA0C,CAAC;AACjE,CAAC"}
@@ -0,0 +1,45 @@
1
+ {
2
+ "Icon": {
3
+ "properties": {
4
+ "name": {
5
+ "oneOf": [
6
+ {
7
+ "type": "string"
8
+ },
9
+ {
10
+ "type": "object",
11
+ "properties": {
12
+ "path": {
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "path"
18
+ ],
19
+ "additionalProperties": false
20
+ }
21
+ ],
22
+ "description": "Material icon name (camelCase or snake_case), e.g. \"info\", \"skipNext\", \"play_arrow\"."
23
+ },
24
+ "size": {
25
+ "type": "string",
26
+ "enum": [
27
+ "sm",
28
+ "md",
29
+ "lg"
30
+ ]
31
+ },
32
+ "color": {
33
+ "type": "string",
34
+ "enum": [
35
+ "primary",
36
+ "muted",
37
+ "inherit"
38
+ ]
39
+ }
40
+ },
41
+ "required": [
42
+ "name"
43
+ ]
44
+ }
45
+ }
@@ -0,0 +1,14 @@
1
+ import type { GenericComponentProps } from '../../store/types.js';
2
+ import '../../../styles/catalog/Icon.css';
3
+ /**
4
+ * @a2uiCatalog Icon
5
+ */
6
+ export interface IconProps extends GenericComponentProps {
7
+ /** Material icon name (camelCase or snake_case), e.g. "info", "skipNext", "play_arrow". */
8
+ name: string | {
9
+ path: string;
10
+ };
11
+ size?: 'sm' | 'md' | 'lg';
12
+ color?: 'primary' | 'muted' | 'inherit';
13
+ }
14
+ export declare function Icon(props: IconProps): import('@lynx-js/react').ReactNode;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "@lynx-js/react/jsx-runtime";
2
+ import '../../../styles/catalog/Icon.css';
3
+ function toMaterialName(name) {
4
+ return name.replace(/[A-Z]/g, (m) => `_${m.toLowerCase()}`);
5
+ }
6
+ export function Icon(props) {
7
+ const { id, name, size = 'md', color = 'inherit' } = props;
8
+ const iconName = typeof name === 'string' ? toMaterialName(name) : '';
9
+ return (_jsx("text", { className: `a2ui-icon a2ui-icon-${size} a2ui-icon-color-${color}`, children: iconName }, id));
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/catalog/Icon/index.tsx"],"names":[],"mappings":";AAKA,OAAO,kCAAkC,CAAC;AAE1C,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAYD,MAAM,UAAU,IAAI,CAClB,KAAgB;IAEhB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtE,OAAO,CACL,eAEE,SAAS,EAAE,uBAAuB,IAAI,oBAAoB,KAAK,EAAE,YAEhE,QAAQ,IAHJ,EAAE,CAIF,CACR,CAAC;AACJ,CAAC"}