forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add description list basic demo (patternfly#10184)
* add description list basic demo * fix DashboardWrapper not found issue * implement review comments * add divider and size * update content * fixed layout issues
- Loading branch information
1 parent
adf25df
commit 31d22c7
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
packages/react-core/src/demos/DescriptionList/DescriptionList.md
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,14 @@ | ||
--- | ||
id: Description list | ||
section: components | ||
--- | ||
|
||
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon'; | ||
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; | ||
|
||
## Demos | ||
|
||
### Basic | ||
|
||
```js file='./examples/DescriptionListBasic.tsx' isFullscreen | ||
``` |
86 changes: 86 additions & 0 deletions
86
packages/react-core/src/demos/DescriptionList/examples/DescriptionListBasic.tsx
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,86 @@ | ||
import React from 'react'; | ||
import { | ||
DescriptionList, | ||
DescriptionListTerm, | ||
DescriptionListGroup, | ||
DescriptionListDescription, | ||
PageSection, | ||
PageSectionVariants, | ||
Card, | ||
CardBody, | ||
CardHeader, | ||
TextContent, | ||
Text, | ||
Title, | ||
Divider, | ||
Flex, | ||
FlexItem | ||
} from '@patternfly/react-core'; | ||
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon'; | ||
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; | ||
|
||
export const DescriptionListBasic: React.FunctionComponent = () => ( | ||
<DashboardWrapper> | ||
<PageSection variant={PageSectionVariants.light}> | ||
<TextContent> | ||
<Title headingLevel="h1">Projects</Title> | ||
<Text component="p">This is a full page demo</Text> | ||
</TextContent> | ||
</PageSection> | ||
<PageSection> | ||
<Card> | ||
<CardHeader> | ||
<Title headingLevel="h2" size="lg"> | ||
Details | ||
</Title> | ||
</CardHeader> | ||
<Divider /> | ||
<CardBody> | ||
<DescriptionList isAutoFit> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Name</DescriptionListTerm> | ||
<DescriptionListDescription>mary-test</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Status</DescriptionListTerm> | ||
<DescriptionListDescription> | ||
<Flex> | ||
<FlexItem spacer={{ lg: 'spacerSm' }}> | ||
<CheckCircleIcon color="green" /> | ||
</FlexItem> | ||
<FlexItem>Active</FlexItem> | ||
</Flex> | ||
</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Default pull secret</DescriptionListTerm> | ||
<DescriptionListDescription>Not configured</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Tolerations</DescriptionListTerm> | ||
<DescriptionListDescription>6 Tolerations</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Network Policies</DescriptionListTerm> | ||
<DescriptionListDescription> | ||
<a href="#">Network Policies</a> | ||
</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Display name</DescriptionListTerm> | ||
<DescriptionListDescription>mary</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Requester</DescriptionListTerm> | ||
<DescriptionListDescription>kube:admin</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>Created at:</DescriptionListTerm> | ||
<DescriptionListDescription>3 minutes ago</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
</DescriptionList> | ||
</CardBody> | ||
</Card> | ||
</PageSection> | ||
</DashboardWrapper> | ||
); |