1
0
Fork 0
mirror of synced 2024-09-17 09:49:11 +12:00
budibase/packages/bbui/src/Icons/Icon.svelte
2021-03-31 10:59:07 +01:00

34 lines
716 B
Svelte

<script context="module">
import pathsByName from "./icon-paths"
export const iconOptions = Object.keys(pathsByName)
export const directions = ["n", "ne", "e", "se", "s", "sw", "w", "nw"]
</script>
<script>
export let name = "arrow"
export let direction = "n"
$: paths = pathsByName[name] || []
$: rotation = directions.indexOf(direction) * 45
</script>
<svg
class="c"
viewBox="0 0 24 24"
fill-rule="evenodd"
clip-rule="evenodd"
style={`transform: rotate(${rotation}deg)`}>
{#each paths as path}
<path d={path} />
{/each}
</svg>
<style>
.c {
width: 1.25em;
height: 1.25em;
fill: currentColor;
overflow: visible;
margin-right: var(--spacing-xs);
}
</style>