-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new badge and message for AI kit (#8110)
Co-authored-by: dindjarinjs <187552781+dindjarinjs@users.noreply.github.com>
- Loading branch information
1 parent
0aadfcd
commit 022988a
Showing
10 changed files
with
93 additions
and
1 deletion.
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,43 @@ | ||
import { Flex, Message, IconsProvider, Text } from '@aws-amplify/ui-react'; | ||
import { IconStar, IconChevron } from '../Icons'; | ||
import { Button } from '@aws-amplify/ui-react'; | ||
|
||
export const AIBanner: React.FC = () => { | ||
const URL = '/react/ai/set-up-ai/'; | ||
return ( | ||
<IconsProvider | ||
icons={{ | ||
message: { | ||
info: <IconStar /> | ||
} | ||
}} | ||
> | ||
<Message className="message-banner" colorTheme="info"> | ||
<Flex className="message-banner__inner"> | ||
<Flex direction="column" gap="xxs"> | ||
<Text as="span" className="message-banner__heading"> | ||
Amplify AI kit is now generally available | ||
</Text> | ||
<Text className="message-banner__content"> | ||
Create fullstack AI-powered apps with TypeScript, no prior | ||
experience in cloud architecture or AI needed. | ||
</Text> | ||
</Flex> | ||
|
||
<Button | ||
as="a" | ||
href={URL} | ||
size="small" | ||
gap="small" | ||
colorTheme="overlay" | ||
rel="noopener noreferrer" | ||
className="message-banner__button" | ||
> | ||
Get started | ||
<IconChevron className="icon-rotate-270" fontSize=".875em" /> | ||
</Button> | ||
</Flex> | ||
</Message> | ||
</IconsProvider> | ||
); | ||
}; |
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 @@ | ||
import * as React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { AIBanner } from '../index'; | ||
|
||
describe('AIBanner', () => { | ||
it('should render the AIBanner component', async () => { | ||
const bannerText = 'Amplify AI kit is now generally available'; | ||
render(<AIBanner />); | ||
|
||
const component = await screen.findByText(bannerText); | ||
expect(component).toBeInTheDocument(); | ||
}); | ||
}); |
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 @@ | ||
export { AIBanner } from './AIBanner'; |
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
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,22 @@ | ||
.message-banner { | ||
align-items: start; | ||
/* Specificity to override Amplify UI color theme */ | ||
&.amplify-message--info { | ||
border: 1px solid var(--amplify-colors-purple-20); | ||
background-color: var(--amplify-colors-purple-10); | ||
@include darkMode { | ||
background-color: var(--amplify-colors-purple-20); | ||
} | ||
} | ||
.amplify-message__icon { | ||
color: var(--amplify-colors-purple-80); | ||
} | ||
&__inner { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
} | ||
&__heading { | ||
font-weight: 700; | ||
} | ||
} |
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