UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

1 lines 1.69 kB
{"version":3,"file":"row.mjs","names":[],"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,YAAY,EAAE,OAAO;CAChC,UAAU,cAAc;CACxB,SAAS,EACN,KAAK;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,CACD,UAAU;CACb,OAAO,EAAE,KAAK;EAAC;EAAS;EAAU;EAAO;EAAU,CAAC,CAAC,UAAU;CAChE,CAAC;AAEF,MAAa,YAAY;CACvB,MAAM;CACN,QAAQ;CACT;AAED,MAAa,MAAM,mBACjB,YACC,EAAE,OAAO,iBAAiB,IAAI;;YAErB,SAAS;CACf,SAAS;CACT,eAAe;CACf,gBAAgB,WAAW,MAAM,QAAQ;CACzC,YAAY,SAAS,MAAM,MAAM;CAClC,CAAC,CAAC;;MAED,gBAAgB,MAAM,UAAU,WAAW,CAAC;;EAGjD"}