Skip to content

Commit 9b860be

Browse files
committed
Port viewer-theme from production Lit composer, fix card bg and heading margins
- Add viewerTheme.ts: exact port of the production viewer-theme used by A2UIViewer on a2ui-composer.ag-ui.com (from private_a2ui_demo repo) - Add appTheme.ts: the app-level theme used for chat view (for future use) - Switch adapter to use viewerTheme instead of composerTheme - Fix card background in gallery: define --a2ui-card-bg at :root level and reference it via --p-100 so the gallery wrapper can override it to transparent (matching Lit's themed-a2ui-surface behavior) - Fix heading margins: add layout-m-0 to markdown.h4 and markdown.h5 to prevent browser default margins on h4/h5 elements
1 parent d163b2c commit 9b860be

4 files changed

Lines changed: 760 additions & 3 deletions

File tree

tools/composer/src/app/globals.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
}
6767

6868
:root {
69+
--a2ui-card-bg: #ffffff;
6970
--radius: 0.625rem;
7071
--background: oklch(1 0 0);
7172
--foreground: oklch(0.145 0 0);
@@ -182,7 +183,7 @@
182183
--n-0: #000000;
183184

184185
/* Primary palette (indigo) */
185-
--p-100: #ffffff;
186+
--p-100: var(--a2ui-card-bg);
186187
--p-99: #fffbff;
187188
--p-98: #fcf8ff;
188189
--p-95: #f2efff;

tools/composer/src/lib/a2ui.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
import { A2UIViewer as BaseA2UIViewer } from "@a2ui/react";
1515
import type { ComponentProps } from "react";
16-
import { composerTheme } from "./composerTheme";
16+
import { viewerTheme } from "./viewerTheme";
1717

1818
export type { ComponentInstance } from "@a2ui/react";
1919

2020
type A2UIViewerProps = ComponentProps<typeof BaseA2UIViewer>;
2121

2222
export function A2UIViewer(props: A2UIViewerProps) {
23-
return <BaseA2UIViewer theme={composerTheme} {...props} />;
23+
return <BaseA2UIViewer theme={viewerTheme} {...props} />;
2424
}

0 commit comments

Comments
 (0)