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

feat(progress-indicator): adds 'vertical' variant #1717

Merged
merged 4 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
81 changes: 81 additions & 0 deletions src/components/progress-indicator/_progress-indicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,42 @@
height: rem(12px);
width: rem(40px);
}

// Vertical variant
.#{$prefix}--progress--vertical {
display: block;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step {
display: list-item;
min-height: 6rem;

svg {
display: inline-block;
}
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-label {
display: inline-block;
width: auto;
vertical-align: top;
margin-top: 0.26rem;
margin-left: 0.5rem;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-line {
top: 22px;
left: 0.69rem;
height: calc(100% - 22px);
width: 1px;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step:first-child .#{$prefix}--progress-line {
display: block;
}
.#{$prefix}--progress--vertical .#{$prefix}--progress-step:last-child .#{$prefix}--progress-line {
display: none;
}
}

@mixin progress-indicator--x {
Expand Down Expand Up @@ -312,6 +348,51 @@
height: rem(12px);
width: rem(40px);
}

.#{$prefix}--progress--vertical {
display: block;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step {
display: list-item;
min-height: 6rem;
width: initial;
min-width: initial;

svg {
display: inline-block;
margin: 0.1rem 0.5rem;
}
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step--current svg {
margin-left: 0.563rem;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-label {
display: inline-block;
width: initial;
max-width: none;
vertical-align: top;
margin: 0;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-step .bx--tooltip {
margin-top: 0.5rem;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-optional {
margin-top: initial;
position: initial;
margin-left: 2.25rem;
}

.#{$prefix}--progress--vertical .#{$prefix}--progress-line {
top: 0;
left: 0;
height: 100%;
width: 1px;
}
}

@include exports('progress-indicator') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,14 @@ module.exports = {
componentsX,
},
},
{
name: 'vertical',
label: 'Vertical',
context: {
vertical: true,
steps,
componentsX,
},
},
],
};
10 changes: 7 additions & 3 deletions src/components/progress-indicator/progress-indicator.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!--
<!--
Copyright IBM Corp. 2016, 2018

This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<ul data-progress data-progress-current class="{{@root.prefix}}--progress">
<ul data-progress data-progress-current class="{{@root.prefix}}--progress {{#if vertical}}{{@root.prefix}}--progress--vertical{{/if}}">
{{#each steps}}
<li class="{{@root.prefix}}--progress-step {{@root.prefix}}--progress-step--{{state}} {{#if disabled}} {{@root.prefix}}--progress-step--disabled {{/if}}" {{#if invalid}} data-invalid {{/if}}>
{{#is state "complete"}}
Expand Down Expand Up @@ -39,7 +39,11 @@
<p tabindex="0" class="{{@root.prefix}}--progress-label" {{#if ../componentsX}} aria-describedby="label-tooltip" {{/if}}>
{{#if ../componentsX}}
{{#if overflow}}
{{overflowLabel}}
{{#if ../vertical}}
{{label}}
{{else}}
{{overflowLabel}}
{{/if}}
{{else}}
{{label}}
{{/if}}
Expand Down
Loading