diff --git a/apps/website/content/docs/chat/api/api-docs.json b/apps/website/content/docs/chat/api/api-docs.json index 5fbc1572a..c643bda05 100644 --- a/apps/website/content/docs/chat/api/api-docs.json +++ b/apps/website/content/docs/chat/api/api-docs.json @@ -235,6 +235,12 @@ "params": [], "examples": [], "properties": [ + { + "name": "alignItems", + "type": "Signal", + "description": "", + "optional": false + }, { "name": "alignment", "type": "InputSignal", @@ -253,12 +259,6 @@ "description": "", "optional": false }, - { - "name": "colClass", - "type": "Signal", - "description": "", - "optional": false - }, { "name": "distribution", "type": "InputSignal<\"center\" | \"start\" | \"end\" | \"spaceBetween\" | \"spaceAround\" | \"spaceEvenly\">", @@ -277,6 +277,12 @@ "description": "", "optional": false }, + { + "name": "gapPx", + "type": "Signal", + "description": "Convert the Tailwind gap unit (multiples of 4px) to pixels.", + "optional": false + }, { "name": "loading", "type": "InputSignal", @@ -595,7 +601,7 @@ }, { "name": "listClass", - "type": "Signal<\"flex flex-row gap-1 overflow-x-auto\" | \"flex flex-col gap-1 overflow-y-auto max-h-96\">", + "type": "Signal<\"a2ui-list--horizontal\" | \"a2ui-list--vertical\">", "description": "", "optional": false }, @@ -813,6 +819,12 @@ "params": [], "examples": [], "properties": [ + { + "name": "alignItems", + "type": "Signal", + "description": "", + "optional": false + }, { "name": "alignment", "type": "InputSignal", @@ -850,17 +862,23 @@ "optional": false }, { - "name": "loading", - "type": "InputSignal", - "description": "", + "name": "gapPx", + "type": "Signal", + "description": "Convert the gap unit (multiples of 4px) to pixels.", "optional": false }, { - "name": "rowClass", + "name": "justifyContent", "type": "Signal", "description": "", "optional": false }, + { + "name": "loading", + "type": "InputSignal", + "description": "", + "optional": false + }, { "name": "spec", "type": "InputSignal", diff --git a/libs/chat/src/lib/a2ui/catalog/audio-player.component.ts b/libs/chat/src/lib/a2ui/catalog/audio-player.component.ts index 2ae249206..9c1ab5ae7 100644 --- a/libs/chat/src/lib/a2ui/catalog/audio-player.component.ts +++ b/libs/chat/src/lib/a2ui/catalog/audio-player.component.ts @@ -7,12 +7,18 @@ import type { Spec } from '@json-render/core'; standalone: true, template: ` `, + styles: [` + .a2ui-audio { + display: block; + width: 100%; + } + `], }) export class A2uiAudioPlayerComponent { readonly url = input(''); diff --git a/libs/chat/src/lib/a2ui/catalog/button.component.ts b/libs/chat/src/lib/a2ui/catalog/button.component.ts index a226da22c..f18515876 100644 --- a/libs/chat/src/lib/a2ui/catalog/button.component.ts +++ b/libs/chat/src/lib/a2ui/catalog/button.component.ts @@ -10,10 +10,7 @@ import { RenderElementComponent } from '@ngaf/render'; changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, + styles: [` + .a2ui-btn { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 8px 16px; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: background 120ms, opacity 120ms; + border: none; + } + .a2ui-btn:disabled { opacity: 0.5; cursor: not-allowed; } + .a2ui-btn--primary { + background: var(--a2ui-primary, #2563eb); + color: #fff; + } + .a2ui-btn--primary:hover:not(:disabled) { background: var(--a2ui-primary-hover, #1d4ed8); } + .a2ui-btn--secondary { + background: transparent; + color: var(--a2ui-input-text, rgba(255,255,255,0.8)); + border: 1px solid var(--a2ui-border, rgba(255,255,255,0.2)); + } + .a2ui-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.08); } + `], }) export class A2uiButtonComponent { /** v1: child Text component is rendered inside the button via childKeys. */ diff --git a/libs/chat/src/lib/a2ui/catalog/card.component.ts b/libs/chat/src/lib/a2ui/catalog/card.component.ts index 4563c836f..5783beeee 100644 --- a/libs/chat/src/lib/a2ui/catalog/card.component.ts +++ b/libs/chat/src/lib/a2ui/catalog/card.component.ts @@ -8,12 +8,23 @@ import { RenderElementComponent } from '@ngaf/render'; standalone: true, imports: [RenderElementComponent], template: ` -
+
@for (key of childKeys(); track key) { }
`, + styles: [` + .a2ui-card { + display: flex; + flex-direction: column; + gap: 8px; + border-radius: 12px; + border: 1px solid var(--a2ui-border, rgba(255,255,255,0.1)); + background: var(--a2ui-card-bg, rgba(255,255,255,0.05)); + padding: 16px; + } + `], }) export class A2uiCardComponent { /** v1: a single child key, delivered via childKeys[0] from the render framework. */ diff --git a/libs/chat/src/lib/a2ui/catalog/check-box.component.ts b/libs/chat/src/lib/a2ui/catalog/check-box.component.ts index 3eb086c63..e63de547e 100644 --- a/libs/chat/src/lib/a2ui/catalog/check-box.component.ts +++ b/libs/chat/src/lib/a2ui/catalog/check-box.component.ts @@ -8,11 +8,27 @@ import { emitBinding } from './emit-binding'; standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: ` -