2021-04-16 12:24:06 +02:00
|
|
|
<script context="module">
|
2021-04-20 21:06:27 +02:00
|
|
|
export const directions = ["n", "ne", "e", "se", "s", "sw", "w", "nw"]
|
2021-04-16 12:24:06 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
2021-04-20 21:06:27 +02:00
|
|
|
export let direction = "n"
|
|
|
|
export let name = "Add"
|
|
|
|
export let hidden = false
|
|
|
|
export let s = false
|
|
|
|
export let m = false
|
|
|
|
export let l = false
|
|
|
|
export let xl = false
|
2021-04-16 12:24:06 +02:00
|
|
|
|
2021-04-20 21:06:27 +02:00
|
|
|
$: rotation = directions.indexOf(direction) * 45
|
|
|
|
$: useDefault = ![s, m, l, xl].includes(true)
|
2021-04-16 12:24:06 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-20 21:06:27 +02:00
|
|
|
<svg
|
|
|
|
on:click
|
|
|
|
class:spectrum-Icon--sizeS={s}
|
|
|
|
class:spectrum-Icon--sizeM={m || useDefault}
|
|
|
|
class:spectrum-Icon--sizeL={l}
|
|
|
|
class:spectrum-Icon--sizeXL={xl}
|
|
|
|
class="spectrum-Icon"
|
|
|
|
focusable="false"
|
|
|
|
aria-hidden={hidden}
|
|
|
|
aria-label={name}
|
|
|
|
style={`transform: rotate(${rotation}deg)`}>
|
|
|
|
<use xlink:href="#spectrum-icon-18-{name}" />
|
|
|
|
</svg>
|