UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

1 lines 2.24 kB
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/react-renderer/a2ui-react/catalog/minimal/index.ts"],"sourcesContent":["/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Catalog, createFunctionImplementation } from \"@a2ui/web_core/v0_9\";\nimport { Text } from \"./components/Text\";\nimport { Button } from \"./components/Button\";\nimport { Row } from \"./components/Row\";\nimport { Column } from \"./components/Column\";\nimport { TextField } from \"./components/TextField\";\nimport type { ReactComponentImplementation } from \"../../adapter\";\nimport { z } from \"zod\";\n\nconst minimalComponents: ReactComponentImplementation[] = [\n Text,\n Button,\n Row,\n Column,\n TextField,\n];\n\nexport const minimalCatalog = new Catalog<ReactComponentImplementation>(\n \"https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json\",\n minimalComponents,\n [\n createFunctionImplementation(\n {\n name: \"capitalize\",\n returnType: \"string\",\n schema: z.object({\n value: z.unknown(),\n }),\n },\n (args) => {\n const val = args.value;\n if (typeof val === \"string\") {\n return val.toUpperCase();\n }\n return val as string;\n },\n ),\n ],\n);\n\nexport { Text, Button, Row, Column, TextField };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,oBAAoD;CACxD;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,iBAAiB,IAAI,QAChC,6EACA,mBACA,CACE,6BACE;CACE,MAAM;CACN,YAAY;CACZ,QAAQ,EAAE,OAAO,EACf,OAAO,EAAE,SAAS,EACnB,CAAC;CACH,GACA,SAAS;CACR,MAAM,MAAM,KAAK;AACjB,KAAI,OAAO,QAAQ,SACjB,QAAO,IAAI,aAAa;AAE1B,QAAO;EAEV,CACF,CACF"}