@copilotkit/a2ui-renderer
Version:
A2UI Renderer for CopilotKit - render A2UI surfaces in React applications
1 lines • 1.83 kB
Source Map (JSON)
{"version":3,"file":"button.cjs","names":["createLitComponent","ButtonApi","LEAF_MARGIN","nothing"],"sources":["../../../../src/web-components/catalog/basic/button.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { ButtonApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { createLitComponent } from \"../../adapter\";\nimport { LEAF_MARGIN } from \"./utils\";\n\nexport const Button = createLitComponent(\n ButtonApi,\n ({ props, buildChild }) => html`\n <button\n type=\"button\"\n style=${styleMap({\n margin: LEAF_MARGIN,\n padding: \"8px 16px\",\n cursor: \"pointer\",\n border: props.variant === \"borderless\" ? \"none\" : \"1px solid #ccc\",\n backgroundColor:\n props.variant === \"primary\"\n ? \"var(--a2ui-primary-color, #007bff)\"\n : props.variant === \"borderless\"\n ? \"transparent\"\n : \"#fff\",\n color: props.variant === \"primary\" ? \"#fff\" : \"inherit\",\n borderRadius: \"4px\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxSizing: \"border-box\",\n })}\n ?disabled=${props.isValid === false}\n @click=${() => props.action?.()}\n >\n ${props.child ? buildChild(props.child) : nothing}\n </button>\n `,\n);\n"],"mappings":";;;;;;;AAMA,MAAa,SAASA,mCACpBC,8CACC,EAAE,OAAO,iBAAiB,QAAI;;;wDAGV;CACf,QAAQC;CACR,SAAS;CACT,QAAQ;CACR,QAAQ,MAAM,YAAY,eAAe,SAAS;CAClD,iBACE,MAAM,YAAY,YACd,uCACA,MAAM,YAAY,eAChB,gBACA;CACR,OAAO,MAAM,YAAY,YAAY,SAAS;CAC9C,cAAc;CACd,SAAS;CACT,YAAY;CACZ,gBAAgB;CAChB,WAAW;CACZ,CAAC,CAAC;kBACS,MAAM,YAAY,MAAM;qBACrB,MAAM,UAAU,CAAC;;QAE9B,MAAM,QAAQ,WAAW,MAAM,MAAM,GAAGC,YAAQ;;IAGvD"}