forked from viamrobotics/prime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add progress component (viamrobotics#514)
- Loading branch information
1 parent
72fccc1
commit ae57665
Showing
9 changed files
with
105 additions
and
37 deletions.
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
<script lang="ts"> | ||
import cx from 'classnames'; | ||
export let size: 'small' | 'medium' | 'large' = 'small'; | ||
export let variant: 'dark' | 'light' = 'dark'; | ||
</script> | ||
|
||
<div | ||
class={cx( | ||
'container -ml-1 flex h-4 w-4 items-center justify-center p-[1.5px]', | ||
{ | ||
'': size === 'small', | ||
'scale-[1.125]': size === 'medium', | ||
'scale-[1.5]': size === 'large', | ||
} | ||
)} | ||
> | ||
{#each { length: 8 } as _, index} | ||
<div | ||
style=" | ||
transform: rotate({index * 45}deg); | ||
animation-delay: {index * 100}ms; | ||
" | ||
class="pill absolute -mt-[0.5px] h-px w-[3px] rounded-[1px] {variant === | ||
'dark' | ||
? 'bg-gray-8' | ||
: 'bg-white'}" | ||
/> | ||
{/each} | ||
</div> | ||
|
||
<style> | ||
.pill { | ||
transform-origin: 6.5px 0.5px; | ||
animation: 0.8s linear 0s infinite fadeout; | ||
} | ||
@keyframes fadeout { | ||
0% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0.2; | ||
} | ||
} | ||
</style> |
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,26 @@ | ||
import { Canvas, Meta, Story } from '@storybook/addon-docs'; | ||
import * as ProgressStories from './progress.stories.svelte'; | ||
|
||
<Meta title='Elements/Progress' /> | ||
|
||
# Progress | ||
|
||
```ts | ||
import { Progress } from '@viamrobotics/prime-core'; | ||
``` | ||
|
||
<Canvas> | ||
<Story of={ProgressStories.Default} /> | ||
</Canvas> | ||
|
||
<Canvas> | ||
<Story of={ProgressStories.Light} /> | ||
</Canvas> | ||
|
||
<Canvas> | ||
<Story of={ProgressStories.Medium} /> | ||
</Canvas> | ||
|
||
<Canvas> | ||
<Story of={ProgressStories.Large} /> | ||
</Canvas> |
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,24 @@ | ||
<script lang="ts"> | ||
import { Meta, Story } from '@storybook/addon-svelte-csf'; | ||
import { Progress } from '@viamrobotics/prime-core'; | ||
</script> | ||
|
||
<Meta title="Elements/Progress" /> | ||
|
||
<Story name="Default"> | ||
<Progress /> | ||
</Story> | ||
|
||
<Story name="Light"> | ||
<div class="-m-10 bg-gray-9 p-10"> | ||
<Progress variant="light" /> | ||
</div> | ||
</Story> | ||
|
||
<Story name="Medium"> | ||
<Progress size="medium" /> | ||
</Story> | ||
|
||
<Story name="Large"> | ||
<Progress size="large" /> | ||
</Story> |