Skip to content

Commit 7736f1c

Browse files
Merge branch 'main' into dev-v3-gethinw-breadcrumb-mobile
2 parents 242ef72 + 3c11f26 commit 7736f1c

File tree

232 files changed

+1915
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+1915
-1068
lines changed

.github/workflows/build-lint-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
uses: cloudscape-design/actions/.github/workflows/build-lint-test.yml@main
2424
secrets: inherit
2525
with:
26-
artifact-path: lib/static-default
26+
artifact-path: pages/lib/static-default
2727
artifact-name: dev-pages
2828
deploy:
2929
needs: build
3030
uses: cloudscape-design/actions/.github/workflows/deploy.yml@main
3131
secrets: inherit
3232
with:
3333
artifact-name: dev-pages
34-
deployment-path: lib/static-default
34+
deployment-path: pages/lib/static-default

package-lock.json

-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"@types/node": "^18.18.5",
7676
"@types/react": "^16.14.20",
7777
"@types/react-dom": "^16.9.14",
78-
"@types/react-resizable": "^1.7.4",
7978
"@types/react-router": "^5.1.18",
8079
"@types/react-router-dom": "^5.3.2",
8180
"@types/react-test-renderer": "^18.3.0",
@@ -123,7 +122,6 @@
123122
"react-router-dom": "^5.3.0",
124123
"react-test-renderer": "^16.14.0",
125124
"react-virtual": "^2.8.2",
126-
"replace-in-files": "^3.0.0",
127125
"rimraf": "^5.0.5",
128126
"rollup": "^3.29.5",
129127
"rollup-plugin-license": "^3.0.1",

pages/app-layout/disable-paddings-breadcrumbs.page.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export default function () {
1616
<AppLayout
1717
ariaLabels={labels}
1818
disableContentPaddings={true}
19-
breadcrumbs={<div className={styles.highlightBorder}>Breadcrumbs</div>}
19+
breadcrumbs={
20+
<nav aria-label="Breadcrumbs" className={styles.highlightBorder}>
21+
Breadcrumbs
22+
</nav>
23+
}
2024
notifications={
2125
<div className={styles.highlightBorder}>
2226
<Box variant="h2">Notifications</Box>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import React from 'react';
4+
5+
import AppLayout from '~components/app-layout';
6+
import Button from '~components/button';
7+
import Header from '~components/header';
8+
import Table from '~components/table';
9+
10+
import { generateItems, Instance } from '../table/generate-data';
11+
import { columnsConfig } from '../table/shared-configs';
12+
import ScreenshotArea from '../utils/screenshot-area';
13+
import { Breadcrumbs, Navigation } from './utils/content-blocks';
14+
import { Tools } from './utils/content-blocks';
15+
import labels from './utils/labels';
16+
import * as toolsContent from './utils/tools-content';
17+
18+
const items = generateItems(100);
19+
20+
export default function () {
21+
return (
22+
<ScreenshotArea gutters={false}>
23+
<AppLayout
24+
data-testid="main-layout"
25+
ariaLabels={labels}
26+
navigation={<Navigation />}
27+
toolsHide={true}
28+
disableContentPaddings={true}
29+
content={
30+
<AppLayout
31+
data-testid="secondary-layout"
32+
ariaLabels={labels}
33+
breadcrumbs={<Breadcrumbs />}
34+
navigationHide={true}
35+
content={
36+
<Table<Instance>
37+
header={
38+
<Header
39+
variant="awsui-h1-sticky"
40+
description="Demo page with footer"
41+
actions={<Button variant="primary">Create</Button>}
42+
>
43+
Sticky Scrollbar Example
44+
</Header>
45+
}
46+
stickyHeader={true}
47+
variant="full-page"
48+
columnDefinitions={columnsConfig}
49+
items={items}
50+
/>
51+
}
52+
tools={<Tools>{toolsContent.long}</Tools>}
53+
/>
54+
}
55+
/>
56+
</ScreenshotArea>
57+
);
58+
}

pages/app-layout/runtime-drawers.page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import awsuiPlugins from '~components/internal/plugins';
1919
import './utils/external-widget';
2020
import AppContext, { AppContextType } from '../app/app-context';
2121
import { Breadcrumbs, Containers, CustomDrawerContent } from './utils/content-blocks';
22+
import { drawerLabels } from './utils/drawers';
2223
import appLayoutLabels from './utils/labels';
2324

2425
type DemoContext = React.Context<
@@ -64,7 +65,7 @@ export default function WithDrawers() {
6465

6566
return (
6667
<AppLayout
67-
ariaLabels={appLayoutLabels}
68+
ariaLabels={{ ...appLayoutLabels, ...drawerLabels }}
6869
breadcrumbs={<Breadcrumbs />}
6970
ref={appLayoutRef}
7071
content={

pages/app-layout/stateful.page.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export default function AppLayoutStatefulDemo() {
1212
return (
1313
<AppLayout
1414
ariaLabels={labels}
15-
breadcrumbs={<Counter id="breadcrumbs" />}
15+
breadcrumbs={
16+
<nav aria-label="Breadcrumbs">
17+
<Counter id="breadcrumbs" />
18+
</nav>
19+
}
1620
navigation={<Counter id="navigation" />}
1721
tools={<Counter id="tools" />}
1822
content={

pages/app-layout/utils/content-blocks.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function Containers() {
3737
{range(count).map(i => (
3838
<Container
3939
key={i}
40-
data-testid={`container-${i + 1}`}
4140
header={
4241
<Header variant="h2" actions={<Button onClick={() => setCount(count - 1)}>Remove</Button>}>
4342
Demo container #{i + 1}
@@ -183,10 +182,15 @@ export function CustomDrawerContent() {
183182
<div className={styles['custom-drawer-wrapper']}>
184183
<div className={styles['drawer-sticky-header']} data-testid="drawer-sticky-header">
185184
<Box variant="h3" tagOverride="h2" padding="n">
186-
Sticky header
185+
<span id="custom-drawer-heading">Sticky header</span>
187186
</Box>
188187
</div>
189-
<div className={styles['drawer-scrollable-content']}>
188+
<div
189+
className={styles['drawer-scrollable-content']}
190+
role="region"
191+
aria-labelledby="custom-drawer-heading"
192+
tabIndex={0}
193+
>
190194
<ScrollableDrawerContent />
191195
</div>
192196
<div className={styles['drawer-sticky-footer']} data-testid="drawer-sticky-footer">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import React, { useContext, useState } from 'react';
4+
import range from 'lodash/range';
5+
6+
import AppLayout from '~components/app-layout';
7+
import Header from '~components/header';
8+
import RadioGroup from '~components/radio-group';
9+
import SideNavigation from '~components/side-navigation';
10+
import SplitPanel from '~components/split-panel';
11+
12+
import AppContext, { AppContextType } from '../app/app-context';
13+
import { Footer, Tools } from './utils/content-blocks';
14+
import labels from './utils/labels';
15+
import * as toolsContent from './utils/tools-content';
16+
17+
const overflowWhenSplitPanelIsAtBottom = (
18+
<div
19+
style={{
20+
height: 400,
21+
}}
22+
></div>
23+
);
24+
25+
const overflowWhenSplitPanelIsOnSide = (
26+
<div style={{ display: 'flex', gap: '2000px 350px', flexWrap: 'wrap' }}>
27+
<div>Item 1</div>
28+
<div>Item 2</div>
29+
</div>
30+
);
31+
32+
const overflowNever = 'Short content';
33+
34+
const overflowAlways = <div style={{ height: 1200 }}></div>;
35+
36+
const contentByOverflowCondition = {
37+
side: overflowWhenSplitPanelIsOnSide,
38+
bottom: overflowWhenSplitPanelIsAtBottom,
39+
never: overflowNever,
40+
always: overflowAlways,
41+
};
42+
43+
type ScrollbarCondition = 'side' | 'bottom' | 'never' | 'always';
44+
45+
type SplitPanelDemoContext = React.Context<
46+
AppContextType<{
47+
scrollbarDisplayCondition: ScrollbarCondition;
48+
toolsEnabled: boolean;
49+
}>
50+
>;
51+
52+
export default function () {
53+
const {
54+
urlParams: { scrollbarDisplayCondition = 'always' },
55+
setUrlParams,
56+
} = useContext(AppContext as SplitPanelDemoContext);
57+
58+
const [splitPanelOpen, setSplitPanelOpen] = useState(true);
59+
60+
return (
61+
<>
62+
<AppLayout
63+
ariaLabels={labels}
64+
navigation={
65+
<SideNavigation
66+
header={{
67+
href: '#',
68+
text: 'Service name',
69+
}}
70+
items={range(3).map(i => ({ type: 'link', text: `Navigation #${i + 1}`, href: `#item-${i}` }))}
71+
/>
72+
}
73+
navigationOpen={true}
74+
disableContentPaddings={true}
75+
minContentWidth={300}
76+
splitPanelOpen={splitPanelOpen}
77+
onSplitPanelToggle={e => setSplitPanelOpen(e.detail.open)}
78+
splitPanelPreferences={{
79+
position: 'side',
80+
}}
81+
tools={<Tools>{toolsContent.long}</Tools>}
82+
content={
83+
<div
84+
style={{
85+
backgroundColor: 'rgba(255, 255, 0, 0.1)',
86+
borderBottom: '1px dashed gray',
87+
}}
88+
>
89+
<Header variant="h1">Split panel with body scroll</Header>
90+
{contentByOverflowCondition[scrollbarDisplayCondition]}
91+
</div>
92+
}
93+
splitPanel={
94+
<SplitPanel
95+
header="Split panel header"
96+
i18nStrings={{
97+
preferencesTitle: 'Preferences',
98+
preferencesPositionLabel: 'Split panel position',
99+
preferencesPositionDescription: 'Choose the default split panel position for the service.',
100+
preferencesPositionSide: 'Side',
101+
preferencesPositionBottom: 'Bottom',
102+
preferencesConfirm: 'Confirm',
103+
preferencesCancel: 'Cancel',
104+
closeButtonAriaLabel: 'Close panel',
105+
openButtonAriaLabel: 'Open panel',
106+
resizeHandleAriaLabel: 'Slider',
107+
}}
108+
>
109+
<div id="radio-group-label">Let content overflow vertically when split panel is:</div>
110+
<RadioGroup
111+
ariaLabelledby="radio-group-label"
112+
value={scrollbarDisplayCondition}
113+
onChange={({ detail }) => setUrlParams({ scrollbarDisplayCondition: detail.value as ScrollbarCondition })}
114+
items={[
115+
{
116+
value: 'side',
117+
label: 'On the side',
118+
},
119+
{
120+
value: 'bottom',
121+
label: 'At the bottom',
122+
},
123+
{
124+
value: 'always',
125+
label: 'Always',
126+
},
127+
{
128+
value: 'never',
129+
label: 'Never',
130+
},
131+
]}
132+
/>
133+
</SplitPanel>
134+
}
135+
/>
136+
<Footer legacyConsoleNav={false} />
137+
</>
138+
);
139+
}

0 commit comments

Comments
 (0)