format: whole project
This commit is contained in:
1 parent
b883b5f6e0
commit
80269cf275
79 files changed
+590
-612
No files matched your search
@@ -1,27 +1,35 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
defaultValue?: boolean;
|
||||
checked?: boolean | undefined;
|
||||
inlineDescription?: boolean;
|
||||
children?: import('svelte').Snippet;
|
||||
description?: import('svelte').Snippet;
|
||||
}
|
||||
interface Props {
|
||||
defaultValue?: boolean
|
||||
checked?: boolean | undefined
|
||||
inlineDescription?: boolean
|
||||
children?: import('svelte').Snippet
|
||||
description?: import('svelte').Snippet
|
||||
}
|
||||
|
||||
let {
|
||||
defaultValue = false,
|
||||
checked = $bindable(defaultValue),
|
||||
inlineDescription = false,
|
||||
children,
|
||||
description
|
||||
}: Props = $props();
|
||||
let {
|
||||
defaultValue = false,
|
||||
checked = $bindable(defaultValue),
|
||||
inlineDescription = false,
|
||||
children,
|
||||
description,
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<label class="font-normal cursor-pointer text-sm flex flex-row items-baseline gap-2">
|
||||
<input type="checkbox" bind:checked class="cursor-pointer" />
|
||||
<div class="inline-flex {inlineDescription ? 'flex-row' : 'flex-col'} font-medium gap-1">
|
||||
{@render children?.()}
|
||||
{#if description}
|
||||
<span class="font-normal text-slate-600 dark:text-zinc-400">{@render description?.()}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<label
|
||||
class="font-normal cursor-pointer text-sm flex flex-row items-baseline gap-2"
|
||||
>
|
||||
<input type="checkbox" bind:checked class="cursor-pointer" />
|
||||
<div
|
||||
class="inline-flex {inlineDescription
|
||||
? 'flex-row'
|
||||
: 'flex-col'} font-medium gap-1"
|
||||
>
|
||||
{@render children?.()}
|
||||
{#if description}
|
||||
<span class="font-normal text-slate-600 dark:text-zinc-400">
|
||||
{@render description?.()}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</label>
|
||||
@@ -1,14 +1,12 @@
|
||||
<script lang="ts">
|
||||
|
||||
|
||||
interface Props {
|
||||
for?: string | undefined;
|
||||
for?: string | undefined
|
||||
/**
|
||||
* The `text` prop will take precedence over the slot.
|
||||
*/
|
||||
text?: string | undefined;
|
||||
class?: string;
|
||||
children?: import('svelte').Snippet;
|
||||
* The `text` prop will take precedence over the slot.
|
||||
*/
|
||||
text?: string | undefined
|
||||
class?: string
|
||||
children?: import('svelte').Snippet
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
@@ -18,8 +16,7 @@
|
||||
class: clazz = '',
|
||||
children,
|
||||
...rest
|
||||
}: Props = $props();
|
||||
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<svelte:element
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<script lang="ts">
|
||||
import { createBubbler } from 'svelte/legacy';
|
||||
import { createBubbler } from 'svelte/legacy'
|
||||
|
||||
const bubble = createBubbler();
|
||||
const bubble = createBubbler()
|
||||
import { generateID } from '../forms/helper.js'
|
||||
|
||||
type T = $$Generic
|
||||
|
||||
interface Props {
|
||||
value: T;
|
||||
group: T;
|
||||
inlineDescription?: boolean;
|
||||
id?: string;
|
||||
disabled?: boolean;
|
||||
children?: import('svelte').Snippet;
|
||||
description?: import('svelte').Snippet;
|
||||
value: T
|
||||
group: T
|
||||
inlineDescription?: boolean
|
||||
id?: string
|
||||
disabled?: boolean
|
||||
children?: import('svelte').Snippet
|
||||
description?: import('svelte').Snippet
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
children,
|
||||
description,
|
||||
...rest
|
||||
}: Props = $props();
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
||||
@@ -2,25 +2,24 @@
|
||||
import { generateID } from '../forms/helper.js'
|
||||
|
||||
interface Props {
|
||||
group?: string;
|
||||
row?: boolean;
|
||||
class?: string;
|
||||
children?: import('svelte').Snippet<[any]>;
|
||||
group?: string
|
||||
row?: boolean
|
||||
class?: string
|
||||
children?: import('svelte').Snippet<[any]>
|
||||
}
|
||||
|
||||
let {
|
||||
group = generateID(),
|
||||
row = false,
|
||||
class: clazz = '',
|
||||
children
|
||||
}: Props = $props();
|
||||
|
||||
children,
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-1">
|
||||
<div
|
||||
class="flex {row ? 'flex-row flex-wrap' : 'flex-col'} gap-4 {clazz || ''}"
|
||||
>
|
||||
{@render children?.({ group, })}
|
||||
{@render children?.({ group })}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
|
||||
interface Props {
|
||||
defaultValue?: boolean;
|
||||
checked?: boolean;
|
||||
labelClass?: string;
|
||||
class?: string;
|
||||
children?: import('svelte').Snippet;
|
||||
description?: import('svelte').Snippet;
|
||||
defaultValue?: boolean
|
||||
checked?: boolean
|
||||
labelClass?: string
|
||||
class?: string
|
||||
children?: import('svelte').Snippet
|
||||
description?: import('svelte').Snippet
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -15,9 +14,8 @@
|
||||
labelClass = '',
|
||||
class: clazz = '',
|
||||
children,
|
||||
description
|
||||
}: Props = $props();
|
||||
|
||||
description,
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<label
|
||||
@@ -39,7 +37,7 @@
|
||||
class="box-border w-5 h-full bg-white peer-checked:dark:bg-black rounded-full shadow-sm
|
||||
group-active:w-6 transition peer-checked:translate-x-5 group-active:peer-checked:translate-x-4
|
||||
rtl:peer-checked:-translate-x-5 rtl:group-active:peer-checked:-translate-x-4"
|
||||
></div>
|
||||
></div>
|
||||
</div>
|
||||
<div class="flex flex-col {labelClass}">
|
||||
{@render children?.()}
|
||||
|
||||
Reference in new issue
Block a user