-
Notifications
You must be signed in to change notification settings - Fork 124
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
11 changed files
with
152 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.ikp-ai-chat-footer__footer { | ||
align-items: center; | ||
} | ||
|
||
.ikp-tagline { | ||
align-items: center; | ||
position: relative; | ||
} | ||
|
||
.ikp-tagline > div { | ||
display: none; | ||
} | ||
|
||
.ikp-tagline > a > div:before { | ||
content: 'Powered by'; | ||
font-weight: normal; | ||
} | ||
|
||
.ikp-tagline:after { | ||
content: ''; | ||
margin-left: 1.5rem; | ||
width: 64px; | ||
height: 18px; | ||
background: url('/inkeep/images/neon-logo.svg'); | ||
background-size: cover; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
filter: grayscale(1); | ||
} | ||
|
||
.ikp-tagline:before { | ||
content: '&'; | ||
position: absolute; | ||
right: 64px; | ||
color: #889096; | ||
margin-left: 0.5rem; | ||
margin-right: 0.5rem; | ||
font-size: 0.875rem; | ||
font-weight: 600; | ||
} | ||
|
||
[data-theme='dark'] { | ||
.ikp-tagline:before { | ||
color: #ffffff7a; | ||
} | ||
|
||
.ikp-tagline:after { | ||
background: url('/inkeep/images/neon-white-logo.svg'); | ||
background-size: cover; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
filter: grayscale(1); | ||
opacity: 0.48; | ||
} | ||
} |
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,13 @@ | ||
.ikp-message-header{ | ||
display: none; | ||
} | ||
|
||
.chat-title { | ||
display: block; | ||
width: 100%; | ||
text-align: center; | ||
font-size: 36px; | ||
font-weight: 500; | ||
line-height: 125%; | ||
letter-spacing: -0.04em; | ||
} |
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,16 @@ | ||
import InkeepEmbedded from 'components/shared/inkeep-embedded'; | ||
import SEO_DATA from 'constants/seo-data'; | ||
import getMetadata from 'utils/get-metadata'; | ||
|
||
export const metadata = getMetadata(SEO_DATA.docsChat); | ||
|
||
const DocsChat = () => ( | ||
<div className="col-span-12 flex h-[calc(100vh-215px)] w-full items-center justify-center"> | ||
<h1 className="sr-only">Neon AI Chat</h1> | ||
<div className="w-[640px]"> | ||
<InkeepEmbedded /> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default DocsChat; |
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
79 changes: 52 additions & 27 deletions
79
src/components/shared/inkeep-embedded/inkeep-embedded.jsx
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,42 +1,67 @@ | ||
'use client'; | ||
|
||
import { InkeepEmbeddedChat } from '@inkeep/uikit'; | ||
import { useTheme } from 'next-themes'; | ||
import { PropTypes } from 'prop-types'; | ||
|
||
import { aiChatSettings, baseSettings } from 'lib/inkeep-settings'; | ||
|
||
const inkeepEmbeddedChatProps = { | ||
baseSettings: { | ||
...baseSettings, | ||
theme: { | ||
components: { | ||
AIChatPageWrapper: { | ||
defaultProps: { | ||
size: 'expand', // 'shrink-vertically' 'expand', 'default', 'full-viewport' | ||
variant: 'no-shadow', // 'no-shadow' or 'container-with-shadow' | ||
}, | ||
}, | ||
const InkeepEmbedded = ({ isDarkTheme = false }) => { | ||
const { theme, systemTheme } = useTheme(); | ||
|
||
let themeMode; | ||
switch (true) { | ||
case isDarkTheme: | ||
themeMode = 'dark'; | ||
break; | ||
case theme === 'system': | ||
themeMode = systemTheme; | ||
break; | ||
default: | ||
themeMode = theme; | ||
} | ||
|
||
const inkeepEmbeddedChatProps = { | ||
baseSettings: { | ||
...baseSettings, | ||
colorMode: { | ||
forcedColorMode: themeMode, | ||
}, | ||
tokens: { | ||
fonts: { | ||
body: 'var(--font-inter), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', | ||
theme: { | ||
stylesheetUrls: ['/inkeep/css/base.css', '/inkeep/css/chat.css'], | ||
components: { | ||
AIChatPageWrapper: { | ||
defaultProps: { | ||
size: 'expand', // 'shrink-vertically' 'expand', 'default', 'full-viewport' | ||
variant: 'no-shadow', // 'no-shadow' or 'container-with-shadow' | ||
}, | ||
}, | ||
}, | ||
colors: { | ||
'gray.800': '#000', | ||
tokens: { | ||
fonts: { | ||
body: 'var(--font-inter), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', | ||
}, | ||
colors: { | ||
'grayDark.900': '#000', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
aiChatSettings: { | ||
...aiChatSettings, | ||
introMessage: | ||
"<span style='font-size:16px;'>Neon is a serverless Postgres platform designed to help you build reliable and scalable applications faster. We separate compute and storage to offer modern developer features such as autoscaling, branching, point-in-time restore, and more.<br/><br/> How can I help you today?</span>", | ||
}, | ||
aiChatSettings: { | ||
...aiChatSettings, | ||
introMessage: "<span class='chat-title'>What do you want to know?</span>", | ||
}, | ||
}; | ||
|
||
return ( | ||
<div> | ||
<InkeepEmbeddedChat {...inkeepEmbeddedChatProps} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const InkeepEmbedded = () => ( | ||
<div> | ||
<InkeepEmbeddedChat {...inkeepEmbeddedChatProps} /> | ||
</div> | ||
); | ||
InkeepEmbedded.propTypes = { | ||
isDarkTheme: PropTypes.bool, | ||
}; | ||
|
||
export default InkeepEmbedded; |
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