chore: lift components folder

This commit is contained in:
Eric Liu 2020-07-19 09:06:08 -07:00
commit 2200b29b92
301 changed files with 57 additions and 76 deletions

View file

@ -0,0 +1,43 @@
<script>
export let currentIndex = 0;
export let vertical = false;
import { createEventDispatcher, setContext } from "svelte";
import { writable, derived } from "svelte/store";
const dispatch = createEventDispatcher();
const steps = writable([]);
const stepsById = derived(steps, $ =>
$.reduce((a, c) => ({ ...a, [c.id]: c }), {})
);
setContext("ProgressIndicator", {
steps,
stepsById,
add: step => {
steps.update(_ => [
..._,
{
...step,
index: _.length,
current: _.length === currentIndex,
complete: _.length <= currentIndex
}
]);
},
change: index => {
dispatch("change", index);
}
});
</script>
<ul
class:bx--progress={true}
class:bx--progress--vertical={vertical}
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave>
<slot />
</ul>