-
Notifications
You must be signed in to change notification settings - Fork 376
feat(Tile): deprecate #10821
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
feat(Tile): deprecate #10821
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e3515e7
feat(Tile): deprecate in docs
kmcfaul 7adc231
moved Tile to deprecated dir
kmcfaul c9a53b8
add isHidden, add example & desc
kmcfaul df10f13
update to screenreader css, add link
kmcfaul c27b66e
rebase, use styles obj, fix screenreader application
kmcfaul eb29f0f
add more spacing to icon
kmcfaul f303da6
revert stylesheet import, adjust flex
kmcfaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
73 changes: 73 additions & 0 deletions
73
packages/react-core/src/components/Card/examples/CardTile.tsx
This file contains hidden or 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,73 @@ | ||
| import React from 'react'; | ||
| import { Card, CardHeader, CardBody, Gallery, Flex } from '@patternfly/react-core'; | ||
| import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon'; | ||
|
|
||
| export const CardTile: React.FunctionComponent = () => { | ||
| const [isChecked, setIsChecked] = React.useState(''); | ||
| const id1 = 'tile-1'; | ||
| const id2 = 'tile-2'; | ||
| const id3 = 'tile-3'; | ||
|
|
||
| const onChange = (event: React.FormEvent<HTMLInputElement>) => { | ||
| setIsChecked(event.currentTarget.id); | ||
| }; | ||
|
|
||
| return ( | ||
| <Gallery hasGutter> | ||
| <Card id="tile-example-1" isSelectable isSelected={isChecked === id1}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id1, | ||
| selectableActionAriaLabelledby: 'tile-example-1', | ||
| name: id1, | ||
| variant: 'single', | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| <Card id="tile-example-2" isSelectable isSelected={isChecked === id2}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id2, | ||
| selectableActionAriaLabelledby: 'tile-example-2', | ||
| name: id2, | ||
| variant: 'single', | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| <Card id="tile-example-3" isSelectable isDisabled isSelected={isChecked === id3}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id3, | ||
| selectableActionAriaLabelledby: 'tile-example-3', | ||
| name: id3, | ||
| variant: 'single', | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header (disabled)</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| </Gallery> | ||
| ); | ||
| }; |
84 changes: 84 additions & 0 deletions
84
packages/react-core/src/components/Card/examples/CardTileMulti.tsx
This file contains hidden or 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,84 @@ | ||
| import React from 'react'; | ||
| import { Card, CardHeader, CardBody, Gallery, Flex } from '@patternfly/react-core'; | ||
| import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon'; | ||
|
|
||
| export const CardTileMulti: React.FunctionComponent = () => { | ||
| const [isChecked1, setIsChecked1] = React.useState(false); | ||
| const [isChecked2, setIsChecked2] = React.useState(false); | ||
| const [isChecked3, setIsChecked3] = React.useState(false); | ||
| const id1 = 'multi-tile-1'; | ||
| const id2 = 'multi-tile-2'; | ||
| const id3 = 'multi-tile-3'; | ||
|
|
||
| const onChange = (event: React.FormEvent<HTMLInputElement>, checked: boolean) => { | ||
| const name = event.currentTarget.name; | ||
|
|
||
| switch (name) { | ||
| case id1: | ||
| setIsChecked1(checked); | ||
| break; | ||
| case id2: | ||
| setIsChecked2(checked); | ||
| break; | ||
| case id3: | ||
| setIsChecked3(checked); | ||
| break; | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <Gallery hasGutter> | ||
| <Card id="multi-tile-example-1" isSelectable isSelected={isChecked1}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id1, | ||
| selectableActionAriaLabelledby: 'multi-tile-example-1', | ||
| name: id1, | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| <Card id="multi-tile-example-2" isSelectable isSelected={isChecked2}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id2, | ||
| selectableActionAriaLabelledby: 'multi-tile-example-2', | ||
| name: id2, | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| <Card id="multi-tile-example-3" isSelectable isDisabled isSelected={isChecked3}> | ||
| <CardHeader | ||
| selectableActions={{ | ||
| selectableActionId: id3, | ||
| selectableActionAriaLabelledby: 'multi-tile-example-3', | ||
| name: id3, | ||
| onChange, | ||
| isHidden: true | ||
| }} | ||
| > | ||
| <Flex gap={{ default: 'gapSm' }} alignItems={{ default: 'alignItemsCenter' }}> | ||
| <PlusIcon /> | ||
| <b>Tile header (disabled)</b> | ||
| </Flex> | ||
| </CardHeader> | ||
| <CardBody>Tile content and description</CardBody> | ||
| </Card> | ||
| </Gallery> | ||
| ); | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...rc/components/Tile/examples/TileBasic.tsx → ...ed/components/Tile/examples/TileBasic.tsx
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
.../components/Tile/examples/TileStacked.tsx → .../components/Tile/examples/TileStacked.tsx
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...le/examples/TileStackedWithLargeIcons.tsx → ...le/examples/TileStackedWithLargeIcons.tsx
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.