-
Notifications
You must be signed in to change notification settings - Fork 843
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
beta badges on panels #884
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c2e8431
beta badges on panels
snide 0f6e17e
add files, whoops
snide 24cf74e
Reverse description lists (#882)
cchaos a6fbef1
Added `inspect` icon (#886)
cchaos 3ee1eeb
Added `layout` prop to `EuiCard` (#885)
cchaos c874b0f
rewrite mixin, fix copy/pasta
snide 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 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 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 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,39 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiCard, | ||
EuiIcon, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
} from '../../../../src/components'; | ||
|
||
export default () => ( | ||
<EuiFlexGroup gutterSize="l"> | ||
<EuiFlexItem> | ||
<EuiCard | ||
layout="horizontal" | ||
icon={<EuiIcon size="xxl" type={`logoBeats`} />} | ||
title={`Elastic Beats`} | ||
description="Example of a card's description. Stick to one or two sentences." | ||
onClick={() => window.alert('Card clicked')} | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiCard | ||
layout="horizontal" | ||
icon={<EuiIcon size="xxl" type={`logoCloud`} />} | ||
title={`Elastic Cloud`} | ||
description="Example of a card's description. Stick to one or two sentences." | ||
onClick={() => window.alert('Card clicked')} | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiCard | ||
layout="horizontal" | ||
title={`No icon example`} | ||
description="Example of a card's description. Stick to one or two sentences." | ||
onClick={() => window.alert('Card clicked')} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); |
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
24 changes: 24 additions & 0 deletions
24
src-docs/src/views/description_list/description_list_reverse.js
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,24 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiDescriptionList, | ||
} from '../../../../src/components'; | ||
|
||
const favoriteVideoGame = [ | ||
{ | ||
title: 'Name', | ||
description: 'The Elder Scrolls: Morrowind', | ||
}, | ||
{ | ||
title: 'Game style', | ||
description: 'Open-world, fantasy, action role-playing', | ||
}, | ||
{ | ||
title: 'Release date', | ||
description: '2002', | ||
}, | ||
]; | ||
|
||
export default () => ( | ||
<EuiDescriptionList textStyle="reverse" listItems={favoriteVideoGame} /> | ||
); |
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
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,29 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiPanel, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
} from '../../../../src/components'; | ||
|
||
const badges = [null, 'Beta', 'Lab']; | ||
|
||
const panelNodes = badges.map(function (item, index) { | ||
return ( | ||
<EuiFlexItem key={index}> | ||
<EuiPanel | ||
betaBadgeLabel={badges[index]} | ||
betaBadgeTooltipContent={badges[index] ? "This module is not GA. Please help us by reporting any bugs." : undefined} | ||
onClick={() => window.alert('Card clicked')} | ||
> | ||
I am some panel content | ||
</EuiPanel> | ||
</EuiFlexItem> | ||
); | ||
}); | ||
|
||
export default () => ( | ||
<EuiFlexGroup gutterSize="l"> | ||
{panelNodes} | ||
</EuiFlexGroup> | ||
); |
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
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
@import 'mixins'; | ||
@import 'beta_badge'; |
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,30 @@ | ||
|
||
/** | ||
* 1. Extend beta badges to at least 40% of the card's width | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'card's width' -> 'container's width' |
||
*/ | ||
|
||
@mixin hasBetaBadge($selector, $spacing: $euiSize) { | ||
&.#{$selector}--hasBetaBadge { | ||
position: relative; | ||
|
||
.#{$selector}__betaBadgeWrapper { | ||
position: absolute; | ||
top: $euiSizeL/-2; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
z-index: 3; // get above abs positioned image | ||
min-width: 40%; /* 1 */ | ||
max-width: calc(100% - #{$spacing*2}); | ||
|
||
.euiToolTipAnchor, | ||
.#{$selector}__betaBadge { | ||
width: 100%; /* 1 */ | ||
} | ||
|
||
.#{$selector}__betaBadge { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
} | ||
} | ||
} |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comma before 'panels'