UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

1 lines 1.86 kB
{"version":3,"file":"column.cjs","names":["z","CommonSchemas","createLitComponent","mapJustify","mapAlign","renderChildList"],"sources":["../../../../src/web-components/catalog/minimal/column.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 ColumnSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"center\", \"end\", \"start\", \"stretch\"]).optional(),\n});\n\nexport const ColumnApiDef = {\n name: \"Column\",\n schema: ColumnSchema,\n};\n\nexport const Column = createLitComponent(\n ColumnApiDef,\n ({ props, buildChild }) => html`\n <div\n style=${styleMap({\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n gap: \"8px\",\n })}\n >\n ${renderChildList(props.children, buildChild)}\n </div>\n `,\n);\n"],"mappings":";;;;;;;;;AAQA,MAAa,eAAeA,MAAE,OAAO;CACnC,UAAUC,kCAAc;CACxB,SAASD,MACN,KAAK;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,CACD,UAAU;CACb,OAAOA,MAAE,KAAK;EAAC;EAAU;EAAO;EAAS;EAAU,CAAC,CAAC,UAAU;CAChE,CAAC;AAEF,MAAa,eAAe;CAC1B,MAAM;CACN,QAAQ;CACT;AAED,MAAa,SAASE,mCACpB,eACC,EAAE,OAAO,iBAAiB,QAAI;;wDAEV;CACf,SAAS;CACT,eAAe;CACf,gBAAgBC,yBAAW,MAAM,QAAQ;CACzC,YAAYC,uBAAS,MAAM,MAAM;CACjC,KAAK;CACN,CAAC,CAAC;;QAEDC,iCAAgB,MAAM,UAAU,WAAW,CAAC;;IAGnD"}