prep: replace $$props.class with props

This commit is contained in:
Xylight committed 2024-10-23 19:55:20 -07:00
1 parent 3ca72662ca
commit 0718c8e0c6
69 files changed
+383 -214

No files matched your search

+18 -15
View File
@@ -1,21 +1,24 @@
<script lang="ts">
let forID: string | undefined = undefined
export { forID as for }
/**
* The `text` prop will take precedence over the slot.
*/
export let text: string | undefined = undefined
let forID: string | undefined = undefined
export { forID as for }
/**
* The `text` prop will take precedence over the slot.
*/
export let text: string | undefined = undefined
let clazz: string = ''
export { clazz as class }
</script>
<svelte:element
this={forID ? 'label' : 'span'}
{...$$restProps}
for={forID}
class="text-sm text-slate-800 dark:text-zinc-200 font-medium w-full {$$props.class || ''}"
this={forID ? 'label' : 'span'}
{...$$restProps}
for={forID}
class="text-sm text-slate-800 dark:text-zinc-200 font-medium w-full {clazz ||
''}"
>
{#if text}
{text}
{:else if $$slots.default}
<slot />
{/if}
{#if text}
{text}
{:else if $$slots.default}
<slot />
{/if}
</svelte:element>