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

+3 -5
View File
@@ -3,14 +3,12 @@
export let group: string = generateID()
export let row: boolean = true
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1 max-w-full">
<div
class="flex {row
? 'flex-row flex-wrap'
: 'flex-col'} gap-4 {$$props.class || ''}"
>
<div class="flex {row ? 'flex-row flex-wrap' : 'flex-col'} gap-4 {clazz}">
<slot {group} />
</div>
</div>
+4 -1
View File
@@ -13,9 +13,12 @@
$: previewURLs =
preview && files ? Array.from(files).map(URL.createObjectURL) : undefined
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1 {$$props.class}">
<div class="flex flex-col gap-1 {clazz}">
{#if $$slots.label || label}
<Label for={id} text={label}>
<slot name="label" />
+17 -14
View File
@@ -1,22 +1,25 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import { createEventDispatcher } from 'svelte'
export let title: string | undefined
export let title: string | undefined
const dispatcher = createEventDispatcher<{ submit: SubmitEvent }>()
const dispatcher = createEventDispatcher<{ submit: SubmitEvent }>()
let clazz: string = ''
export { clazz as class }
</script>
<form
on:submit={(e) => dispatcher('submit', e)}
{...$$restProps}
class="flex flex-col gap-4 {$$props.class}"
on:submit={(e) => dispatcher('submit', e)}
{...$$restProps}
class="flex flex-col gap-4 {clazz}"
>
{#if title || $$slots.title}
{#if $$slots.title}
<slot name="title" />
{:else if title}
<h1 class="text-2xl font-bold">{title}</h1>
{/if}
{/if}
<slot />
{#if title || $$slots.title}
{#if $$slots.title}
<slot name="title" />
{:else if title}
<h1 class="text-2xl font-bold">{title}</h1>
{/if}
{/if}
<slot />
</form>
+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>
+3 -3
View File
@@ -3,13 +3,13 @@
export let group: string = generateID()
export let row: boolean = false
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1">
<div
class="flex {row
? 'flex-row flex-wrap'
: 'flex-col'} gap-4 {$$props.class || ''}"
class="flex {row ? 'flex-row flex-wrap' : 'flex-col'} gap-4 {clazz || ''}"
>
<slot {group} />
</div>
+4 -2
View File
@@ -48,9 +48,11 @@
contextmenu: any
input: any
}>()
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1 {$$props.class}">
<div class="flex flex-col gap-1 {clazz}">
{#if $$slots.label || label}
<Label for={id} text={label}>
<slot name="label" />
@@ -67,7 +69,7 @@
shadow
]} {buttonColor.secondary} appearance-none transition-colors rounded-lg text-sm
w-full min-w-full cursor-pointer pr-6 {buttonColor.secondary}
{$$props.class}"
{clazz}"
bind:value
on:mousedown={(e) => {
e.preventDefault()
+6 -2
View File
@@ -1,9 +1,13 @@
<script lang="ts">
export let defaultValue: boolean = false
export let checked: boolean = defaultValue
export let labelClass: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<label class="font-normal cursor-pointer flex flex-row items-start gap-4 group {$$props.class}">
<label class="font-normal cursor-pointer flex flex-row items-start gap-4 group {class}">
<div
class="w-11 h-6 rounded-full relative z-[inherit] cursor-pointer flex flex-row transition-colors shadow-sm
{checked ? 'bg-primary-900 dark:bg-primary-100' : 'bg-slate-200 dark:bg-zinc-800'}
@@ -20,7 +24,7 @@
rtl:peer-checked:-translate-x-5 rtl:group-active:peer-checked:-translate-x-4"
/>
</div>
<div class="flex flex-col {$$props.labelClass}">
<div class="flex flex-col {labelClass}">
<slot />
{#if $$slots.description}
<span class="font-normal text-sm text-slate-700 dark:text-zinc-300">
+5 -3
View File
@@ -26,9 +26,11 @@
const borderClass = `
border border-slate-200 dark:border-zinc-800
`
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1 {$$props.class}">
<div class="flex flex-col gap-1 {clazz}">
{#if $$slots.label || label}
<Label
for={id}
@@ -41,7 +43,7 @@
</Label>
{/if}
<div
class="rounded-xl flex flex-col items-center text-sm bg-white dark:bg-zinc-950 {$$props.class}"
class="rounded-xl flex flex-col items-center text-sm bg-white dark:bg-zinc-950 {clazz}"
>
<textarea
{id}
@@ -62,7 +64,7 @@
dark:ring-zinc-200/50 transition-all text-sm w-full disabled:bg-slate-100
disabled:cursor-not-allowed disabled:dark:bg-zinc-900 invalid:!border-red-500
peer invalid:text-red-500 z-10
{$$props.class || ''}"
{clazz || ''}"
class:rounded-b-none={$$slots.suffix}
class:border-b-0={$$slots.suffix}
/>
+5 -3
View File
@@ -32,9 +32,11 @@
const borderClass = `
border border-slate-200 border-b-slate-300 dark:border-zinc-900 dark:border-t-zinc-800
`
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-col gap-1 {$$props.class}">
<div class="flex flex-col gap-1 {clazz}">
{#if $$slots.label || label}
<Label
for={id}
@@ -51,7 +53,7 @@
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring-2
ring-slate-300 dark:ring-zinc-700
transition-colors
rounded-lg flex flex-row items-center text-sm {$$props.class}"
rounded-lg flex flex-row items-center text-sm {clazz}"
>
{#if $$slots.prefix}
<div
@@ -78,7 +80,7 @@
focus:outline-none rounded-lg text-sm w-full disabled:bg-slate-100
disabled:cursor-not-allowed disabled:dark:bg-zinc-950 invalid:!border-red-500
peer invalid:text-red-500 z-10
{$$props.class || ''}"
{clazz || ''}"
class:rounded-l-none={$$slots.prefix}
class:border-l-0={$$slots.prefix && inlineAffixes}
class:rounded-r-none={$$slots.suffix}