Skip to content
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

Bluedialog Initial commit #2923

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
98 changes: 98 additions & 0 deletions pages/bluedialog/bluedialog.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import {
Box,
Button,
DatePicker,
ExpandableSection,
Form,
FormField,
Header,
Input,
Select,
SpaceBetween,
Textarea,
} from '~components';

import styles from './styles.scss';

export default function Bluedialogbox() {
const [showDialog, setShowDialog] = React.useState(true);
// Inputs
const [dateValue, setDateValue] = React.useState('');
const [amountValue, setAmountValue] = React.useState('0');
const [descriptionValue, setDescriptionValue] = React.useState('');
const [selectedService, setSelectedService] = React.useState({ label: 'Cloudwatch', value: 'Cloudwatch' });

function submitData() {
console.log({ dateValue, amountValue, descriptionValue, selectedService });
}
function skipDialog() {
setShowDialog(false);
}

return showDialog ? (
<div className={styles['blue-dialog-box']}>
<Form
header={
<div className={styles['blue-dialog-box__header']}>
<Header variant="h1">Dialog header</Header>
<Button iconName="close" variant="icon" onClick={skipDialog} />
</div>
}
>
<div className={styles['blue-dialog-box__content']}>
<SpaceBetween direction="vertical" size="l">
<FormField label="When did the increase occur?">
<DatePicker
onChange={({ detail }) => setDateValue(detail.value)}
value={dateValue}
openCalendarAriaLabel={selectedDate =>
'Choose certificate expiry date' + (selectedDate ? `, selected date is ${selectedDate}` : '')
}
placeholder="YYYY/MM/DD"
/>
</FormField>
<FormField constraintText="Enter a dollar amount in USD" label="What is the increase amount?">
<Input value={amountValue} onChange={({ detail }) => setAmountValue(detail.value)} />
</FormField>

<ExpandableSection
defaultExpanded={true}
headerText={
<Box color="text-status-inactive" fontWeight="bold" fontSize="heading-xs">
Provide more details to enhance troubleshooting
</Box>
}
>
<SpaceBetween size={'l'}>
<FormField label="Which service is this related to ? - optional">
<Select
selectedOption={selectedService}
onChange={({ detail }: any) => setSelectedService(detail.selectedOption)}
options={[
{ label: 'Cloudwatch', value: 'Cloudwatch' },
{ label: 'Dynamodb', value: 'Dynamodb' },
{ label: 'Route 53', value: 'Route 53' },
{ label: 'S3', value: 'S3' },
]}
/>
</FormField>
<FormField label="Describe the issue in few words. - optional">
<Textarea onChange={({ detail }) => setDescriptionValue(detail.value)} value={descriptionValue} />
</FormField>
</SpaceBetween>
</ExpandableSection>
</SpaceBetween>
</div>
<div className={styles['blue-dialog-box__footer']}>
<Button onClick={submitData}>Submit</Button>
</div>
</Form>
</div>
) : (
<></>
);
}
30 changes: 30 additions & 0 deletions pages/bluedialog/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
@use '~design-tokens' as awsui;


.blue-dialog-box {
margin: 20px;
border: 1px solid awsui.$color-border-status-info;
background-color: awsui.$color-background-status-info;
border-radius: 16px;
}
.blue-dialog-box__header {
display: flex;
justify-content: space-between;
padding: 10px 20px 0 20px;
}

.blue-dialog-box__content {
padding: 0 20px 20px 20px;
}

.blue-dialog-box__footer {
border-block-start: 1px solid awsui.$color-border-divider-default;
padding: 10px;
display: flex;
flex-direction: row-reverse;
gap: 20px;
}