Skip to content
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

Eui-step docs #134

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/core/addon/components/eui-steps/index.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<div class="euiSteps" ...attributes>
<div

class={{class-names
"euiSteps"
status=(arg-or-default @status "incomplete")
}}
...attributes>
{{yield}}
</div>
34 changes: 16 additions & 18 deletions packages/core/docs/navigation/steps-demo/demo1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@
order: 1
---

# Basic Steps
<EuiText>
<p><strong>EuiSteps</strong> presents procedural content in a numbered outline format. It is best used when presenting instructional content that must be conducted in a particular order. It requires a <EuiCode>title</EuiCode> and <EuiCode>children</EuiCode> to be present and will automatically increment the step number based on the initial <EuiCode>firstStepNumber</EuiCode>.</p>
</EuiText>

```hbs template
<EuiSteps>
<EuiStep
@step={{1}}
@title="Step 1"
>
You do this!
<EuiStep @step={{1}} @title='Step 1'>
Do this first
</EuiStep>
<EuiStep
@step={{2}}
@title="Step 2"
>
You do that!
</EuiStep>
<EuiStep
@step={{3}}
@title="Step 3"
@status="danger"
>
You did what!?
<EuiStep @step={{2}} @title='Step 2'>
Then this
</EuiStep>
</EuiSteps>
<EuiSpacer @size='m' />
<EuiText>
<p>
Set
<EuiCode>firstStepNumber</EuiCode>
to continue step numbering after any type of break in the content
</p>
</EuiText>
<EuiSpacer @size='m' />
```
39 changes: 18 additions & 21 deletions packages/core/docs/navigation/steps-demo/demo2.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,60 @@
---
order: 2
order: 4
---

# Statuses

<EuiText>
<p>Steps can optionally include <EuiCode>status</EuiCode> prop that will alter the look of the number prefix. The options are <EuiCode>incomplete</EuiCode>, <EuiCode>complete</EuiCode>, <EuiCode>warning</EuiCode>, <EuiCode>danger</EuiCode>, <EuiCode>disabled</EuiCode> and <EuiCode>loading</EuiCode>. This is used mostly as a final step when you need to make some sort of final check.</p>
</EuiText>

```hbs template
<EuiSteps>
<EuiStep
@step={{1}}
@title="Step 1"
>
<EuiStep @step={{1}} @title='Step 1'>
You do this!
</EuiStep>
<EuiStep
@title="Step 2"
@status={{this.status}}
@step={{2}}
>
You did good! {{if (eq this.status "danger") "(or not)"}}
<EuiSubSteps>
Click the buttons below to change status!
<EuiStep @title='Step 2' @status={{this.status}} @step={{2}}>
We are fancy buttons just waiting to be pushed!
<div>
<EuiSpacer />
<EuiFlexGroup>
<EuiFlexItem @grow={{false}}>
<EuiButton @color="danger" {{on "click" this.setDanger}}>
<EuiButton @color='danger' {{on 'click' this.setDanger}}>
Set Danger
</EuiButton>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButton @color="success" {{on "click" this.setComplete}}>
<EuiButton @color='success' {{on 'click' this.setComplete}}>
Set Complete
</EuiButton>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButton @color="warning" {{on "click" this.setWarning}}>
<EuiButton @color='warning' {{on 'click' this.setWarning}}>
Set Warning
</EuiButton>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButton @color="primary" {{on "click" this.setLoading}}>
<EuiButton @color='primary' {{on 'click' this.setLoading}}>
Set Loading
</EuiButton>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButtonEmpty {{on "click" this.setDisabled}}>
<EuiButtonEmpty {{on 'click' this.setDisabled}}>
Set Disabled
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButtonEmpty {{on "click" this.setIncomplete}}>
<EuiButtonEmpty {{on 'click' this.setIncomplete}}>
Set Incomplete
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem @grow={{false}}>
<EuiButtonEmpty {{on "click" this.reset}}>
<EuiButtonEmpty {{on 'click' this.reset}}>
Reset
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiSubSteps>
</div>
</EuiStep>
</EuiSteps>
```
Expand Down
22 changes: 12 additions & 10 deletions packages/core/docs/navigation/steps-demo/demo3.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
---
order: 3
order: 5
---

# Horizontal Steps

<EuiText>
<p>For use when forms/setup instructions can and should be split into multiple pages. Each step should correspond to an individual page of form elements, using the <EuiCode>status</EuiCode> key to denote the user's progress.</p>
<p>For horizontal steps, the <EuiCode>status</EuiCode> key defaults to <EuiCode>"incomplete"</EuiCode> and the default filled styling is reserved for indicating <EuiCode>"current"</EuiCode> status.</p>
</EuiText>

```hbs template
<EuiStepsHorizontal>
<EuiStepHorizontal
@title="Cart"
@title='Completed step 1'
@status='complete'
@step={{1}}
@isComplete={{true}}
/>
<EuiStepHorizontal @title='Selected step 2' @step={{2}} @status='current' />
<EuiStepHorizontal
@title="Shipping"
@step={{2}}
@isComplete={{true}}
/>
<EuiStepHorizontal
@title="Payment Method"
@title='Incomplete step 3 which will wrap to the next line'
@step={{3}}
@isSelected={{true}}
/>
<EuiStepHorizontal
@title="Review Order"
@title='Disabled step 4'
@status='disabled'
@step={{4}}
@disabled={{true}}
/>
Expand Down
84 changes: 84 additions & 0 deletions packages/core/docs/navigation/steps-demo/demo4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
order: 2
---

# Complex steps

<EuiText>
<p>If you need to call out a set of substeps that are not lines of code, most likely a <EuiCode>&lt;ol/&gt;</EuiCode>, wrap the block in a <EuiCode>&lt;EuiSubSteps/&gt;</EuiCode>.</p>
</EuiText>

```hbs template
<EuiSteps>
<EuiStep @step={{1}} @title='Step 1 has intro plus code snippet'>
<EuiText>
<p>Run this code snippet to install things.</p>
</EuiText>
<EuiSpacer />
<EuiCodeBlock @language='bash'>npm install</EuiCodeBlock>
</EuiStep>
<EuiStep @step={{2}} @title='Step 2 has sub steps'>
<EuiText>
<p>
In order to complete this step, do the following things{' '}
<strong>in order</strong>.
</p>
<EuiSubSteps>
<ol>
<li>Do thing 1</li>
<li>Do thing 2</li>
<li>Do thing 3</li>
</ol>
</EuiSubSteps>
<p>Here are some bullet point reminders.</p>
<ul>
<li>Reminder 1</li>
<li>Reminder 2</li>
<li>Reminder 3</li>
</ul>
</EuiText>
</EuiStep>
<EuiStep @step={{3}} @title='Step 3 has an intro and one line instruction'>
<EuiText>
<p>
Now that you&apos;ve completed step 2, go find the{' '}
<EuiCode>thing</EuiCode>.
</p>
<p>
Go to
<strong>Overview &gt;&gt; Endpoints</strong>
note{' '}
<strong>Elasticsearch</strong>
as
<EuiCode>&lt;thing&gt;</EuiCode>.
</p>
</EuiText>
</EuiStep>
<EuiStep @step={{4}} @title='The last step has two options'>
<EuiText @size='s'>
<h3>
<strong>Option 1:</strong>
If you have this type of instance
</h3>
<EuiSubSteps>
<ol>
<li>Do thing 1</li>
<li>Do thing 2</li>
<li>Do thing 3</li>
</ol>
</EuiSubSteps>
<h3>
<strong>Option 2:</strong>
If you have the other type of instance
</h3>
<EuiSubSteps>
<ol>
<li>Do thing 1</li>
<li>Do thing 2</li>
<li>Do thing 3</li>
</ol>
</EuiSubSteps>
</EuiText>
</EuiStep>
</EuiSteps>
```
29 changes: 29 additions & 0 deletions packages/core/docs/navigation/steps-demo/demo5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
order: 3
---

# Heading elements

<EuiText>
<p>To aid with accessibility and hierarchical headings, you can and should pass in a heading element to use for each step title. The example below shows that the logical heading element should be an <EuiCode>h2</EuiCode>and therefore adds <EuiCode>headingElement<span class="token verb keyword">=</span><span class="token conjunction variable">"</span>h2<span class="token conjunction variable">"</span></EuiCode> to the EuiSteps component.</p>
<p>The style of the title will <strong>not</strong> be affected.</p>
</EuiText>

```hbs template
<div>
<EuiTitle size='l'>
<h1>Heading 1</h1>
</EuiTitle>

<EuiSpacer size='xl' />

<EuiSteps @headingElement='h2'>
<EuiStep @step={{1}} @title='Step 1'>
<EuiTitle @size='xs'>
<h3>Did you notice the step title is inside a Heading 2 element?</h3>
</EuiTitle>
</EuiStep>

</EuiSteps>
</div>
```