SYNC: roles UX

This commit is contained in:
SPRINX0\prochazka
2025-08-25 16:23:45 +02:00
committed by Diflow
parent 879c89a285
commit 97923b19bf

View File

@@ -8,6 +8,8 @@
export let label;
export let disabled = false;
$: renderedValue = value ?? inheritedValue;
$: isInherited = inheritedValue != null && value == null;
@@ -30,11 +32,12 @@
<div
class="wrapper"
on:click|preventDefault|stopPropagation={() => {
if (disabled) return;
onChange(getNextValue());
}}
>
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited />
<div class="label">
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited class:disabled />
<div class="label" class:disabled>
{label}
</div>
</div>
@@ -51,6 +54,11 @@
user-select: none;
}
.label.disabled {
cursor: not-allowed;
color: var(--theme-font-3);
}
.checkbox {
width: 14px !important;
height: 14px !important;
@@ -76,4 +84,9 @@
.isInherited {
background: var(--theme-bg-2) !important;
}
.checkbox.disabled {
background: var(--theme-bg-2) !important;
cursor: not-allowed;
}
</style>