🧼 Updates inputs after svelte migration

This commit is contained in:
Rune Harlyk
2025-03-01 23:01:32 +01:00
committed by Rune Harlyk
parent 0b01634a20
commit 113ac1bc2c
2 changed files with 36 additions and 41 deletions
@@ -1,7 +1,4 @@
<script lang="ts">
import { createBubbler } from 'svelte/legacy';
const bubble = createBubbler();
interface Props {
min?: number;
max?: number;
@@ -13,7 +10,8 @@
min = 0,
max = 100,
step = 1,
value = $bindable((max - min) / 2)
value = $bindable((max - min) / 2),
...rest
}: Props = $props();
</script>
@@ -21,17 +19,16 @@
type="range"
style="writing-mode: vertical-lr; direction: rtl"
class="cursor-pointer"
min={min}
max={max}
step={step}
{min}
{max}
{step}
bind:value
oninput={bubble('input')}
onchange={bubble('change')}
{...rest}
/>
<style>
input[type=range]::-webkit-slider-runnable-track {
background: oklch(var(--p)/1);
input[type='range']::-webkit-slider-runnable-track {
background: oklch(var(--p) / 1);
border-radius: var(--rounded-box, 1rem);
}
}
</style>
@@ -1,11 +1,9 @@
<script lang="ts">
import { createBubbler } from 'svelte/legacy';
const bubble = createBubbler();
interface Props {
options?: string[];
selectedOption?: string;
[key: string]: any
change: () => void;
[key: string]: any;
}
let { options = [], selectedOption = $bindable(''), ...rest }: Props = $props();
@@ -13,7 +11,7 @@
<select
bind:value={selectedOption}
onchange={bubble('change')}
{...rest}
class="select select-bordered select-sm lg:select-md max-w-xs {rest.class || ''}"
>
{#each options as option}