Skip to content

Commit 8a03d6e

Browse files
committed
feat(chat): initial styling
1 parent da400be commit 8a03d6e

28 files changed

+472
-565
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"globby": "^14.1.0",
8080
"husky": "^9.1.7",
8181
"ig-typedoc-theme": "^6.2.2",
82-
"igniteui-theming": "^19.1.2",
82+
"igniteui-theming": "^19.3.0-beta.1",
8383
"keep-a-changelog": "^2.6.2",
8484
"lint-staged": "^16.1.2",
8585
"lit-analyzer": "^2.0.3",

src/components/chat/chat-input.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ export default class IgcChatInputComponent extends LitElement {
243243
name="send-message"
244244
collection="material"
245245
variant="contained"
246-
class="small"
246+
part="send-button"
247247
?disabled=${!this.inputValue.trim() &&
248248
this._chatState?.inputAttachments.length === 0}
249249
@click=${this.sendMessage}
250250
></igc-icon-button>`;
251251
}
252252

253253
private renderActionsArea() {
254-
return html`<div class="buttons-container">
254+
return html`<div part="buttons-container">
255255
${this._chatState?.options?.templates?.textAreaActionsTemplate
256256
? this._chatState?.options?.templates?.textAreaActionsTemplate
257257
: html` ${this.renderDefaultFileUploadTemplate()}
@@ -260,19 +260,19 @@ export default class IgcChatInputComponent extends LitElement {
260260
}
261261

262262
private renderAttachmentsArea() {
263-
return html`<div role="list" aria-label="Attachments">
263+
return html`<div part="attachments" role="list" aria-label="Attachments">
264264
${this._chatState?.options?.templates?.textAreaAttachmentsTemplate
265265
? this._chatState.options.templates.textAreaAttachmentsTemplate(
266266
this._chatState?.inputAttachments
267267
)
268268
: html`${this._chatState?.inputAttachments?.map(
269269
(attachment, index) => html`
270-
<div class="attachment-wrapper" role="listitem">
270+
<div part="attachment-wrapper" role="listitem">
271271
<igc-chip
272272
removable
273273
@igcRemove=${() => this.removeAttachment(index)}
274274
>
275-
<span class="attachment-name">${attachment.name}</span>
275+
<span part="attachment-name">${attachment.name}</span>
276276
</igc-chip>
277277
</div>
278278
`
@@ -282,16 +282,16 @@ export default class IgcChatInputComponent extends LitElement {
282282

283283
protected override render() {
284284
return html`
285-
<div class="input-container ${this.dragClass}">
285+
<div part="input-container" class="${this.dragClass}">
286286
${this.renderAttachmentsArea()}
287287
288-
<div class="input-wrapper">
288+
<div part="input-wrapper">
289289
${this._chatState?.options?.templates?.textInputTemplate
290290
? this._chatState.options.templates.textInputTemplate(
291291
this._chatState?.inputValue
292292
)
293293
: html` <igc-textarea
294-
class="text-input"
294+
part="text-input"
295295
placeholder="Type a message..."
296296
resize="auto"
297297
rows="1"

src/components/chat/chat-message-list.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ export default class IgcChatMessageListComponent extends LitElement {
156156
protected *renderLoadingTemplate() {
157157
yield html`${this._chatState?.options?.templates?.composingIndicatorTemplate
158158
? this._chatState.options.templates.composingIndicatorTemplate
159-
: html`<div class="typing-indicator">
160-
<div class="typing-dot"></div>
161-
<div class="typing-dot"></div>
162-
<div class="typing-dot"></div>
159+
: html`<div part="typing-indicator">
160+
<div part="typing-dot"></div>
161+
<div part="typing-dot"></div>
162+
<div part="typing-dot"></div>
163163
</div>`}`;
164164
}
165165

@@ -170,15 +170,15 @@ export default class IgcChatMessageListComponent extends LitElement {
170170

171171
return html`
172172
<div
173-
class='message-container'
173+
part="message-container"
174174
aria-activedescendant=${this._activeMessageId}
175175
role="group"
176176
aria-label="Message list"
177177
tabindex='0'
178178
@focusin=${this.handleFocusIn}
179179
@focusout=${this.handleFocusOut}
180180
@keydown=${this.handleKeyDown}></div>
181-
<div class="message-list">
181+
<div part="message-list">
182182
${repeat(
183183
groupedMessages,
184184
(group) => group.date,
@@ -192,9 +192,9 @@ export default class IgcChatMessageListComponent extends LitElement {
192192
<igc-chat-message
193193
id=${messageId}
194194
role="option"
195-
class=${this._activeMessageId === messageId
195+
part="message-item ${this._activeMessageId === messageId
196196
? 'active'
197-
: ''}
197+
: ''}"
198198
.message=${message}
199199
>
200200
</igc-chat-message>

src/components/chat/chat-message.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { ChatState } from './chat-state.js';
99
import { renderMarkdown } from './markdown-util.js';
1010
import IgcMessageAttachmentsComponent from './message-attachments.js';
1111
import { styles } from './themes/message.base.css.js';
12+
import { styles as shared } from './themes/shared/chat-message.common.css.js';
1213
import type { IgcMessage } from './types.js';
1314

1415
/**
@@ -19,7 +20,7 @@ import type { IgcMessage } from './types.js';
1920
export default class IgcChatMessageComponent extends LitElement {
2021
public static readonly tagName = 'igc-chat-message';
2122

22-
public static override styles = styles;
23+
public static override styles = [styles, shared];
2324

2425
@consume({ context: chatContext, subscribe: true })
2526
private _chatState?: ChatState;
@@ -49,8 +50,8 @@ export default class IgcChatMessageComponent extends LitElement {
4950
this._chatState?.options?.markdownRenderer || renderMarkdown;
5051

5152
return html`
52-
<div class=${containerClass}>
53-
<div class="bubble">
53+
<div part=${containerClass}>
54+
<div part="bubble">
5455
${this._chatState?.options?.templates?.messageTemplate && this.message
5556
? this._chatState.options.templates.messageTemplate(this.message)
5657
: html` ${sanitizedMessageText

0 commit comments

Comments
 (0)