-
Notifications
You must be signed in to change notification settings - Fork 6
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
16 changed files
with
891 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Avatar } from "../../lib/components"; | ||
import { TestBed } from "../app/test-bed"; | ||
import { ScreenshotArea } from "../screenshot-area"; | ||
|
||
const customIconSvg = ( | ||
<svg | ||
className="w-6 h-6 text-gray-800 dark:text-white" | ||
aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="m8 9 3 3-3 3m5 0h3M4 19h16a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Z" | ||
/> | ||
</svg> | ||
); | ||
|
||
export default function AvatarPage() { | ||
return ( | ||
<ScreenshotArea> | ||
<h1>Avatar</h1> | ||
<main> | ||
<TestBed> | ||
<Avatar ariaLabel="User avatar" /> | ||
<Avatar color="gen-ai" iconName="gen-ai" ariaLabel="User avatar" /> | ||
|
||
<Avatar initials="GW" ariaLabel="User avatar GW" tooltipText="User avatar" /> | ||
<Avatar color="gen-ai" initials="GW" ariaLabel="Gen AI assistant GW" tooltipText="Gen AI assistant" /> | ||
|
||
<Avatar loading={true} ariaLabel="User avatar typing" tooltipText="User avatar typing" /> | ||
<Avatar | ||
color="gen-ai" | ||
loading={true} | ||
ariaLabel="Gen AI assistant generating response" | ||
tooltipText="Gen AI assistant generating response" | ||
/> | ||
|
||
<Avatar iconSvg={customIconSvg} ariaLabel="Avatar loading" /> | ||
<Avatar color="gen-ai" iconSvg={customIconSvg} ariaLabel="Gen AI assistant loading" /> | ||
</TestBed> | ||
</main> | ||
</ScreenshotArea> | ||
); | ||
} |
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,19 +1,43 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import SpaceBetween from "@cloudscape-design/components/space-between"; | ||
import Toggle from "@cloudscape-design/components/toggle"; | ||
import { useState } from "react"; | ||
import { Avatar } from "../../lib/components"; | ||
import { TestBed } from "../app/test-bed"; | ||
import { ScreenshotArea } from "../screenshot-area"; | ||
|
||
export default function AvatarPage() { | ||
const [loading, setLoading] = useState(false); | ||
const [initials, setInitials] = useState(false); | ||
|
||
return ( | ||
<ScreenshotArea> | ||
<> | ||
<h1>Avatar</h1> | ||
<main> | ||
<TestBed> | ||
<Avatar initials="GW" /> | ||
</TestBed> | ||
</main> | ||
</ScreenshotArea> | ||
<SpaceBetween size="m"> | ||
<Avatar | ||
color="default" | ||
loading={loading} | ||
initials={initials ? "TF" : undefined} | ||
ariaLabel="User avatar Timothee Fontaka" | ||
tooltipText="Timothee Fontaka" | ||
/> | ||
<Avatar | ||
color="gen-ai" | ||
iconName="gen-ai" | ||
loading={loading} | ||
initials={initials ? "AI" : undefined} | ||
ariaLabel="Avatar Gen AI assistant" | ||
tooltipText="Gen AI assistant" | ||
/> | ||
|
||
<Toggle checked={loading} onChange={({ detail }) => setLoading(detail.checked)}> | ||
Loading | ||
</Toggle> | ||
|
||
<Toggle checked={initials} onChange={({ detail }) => setInitials(detail.checked)}> | ||
Initials | ||
</Toggle> | ||
</SpaceBetween> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.