Initial commit with files

Still need to fix the imports
This commit is contained in:
Ryan Gossiaux
2021-12-13 17:13:47 -08:00
parent 42aba8a158
commit db9ec57065
56 changed files with 4034 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<script lang="ts">
import { getContext } from "svelte";
import { ListboxStates, StateDefinition } from "./Listbox.svelte";
import { useId } from "./use-id";
let api: SvelteStore<StateDefinition> = getContext("api");
let id = `headlessui-listbox-label-${useId()}`;
let labelStore: SvelteStore<HTMLLabelElement> = getContext("labelStore");
function handleClick() {
$api.buttonRef?.focus({ preventScroll: true });
}
</script>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label {...$$restProps} {id} bind:this={$labelStore} on:click={handleClick}>
<slot
open={$api.listboxState === ListboxStates.Open}
disabled={$api.disabled}
/>
</label>