diff --git a/nx2/blocks/chat/chat.css b/nx2/blocks/chat/chat.css index 94e299c28..3721bad2d 100644 --- a/nx2/blocks/chat/chat.css +++ b/nx2/blocks/chat/chat.css @@ -76,6 +76,29 @@ } } +:host([styled-as-panel]) { + padding-top: 0; +} + +.chat-body { + display: flex; + flex-direction: column; + flex: 1 1 auto; + min-height: 0; + width: 100%; + align-items: center; + gap: var(--s2-spacing-300); + box-sizing: border-box; +} + +:host([styled-as-panel]) .chat-body { + border: 1px solid var(--s2-gray-100); + border-radius: var(--s2-corner-radius-800); + background: light-dark(#fff, #000); + overflow: hidden; + padding: var(--s2-spacing-200) 0; +} + .chat-header { display: flex; align-items: center; @@ -627,12 +650,14 @@ } .chat-disclaimer { + flex-shrink: 0; max-width: 720px; width: calc(100% - 2 * var(--s2-spacing-200)); margin: 0; font-size: var(--s2-body-size-xs); - color: var(--s2-gray-700); + color: var(--s2-gray-600); line-height: 1.5; + text-align: center; box-sizing: border-box; a { diff --git a/nx2/blocks/chat/chat.js b/nx2/blocks/chat/chat.js index 6a6921e5a..83be6177c 100644 --- a/nx2/blocks/chat/chat.js +++ b/nx2/blocks/chat/chat.js @@ -33,6 +33,7 @@ class NxChat extends LitElement { thinking: { type: Boolean }, connected: { type: Boolean }, toolCards: { type: Object }, + styled: { type: Boolean, reflect: true, attribute: 'styled-as-panel' }, _prompts: { state: true }, _items: { state: true }, _dragging: { state: true }, @@ -502,89 +503,91 @@ class NxChat extends LitElement { .onSend=${(p) => this._sendPrompt(p)} > -
- - -
-
-
- ${!this.messages?.length && !this.thinking - ? html` this._sendPrompt(p)} - @nx-show-prompts=${this._openPrompts} - >` - : nothing} - ${this.messages?.map((msg) => renderMessage(msg, this.toolCards))} - ${this.thinking && !this.messages?.at(-1)?.streaming ? html`
Thinking...
` : nothing} +
+
+ +
-
-
- this._onSlashSelect(detail.id)} - @mousedown=${(e) => e.preventDefault()} - > - ${renderApprovalCard(this._pendingApproval(), this._controller.approveToolCall)} -
- - ${this._dragging ? html` - ` : nothing} - ${this._items?.length ? html` - ` : nothing} - -
- - - - - +
+
+ ${!this.messages?.length && !this.thinking + ? html` this._sendPrompt(p)} + @nx-show-prompts=${this._openPrompts} + >` + : nothing} + ${this.messages?.map((msg) => renderMessage(msg, this.toolCards))} + ${this.thinking && !this.messages?.at(-1)?.streaming ? html`
Thinking...
` : nothing} +
+
+
+ this._onSlashSelect(detail.id)} + @mousedown=${(e) => e.preventDefault()} + > + ${renderApprovalCard(this._pendingApproval(), this._controller.approveToolCall)} + + + ${this._dragging ? html` + ` : nothing} + ${this._items?.length ? html` + ` : nothing} + +
+ + + + + +
+
-

Responses are generated using AI, and may be inaccurate. Check before using. diff --git a/nx2/styles/styles.css b/nx2/styles/styles.css index 0f7180094..993f852f2 100644 --- a/nx2/styles/styles.css +++ b/nx2/styles/styles.css @@ -560,6 +560,16 @@ html:has(meta[content="edge-delivery"]) { left: -12px; } } + + &:has([styled-as-panel]) .panel-wrapper { + border-radius: 0; + background: none; + } + + &:has([styled-as-panel]) .panel-shell { + border: none; + overflow: visible; + } } footer {