-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(InfoCard): enhance accessibility + set max width of 60ch (#1977)
- Loading branch information
1 parent
61892ca
commit 88ae6f7
Showing
19 changed files
with
305 additions
and
293 deletions.
There are no files selected for viewing
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
166 changes: 0 additions & 166 deletions
166
packages/dnb-design-system-portal/src/docs/uilib/components/info-card/Examples.js
This file was deleted.
Oops, something went wrong.
128 changes: 128 additions & 0 deletions
128
packages/dnb-design-system-portal/src/docs/uilib/components/info-card/Examples.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,128 @@ | ||
/** | ||
* UI lib Component Example | ||
* | ||
*/ | ||
|
||
import React from 'react' | ||
import ComponentBox from 'dnb-design-system-portal/src/shared/tags/ComponentBox' | ||
import { card_medium as Card } from '@dnb/eufemia/src/icons' | ||
import InfoCard from '@dnb/eufemia/src/components/info-card/InfoCard' | ||
|
||
export const InfoCardBasic = () => ( | ||
<ComponentBox data-visual-test="info-card-basic"> | ||
<InfoCard text="This is a description of some information or a tip that will inform the user of something that will help them." /> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardTitle = () => ( | ||
<ComponentBox data-visual-test="info-card-title"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardButtons = () => ( | ||
<ComponentBox data-visual-test="info-card-buttons"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
closeButtonText="Close" | ||
onClose={() => { | ||
console.log('onClose') | ||
}} | ||
acceptButtonText="Accept" | ||
onAccept={() => { | ||
console.log('onAccept') | ||
}} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardButtonsCentered = () => ( | ||
<ComponentBox data-visual-test="info-card-buttons-centered"> | ||
<InfoCard | ||
centered | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
closeButtonText="Close" | ||
onClose={() => { | ||
console.log('onClose') | ||
}} | ||
acceptButtonText="Accept" | ||
onAccept={() => { | ||
console.log('onAccept') | ||
}} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardAcceptButton = () => ( | ||
<ComponentBox data-visual-test="info-card-accept-button"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
acceptButtonText="Accept" | ||
onAccept={() => { | ||
console.log('onAccept') | ||
}} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardCloseButton = () => ( | ||
<ComponentBox data-visual-test="info-card-close-button"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
closeButtonText="Close" | ||
onClose={() => { | ||
console.log('onClose') | ||
}} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardCustomIcon = () => ( | ||
<ComponentBox scope={{ Card }} data-visual-test="info-card-custom-icon"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
icon={Card} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardCentered = () => ( | ||
<ComponentBox data-visual-test="info-card-centered"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="Title of your info/tip" | ||
centered={true} | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardCustomImage = () => ( | ||
<ComponentBox data-visual-test="info-card-custom-image"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="This is the InfoCard with a custom image" | ||
src="/images/avatars/1501870.jpg" | ||
alt="Profile picture" | ||
/> | ||
</ComponentBox> | ||
) | ||
|
||
export const InfoCardCustomImageCentered = () => ( | ||
<ComponentBox data-visual-test="info-card-custom-image-centered"> | ||
<InfoCard | ||
text="This is a description of some information or a tip that will inform the user of something that will help them." | ||
title="This is the InfoCard with a custom image" | ||
centered={true} | ||
src="/images/avatars/1501870.jpg" | ||
alt="Profile picture" | ||
/> | ||
</ComponentBox> | ||
) |
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
Oops, something went wrong.