Skip to content

feat: Expanded mode for global drawers #3381

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

Draft
wants to merge 44 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9af212c
Initial draft implementation
georgylobko Mar 13, 2025
d830012
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko Mar 24, 2025
2169962
feat: Focus mode button
georgylobko Mar 25, 2025
3335806
chore: Make one more drawer expandable
georgylobko Mar 25, 2025
b6956cc
chore: Quit focus mode on closing drawer
georgylobko Mar 26, 2025
6f09f94
Merge branch 'main' into feat/expandable-drawer
georgylobko Mar 27, 2025
1402ee4
feat: Preserve local drawers, split panel and nav state in the focus …
georgylobko Mar 28, 2025
4fbf9c1
fix: Size limit in package.json
georgylobko Mar 28, 2025
23eff87
upd snapshots
georgylobko Mar 28, 2025
ad99159
fix tests
georgylobko Mar 28, 2025
9144339
Merge branch 'main' into feat/expandable-drawer
georgylobko Mar 31, 2025
3e7d159
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 1, 2025
84b2b96
chore: Border styles for global drawers (including expanded state)
georgylobko Apr 1, 2025
ffd3a83
chore: Rename focus mode to expanded mode
georgylobko Apr 2, 2025
680b1c2
feat: Allow only 1 drawer to be in expanded mode
georgylobko Apr 2, 2025
963f160
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 2, 2025
f79ee97
chore: Prevent rendering expanded mode button in mobile view
georgylobko Apr 2, 2025
1a29592
chore: Update snapshots
georgylobko Apr 2, 2025
84e2fbc
feat: Split panel behaviour
georgylobko Apr 2, 2025
faa3535
feat: Overflown triggers behavior in expanded mode
georgylobko Apr 3, 2025
7c64515
chore: Overflow menu condition for local drawers
georgylobko Apr 3, 2025
be428d5
chore: Integ test to check page elements' visibility in focus mode
georgylobko Apr 3, 2025
7ded8b6
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 3, 2025
6b598da
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 4, 2025
7045cd2
feat: Expanded mode for nested app layouts
georgylobko Apr 4, 2025
92da442
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 4, 2025
6f5a68b
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko Apr 14, 2025
6d6fe6f
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 14, 2025
ec02608
chore: Increase size limit
georgylobko Apr 14, 2025
860f3c0
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 16, 2025
27f5d0a
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko Apr 22, 2025
56fe43e
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko Apr 23, 2025
ecf77db
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko Apr 28, 2025
9af73d1
Merge branch 'main' into feat/expandable-drawer
georgylobko Apr 28, 2025
1231650
Merge branch 'main' into feat/expandable-drawer
georgylobko May 5, 2025
dfabb70
fix: Hide side split panel when focus mode is on
georgylobko May 5, 2025
5aff235
Merge branch 'main' into feat/expandable-drawer
georgylobko May 6, 2025
028a2e4
chore: Adjust expanded drawer styles
georgylobko May 6, 2025
8500e9e
chore: Adjust expanded drawer styles
georgylobko May 6, 2025
ee1abe4
chore: Explore drawer animation (#3472)
at-susie May 6, 2025
d80bd18
chore: Hide grey gap for rightmost global expanded widget
georgylobko May 7, 2025
7a23d03
Merge remote-tracking branch 'origin/main' into feat/expandable-drawer
georgylobko May 7, 2025
f1ca7d6
chore: Update resize icon
georgylobko May 7, 2025
282d0b0
chore: Increase limit size
georgylobko May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
{
"path": "lib/components/internal/widget-exports.js",
"brotli": false,
"limit": "775 kB",
"limit": "779 kB",
"ignore": "react-dom"
}
],
Expand Down
213 changes: 213 additions & 0 deletions pages/app-layout/sidecar-demo.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useContext, useRef, useState } from 'react';

import {
AppLayout,
Box,
Button,
CopyToClipboard,
Header,
HelpPanel,
KeyValuePairs,
Link,
ProgressBar,
SideNavigation,
SpaceBetween,
SplitPanel,
StatusIndicator,
Table,
} from '~components';
import { AppLayoutProps } from '~components/app-layout';

import './utils/external-widget-demo';
import AppContext, { AppContextType } from '../app/app-context';
import { generateItems, Instance } from '../table/generate-data';
import { columnsConfig } from '../table/shared-configs';
import { Breadcrumbs } from './utils/content-blocks';
import { drawerLabels } from './utils/drawers';
import appLayoutLabels from './utils/labels';

type DemoContext = React.Context<
AppContextType<{
hasTools: boolean | undefined;
hasDrawers: boolean | undefined;
splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];
}>
>;

export default function WithDrawers() {
const { urlParams, setUrlParams } = useContext(AppContext as DemoContext);
const hasTools = urlParams.hasTools ?? true;
const appLayoutRef = useRef<AppLayoutProps.Ref>(null);

const [activeHref, setActiveHref] = useState('#/');
const [navigationOpen, setNavigationOpen] = useState(true);
const [toolsOpen, setToolsOpen] = useState(false);

const items = generateItems(20);

function openHelp() {
setToolsOpen(true);
}

return (
<AppLayout
ariaLabels={{ ...appLayoutLabels, ...drawerLabels }}
breadcrumbs={<Breadcrumbs />}
ref={appLayoutRef}
navigation={
<SideNavigation
activeHref={activeHref}
header={{ text: 'Navigation', href: '#/' }}
onFollow={e => {
e.preventDefault();
setActiveHref(e.detail.href);
}}
items={[
{ type: 'link', text: 'Side nav menu A', href: '#/menu-a' },
{ type: 'link', text: 'Side nav menu B', href: '#/menu-b' },
{ type: 'link', text: 'Side nav menu C', href: '#/menu-c' },
]}
/>
}
navigationOpen={navigationOpen}
onNavigationChange={({ detail }) => setNavigationOpen(detail.open)}
content={
<Table<Instance>
header={
<Header
variant="awsui-h1-sticky"
description="Demo page with footer"
info={
<Link variant="info" onFollow={() => openHelp()}>
Info
</Link>
}
actions={<Button variant="primary">Create</Button>}
>
Sticky Scrollbar Example
</Header>
}
stickyHeader={true}
variant="full-page"
columnDefinitions={columnsConfig}
items={items}
selectionType="multi"
ariaLabels={{
selectionGroupLabel: 'Item selection',
allItemsSelectionLabel: () => 'Select all items',
itemSelectionLabel: (_, item) => `Select ${item.id}`,
}}
/>
}
splitPanel={
<SplitPanel
header="Overview"
i18nStrings={{
preferencesTitle: 'Preferences',
preferencesPositionLabel: 'Split panel position',
preferencesPositionDescription: 'Choose the default split panel position for the service.',
preferencesPositionSide: 'Side',
preferencesPositionBottom: 'Bottom',
preferencesConfirm: 'Confirm',
preferencesCancel: 'Cancel',
closeButtonAriaLabel: 'Close panel',
openButtonAriaLabel: 'Open panel',
resizeHandleAriaLabel: 'Slider',
}}
>
<SpaceBetween size="m">
<Box>
Receive real-time data insights to build process improvements, track key performance indicators, and
predict future business outcomes. Create a new Cloud Data Solution account to receive a 30 day free trial
of all Cloud Data Solution services.
</Box>
<KeyValuePairs
columns={2}
items={[
{
type: 'group',
items: [
{
label: 'Distribution ID',
value: 'E1WG1ZNPRXT0D4',
},
{
label: 'ARN',
value: (
<CopyToClipboard
copyButtonAriaLabel="Copy ARN"
copyErrorText="ARN failed to copy"
copySuccessText="ARN copied"
textToCopy="arn:service23G24::111122223333:distribution/23E1WG1ZNPRXT0D4"
variant="inline"
/>
),
},
{
label: 'Status',
value: <StatusIndicator>Available</StatusIndicator>,
},
],
},

{
type: 'group',
items: [
{
label: 'SSL Certificate',
id: 'ssl-certificate-id',
value: (
<ProgressBar
value={30}
additionalInfo="Additional information"
description="Progress bar description"
ariaLabelledby="ssl-certificate-id"
/>
),
},
{
label: 'Price class',
value: 'Use only US, Canada, Europe',
},
{
label: 'CNAMEs',
value: (
<Link external={true} href="#">
abc.service23G24.xyz
</Link>
),
},
],
},
]}
/>
</SpaceBetween>
</SplitPanel>
}
splitPanelPreferences={{
position: urlParams.splitPanelPosition,
}}
onSplitPanelPreferencesChange={event => {
const { position } = event.detail;
setUrlParams({ splitPanelPosition: position === 'side' ? position : undefined });
}}
toolsOpen={toolsOpen}
toolsHide={!hasTools}
onToolsChange={({ detail }) => setToolsOpen(detail.open)}
tools={
<HelpPanel header={<h2>Help</h2>}>
<p>This is a demo page showcasing the AppLayout component with a sticky header and scrollable content.</p>
<h3>Features:</h3>
<ul>
<li>Responsive navigation sidebar</li>
<li>Sticky header with actions</li>
<li>Full-page table with sticky header</li>
<li>Split panel support</li>
</ul>
</HelpPanel>
}
/>
);
}
Loading
Loading