prep: replace $$props.class with props
This commit is contained in:
1 parent
3ca72662ca
commit
0718c8e0c6
69 files changed
+383
-214
No files matched your search
@@ -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>
|
||||
Reference in new issue
Block a user