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

@@ -33,11 +33,13 @@
onDestroy(() => {
clearErrorScope(scope)
})
let clazz: string = ''
export { clazz as class }
</script>
{#if scopedErrors.length > 0}
<div
class={$$props.class}
class={clazz}
in:slide={{ duration: 400, easing: expoOut }}
out:slide={{ duration: 400, delay: 400, easing: expoOut }}
>
@@ -16,6 +16,8 @@
textarea.style.height = `${textarea.scrollHeight}px` // Set height to the scrollHeight
}
}
let clazz: string = ''
export { clazz as class }
</script>
<label class="w-full">
@@ -34,6 +36,6 @@
{required}
{...$$restProps}
rows={1}
class="font-semibold text-2xl focus:outline-none w-full bg-transparent resize-none {$$props.class}"
class="font-semibold text-2xl focus:outline-none w-full bg-transparent resize-none {clazz}"
/>
</label>
+5 -2
View File
@@ -14,6 +14,9 @@
export let nowrap: boolean = false
$: richURL = $$slots.default ? undefined : parseURL(href)
let clazz: string = ''
export { clazz as class }
</script>
<a
@@ -21,14 +24,14 @@
{href}
class="{highlight
? 'text-blue-500'
: ''} hover:underline max-w-full inline-flex items-center gap-1 {$$props.class}"
: ''} hover:underline max-w-full inline-flex items-center gap-1 {clazz}"
>
<slot name="icon" />
<slot>
<span
class="flex relative gap-0 {nowrap
? 'w-full whitespace-nowrap overflow-hidden text-ellipsis text-xs'
: ''} {$$props.class}"
: ''} {clazz}"
>
{#if richURL}
<span class="text-blue-300 dark:text-blue-800">
+6 -2
View File
@@ -10,6 +10,10 @@
export let selected: T
export let headless: boolean = false
let clazz: string = ''
export let buttonClazz: string = ''
export { clazz as class }
const dispatcher = createEventDispatcher<{ select: T }>()
$: {
@@ -19,7 +23,7 @@
let containerClass = `
flex flex-row rtl:flex-row-reverse items-center w-max max-w-full overflow-auto
${headless ? 'pb-1 gap-1' : ''}
${$$props.class}
${clazz}
`
const buttonClass = (selected: boolean) => `
@@ -27,7 +31,7 @@
last:rounded-r-lg last:border-r last:dark:border-r-transparent
rounded-l-none
rounded-r-none
px-3 py-1.5 text-sm hover:brightness-110 ${$$props.buttonClass || ''}
px-3 py-1.5 text-sm hover:brightness-110 ${buttonClazz || ''}
${
!selected
? `hover:dark:bg-zinc-800 border-slate-100 border-t border-b border-b-slate-300 dark:border-b-0
+3 -1
View File
@@ -26,9 +26,11 @@
export let taglines: Tagline[] | undefined = undefined
export let admins: PersonView[] | undefined = undefined
export let version: string | undefined = undefined
let clazz: string = ''
export { clazz as class }
</script>
<StickyCard class="w-full {$$props.class} text-slate-600 dark:text-zinc-400">
<StickyCard class="w-full {clazz} text-slate-600 dark:text-zinc-400">
{#if site.site.banner}
<div
class="rounded-xl
@@ -46,6 +46,10 @@
let editingLoad = false
export let contentClass: string = ''
let clazz: string = ''
export { clazz as class }
async function save() {
if (!$profile?.jwt || newComment.length <= 0) return
@@ -111,7 +115,7 @@
<li
class="py-3 relative {node.comment_view.comment.distinguished
? ' text-primary-900 dark:text-primary-100'
: ''} {highlight} {$$props.class}"
: ''} {highlight} {clazz}"
id={node.comment_view.comment.id.toString()}
>
{#if meta}
@@ -194,7 +198,7 @@
{/if}
{#if open}
<div
class="relative {$$props.contentClass}"
class="relative {contentClass}"
transition:slide={{ duration: 400, easing: expoOut }}
>
<div
@@ -14,6 +14,8 @@
export let community = false
export let meta: boolean = true
let clazz: string = ''
export { clazz as class }
</script>
<Material
@@ -23,7 +25,7 @@
? 'py-5'
: view == 'compact'
? 'py-4'
: 'py-5'} {$$props.class}"
: 'py-5'} {clazz}"
color="distinct"
padding="none"
>
@@ -140,11 +140,11 @@
loading.subscribing = false
}
let clazz: string = ''
export { clazz as class }
</script>
<StickyCard
class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {$$props.class}"
>
<StickyCard class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {clazz}">
<Entity
name={community_view.community.title}
label="!{fullCommunityName(
@@ -36,6 +36,8 @@
export let counts: CommunityAggregates | undefined = undefined
export let moderators: CommunityModeratorView[] = []
export let blocked: boolean = false
let clazz: string = ''
export { clazz as class }
</script>
<EntityHeader
@@ -67,7 +69,7 @@
]
: []}
bio={community.description}
class={$$props.class}
class={clazz}
>
<button
on:click={() => {
@@ -28,6 +28,8 @@
export let showCounts: boolean = true
let showInfo = false
let clazz: string = 'py-4 flex flex-col gap-4 text-sm max-w-full relative'
export { clazz as class }
</script>
{#if showInfo}
@@ -36,10 +38,7 @@
</Modal>
{/if}
<div
class={$$props.class ??
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
>
<div class={clazz}>
<div
class="flex
{view == 'cozy'
@@ -16,12 +16,15 @@
export let badges = {
nsfw: false,
}
let clazz: string = ''
export let instanceClass: string = ''
export { clazz as class }
</script>
<a
{...$$restProps}
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {$$props.class ||
''}"
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {clazz}"
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
data-sveltekit-preload-data="tap"
>
@@ -42,7 +45,7 @@
{#if showInstance}
<span
class="text-slate-500 dark:text-zinc-500 font-normal
instance-text flex-shrink {$$props.instanceClass || ''}"
instance-text flex-shrink {instanceClass || ''}"
>
@{new URL(community.actor_id).hostname}
</span>
@@ -37,9 +37,12 @@
$: changeDefault
? ($userSettings.defaultSort.sort = selected as SortType)
: undefined
let clazz: string = ''
export { clazz as class }
</script>
<div class="flex flex-row {$$props.class}">
<div class="flex flex-row {clazz}">
<Select
{...$$restProps}
class={selected?.startsWith('Top') ? 'rounded-r-none' : ''}
@@ -6,9 +6,11 @@
export let message: PrivateMessageView
export let meta: boolean = true
export let style: string = ''
</script>
<div class="flex flex-col gap-2 text-sm" style={$$props.style ?? ''}>
<div class="flex flex-col gap-2 text-sm" {style}>
{#if meta}
<div class="flex flex-row gap-2 items-center flex-wrap">
<span class="font-medium text-xs">From</span>
@@ -1,6 +1,9 @@
<script lang="ts">
export let width: number = 16
export let filled: boolean = false
let clazz: string = ''
export { clazz as class }
</script>
{#if filled}
@@ -10,7 +13,7 @@
viewBox="0 0 20 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="inline {$$props.class}"
class="inline {clazz}"
>
<path
d="M10.516 1.17C10.3767 1.03791 10.192 0.964283 10 0.964283C9.80801 0.964283 9.62333 1.03791 9.484 1.17C7.36127 3.18588 4.53412 4.29133 1.607 4.25C1.44753 4.24793 1.29156 4.29674 1.16172 4.38935C1.03189 4.48196 0.934957 4.61355 0.885 4.765C0.462973 6.05116 0.248618 7.39637 0.25 8.75C0.25 14.692 4.314 19.683 9.813 21.098C9.93566 21.1296 10.0643 21.1296 10.187 21.098C15.686 19.683 19.75 14.692 19.75 8.75C19.75 7.36 19.527 6.02 19.115 4.765C19.0652 4.61336 18.9684 4.48156 18.8385 4.38875C18.7087 4.29595 18.5526 4.247 18.393 4.249L18.25 4.25C15.254 4.25 12.533 3.08 10.516 1.17Z"
@@ -24,7 +27,7 @@
viewBox="0 0 20 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="inline {$$props.class}"
class="inline {clazz}"
>
<path
fill-rule="evenodd"
+6 -2
View File
@@ -74,6 +74,10 @@
goto(postLink(post.post))
}
}
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<!--
@@ -91,7 +95,7 @@
{view == 'compact' ? 'py-3 list-type compact' : ''}
{view == 'list' ? 'py-5 list-type' : ''}
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
{$$props.class ?? ''}"
{clazz ?? ''}"
id={post.post.id.toString()}
on:click={(e) => {
onClick(e)
@@ -101,7 +105,7 @@
if (e.key == 'Enter') onClick(e)
}}
tabindex="0"
style={$$props.style ?? ''}
{style}
>
<PostMeta
community={post.community}
@@ -82,6 +82,8 @@
$: buttonHeight = view == 'compact' ? 'h-7' : 'h-8'
$: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8'
export let style: string = ''
</script>
{#if editing}
@@ -119,7 +121,7 @@
<footer
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
class:flex-row-reverse={$userSettings.posts.reverseActions}
style={$$props.style ?? ''}
{style}
>
<PostVote
post={post.post}
@@ -27,18 +27,21 @@
}
$: overflows = isOverflown(element, body)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<svelte:element
this={htmlElement}
style={$$props.style ?? ''}
{style}
class="{!expanded
? ` overflow-hidden
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0
${view == 'list' ? `max-h-24` : 'max-h-48'}`
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {$$props.class ??
''}"
: 'text-slate-600 dark:text-zinc-400 max-h-full'} text-base {clazz}"
class:pointer-events-none={!clickThrough}
bind:this={element}
>
@@ -98,6 +98,9 @@
export let tags: Tag[] = []
let popoverOpen = false
export let style: string = ''
export let titleClass: string = ''
</script>
<!--
@@ -109,7 +112,7 @@
? 'grid-rows-2'
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
class:compact={view == 'compact'}
style={$$props.style ?? ''}
{style}
>
{#if showCommunity && community && subscribed && showCommunity}
<Popover bind:open={popoverOpen} manual>
@@ -280,7 +283,7 @@
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
{$userSettings.font == 'satoshi/nunito'
? 'font-display font-semibold'
: 'font-medium'} {$$props.titleClass ?? ''}"
: 'font-medium'} {titleClass}"
class:text-slate-600={$userSettings.markReadPosts && read}
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
class:text-base={view == 'compact'}
@@ -93,6 +93,9 @@
$: data = typeData(type)
$: embedUrl = urlToEmbed(url)
let clazz: string = ''
export { clazz as class }
</script>
<!--
@@ -102,7 +105,7 @@
{#if opened}
{#if type == 'video'}
<!-- svelte-ignore a11y-media-has-caption -->
<video {autoplay} controls class="rounded-xl aspect-video {$$props.class}">
<video {autoplay} controls class="rounded-xl aspect-video {clazz}">
<source src={url} />
</video>
{:else}
@@ -112,7 +115,7 @@
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
class="aspect-video rounded-xl dark:bg-zinc-900 {$$props.class ?? ''}"
class="aspect-video rounded-xl dark:bg-zinc-900 {clazz ?? ''}"
/>
{/if}
{:else}
@@ -27,16 +27,17 @@
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
$: size = thumbnailSize(view)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<!--
@component
Thumbnails for compact and list view posts.
-->
<div
class="{size} relative group/media {$$props.class ?? ''}"
style={$$props.style ?? ''}
>
<div class="{size} relative group/media {clazz ?? ''}" {style}>
{#if post.alt_text}
<Popover
openOnHover
@@ -14,12 +14,12 @@
export let user: PersonView
export let view: 'cozy' | 'compact' = 'compact'
export let showCounts: boolean = true
let clazz: string = 'py-4 flex flex-col gap-4 text-sm max-w-full relative'
export { clazz as class }
</script>
<div
class={$$props.class ??
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
>
<div class={clazz}>
<div
class="flex
{view == 'cozy'
@@ -65,11 +65,14 @@
export let displayName = $userSettings.displayNames
$: envBadge = getEnvBadge(user.actor_id)
export let instanceClass: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<a
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {$$props.class ??
''}"
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {clazz}"
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
data-sveltekit-preload-data="tap"
>
@@ -94,7 +97,7 @@
</span>
{#if showInstance}
<span
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {$$props.instanceClass ??
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {instanceClass ??
''}"
>
@{new URL(user.actor_id).hostname}
@@ -10,12 +10,14 @@
loading = true
goto(`/search?q=${query}`).then(() => (loading = false))
}
let clazz: string = ''
export { clazz as class }
</script>
<form on:submit|preventDefault={search} class="w-full h-full {$$props.class}">
<form on:submit|preventDefault={search} class="w-full h-full {clazz}">
<TextInput
bind:value={query}
class="w-full h-full {$$props.class}"
class="w-full h-full {clazz}"
placeholder={$t('nav.search')}
autofocus
/>
+6 -2
View File
@@ -98,13 +98,17 @@
export let noStyle: boolean = false
$: tokens = marked.lexer(source)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<div
class="{noStyle
? ''
: 'break-words flex flex-col gap-2 leading-[1.5]'} {$$props.class}"
style={$$props.style}
: 'break-words flex flex-col gap-2 leading-[1.5]'} {clazz}"
{style}
>
<SvelteMarkdown
bind:source={tokens}
@@ -93,6 +93,9 @@
}
$: if (!previewing && value) adjustHeight()
let clazz: string = ''
export { clazz as class }
</script>
{#if uploadingImage && images}
@@ -121,7 +124,7 @@
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700/70 dark:border-zinc-800
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring ring-slate-300
dark:ring-zinc-700 rounded-xl
overflow-hidden transition-colors {$$props.class}"
overflow-hidden transition-colors {clazz}"
class:mt-1={label}
>
{#if previewing}
@@ -135,7 +138,7 @@ overflow-hidden transition-colors {$$props.class}"
<!--Toolbar-->
<div
class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 border-b
border-slate-200 dark:border-zinc-900 {$$props.disabled
border-slate-200 dark:border-zinc-900 {disabled
? 'opacity-60 pointer-events-none'
: ''}"
>
+6 -3
View File
@@ -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}
>
+6 -2
View File
@@ -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 />
+4 -1
View File
@@ -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 -4
View File
@@ -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
+3 -1
View File
@@ -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>
+12 -5
View File
@@ -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>
+4 -2
View File
@@ -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>
+3 -1
View File
@@ -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>
+6 -1
View File
@@ -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>
+4 -1
View File
@@ -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"
+5 -2
View File
@@ -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) => {
+3 -1
View File
@@ -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"
>
+6 -2
View File
@@ -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}
+3 -1
View File
@@ -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}>
@@ -7,9 +7,12 @@
notation: 'compact',
}
let clazz: string = ''
export { clazz as class }
export { localeToUse as locale }
</script>
<span class={$$props.class ?? ''}>
<span class={clazz ?? ''}>
{Intl.NumberFormat(localeToUse, options).format(number)}
</span>
+4 -6
View File
@@ -57,13 +57,11 @@
}
$: dateTime = toLocaleDateString(date)
export let style: string = ''
let clazz: string = ''
export { clazz as class }
</script>
<time
datetime={dateTime}
title={dateTime}
class={$$props.class ?? ''}
style={$$props.style ?? ''}
>
<time datetime={dateTime} title={dateTime} class={clazz} {style}>
{formatRelativeDate(date, options, $locale, relativeTo)}
</time>