-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new badge and message for AI kit #8110
Changes from 7 commits
f08ecb8
6360605
8322e1b
69b06f3
8ec3737
08d8ca6
fe0f2e2
5ddd7e3
621c6f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Flex, Message, IconsProvider, Text } from '@aws-amplify/ui-react'; | ||
import { IconStar, IconChevron } from '../Icons'; | ||
import { Button } from '@aws-amplify/ui-react'; | ||
|
||
interface BannerProps { | ||
url?: string; | ||
} | ||
|
||
export const Banner: React.FC<BannerProps> = ({ | ||
url = '/react/ai/set-up-ai/' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably don't need this prop since the rest of the banner content is hardcoded, right? Might as well just put it directly on the button There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I'll make it a constant variable URL |
||
}) => { | ||
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" | ||
target="_blank" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why open a new window on the same site? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
colorTheme="overlay" | ||
rel="noopener noreferrer" | ||
className="message-banner__button" | ||
> | ||
Get started | ||
<IconChevron className="icon-rotate-270" fontSize=".875em" /> | ||
</Button> | ||
</Flex> | ||
</Message> | ||
</IconsProvider> | ||
); | ||
}; |
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 { Banner } from '../index'; | ||
|
||
describe('Banner', () => { | ||
it('should render the Banner component', async () => { | ||
const bannerText = 'Amplify AI kit is now generally available'; | ||
render(<Banner />); | ||
|
||
const component = await screen.findByText(bannerText); | ||
expect(component).toBeInTheDocument(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Banner } from './Banner'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* List of paths that the gen2 <Banner /> should display on | ||
*/ | ||
export const GEN2BANNER_URLS = ['/']; | ||
ErikCH marked this conversation as resolved.
Show resolved
Hide resolved
|
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; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,24 +350,44 @@ | |
fast-xml-parser "^4.4.1" | ||
tslib "^2.5.0" | ||
|
||
"@aws-amplify/[email protected]": | ||
version "3.0.22" | ||
resolved "https://registry.npmjs.org/@aws-amplify/ui-react-core/-/ui-react-core-3.0.22.tgz" | ||
integrity sha512-uL5jspqvTZhpqH1inPV3ifvrzIVgIIriXPgjz4BaceDm+1X03Hc3tfq5TiUKW8PdpuWF6riXXBP3MEFsk29OGw== | ||
"@aws-amplify/ui-react-ai@^1.0.0": | ||
ErikCH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui-react-ai/-/ui-react-ai-1.0.0.tgz#db6dede6b42685f9c03293374a1aaf195de7f02f" | ||
integrity sha512-Y+ezPjjdUajEjN+naWhaBn7TQ4nVEtB0EylGwI8YrLKHFQVJaEGBWvvw9mfiUl3krWv+utP+EhagTM8Zk9cMBg== | ||
dependencies: | ||
"@aws-amplify/ui" "^6.6.6" | ||
"@aws-amplify/ui-react" "^6.6.0" | ||
"@aws-amplify/ui-react-core" "^3.0.30" | ||
|
||
"@aws-amplify/[email protected]", "@aws-amplify/ui-react-core@^3.0.30": | ||
version "3.0.30" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui-react-core/-/ui-react-core-3.0.30.tgz#e86346d5293bfa7f22aae9832fc0bef94ea64a83" | ||
integrity sha512-3AaUSC1Mg+yr7TqHfp34QpP6ICjQl9wUR+x7KxsETc7m5tCv4ANGXOD7qaADCi3CEw2IChBFuVu4NFKsGJbjqQ== | ||
dependencies: | ||
"@aws-amplify/ui" "6.4.1" | ||
"@aws-amplify/ui" "6.6.6" | ||
"@xstate/react" "^3.2.2" | ||
lodash "4.17.21" | ||
react-hook-form "^7.43.5" | ||
xstate "^4.33.6" | ||
|
||
"@aws-amplify/ui-react@^6.3.1": | ||
version "6.3.1" | ||
resolved "https://registry.npmjs.org/@aws-amplify/ui-react/-/ui-react-6.3.1.tgz" | ||
integrity sha512-n/wTjMYYuAhpgpuQ4o+9+IgvNsdjGqbfaA4bAXE7b1apIOfM8HTaO2zant85x+geDl7rbaa1y/z62T4H9AksMQ== | ||
"@aws-amplify/ui-react-core@3.1.0": | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui-react-core/-/ui-react-core-3.1.0.tgz#236ecf10194a27dc57fc983c679ab1de19b8a00d" | ||
integrity sha512-Nime3qjJRQyfRDDA4bnAaFVzRfEBddZFP8NhVIb13z7Uw0XoPQzX+dXwuRW+Bjt2FJnlIUHh7Cfkt0m4PedRHQ== | ||
dependencies: | ||
"@aws-amplify/ui" "6.4.1" | ||
"@aws-amplify/ui-react-core" "3.0.22" | ||
"@aws-amplify/ui" "6.7.0" | ||
"@xstate/react" "^3.2.2" | ||
lodash "4.17.21" | ||
react-hook-form "^7.43.5" | ||
xstate "^4.33.6" | ||
|
||
"@aws-amplify/ui-react@^6.6.0": | ||
version "6.6.0" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui-react/-/ui-react-6.6.0.tgz#1d10f435286fcac5e07330e318a0e30c0c84de94" | ||
integrity sha512-BHth+/CBZ8XE0IBpq+L/7mWbvGRIQxjtOmW50593hW7PvtaSXXDzPHZXRQ5nRhWs1anhxNWDiv4BKuiey6YpOw== | ||
dependencies: | ||
"@aws-amplify/ui" "6.6.6" | ||
"@aws-amplify/ui-react-core" "3.0.30" | ||
"@radix-ui/react-direction" "1.0.0" | ||
"@radix-ui/react-dropdown-menu" "1.0.0" | ||
"@radix-ui/react-slider" "1.0.0" | ||
|
@@ -376,10 +396,34 @@ | |
qrcode "1.5.0" | ||
tslib "^2.5.2" | ||
|
||
"@aws-amplify/[email protected]": | ||
version "6.4.1" | ||
resolved "https://registry.npmjs.org/@aws-amplify/ui/-/ui-6.4.1.tgz" | ||
integrity sha512-0rGGJjnd60gZNhjqDepk3VpCpzyJDE2+xevVg0iqM8APKpyQ9XRWisNLIvglQy7p/3CauXdw8U0NZVcu29Yhrw== | ||
"@aws-amplify/ui-react@^6.7.0": | ||
version "6.7.0" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui-react/-/ui-react-6.7.0.tgz#a3fc28980feee01f319448c360307a5ccc65c7f3" | ||
integrity sha512-3H97gz43+iaVNPqkQIiFj4Ko7zJLyMGtZScfNyt6PK4Ntuit5ZP6hc+Z7BtNsNEkfnAiGL1BiNOuD1IBfsnifw== | ||
dependencies: | ||
"@aws-amplify/ui" "6.7.0" | ||
"@aws-amplify/ui-react-core" "3.1.0" | ||
"@radix-ui/react-direction" "1.0.0" | ||
"@radix-ui/react-dropdown-menu" "1.0.0" | ||
"@radix-ui/react-slider" "1.0.0" | ||
"@xstate/react" "^3.2.2" | ||
lodash "4.17.21" | ||
qrcode "1.5.0" | ||
tslib "^2.5.2" | ||
|
||
"@aws-amplify/[email protected]", "@aws-amplify/ui@^6.6.6": | ||
ErikCH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version "6.6.6" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui/-/ui-6.6.6.tgz#adf39ea025ed2f35e46bb01323f8d73142b41f59" | ||
integrity sha512-4fBMO5+saXaAgBwhYbQIgudVcK1B9oHuG3WizMpImcYUbB5aL4B6NhFtmSz3DBBqAeqrZHUuUV7gWibU5JxAGQ== | ||
dependencies: | ||
csstype "^3.1.1" | ||
lodash "4.17.21" | ||
tslib "^2.5.2" | ||
|
||
"@aws-amplify/[email protected]": | ||
version "6.7.0" | ||
resolved "https://registry.yarnpkg.com/@aws-amplify/ui/-/ui-6.7.0.tgz#f31da1515a25c2fac3d9e17c9638e619a988baf8" | ||
integrity sha512-6hByYfFBQRjsFMoVGdCWMSdo7rwMgz6rxxdWV0xuHb4j3tsPEI9ZhRXG0Z1ivtQFAM3Uaz0D3hcg1kp6QFdCFg== | ||
dependencies: | ||
csstype "^3.1.1" | ||
lodash "4.17.21" | ||
|
@@ -4574,7 +4618,7 @@ cross-env@^7.0.3: | |
dependencies: | ||
cross-spawn "^7.0.1" | ||
|
||
cross-spawn@^6.0.0, "cross-spawn@^6.0.6 || ^7.0.5", cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: | ||
cross-spawn@^6.0.0, cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3, cross-spawn@^7.0.5: | ||
version "7.0.6" | ||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" | ||
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be called AIBanner since the content is hardcoded.