@copilotkit/a2ui-renderer
Version:
A2UI Renderer for CopilotKit - render A2UI surfaces in React applications
1 lines • 1.78 kB
Source Map (JSON)
{"version":3,"file":"row.cjs","names":["z","CommonSchemas","createLitComponent","mapJustify","mapAlign","renderChildList"],"sources":["../../../../src/web-components/catalog/minimal/row.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\nimport { z } from \"zod\";\nimport { createLitComponent } from \"../../adapter\";\nimport { renderChildList } from \"../children\";\nimport { mapAlign, mapJustify } from \"./utils\";\n\nexport const RowSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"center\",\n \"end\",\n \"spaceAround\",\n \"spaceBetween\",\n \"spaceEvenly\",\n \"start\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n});\n\nexport const RowApiDef = {\n name: \"Row\",\n schema: RowSchema,\n};\n\nexport const Row = createLitComponent(\n RowApiDef,\n ({ props, buildChild }) => html`\n <div\n style=${styleMap({\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n })}\n >\n ${renderChildList(props.children, buildChild)}\n </div>\n`,\n);\n"],"mappings":";;;;;;;;;AAQA,MAAa,YAAYA,MAAE,OAAO;CAChC,UAAUC,kCAAc;CACxB,SAASD,MACN,KAAK;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,CACD,UAAU;CACb,OAAOA,MAAE,KAAK;EAAC;EAAS;EAAU;EAAO;EAAU,CAAC,CAAC,UAAU;CAChE,CAAC;AAEF,MAAa,YAAY;CACvB,MAAM;CACN,QAAQ;CACT;AAED,MAAa,MAAME,mCACjB,YACC,EAAE,OAAO,iBAAiB,QAAI;;sDAEZ;CACf,SAAS;CACT,eAAe;CACf,gBAAgBC,yBAAW,MAAM,QAAQ;CACzC,YAAYC,uBAAS,MAAM,MAAM;CAClC,CAAC,CAAC;;MAEDC,iCAAgB,MAAM,UAAU,WAAW,CAAC;;EAGjD"}