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
@@ -38,6 +38,9 @@
|
||||
$: optimizedURLs = [2, 3, 6, -1].map((n) =>
|
||||
optimizeUrl(url, (res || width) * n)
|
||||
)
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
{#if optimizedURLs[0] != undefined}
|
||||
@@ -49,15 +52,15 @@
|
||||
{alt}
|
||||
{width}
|
||||
{title}
|
||||
class="aspect-square object-cover overflow-hidden {$$props.class} flex-shrink-0"
|
||||
style="width: {width}px; height: {width}px; {$$props.style || undefined}"
|
||||
class="aspect-square object-cover overflow-hidden {clazz} flex-shrink-0"
|
||||
style="width: {width}px; height: {width}px; {style}"
|
||||
class:rounded-full={circle}
|
||||
class:rounded-md={!circle}
|
||||
/>
|
||||
{:else}
|
||||
<div
|
||||
style="width: {width}px; height: {width}px;"
|
||||
class="aspect-square object-cover overflow-hidden {$$props.class} flex-shrink-0"
|
||||
class="aspect-square object-cover overflow-hidden {clazz} flex-shrink-0"
|
||||
class:rounded-full={circle}
|
||||
class:rounded-md={!circle}
|
||||
>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<script lang="ts">
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="flex flex-row items-center
|
||||
text-sm text-slate-600 dark:text-zinc-400 gap-2 flex-wrap {$$props.class ||
|
||||
''}"
|
||||
text-sm text-slate-600 dark:text-zinc-400 gap-2 flex-wrap {clazz}"
|
||||
>
|
||||
<span class="font-medium text-left">
|
||||
<slot />
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
}[] = []
|
||||
|
||||
export let center: boolean = false
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Material
|
||||
@@ -25,7 +28,7 @@
|
||||
padding="none"
|
||||
rounding="xl"
|
||||
{...$$restProps}
|
||||
class="z-10 relative border-slate-200 dark:border-zinc-700 {$$props.class}"
|
||||
class="z-10 relative border-slate-200 dark:border-zinc-700 {clazz}"
|
||||
>
|
||||
{#if banner || avatar}
|
||||
<div class="max-h-36 overflow-visible">
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
import { Minus, Plus, Icon } from 'svelte-hero-icons'
|
||||
export let open: boolean = false
|
||||
export let icon: boolean = true
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Disclosure
|
||||
bind:open
|
||||
class="items-start justify-items-start gap-2 {$$props.class}"
|
||||
>
|
||||
<Disclosure bind:open class="items-start justify-items-start gap-2 {clazz}">
|
||||
<div
|
||||
slot="summary"
|
||||
class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
sharing = false
|
||||
return file
|
||||
}
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
{#if $page.state.openImage || '' != ''}
|
||||
@@ -146,6 +148,6 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<button on:click={() => history.back()} class="contents {$$props.class}">
|
||||
<button on:click={() => history.back()} class="contents {clazz}">
|
||||
<slot />
|
||||
</button>
|
||||
@@ -1,18 +1,25 @@
|
||||
<script lang="ts">
|
||||
import FormattedNumber from "../util/FormattedNumber.svelte"
|
||||
import FormattedNumber from '../util/FormattedNumber.svelte'
|
||||
|
||||
export let label: string
|
||||
export let content: string
|
||||
export let formatted: boolean = false
|
||||
|
||||
export let labelClass: string = ''
|
||||
export let contentClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col {$$props.class}">
|
||||
<span class="text-slate-600 dark:text-zinc-400 text-xs {$$props.labelClass}">{label}</span>
|
||||
<span class="text-base {$$props.contentClass}">
|
||||
<div class="flex flex-col {clazz}">
|
||||
<span class="text-slate-600 dark:text-zinc-400 text-xs {labelClass}">
|
||||
{label}
|
||||
</span>
|
||||
<span class="text-base {contentClass}">
|
||||
{#if formatted}
|
||||
<FormattedNumber number={Number(content)} />
|
||||
{:else}
|
||||
{content}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,10 +6,12 @@
|
||||
export let title: string
|
||||
export let description: string | undefined = undefined
|
||||
export let center: boolean = false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="text-slate-700 dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {$$props.class}"
|
||||
class="text-slate-700 dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {clazz}"
|
||||
>
|
||||
<div class="flex flex-row gap-4 items-center max-w-sm">
|
||||
{#if icon}
|
||||
@@ -19,7 +21,7 @@
|
||||
<Icon src={icon} size="28" />
|
||||
</div>
|
||||
{/if}
|
||||
<div class={$$props.class}>
|
||||
<div class={clazz}>
|
||||
<h1 class="text-slate-900 dark:text-zinc-100 text-lg font-medium">
|
||||
{title}
|
||||
</h1>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<script lang="ts">
|
||||
export let small: boolean = false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<span
|
||||
{...$$restProps}
|
||||
class="{!small ? 'text-lg' : 'text-xs'} font-semibold {$$props.class}"
|
||||
class="{!small ? 'text-lg' : 'text-xs'} font-semibold {clazz}"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
@@ -1,7 +1,12 @@
|
||||
<script lang="ts">
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<aside
|
||||
class="sticky top-0 left-0 break-words flex flex-shrink
|
||||
flex-col gap-4 px-6 pt-4 max-w-full w-full h-full
|
||||
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {$$props.class}"
|
||||
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {clazz}"
|
||||
>
|
||||
<slot />
|
||||
</aside>
|
||||
@@ -84,13 +84,16 @@
|
||||
|
||||
$: sidePadding = calculatePadding($dockProps.noGap, $dockProps.top, false)
|
||||
$: topPanel = $dockProps.noGap && $dockProps.top
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth={$screenWidth} />
|
||||
|
||||
<div
|
||||
{...$$restProps}
|
||||
class="shell bg-slate-50 dark:bg-zinc-950 {$$props.class}"
|
||||
class="shell bg-slate-50 dark:bg-zinc-950 {clazz}"
|
||||
style={$themeVars}
|
||||
>
|
||||
<slot />
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
import { contentPadding } from '../Shell.svelte'
|
||||
|
||||
export let pageHeader = false
|
||||
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
@@ -16,14 +20,12 @@
|
||||
"
|
||||
style="{pageHeader
|
||||
? `margin-top: min(-6rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(6rem, calc(${$contentPadding.top}px));`
|
||||
: ''} {$$props.style};
|
||||
: ''} {style};
|
||||
"
|
||||
>
|
||||
<h1
|
||||
class="text-3xl font-medium flex gap-2 w-full
|
||||
{$userSettings.font == 'satoshi/nunito'
|
||||
? 'font-display'
|
||||
: ''} {$$props.class ?? ''}"
|
||||
{$userSettings.font == 'satoshi/nunito' ? 'font-display' : ''} {clazz ?? ''}"
|
||||
>
|
||||
<slot />
|
||||
</h1>
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
href: string
|
||||
) => string = (route, href) => href
|
||||
export let defaultRoute: string | undefined = undefined
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<nav
|
||||
class="flex flex-row items-center gap-1 p-1 rounded-full bg-white/60 dark:bg-zinc-800/60
|
||||
backdrop-blur-lg border border-slate-200/60 dark:border-zinc-800 shadow-lg border-opacity-50 {$$props.class ??
|
||||
backdrop-blur-lg border border-slate-200/60 dark:border-zinc-800 shadow-lg border-opacity-50 {clazz ??
|
||||
''}
|
||||
"
|
||||
>
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
function action(detail: any) {
|
||||
dispatcher('action', detail)
|
||||
}
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<ul
|
||||
class="divide-y divide-slate-200 dark:divide-zinc-900 flex flex-col {$$props.class}"
|
||||
class="divide-y divide-slate-200 dark:divide-zinc-900 flex flex-col {class}"
|
||||
>
|
||||
<slot {action} />
|
||||
</ul>
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
$: isSelected = isSelectedFilter($page.url.pathname)
|
||||
$: isPanel = adaptive ? $dockProps.noGap : false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@@ -26,7 +28,7 @@
|
||||
? '@3xl:h-8 @3xl:px-3 @3xl:rounded-[10px] @3xl:w-auto'
|
||||
: ''} {isSelected
|
||||
? 'bg-slate-200 dark:bg-zinc-900 text-primary-900 dark:!text-primary-100'
|
||||
: ''} {$$props.class ?? ''}"
|
||||
: ''} {clazz}"
|
||||
size="custom"
|
||||
{href}
|
||||
rounding="pill"
|
||||
|
||||
@@ -40,15 +40,18 @@
|
||||
import { dockProps } from '../layout/Shell.svelte'
|
||||
|
||||
let promptOpen: boolean = false
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<CommandsWrapper bind:open={promptOpen} />
|
||||
<nav
|
||||
class="flex flex-row gap-2 items-center w-full mx-auto z-50 box-border p-0.5
|
||||
duration-150 @container
|
||||
{$$props.class}
|
||||
{clazz}
|
||||
"
|
||||
style={$$props.style}
|
||||
{style}
|
||||
>
|
||||
<NavButton
|
||||
on:contextmenu={(e) => {
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
|
||||
let showInstance = false
|
||||
|
||||
export let buttonClass: string = ''
|
||||
</script>
|
||||
|
||||
{#if showInstance}
|
||||
@@ -60,7 +62,7 @@
|
||||
<button
|
||||
class="w-10 h-10 rounded-full border-2 border-slate-200 dark:border-zinc-700
|
||||
transition-all bg-slate-50 dark:bg-zinc-900 relative
|
||||
hover:border-primary-900 hover:dark:border-primary-100 active:scale-95 {$$props.buttonClass}"
|
||||
hover:border-primary-900 hover:dark:border-primary-100 active:scale-95 {buttonClass}"
|
||||
title={$t('profile.profile')}
|
||||
slot="target"
|
||||
>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
import type { Action } from './actions'
|
||||
|
||||
export let action: Action
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@@ -18,7 +20,7 @@
|
||||
alignment="left"
|
||||
color="tertiary"
|
||||
size="lg"
|
||||
class="focus:bg-slate-200 focus:dark:bg-zinc-800 block w-full {$$props.class}"
|
||||
class="focus:bg-slate-200 focus:dark:bg-zinc-800 block w-full {clazz}"
|
||||
data-sveltekit-preload-code="viewport"
|
||||
data-sveltekit-preload-data="tap"
|
||||
>
|
||||
|
||||
@@ -22,12 +22,16 @@
|
||||
import { iconOfLink } from '../navbar/link'
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
|
||||
export let style: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<nav
|
||||
class="flex flex-col p-4 overflow-auto
|
||||
gap-1 h-fit max-h-screen {$$props.class}"
|
||||
style={$$props.style}
|
||||
gap-1 h-fit max-h-screen {clazz}"
|
||||
{style}
|
||||
>
|
||||
{#if $userSettings.dock.pins?.length ?? 0 > 0}
|
||||
<div class="flex items-center flex-wrap gap-2 pl-1.5">
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
selected = $page.url.pathname == href
|
||||
}
|
||||
}
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@@ -23,7 +25,7 @@
|
||||
on:contextmenu
|
||||
class="font-normal block !origin-left border border-transparent {!selected
|
||||
? 'text-slate-600 dark:text-zinc-400'
|
||||
: ''} {$$props.class}"
|
||||
: ''} {clazz}"
|
||||
>
|
||||
<slot {selected} name="icon" slot="prefix">
|
||||
{#if icon}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<script lang="ts">
|
||||
export let wrap: keyof typeof wrapClass = 'wrap'
|
||||
|
||||
$: classes = `${wrapClass[wrap]} ${$$props.class ?? ''}`
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
$: classes = `${wrapClass[wrap]} ${clazz ?? ''}`
|
||||
</script>
|
||||
|
||||
<span class={classes}>
|
||||
|
||||
Reference in new issue
Block a user