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
@@ -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>
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
/>
|
||||
|
||||
@@ -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'
|
||||
: ''}"
|
||||
>
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -1,52 +1,57 @@
|
||||
<script lang="ts">
|
||||
export let label: string = ''
|
||||
export let label: string = ''
|
||||
|
||||
const badgeColor = {
|
||||
red: 'bg-red-500 text-white ring-transparent',
|
||||
green: 'bg-green-500 text-white dark:text-black ring-transparent',
|
||||
yellow: 'bg-yellow-500 text-black ring-transparent',
|
||||
gray: 'bg-gray-600 text-white ring-transparent',
|
||||
blue: 'bg-blue-500 text-white ring-transparent',
|
||||
purple: 'bg-purple-500 text-white ring-transparent',
|
||||
'red-subtle': `bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400
|
||||
const badgeColor = {
|
||||
red: 'bg-red-500 text-white ring-transparent',
|
||||
green: 'bg-green-500 text-white dark:text-black ring-transparent',
|
||||
yellow: 'bg-yellow-500 text-black ring-transparent',
|
||||
gray: 'bg-gray-600 text-white ring-transparent',
|
||||
blue: 'bg-blue-500 text-white ring-transparent',
|
||||
purple: 'bg-purple-500 text-white ring-transparent',
|
||||
'red-subtle': `bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400
|
||||
ring-red-400 dark:ring-red-500/30`,
|
||||
'green-subtle': `bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400
|
||||
'green-subtle': `bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400
|
||||
ring-green-400 dark:ring-green-500/30`,
|
||||
'yellow-subtle': `bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400
|
||||
'yellow-subtle': `bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400
|
||||
ring-yellow-400 dark:ring-yellow-500/30`,
|
||||
'gray-subtle': `bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-300
|
||||
'gray-subtle': `bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-300
|
||||
ring-gray-400 dark:ring-gray-400/30`,
|
||||
'blue-subtle': `bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300
|
||||
'blue-subtle': `bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300
|
||||
ring-blue-400 dark:ring-blue-400/30`,
|
||||
'purple-subtle': `bg-purple-100 dark:bg-purple-500/20 text-purple-700 dark:text-purple-400
|
||||
'purple-subtle': `bg-purple-100 dark:bg-purple-500/20 text-purple-700 dark:text-purple-400
|
||||
ring-purple-400 dark:ring-purple-500/30`,
|
||||
custom: ''
|
||||
}
|
||||
custom: '',
|
||||
}
|
||||
|
||||
const badgeRoundness = {
|
||||
full: 'rounded-full',
|
||||
md: 'rounded-md',
|
||||
custom: ''
|
||||
}
|
||||
const badgeRoundness = {
|
||||
full: 'rounded-full',
|
||||
md: 'rounded-md',
|
||||
custom: '',
|
||||
}
|
||||
|
||||
type BadgeColor = keyof typeof badgeColor
|
||||
type BadgeRoundness = keyof typeof badgeRoundness
|
||||
type BadgeColor = keyof typeof badgeColor
|
||||
type BadgeRoundness = keyof typeof badgeRoundness
|
||||
|
||||
export let color: BadgeColor = 'gray-subtle'
|
||||
export let rounding: BadgeRoundness = 'full'
|
||||
export let color: BadgeColor = 'gray-subtle'
|
||||
export let rounding: BadgeRoundness = 'full'
|
||||
export let allowIconOnly: boolean = false
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<span
|
||||
class="{allowIconOnly ? 'max-md:px-1.5 max-md:py-1.5' : ''} px-2.5 py-1 {badgeRoundness[
|
||||
rounding
|
||||
]} text-xs font-medium flex items-center gap-1 ring-1 ring-inset {badgeColor[
|
||||
color
|
||||
]} {$$props.class}"
|
||||
title={label}
|
||||
class="{allowIconOnly
|
||||
? 'max-md:px-1.5 max-md:py-1.5'
|
||||
: ''} px-2.5 py-1 {badgeRoundness[
|
||||
rounding
|
||||
]} text-xs font-medium flex items-center gap-1 ring-1 ring-inset {badgeColor[
|
||||
color
|
||||
]} {clazz}"
|
||||
title={label}
|
||||
>
|
||||
<slot name="icon" />
|
||||
<span class={allowIconOnly ? 'hidden md:contents' : 'contents'}>
|
||||
<slot />
|
||||
<slot />
|
||||
</span>
|
||||
</span>
|
||||
@@ -130,6 +130,9 @@
|
||||
export let loaderWidth: number | undefined = undefined
|
||||
|
||||
export let href: string | undefined = undefined
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<svelte:element
|
||||
@@ -155,7 +158,7 @@
|
||||
: alignment == 'left'
|
||||
? 'origin-left'
|
||||
: 'origin-right'}
|
||||
{$$props.class}"
|
||||
{clazz}"
|
||||
type={submit ? 'submit' : 'button'}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
navigator.clipboard.writeText(src)
|
||||
}
|
||||
}
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Material
|
||||
@@ -64,7 +67,7 @@
|
||||
<pre
|
||||
bind:this={pre}
|
||||
{...$$restProps}
|
||||
class="{$$props.class} bg-white dark:bg-zinc-900 px-4 overflow-auto max-h-96">
|
||||
class="{clazz} bg-white dark:bg-zinc-900 px-4 overflow-auto max-h-96">
|
||||
{#if htmlSrc}
|
||||
{@html htmlSrc}
|
||||
{:else if $$slots.default}
|
||||
|
||||
@@ -10,11 +10,14 @@
|
||||
export let copy: boolean = true
|
||||
|
||||
let copied = false
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="px-4 py-1 flex justify-between max-w-full box-border bg-slate-100 dark:bg-zinc-950 items-center gap-4 rounded-md border dark:border-zinc-800
|
||||
{$$props.class}"
|
||||
{clazz}"
|
||||
>
|
||||
<pre class="overflow-auto max-w-full whitespace-nowrap w-max">
|
||||
{value}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
import { slide } from 'svelte/transition'
|
||||
|
||||
export let open: boolean = false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div {...$$restProps} class={$$props.class}>
|
||||
<div {...$$restProps} class={clazz}>
|
||||
<button on:click={() => (open = !open)} class="w-full">
|
||||
<slot name="summary" {open} />
|
||||
</button>
|
||||
|
||||
@@ -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>
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
@@ -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,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>
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
export let color: Color = 'default'
|
||||
|
||||
export let element: string = 'div'
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<svelte:element
|
||||
@@ -64,7 +66,7 @@
|
||||
{roundedClass[rounding]}
|
||||
{colorClass[color]}
|
||||
text-sm
|
||||
{$$props.class}
|
||||
{clazz}
|
||||
"
|
||||
>
|
||||
<slot />
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
flip(),
|
||||
]
|
||||
export let strategy: Strategy = 'absolute'
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Popover
|
||||
@@ -34,7 +36,7 @@
|
||||
{...$$restProps}
|
||||
bind:open
|
||||
popoverClass="backdrop-blur-xl rounded-xl w-full max-w-[280px]"
|
||||
class={$$props.class}
|
||||
class={clazz}
|
||||
>
|
||||
<slot name="target" slot="target" />
|
||||
<div
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
export let alignment: ButtonAlignment = 'left'
|
||||
export let href: string | undefined = undefined
|
||||
export let disabled: boolean = false
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@@ -19,7 +21,7 @@
|
||||
? 'opacity-70 pointer-events-none cursor-not-allowed'
|
||||
: ''} {color == 'tertiary'
|
||||
? 'hover:dark:bg-zinc-800/70'
|
||||
: ''} duration-100 {$$props.class}"
|
||||
: ''} duration-100 {clazz}"
|
||||
{alignment}
|
||||
{href}
|
||||
{disabled}
|
||||
|
||||
@@ -62,6 +62,10 @@
|
||||
floatingRef(node)
|
||||
}
|
||||
}
|
||||
|
||||
export let popoverClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<svelte:body
|
||||
@@ -92,9 +96,7 @@
|
||||
}}
|
||||
role="menu"
|
||||
type="button"
|
||||
class="{canUseContents
|
||||
? 'contents text-left'
|
||||
: 'w-max h-max'} {$$props.class}"
|
||||
class="{canUseContents ? 'contents text-left' : 'w-max h-max'} {clazz}"
|
||||
bind:this={el}
|
||||
use:customFloatingRef
|
||||
>
|
||||
@@ -106,7 +108,7 @@
|
||||
<Portal class="z-[150]">
|
||||
<div
|
||||
transition:scale={{ duration: 200, start: 0.96, easing: backOut }}
|
||||
class="z-[150] {$$props.popoverClass}"
|
||||
class="z-[150] {popoverClass}"
|
||||
use:customFloatingContent
|
||||
use:focusTrap
|
||||
>
|
||||
|
||||
@@ -1,34 +1,37 @@
|
||||
<script lang="ts">
|
||||
import { browser } from '$app/environment'
|
||||
import { browser } from '$app/environment'
|
||||
|
||||
// https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516
|
||||
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
||||
let slottedElements: HTMLDivElement, portal: HTMLDivElement
|
||||
// https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516
|
||||
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
||||
let slottedElements: HTMLDivElement, portal: HTMLDivElement
|
||||
|
||||
const dispatch = createEventDispatcher<{ mounted: void }>()
|
||||
const dispatch = createEventDispatcher<{ mounted: void }>()
|
||||
|
||||
onMount(() => {
|
||||
if (!browser) return
|
||||
portal = document?.createElement('div')
|
||||
if (portal) portal.className = 'portal-mount'
|
||||
document?.body.appendChild(portal)
|
||||
portal?.appendChild(slottedElements)
|
||||
dispatch('mounted')
|
||||
})
|
||||
onMount(() => {
|
||||
if (!browser) return
|
||||
portal = document?.createElement('div')
|
||||
if (portal) portal.className = 'portal-mount'
|
||||
document?.body.appendChild(portal)
|
||||
portal?.appendChild(slottedElements)
|
||||
dispatch('mounted')
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
portal.remove()
|
||||
})
|
||||
onDestroy(() => {
|
||||
portal.remove()
|
||||
})
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div class="portal-initial-mount-point">
|
||||
<div bind:this={slottedElements} class="portal-content {$$props.class || ''}">
|
||||
<slot />
|
||||
</div>
|
||||
<div bind:this={slottedElements} class="portal-content {clazz || ''}">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.portal-initial-mount-point {
|
||||
display: none;
|
||||
}
|
||||
.portal-initial-mount-point {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -6,9 +6,12 @@
|
||||
export let badge: string | undefined = undefined
|
||||
|
||||
export let link: string = '#'
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col w-max {$$props.class}">
|
||||
<div class="flex flex-col w-max {clazz}">
|
||||
<a
|
||||
href={link}
|
||||
class="text-base font-medium inline-flex items-center gap-2 {link != '#'
|
||||
|
||||
@@ -15,10 +15,16 @@
|
||||
tablet: true,
|
||||
mobile: true,
|
||||
}
|
||||
|
||||
export let mainClass: string = ''
|
||||
export let itemsClass: string = ''
|
||||
export let optionsClass: string = ''
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="flex flex-col w-full justify-between gap-2 max-w-full @container/setting {$$props.mainClass}"
|
||||
class="flex flex-col w-full justify-between gap-2 max-w-full @container/setting {mainClass}"
|
||||
>
|
||||
{#if Object.values(supportedPlatforms).some((v) => v == false)}
|
||||
<div class="flex items-center gap-2 flex-wrap">
|
||||
@@ -43,10 +49,10 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div
|
||||
class="flex flex-col @md/setting:flex-row items-center gap-2 {$$props.itemsClass}"
|
||||
class="flex flex-col @md/setting:flex-row items-center gap-2 {itemsClass}"
|
||||
>
|
||||
<div
|
||||
class="flex flex-col gap-0.5 flex-[2] w-full flex-shrink-0 min-w-48 {$$props.class}"
|
||||
class="flex flex-col gap-0.5 flex-[2] w-full flex-shrink-0 min-w-48 {clazz}"
|
||||
>
|
||||
<h1 class="font-medium text-base"><slot name="title" /></h1>
|
||||
{#if $$slots.description}
|
||||
@@ -58,7 +64,7 @@
|
||||
{#if $$slots.default}
|
||||
<div
|
||||
class="w-full flex flex-col gap-2 flex-1 max-w-full
|
||||
@md/setting:items-end flex-shrink-0 {$$props.optionClass}"
|
||||
@md/setting:items-end flex-shrink-0 {optionClass}"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
export let value: string
|
||||
|
||||
const dispatch = createEventDispatcher<{ change: string }>()
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="w-full h-8 relative rounded-md border dark:border-zinc-600 hover:dark:border-zinc-400
|
||||
transition-colors {$$props.class}"
|
||||
transition-colors {clazz}"
|
||||
style="background-color: rgb({value});"
|
||||
>
|
||||
<input
|
||||
|
||||
Reference in new issue
Block a user