Skip to content

chore: VR improvements #3374

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

Merged
merged 54 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
dd9f9bc
apply second direction for vr improvements
at-susie Mar 25, 2025
565c282
Merge branch 'main' into implement-vr-improvements
at-susie Mar 25, 2025
8d93a35
Merge branch 'main' into implement-vr-improvements
at-susie Mar 26, 2025
647d7c8
update with consolidated tech strategy
at-susie Mar 26, 2025
eabd377
move visual context to inner part
at-susie Mar 28, 2025
99adad6
Merge branch 'main' into implement-vr-improvements
at-susie Mar 31, 2025
565543a
update snapshot
at-susie Mar 31, 2025
c5080e1
fix inlineLabelText background issue
at-susie Apr 2, 2025
76db14b
resolve conflicts
at-susie Apr 2, 2025
9f92b3e
Merge branch 'main' into implement-vr-improvements
at-susie Apr 2, 2025
680940e
fix inline label background issue
at-susie Apr 2, 2025
f5257fa
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 2, 2025
988d047
update snapshots
at-susie Apr 2, 2025
ccabeae
Temporarly increase package size limit for exploration
at-susie Apr 2, 2025
c4ba38b
apply second direction for vr improvements
at-susie Mar 25, 2025
c20087a
update with consolidated tech strategy
at-susie Mar 26, 2025
2b9a4a4
move visual context to inner part
at-susie Mar 28, 2025
6ba6839
fix inlineLabelText background issue
at-susie Apr 2, 2025
d2fd93e
fix inline label background issue
at-susie Apr 2, 2025
e9e2bdb
update snapshots
at-susie Apr 2, 2025
24552e6
Temporarly increase package size limit for exploration
at-susie Apr 2, 2025
116e903
chore: Stroke adjustment
at-susie Apr 3, 2025
543b59a
update snapshot
at-susie Apr 3, 2025
122ab5c
resolve conflicts
at-susie Apr 3, 2025
a2de946
update snapshots
at-susie Apr 3, 2025
a8f4d36
Merge branch 'main' into implement-vr-improvements
at-susie Apr 4, 2025
495dead
update snapshot
at-susie Apr 7, 2025
beb3451
update design-tokens.test.ts.snap
at-susie Apr 7, 2025
680ac68
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
b8e5314
update snapshot
at-susie Apr 10, 2025
6e13301
replace a border width constant with new border tokens
at-susie Apr 10, 2025
141daa6
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
efbffe4
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
ee17b6e
update borderWidthField value to 1px
at-susie Apr 11, 2025
20b0bc3
Merge branch 'main' into implement-vr-improvements
at-susie Apr 11, 2025
250e35f
update integration tests with main
at-susie Apr 11, 2025
8a8f57c
update snapshot tests
at-susie Apr 11, 2025
545ef5f
Merge branch 'main' into implement-vr-improvements
at-susie Apr 11, 2025
552b4dd
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
b196c47
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
944a8bf
make segmented control stroke width 1px too
at-susie Apr 14, 2025
cca119b
update to have pixel perfect radio stroke width
at-susie Apr 14, 2025
da710ca
clean up demo pages and added a default one
at-susie Apr 14, 2025
212202c
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
ba3c6be
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 14, 2025
15d30b8
update the token stroke width for property filter
at-susie Apr 14, 2025
d52ab09
Merge branch 'main' into implement-vr-improvements
at-susie Apr 17, 2025
c89743d
update a value that was hard-coded
at-susie Apr 17, 2025
197287f
remove parentTokens from toolbar visual context definition and adjust…
at-susie Apr 17, 2025
34944f3
update the expected value based on the prompt-input border width change
at-susie Apr 17, 2025
c2e9d6c
fix issues found in bug-bash - code editor border width and striped r…
at-susie Apr 17, 2025
d052874
Merge branch 'main' into implement-vr-improvements
at-susie Apr 22, 2025
c409a91
add an additional :not pseudo to striped divider for last-row
at-susie Apr 22, 2025
b02f890
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 22, 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
110 changes: 110 additions & 0 deletions pages/app-layout-toolbar/full-page-cards.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useState } from 'react';
import range from 'lodash/range';

import { AppLayoutToolbar } from '~components';
import Button from '~components/button';
import Cards, { CardsProps } from '~components/cards';
import Header from '~components/header';
import Link from '~components/link';

import * as toolsContent from '../app-layout//utils/tools-content';
import { Breadcrumbs, Footer, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import ScreenshotArea from '../utils/screenshot-area';

interface Item {
number: number;
text: string;
}

function createSimpleItems(count: number) {
const texts = ['One', 'Two', 'Three', 'Four', 'Five'];
return range(count).map(number => ({ number, text: texts[number % texts.length] }));
}

const cardDefinition: CardsProps.CardDefinition<Item> = {
header: item => item.text,
sections: [
{
id: 'description',
header: 'Number',
content: item => item.number,
},
{
id: 'type',
header: 'Text',
content: item => item.text,
},
],
};

const config: CardsProps['cardsPerRow'] = [
{
cards: 1,
},
{
minWidth: 400,
cards: 2,
},
{
cards: 3,
minWidth: 700,
},
{
cards: 4,
minWidth: 1000,
},
];

const items = createSimpleItems(16);

export default function () {
const [toolsOpen, setToolsOpen] = useState(false);
const [selectedTool, setSelectedTool] = useState<keyof typeof toolsContent>('long');

function openHelp(article: keyof typeof toolsContent) {
setToolsOpen(true);
setSelectedTool(article);
}

return (
<ScreenshotArea gutters={false}>
<AppLayoutToolbar
ariaLabels={labels}
breadcrumbs={<Breadcrumbs />}
navigation={<Navigation />}
contentType="cards"
tools={<Tools>{toolsContent[selectedTool]}</Tools>}
toolsOpen={toolsOpen}
onToolsChange={({ detail }) => setToolsOpen(detail.open)}
notifications={<Notifications />}
content={
<Cards<Item>
items={items}
cardDefinition={cardDefinition}
stickyHeader={true}
variant="full-page"
header={
<Header
variant="awsui-h1-sticky"
description="Demo page with footer"
info={
<Link variant="info" onFollow={() => openHelp('long')}>
Long help text
</Link>
}
actions={<Button variant="primary">Create</Button>}
>
Sticky Scrollbar Example
</Header>
}
cardsPerRow={config}
/>
}
/>
<Footer legacyConsoleNav={false} />
</ScreenshotArea>
);
}
68 changes: 68 additions & 0 deletions pages/app-layout-toolbar/full-page-table.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useContext, useState } from 'react';

import { AppLayoutToolbar, Button, Header, Link, Table } from '~components';

import AppContext, { AppContextType } from '../app/app-context';
import { Breadcrumbs, Footer, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import * as toolsContent from '../app-layout/utils/tools-content';
import { generateItems, Instance } from '../table/generate-data';
import { columnsConfig } from '../table/shared-configs';
import ScreenshotArea from '../utils/screenshot-area';

type PageContext = React.Context<AppContextType<{ stickyNotifications: boolean }>>;

const items = generateItems(20);

export default function () {
const [toolsOpen, setToolsOpen] = useState(false);
const [selectedTool, setSelectedTool] = useState<keyof typeof toolsContent>('long');
const { urlParams } = useContext(AppContext as PageContext);

function openHelp(article: keyof typeof toolsContent) {
setToolsOpen(true);
setSelectedTool(article);
}

return (
<ScreenshotArea gutters={false}>
<AppLayoutToolbar
ariaLabels={labels}
breadcrumbs={<Breadcrumbs />}
navigation={<Navigation />}
contentType="table"
tools={<Tools>{toolsContent[selectedTool]}</Tools>}
toolsOpen={toolsOpen}
onToolsChange={({ detail }) => setToolsOpen(detail.open)}
notifications={<Notifications />}
stickyNotifications={urlParams.stickyNotifications}
content={
<Table<Instance>
header={
<Header
variant="awsui-h1-sticky"
description="Demo page with footer"
info={
<Link variant="info" onFollow={() => openHelp('long')}>
Long help text
</Link>
}
actions={<Button variant="primary">Create</Button>}
>
Sticky Scrollbar Example
</Header>
}
stickyHeader={true}
variant="full-page"
columnDefinitions={columnsConfig}
items={items}
stripedRows={true}
/>
}
/>
<Footer legacyConsoleNav={false} />
</ScreenshotArea>
);
}
107 changes: 107 additions & 0 deletions pages/app-layout-toolbar/with-wizard.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useContext, useState } from 'react';

import {
AppLayoutToolbar,
Box,
Button,
ColumnLayout,
Container,
Header,
SpaceBetween,
Table,
Wizard,
} from '~components';

import AppContext, { AppContextType } from '../app/app-context';
import { Breadcrumbs } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import { generateItems, Instance } from '../table/generate-data';
import { columnsConfig } from '../table/shared-configs';
import ScreenshotArea from '../utils/screenshot-area';

type DemoContext = React.Context<
AppContextType<{ hasBreadcrumbs: boolean; hasNotifications: boolean; disableOverlap: boolean }>
>;

const items = generateItems(20);

export default function () {
const { urlParams } = useContext(AppContext as DemoContext);
const [activeStepIndex, setActiveStepIndex] = useState(0);

return (
<ScreenshotArea gutters={false}>
<AppLayoutToolbar
ariaLabels={labels}
navigationHide={false}
breadcrumbs={urlParams.hasBreadcrumbs && <Breadcrumbs />}
content={
<Wizard
i18nStrings={{
stepNumberLabel: stepNumber => `Step ${stepNumber}`,
collapsedStepsLabel: (stepNumber, stepsCount) => `Step ${stepNumber} of ${stepsCount}`,
skipToButtonLabel: step => `Skip to ${step.title}`,
navigationAriaLabel: 'Steps',
cancelButton: 'Cancel',
previousButton: 'Previous',
nextButton: 'Next',
submitButton: 'Launch instance',
optional: 'optional',
}}
onNavigate={({ detail }) => setActiveStepIndex(detail.requestedStepIndex)}
activeStepIndex={activeStepIndex}
allowSkipTo={true}
steps={[
{
title: 'Add storage',
content: (
<Box>
<Table<Instance>
header={
<Header
variant="awsui-h1-sticky"
description="Demo page with footer"
actions={<Button variant="primary">Create</Button>}
>
Sticky Scrollbar Example
</Header>
}
columnDefinitions={columnsConfig}
items={items}
/>
</Box>
),
isOptional: true,
},
{
title: 'Review and launch',
content: (
<SpaceBetween size="xs">
<Header variant="h3" actions={<Button onClick={() => setActiveStepIndex(0)}>Edit</Button>}>
Step 1: Instance type
</Header>
<Container header={<Header variant="h2">Container title</Header>}>
<ColumnLayout columns={2} variant="text-grid">
<div>
<Box variant="awsui-key-label">First field</Box>
<div>Value</div>
</div>
<div>
<Box variant="awsui-key-label">Second Field</Box>
<div>Value</div>
</div>
</ColumnLayout>
</Container>
</SpaceBetween>
),
},
]}
/>
}
contentType="wizard"
/>
</ScreenshotArea>
);
}
Loading
Loading