-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
184 additions
and
133 deletions.
There are no files selected for viewing
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
48 changes: 0 additions & 48 deletions
48
docs/docs/examples/0011-theme-customization/example-custom-button-color/theme-overrides.tsx
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
docs/docs/examples/0011-theme-customization/example-custom-button-color/theme-variables.tsx
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,61 @@ | ||
export default `.nlux-theme-MyBrandName[data-color-scheme='light'] { | ||
--nlux-ChatRoom--BackgroundColor: #f9f9f9; | ||
} | ||
.nlux-theme-MyBrandName[data-color-scheme='dark'] { | ||
--nlux-ChatRoom--BackgroundColor: #060524; | ||
} | ||
.nlux-theme-MyBrandName { | ||
/* Override top-level chat room colors */ | ||
--nlux-ChatRoom--BorderColor: #24233d; | ||
--nlux-ChatRoom-Divider--Color: #24233d; | ||
--nlux-ChatRoom--TextColor: #ffffff; | ||
/* Override message bubble colors */ | ||
--nlux-AiMessage--BackgroundColor: #00bfff; | ||
--nlux-HumanMessage--BackgroundColor: #dc143c; | ||
/* Override border width */ | ||
--nlux-ChatRoom--BorderWidth: 0; | ||
--nlux-SubmitButton--BorderWidth: 0; | ||
--nlux-PromptInput--BorderWidth: 0; | ||
--nlux-ChatItem-Avatar--BorderWidth: 0; | ||
--nlux-ChatItem-Message-BubbleLayout--BorderWidth: 0; | ||
--nlux-ConversationStarter--BorderWidth: 0; | ||
/* Override border radius */ | ||
--nlux-ChatRoom--BorderRadius: 5px; | ||
--nlux-PromptInput--BorderRadius: 5px 0 0 5px; | ||
--nlux-SubmitButton--BorderRadius: 0 5px 5px 0; | ||
--nlux-ChatItem-Avatar--BorderRadius: 5px; | ||
--nlux-ChatItem-Message-BubbleLayout--BorderRadius: 5px; | ||
--nlux-ConversationStarter--BorderRadius: 5px; | ||
/* Override input colors */ | ||
--nlux-PromptInput--BackgroundColor: #24233d; | ||
--nlux-PromptInput-Active--BackgroundColor: #24233d; | ||
--nlux-PromptInput-Disabled--BackgroundColor: #24233d; | ||
/* Gap between submit button and input */ | ||
--nlux-Composer--Gap: 0; | ||
/* Override submit button colors */ | ||
--nlux-SubmitButton--BackgroundColor: #24233d; | ||
--nlux-SubmitButton-Active--BackgroundColor: #24233d; | ||
--nlux-SubmitButton-Disabled--BackgroundColor: #24233d; | ||
/* Conversation starter colors */ | ||
--nlux-ConversationStarter--BackgroundColor: #24233d; | ||
/* Override icon for the send button */ | ||
--nlux-send-icon: url('data:image/svg+xml,\\ | ||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" \\ | ||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\\ | ||
<circle cx="12" cy="12" r="10"/>\\ | ||
<path d="M16 12l-4-4-4 4M12 16V9"/>\\ | ||
</svg>\\ | ||
'); | ||
} | ||
`; |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
```tsx | ||
const aiChat = createAiChat().withDisplayOptions({ | ||
themeId: 'ciel' | ||
}); | ||
const aiChat = createAiChat().withDisplayOptions({ themeId: 'MyBrandName' }); | ||
``` |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
```tsx | ||
<AiChat displayOptions={{ | ||
themeId: 'ciel' | ||
}} /> | ||
<AiChat displayOptions={{ themeId: 'MyBrandName' }} /> | ||
``` |
18 changes: 11 additions & 7 deletions
18
docs/docs/learn/_005-customize-theme/example-custom-button-color/app.tsx
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 |
---|---|---|
@@ -1,20 +1,24 @@ | ||
export default (colorMode: 'dark' | 'light') => `import {useMemo} from 'react'; | ||
import {AiChat} from '@nlux/react'; | ||
import '@nlux/themes/nova.css'; | ||
import {streamAdapter} from './adapter'; | ||
import {personas} from './personas'; | ||
// Theme variable overrides are defined in theme-overrides.css | ||
import './theme-overrides.css'; | ||
// We import the unstyled CSS that gives us the basic layout and structure | ||
import "@nlux/themes/unstyled.css"; | ||
// We set the variables in a separate CSS file | ||
import "./theme-variables.css"; | ||
export default () => { | ||
const adapter = useMemo(() => streamAdapter, []); | ||
return ( | ||
<AiChat | ||
conversationOptions={{layout: 'bubbles'}} | ||
displayOptions={{colorScheme: 'dark'}} | ||
personaOptions={personas} | ||
adapter={adapter} | ||
displayOptions={{ | ||
themeId: "MyBrandName", | ||
colorScheme: "${colorMode}" | ||
}} | ||
personaOptions={ personas } | ||
adapter={ adapter } | ||
/> | ||
); | ||
};`; |
41 changes: 0 additions & 41 deletions
41
docs/docs/learn/_005-customize-theme/example-custom-button-color/theme-overrides.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.