add ui to change the continuous download attribute of a show

This commit is contained in:
maxDorninger
2025-06-22 14:48:40 +02:00
parent 87cb9088c4
commit ca8a102277
6 changed files with 88 additions and 7 deletions

View File

@@ -0,0 +1,35 @@
<script lang="ts">
import {Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild} from "bits-ui";
import Check from "@lucide/svelte/icons/check";
import Minus from "@lucide/svelte/icons/minus";
import {cn} from "$lib/utils.js";
let {
ref = $bindable(null),
class: className,
checked = $bindable(false),
indeterminate = $bindable(false),
...restProps
}: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();
</script>
<CheckboxPrimitive.Root
{...restProps}
bind:checked
bind:indeterminate
bind:ref
class={cn(
"border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 rounded-sm border shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
className
)}
>
{#snippet children({checked, indeterminate})}
<span class="flex items-center justify-center text-current">
{#if indeterminate}
<Minus class="size-4"/>
{:else}
<Check class={cn("size-4", !checked && "text-transparent")}/>
{/if}
</span>
{/snippet}
</CheckboxPrimitive.Root>

View File

@@ -0,0 +1,7 @@
import Root from "./checkbox.svelte";
export {
Root,
//
Root as Checkbox,
};