-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom styling and branding v2 (#160)
* feat: add chat stage and avatar components * feat: add branding * feat: implement design system * chore: change brand logo file * feat: add settings styles component * fix: improve initialization * fix: fix minor bugs * feat: add additional values * fix: move branding toggle out of the styling toggle * fix: refine dark style theme * fix: make branding dynamic * fix: remove direct classlist add and leave only reactive use effect * fix: color initialization on theme * test: add tests * tests: move test out of init clause * fix: merge issues causing test failure * fix: fix layout cosmetics and remove avatar from bubbles * fix: make link icon generic and remove BEM from styles * fix: fix dark theme toggle * fix: remove boolean and icon specific bindings for chat avatar * fix: remove styles from chat-thread * fix: remove duplicated styles in wrong context * fix: update color name * chore: optimize default names * chore: update init object for colors styling * fix: fix chat stage rendering conditional * test: fix enable branding test * test: fix theme switch test * test: fix broken follow up questions test * feat: change items to compliant name. Closes #163 * test: fix tests to match new names * fix: remove unnecessary empty container in return * fix: remove unnecessary css rule --------- Co-authored-by: Shibani Basava (from Dev Box) <shibanib@microsoft.com>
- Loading branch information
1 parent
081659a
commit 703d278
Showing
27 changed files
with
909 additions
and
216 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { LitElement, html } from 'lit'; | ||
import { customElement, property } from 'lit/decorators.js'; | ||
import { styles } from '../styles/chat-stage.js'; | ||
import './link-icon.js'; | ||
export interface ChatStage { | ||
pagetitle: string; | ||
url: string; | ||
svgIcon: string; | ||
} | ||
|
||
@customElement('chat-stage') | ||
export class ChatStageComponent extends LitElement { | ||
static override styles = [styles]; | ||
|
||
@property({ type: String }) | ||
pagetitle = ''; | ||
|
||
@property({ type: String }) | ||
url = ''; | ||
|
||
@property({ type: String }) | ||
svgIcon = ''; | ||
|
||
override render() { | ||
return html` | ||
<header class="chat-stage__header" data-testid="chat-branding"> | ||
<link-icon url="${this.url}" svgIcon="${this.svgIcon}"></link-icon> | ||
<h1 class="chat-stage__hl">${this.pagetitle}</h1> | ||
</header> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { LitElement, html } from 'lit'; | ||
import { customElement, property } from 'lit/decorators.js'; | ||
|
||
import { styles } from '../styles/link-icon.js'; | ||
import { unsafeSVG } from 'lit/directives/unsafe-svg.js'; | ||
|
||
export interface LinkIcon { | ||
label: string; | ||
svgIcon: string; | ||
url: string; | ||
} | ||
|
||
@customElement('link-icon') | ||
export class LinkIconComponent extends LitElement { | ||
static override styles = [styles]; | ||
|
||
@property({ type: String }) | ||
label = ''; | ||
|
||
@property({ type: String }) | ||
svgIcon = ''; | ||
|
||
@property({ type: String }) | ||
url = ''; | ||
|
||
override render() { | ||
return html` | ||
<a title="${this.label}" href="${this.url}" target="_blank" rel="noopener noreferrer"> | ||
${unsafeSVG(this.svgIcon)} | ||
</a> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.