-
Notifications
You must be signed in to change notification settings - Fork 164
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
277 changed files
with
10,655 additions
and
3,393 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,75 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import React from 'react'; | ||
|
||
import Box from '~components/box'; | ||
import BreadcrumbGroup from '~components/breadcrumb-group'; | ||
import SpaceBetween from '~components/space-between'; | ||
|
||
import ScreenshotArea from '../utils/screenshot-area'; | ||
|
||
let counter = 0; | ||
|
||
export default function ResponsiveBreadcrumbsPage() { | ||
return ( | ||
<ScreenshotArea disableAnimations={true}> | ||
<article> | ||
<Box padding="xl"> | ||
<SpaceBetween size="xxl"> | ||
<h1>Responsive breadcrumbs</h1> | ||
<ResponsiveBreadcrumbs | ||
widths={[900, 800, 700, 600, 500, 400, 300, 200]} | ||
items={[ | ||
'A', | ||
'Longer breadrcumb', | ||
'ABC', | ||
'Another even longer breadcrumb', | ||
'ABCDEF', | ||
'ABCDEFGHIJsjbdkasbdhjabsjdhasjhdabsjd', | ||
]} | ||
/> | ||
<ResponsiveBreadcrumbs widths={[150]} items={['Small', 'Small', 'Small', 'Small', 'Small']} /> | ||
<ResponsiveBreadcrumbs | ||
widths={[150]} | ||
items={[ | ||
'Large breadcrumb', | ||
'Large breadcrumb', | ||
'Large breadcrumb', | ||
'Large breadcrumb', | ||
'Large breadcrumb', | ||
]} | ||
/> | ||
<ResponsiveBreadcrumbs widths={[100]} items={['Small', 'Small']} /> | ||
<ResponsiveBreadcrumbs widths={[100]} items={['Large breadcrumb', 'Large breadcrumb']} /> | ||
<ResponsiveBreadcrumbs widths={[100]} items={['Large breadcrumb', 'Small']} /> | ||
<ResponsiveBreadcrumbs widths={[30]} items={['Small']} /> | ||
<ResponsiveBreadcrumbs widths={[30]} items={['Large breadcrumb']} /> | ||
</SpaceBetween> | ||
</Box> | ||
</article> | ||
</ScreenshotArea> | ||
); | ||
} | ||
|
||
interface ResponsiveBreadcrumbsProps { | ||
items: Array<string>; | ||
widths: Array<number>; | ||
} | ||
|
||
const ResponsiveBreadcrumbs = ({ items, widths }: ResponsiveBreadcrumbsProps) => { | ||
const breadcrumbs = items.map(text => ({ text, href: `#` })); | ||
return ( | ||
<SpaceBetween size="xxl"> | ||
{widths.map((width, key) => ( | ||
<div key={key} style={{ width, borderInlineEnd: '2px solid blue' }}> | ||
<BreadcrumbGroup | ||
key={key} | ||
ariaLabel={`label - ${counter++}`} | ||
expandAriaLabel="Show path for long text" | ||
items={breadcrumbs} | ||
/> | ||
</div> | ||
))} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import * as React from 'react'; | ||
|
||
import ButtonDropdown from '~components/button-dropdown'; | ||
|
||
export default function ButtonDropdownPage() { | ||
return ( | ||
<> | ||
<h1>Button dropdown with main action</h1> | ||
<ButtonDropdown | ||
items={[ | ||
{ | ||
text: 'Launch instance from template', | ||
id: 'launch-instance-from-template', | ||
}, | ||
]} | ||
mainAction={{ text: 'Launch instance' }} | ||
ariaLabel="More launch options" | ||
variant="primary" | ||
/> | ||
</> | ||
); | ||
} |
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,25 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import React, { useContext } from 'react'; | ||
|
||
import AppContext from '../app/app-context'; | ||
import { IframeWrapper } from '../utils/iframe-wrapper'; | ||
import ScreenshotArea from '../utils/screenshot-area'; | ||
import { Configurator, DropdownExpandableContext, DropdownsDemo } from './expandable.page'; | ||
|
||
export default function () { | ||
const { | ||
urlParams: { componentType = 'Autosuggest', expandToViewport = true }, | ||
setUrlParams, | ||
} = useContext(AppContext as DropdownExpandableContext); | ||
return ( | ||
<ScreenshotArea> | ||
<h1>Expandable dropdown scenarios inside iframe</h1> | ||
<Configurator componentType={componentType} expandToViewport={expandToViewport} onChange={setUrlParams} /> | ||
<IframeWrapper | ||
id="expandable-dropdowns-iframe" | ||
AppComponent={() => <DropdownsDemo componentType={componentType} expandToViewport={expandToViewport} />} | ||
/> | ||
</ScreenshotArea> | ||
); | ||
} |
Oops, something went wrong.