UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

1 lines 1.34 kB
{"version":3,"file":"list.mjs","names":[],"sources":["../../../../src/web-components/catalog/basic/list.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { ListApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { createLitComponent } from \"../../adapter\";\nimport { renderChildList } from \"../children\";\nimport { mapAlign } from \"./utils\";\n\nexport const List = createLitComponent(ListApi, ({ props, buildChild }) => {\n const isHorizontal = props.direction === \"horizontal\";\n return html`\n <div\n style=${styleMap({\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: mapAlign(props.align),\n overflowX: isHorizontal ? \"auto\" : \"hidden\",\n overflowY: isHorizontal ? \"hidden\" : \"auto\",\n width: \"100%\",\n margin: \"0\",\n padding: \"0\",\n })}\n >\n ${renderChildList(props.children, buildChild)}\n </div>\n `;\n});\n"],"mappings":";;;;;;;;AAOA,MAAa,OAAO,mBAAmB,UAAU,EAAE,OAAO,iBAAiB;CACzE,MAAM,eAAe,MAAM,cAAc;AACzC,QAAO,IAAI;;cAEC,SAAS;EACf,SAAS;EACT,eAAe,eAAe,QAAQ;EACtC,YAAY,SAAS,MAAM,MAAM;EACjC,WAAW,eAAe,SAAS;EACnC,WAAW,eAAe,WAAW;EACrC,OAAO;EACP,QAAQ;EACR,SAAS;EACV,CAAC,CAAC;;QAED,gBAAgB,MAAM,UAAU,WAAW,CAAC;;;EAGlD"}