-
Notifications
You must be signed in to change notification settings - Fork 841
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
add Steps component #202
Merged
Merged
add Steps component #202
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f36a32
add Steps component
nreese 1d7124e
rename offset to firstStepNumber, add EuiStep jest test, pass classNa…
nreese c150655
rename euiStep to euiStepContent, put euiStep class on root element
nreese 38fba87
add headingElement prop
nreese cf81499
add heading element example to src-docs
nreese be7c3cd
more cleanup
nreese 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,59 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiCode, | ||
EuiSpacer, | ||
EuiSteps, | ||
EuiText, | ||
} from '../../../../src/components'; | ||
|
||
const firstSetOfSteps = [ | ||
{ | ||
title: 'step 1', | ||
children: (<p>{'Do this first'}</p>) | ||
}, | ||
{ | ||
title: 'step 2', | ||
children: (<p>{'Then this'}</p>) | ||
}, | ||
{ | ||
title: 'step 3', | ||
children: (<p>{'And finally, do this'}</p>) | ||
}, | ||
]; | ||
|
||
const nextSetOfSteps = [ | ||
{ | ||
title: 'good step', | ||
children: (<p>{'Do this first'}</p>) | ||
}, | ||
{ | ||
title: 'better step', | ||
children: (<p>{'Then this'}</p>) | ||
}, | ||
{ | ||
title: 'best step', | ||
children: (<p>{'And finally, do this'}</p>) | ||
}, | ||
]; | ||
|
||
export default () => ( | ||
<div> | ||
<EuiSteps | ||
steps={firstSetOfSteps} | ||
/> | ||
|
||
<EuiText> | ||
<EuiSpacer size="m"/> | ||
<p> | ||
Set <EuiCode>firstStepNumber</EuiCode> to continue step numbering after any type of break in the content | ||
</p> | ||
<EuiSpacer size="m"/> | ||
</EuiText> | ||
|
||
<EuiSteps | ||
firstStepNumber={firstSetOfSteps.length} | ||
steps={nextSetOfSteps} | ||
/> | ||
</div> | ||
); |
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,31 @@ | ||
import React from 'react'; | ||
|
||
import { renderToHtml } from '../../services'; | ||
|
||
import { | ||
GuideSectionTypes, | ||
} from '../../components'; | ||
|
||
import Steps from './steps'; | ||
const stepsSource = require('!!raw-loader!./steps'); | ||
const stepsHtml = renderToHtml(Steps); | ||
|
||
export const StepsExample = { | ||
title: 'Steps', | ||
sections: [{ | ||
title: 'Steps', | ||
source: [{ | ||
type: GuideSectionTypes.JS, | ||
code: stepsSource, | ||
}, { | ||
type: GuideSectionTypes.HTML, | ||
code: stepsHtml, | ||
}], | ||
text: ( | ||
<p> | ||
Numbered steps | ||
</p> | ||
), | ||
demo: <Steps />, | ||
}], | ||
}; |
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,29 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiStep is rendered 1`] = ` | ||
<div | ||
aria-label="aria-label" | ||
class="euiStep testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
1 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
First step | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
Do this | ||
</p> | ||
</div> | ||
</div> | ||
`; |
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,157 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiSteps renders steps 1`] = ` | ||
<div | ||
aria-label="aria-label" | ||
class="euiSteps testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
1 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
first title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
Do this first | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
2 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
second title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
Then this | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
3 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
third title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
And finally, do this | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`EuiSteps renders steps with firstStepNumber 1`] = ` | ||
<div | ||
aria-label="aria-label" | ||
class="euiSteps testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
10 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
first title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
Do this first | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
11 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
second title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
Then this | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="euiStep" | ||
> | ||
<div> | ||
<div | ||
class="euiStepNumber" | ||
> | ||
12 | ||
</div> | ||
<p | ||
class="euiTitle euiStepTitle" | ||
> | ||
third title | ||
</p> | ||
</div> | ||
<div | ||
class="euiStepContent" | ||
> | ||
<p> | ||
And finally, do this | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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 @@ | ||
@import 'steps'; |
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,27 @@ | ||
.euiSteps { | ||
|
||
} | ||
|
||
.euiStepNumber { | ||
width: 32px; | ||
height: 32px; | ||
display: inline-block; | ||
line-height: 32px; | ||
text-align: center; | ||
color: #FFF; | ||
border-radius: 100%; | ||
background-color: #0079a5; | ||
} | ||
|
||
.euiStepTitle { | ||
display: inline-block; | ||
margin-left: 16px; | ||
} | ||
|
||
.euiStepContent { | ||
border-left: medium solid #D9D9D9; | ||
margin-top: 8px; | ||
margin-bottom: 8px; | ||
margin-left: 16px; | ||
padding-left: 24px; | ||
} |
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,3 @@ | ||
export { | ||
EuiSteps, | ||
} from './steps'; |
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.
Same nit about parens here and elsewhere in the file.