Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
[Prerelease] Bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikiki committed Feb 9, 2018
1 parent 3aaf873 commit 9fee2b9
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 2 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="0.2.2"></a>
## [0.2.2](https://github.com/Wikiki/bulma-steps/compare/v0.1.2...v0.2.2) (2018-02-09)


### Bug Fixes

* **bower:** Add missing version ([586b33a](https://github.com/Wikiki/bulma-steps/commit/586b33a))
* **js:** export default ([3aaf873](https://github.com/Wikiki/bulma-steps/commit/3aaf873))


### Features

* **gulp:** Add gulp dependencies ([d03cff4](https://github.com/Wikiki/bulma-steps/commit/d03cff4))
* **gulp:** Add release task ([e607ccf](https://github.com/Wikiki/bulma-steps/commit/e607ccf))



# Change Log

## [v0.1.2](https://github.com/wikiki/bulma-steps/tree/v0.1.2) (2017-11-30)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bulma-steps",
"description": "Display steps for a process (like sign-up, or order, form), in different colors, sizes, and states",
"main": "steps.sass",
"version": "0.2.1",
"version": "0.2.2",
"authors": [
"Wikiki <wikiki@protonmail.com> (https://wikiki.github.io/bulma-extensions/overview)"
],
Expand Down
1 change: 1 addition & 0 deletions dist/bulma-steps.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

219 changes: 219 additions & 0 deletions dist/bulma-steps.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
$steps-maker-default-color: $grey-light !default
$steps-marker-default-border: .2em solid #fff !default
$steps-default-color: $grey-lighter !default
$steps-completed-color: $primary !default
$steps-active-color: $primary !default
$steps-divider-height: .2em !default

=steps-size($size)
font-size: $size
min-height: $size * 2

.step-item
&:not(:first-child)::before
height: $steps-divider-height
width: 100%
bottom: 0
left: -50%
top: #{$size}
.step-marker
height: $size * 2
width: $size * 2
position: absolute
left: calc(50% - #{$size})
.icon
*
font-size: $size
.step-details
margin-top: $size * 2
margin-left: .5em
margin-right: .5em
padding-top: .2em
.step-title
font-size: $size * 1.2
font-weight: $weight-semibold


.steps
+block
display: flex
flex-wrap: wrap

.step-item
margin-top: 0
position: relative
flex-grow: 1
flex-basis: 0
&:not(:first-child)
flex-basis: 1em
flex-grow: 1
flex-shrink: 1
&::before
// This will contain the horizontal or vertical divider
content: " "
display: block
position: absolute

&::before
background: linear-gradient(to left, $steps-default-color 50%, $steps-active-color 50%)
background-size: 200% 100%
background-position: right bottom
.step-marker
color: $white
&.is-active
&::before
background-position: left bottom
.step-marker
background-color: $white
border-color: $steps-active-color
color: $steps-active-color
&.is-completed
&::before
background-position: left bottom
.step-marker
color: $white
background-color: $steps-completed-color

.step-marker
align-items: center
display: flex
border-radius: 50%
font-weight: $weight-bold
justify-content: center
background: $steps-maker-default-color
color: $white
border: $steps-marker-default-border
z-index: 1

.step-details
text-align: center

// Override marker color per step
@each $name, $pair in $colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
&::before
background: linear-gradient(to left, $steps-default-color 50%, $color 50%)
background-size: 200% 100%
background-position: right bottom
&.is-active
&::before
background-position: left bottom
.step-marker
background-color: $white
border-color: $color
color: $color
&.is-completed
&::before
background-position: left bottom
.step-marker
color: $color-invert
background-color: $color

.steps-content
align-items: stretch
flex-basis: 100%
margin: 2rem 0
.step-content
display: none
&.is-active
display: block

.steps-actions
display: flex
align-items: stretch
flex-basis: 100%
.steps-action
display: flex
flex-basis: 0
flex-grow: 1
margin: .5rem
justify-content: center
align-items: center

&.is-animated
.step-item
&::before
transition: all 2s ease
.step-marker
transition: all 0s ease
transition-delay: 1.5s

+steps-size($size-normal)
&.is-small
+steps-size($size-small)
&.is-medium
+steps-size($size-medium)
&.is-large
+steps-size($size-large)
length) {
if (typeof this.options.onFinish != 'undefined' && this.options.onFinish != null && this.options.onFinish) {
this.options.onFinish(current_id);
}
this.deactivate_step(current_id);
} else {
this.complete_step(current_id);
this.activate_step(next_id);
}
}

previous_step() {
var current_id = this.get_current_step_id();
if (current_id == null) {
return;
}

this.uncomplete_step(current_id - 1);
this.activate_step(current_id - 1);
}

/**
* Activate a single step,
* will deactivate all other steps.
*/
activate_step(step_id) {
this.updateActions(this.steps[step_id]);

for (var i = 0; i < this.steps.length; i++) {
var _step = this.steps[i];

if (_step == this.steps[step_id]) {
continue;
}

this.deactivate_step(i);
}

this.steps[step_id].classList.add(this.options.active_class);
if (typeof this.contents[step_id] !== 'undefined') {
this.contents[step_id].classList.add(this.options.active_class);
}

if (typeof this.options.onShow != 'undefined' && this.options.onShow != null && this.options.onShow) {
this.options.onShow(step_id);
}
}

complete_step(step_id) {
this.steps[step_id].classList.add(this.options.completed_class);
}

uncomplete_step(step_id) {
this.steps[step_id].classList.remove(this.options.completed_class);
}

deactivate_step(step_id) {
this.steps[step_id].classList.remove(this.options.active_class);
if (typeof this.contents[step_id] !== 'undefined') {
this.contents[step_id].classList.remove(this.options.active_class);
}
}
}

document.addEventListener('DOMContentLoaded', function() {
var stepsContainers = document.querySelectorAll('.steps');
[].forEach.call(stepsContainers, (stepsContainer) => {
var stepsWizard = new StepsWizard(stepsContainer);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bulma-steps",
"version": "0.2.1",
"version": "0.2.2",
"description": "Display steps for a process (like sign-up, or order, form), in different colors, sizes, and states ",
"main": "steps.sass",
"scripts": {
Expand Down

0 comments on commit 9fee2b9

Please sign in to comment.