Implement issue state change button

This commit is contained in:
Rūdolfs Ošiņš
2024-10-29 10:54:16 +01:00
parent 319b1502c6
commit daaef13ff2
5 changed files with 196 additions and 11 deletions
+57
View File
@@ -0,0 +1,57 @@
<script lang="ts">
export let selected: boolean;
export let disabled: boolean = false;
export let title: string | undefined = undefined;
export let style: string | undefined = undefined;
</script>
<style>
.item {
cursor: pointer;
display: flex;
align-items: center;
flex-direction: row;
gap: 0.375rem;
padding: 0.5rem 0.375rem;
white-space: nowrap;
font-size: var(--font-size-small);
font-weight: var(--font-weight-regular);
color: var(--color-foreground-contrast);
clip-path: var(--1px-corner-fill);
}
.item.disabled {
color: var(--color-foreground-disabled);
}
.item:hover,
.selected {
background-color: var(--color-fill-ghost);
}
.selected {
font-weight: var(--font-weight-semibold);
color: var(--color-foreground-contrast);
background-color: var(--color-fill-ghost);
}
.item:hover.selected {
background-color: var(--color-fill-ghost-hover);
}
.item:hover.selected.disabled {
background-color: var(--color-fill-ghost);
}
.item:hover.disabled {
cursor: not-allowed;
background-color: var(--color-background-float);
}
</style>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
role="button"
tabindex="0"
class="item"
class:selected
class:disabled
{style}
{title}
on:click>
<slot />
</div>