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(() => {
|
onDestroy(() => {
|
||||||
clearErrorScope(scope)
|
clearErrorScope(scope)
|
||||||
})
|
})
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if scopedErrors.length > 0}
|
{#if scopedErrors.length > 0}
|
||||||
<div
|
<div
|
||||||
class={$$props.class}
|
class={clazz}
|
||||||
in:slide={{ duration: 400, easing: expoOut }}
|
in:slide={{ duration: 400, easing: expoOut }}
|
||||||
out:slide={{ duration: 400, delay: 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
|
textarea.style.height = `${textarea.scrollHeight}px` // Set height to the scrollHeight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label class="w-full">
|
<label class="w-full">
|
||||||
@@ -34,6 +36,6 @@
|
|||||||
{required}
|
{required}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
rows={1}
|
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>
|
</label>
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
export let nowrap: boolean = false
|
export let nowrap: boolean = false
|
||||||
|
|
||||||
$: richURL = $$slots.default ? undefined : parseURL(href)
|
$: richURL = $$slots.default ? undefined : parseURL(href)
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
@@ -21,14 +24,14 @@
|
|||||||
{href}
|
{href}
|
||||||
class="{highlight
|
class="{highlight
|
||||||
? 'text-blue-500'
|
? '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 name="icon" />
|
||||||
<slot>
|
<slot>
|
||||||
<span
|
<span
|
||||||
class="flex relative gap-0 {nowrap
|
class="flex relative gap-0 {nowrap
|
||||||
? 'w-full whitespace-nowrap overflow-hidden text-ellipsis text-xs'
|
? 'w-full whitespace-nowrap overflow-hidden text-ellipsis text-xs'
|
||||||
: ''} {$$props.class}"
|
: ''} {clazz}"
|
||||||
>
|
>
|
||||||
{#if richURL}
|
{#if richURL}
|
||||||
<span class="text-blue-300 dark:text-blue-800">
|
<span class="text-blue-300 dark:text-blue-800">
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
export let selected: T
|
export let selected: T
|
||||||
export let headless: boolean = false
|
export let headless: boolean = false
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export let buttonClazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
|
||||||
const dispatcher = createEventDispatcher<{ select: T }>()
|
const dispatcher = createEventDispatcher<{ select: T }>()
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
@@ -19,7 +23,7 @@
|
|||||||
let containerClass = `
|
let containerClass = `
|
||||||
flex flex-row rtl:flex-row-reverse items-center w-max max-w-full overflow-auto
|
flex flex-row rtl:flex-row-reverse items-center w-max max-w-full overflow-auto
|
||||||
${headless ? 'pb-1 gap-1' : ''}
|
${headless ? 'pb-1 gap-1' : ''}
|
||||||
${$$props.class}
|
${clazz}
|
||||||
`
|
`
|
||||||
|
|
||||||
const buttonClass = (selected: boolean) => `
|
const buttonClass = (selected: boolean) => `
|
||||||
@@ -27,7 +31,7 @@
|
|||||||
last:rounded-r-lg last:border-r last:dark:border-r-transparent
|
last:rounded-r-lg last:border-r last:dark:border-r-transparent
|
||||||
rounded-l-none
|
rounded-l-none
|
||||||
rounded-r-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
|
!selected
|
||||||
? `hover:dark:bg-zinc-800 border-slate-100 border-t border-b border-b-slate-300 dark:border-b-0
|
? `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 taglines: Tagline[] | undefined = undefined
|
||||||
export let admins: PersonView[] | undefined = undefined
|
export let admins: PersonView[] | undefined = undefined
|
||||||
export let version: string | undefined = undefined
|
export let version: string | undefined = undefined
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</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}
|
{#if site.site.banner}
|
||||||
<div
|
<div
|
||||||
class="rounded-xl
|
class="rounded-xl
|
||||||
|
|||||||
@@ -46,6 +46,10 @@
|
|||||||
|
|
||||||
let editingLoad = false
|
let editingLoad = false
|
||||||
|
|
||||||
|
export let contentClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
if (!$profile?.jwt || newComment.length <= 0) return
|
if (!$profile?.jwt || newComment.length <= 0) return
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@
|
|||||||
<li
|
<li
|
||||||
class="py-3 relative {node.comment_view.comment.distinguished
|
class="py-3 relative {node.comment_view.comment.distinguished
|
||||||
? ' text-primary-900 dark:text-primary-100'
|
? ' text-primary-900 dark:text-primary-100'
|
||||||
: ''} {highlight} {$$props.class}"
|
: ''} {highlight} {clazz}"
|
||||||
id={node.comment_view.comment.id.toString()}
|
id={node.comment_view.comment.id.toString()}
|
||||||
>
|
>
|
||||||
{#if meta}
|
{#if meta}
|
||||||
@@ -194,7 +198,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if open}
|
{#if open}
|
||||||
<div
|
<div
|
||||||
class="relative {$$props.contentClass}"
|
class="relative {contentClass}"
|
||||||
transition:slide={{ duration: 400, easing: expoOut }}
|
transition:slide={{ duration: 400, easing: expoOut }}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
export let community = false
|
export let community = false
|
||||||
|
|
||||||
export let meta: boolean = true
|
export let meta: boolean = true
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
@@ -23,7 +25,7 @@
|
|||||||
? 'py-5'
|
? 'py-5'
|
||||||
: view == 'compact'
|
: view == 'compact'
|
||||||
? 'py-4'
|
? 'py-4'
|
||||||
: 'py-5'} {$$props.class}"
|
: 'py-5'} {clazz}"
|
||||||
color="distinct"
|
color="distinct"
|
||||||
padding="none"
|
padding="none"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -140,11 +140,11 @@
|
|||||||
|
|
||||||
loading.subscribing = false
|
loading.subscribing = false
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<StickyCard
|
<StickyCard class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {clazz}">
|
||||||
class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {$$props.class}"
|
|
||||||
>
|
|
||||||
<Entity
|
<Entity
|
||||||
name={community_view.community.title}
|
name={community_view.community.title}
|
||||||
label="!{fullCommunityName(
|
label="!{fullCommunityName(
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
export let counts: CommunityAggregates | undefined = undefined
|
export let counts: CommunityAggregates | undefined = undefined
|
||||||
export let moderators: CommunityModeratorView[] = []
|
export let moderators: CommunityModeratorView[] = []
|
||||||
export let blocked: boolean = false
|
export let blocked: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<EntityHeader
|
<EntityHeader
|
||||||
@@ -67,7 +69,7 @@
|
|||||||
]
|
]
|
||||||
: []}
|
: []}
|
||||||
bio={community.description}
|
bio={community.description}
|
||||||
class={$$props.class}
|
class={clazz}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
export let showCounts: boolean = true
|
export let showCounts: boolean = true
|
||||||
|
|
||||||
let showInfo = false
|
let showInfo = false
|
||||||
|
let clazz: string = 'py-4 flex flex-col gap-4 text-sm max-w-full relative'
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if showInfo}
|
{#if showInfo}
|
||||||
@@ -36,10 +38,7 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div
|
<div class={clazz}>
|
||||||
class={$$props.class ??
|
|
||||||
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex
|
class="flex
|
||||||
{view == 'cozy'
|
{view == 'cozy'
|
||||||
|
|||||||
@@ -16,12 +16,15 @@
|
|||||||
export let badges = {
|
export let badges = {
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export let instanceClass: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
{...$$restProps}
|
{...$$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}"
|
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
|
||||||
data-sveltekit-preload-data="tap"
|
data-sveltekit-preload-data="tap"
|
||||||
>
|
>
|
||||||
@@ -42,7 +45,7 @@
|
|||||||
{#if showInstance}
|
{#if showInstance}
|
||||||
<span
|
<span
|
||||||
class="text-slate-500 dark:text-zinc-500 font-normal
|
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}
|
@{new URL(community.actor_id).hostname}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -37,9 +37,12 @@
|
|||||||
$: changeDefault
|
$: changeDefault
|
||||||
? ($userSettings.defaultSort.sort = selected as SortType)
|
? ($userSettings.defaultSort.sort = selected as SortType)
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-row {$$props.class}">
|
<div class="flex flex-row {clazz}">
|
||||||
<Select
|
<Select
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class={selected?.startsWith('Top') ? 'rounded-r-none' : ''}
|
class={selected?.startsWith('Top') ? 'rounded-r-none' : ''}
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
|
|
||||||
export let message: PrivateMessageView
|
export let message: PrivateMessageView
|
||||||
export let meta: boolean = true
|
export let meta: boolean = true
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
</script>
|
</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}
|
{#if meta}
|
||||||
<div class="flex flex-row gap-2 items-center flex-wrap">
|
<div class="flex flex-row gap-2 items-center flex-wrap">
|
||||||
<span class="font-medium text-xs">From</span>
|
<span class="font-medium text-xs">From</span>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let width: number = 16
|
export let width: number = 16
|
||||||
export let filled: boolean = false
|
export let filled: boolean = false
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if filled}
|
{#if filled}
|
||||||
@@ -10,7 +13,7 @@
|
|||||||
viewBox="0 0 20 22"
|
viewBox="0 0 20 22"
|
||||||
fill="none"
|
fill="none"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
class="inline {$$props.class}"
|
class="inline {clazz}"
|
||||||
>
|
>
|
||||||
<path
|
<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"
|
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"
|
viewBox="0 0 20 22"
|
||||||
fill="none"
|
fill="none"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
class="inline {$$props.class}"
|
class="inline {clazz}"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
fill-rule="evenodd"
|
fill-rule="evenodd"
|
||||||
|
|||||||
@@ -74,6 +74,10 @@
|
|||||||
goto(postLink(post.post))
|
goto(postLink(post.post))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -91,7 +95,7 @@
|
|||||||
{view == 'compact' ? 'py-3 list-type compact' : ''}
|
{view == 'compact' ? 'py-3 list-type compact' : ''}
|
||||||
{view == 'list' ? 'py-5 list-type' : ''}
|
{view == 'list' ? 'py-5 list-type' : ''}
|
||||||
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
|
{view == 'cozy' ? 'py-5 flex flex-col gap-2' : ''}
|
||||||
{$$props.class ?? ''}"
|
{clazz ?? ''}"
|
||||||
id={post.post.id.toString()}
|
id={post.post.id.toString()}
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
onClick(e)
|
onClick(e)
|
||||||
@@ -101,7 +105,7 @@
|
|||||||
if (e.key == 'Enter') onClick(e)
|
if (e.key == 'Enter') onClick(e)
|
||||||
}}
|
}}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
style={$$props.style ?? ''}
|
{style}
|
||||||
>
|
>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
community={post.community}
|
community={post.community}
|
||||||
|
|||||||
@@ -82,6 +82,8 @@
|
|||||||
|
|
||||||
$: buttonHeight = view == 'compact' ? 'h-7' : 'h-8'
|
$: buttonHeight = view == 'compact' ? 'h-7' : 'h-8'
|
||||||
$: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8'
|
$: buttonSquare = view == 'compact' ? 'w-7 h-7' : 'w-8 h-8'
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if editing}
|
{#if editing}
|
||||||
@@ -119,7 +121,7 @@
|
|||||||
<footer
|
<footer
|
||||||
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
|
class="flex flex-row gap-2 items-center flex-shrink-0 {buttonHeight}"
|
||||||
class:flex-row-reverse={$userSettings.posts.reverseActions}
|
class:flex-row-reverse={$userSettings.posts.reverseActions}
|
||||||
style={$$props.style ?? ''}
|
{style}
|
||||||
>
|
>
|
||||||
<PostVote
|
<PostVote
|
||||||
post={post.post}
|
post={post.post}
|
||||||
|
|||||||
@@ -27,18 +27,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: overflows = isOverflown(element, body)
|
$: overflows = isOverflown(element, body)
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:element
|
<svelte:element
|
||||||
this={htmlElement}
|
this={htmlElement}
|
||||||
style={$$props.style ?? ''}
|
{style}
|
||||||
class="{!expanded
|
class="{!expanded
|
||||||
? ` overflow-hidden
|
? ` overflow-hidden
|
||||||
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
|
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
|
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0
|
||||||
${view == 'list' ? `max-h-24` : 'max-h-48'}`
|
${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}
|
class:pointer-events-none={!clickThrough}
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -98,6 +98,9 @@
|
|||||||
export let tags: Tag[] = []
|
export let tags: Tag[] = []
|
||||||
|
|
||||||
let popoverOpen = false
|
let popoverOpen = false
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
export let titleClass: string = ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -109,7 +112,7 @@
|
|||||||
? 'grid-rows-2'
|
? 'grid-rows-2'
|
||||||
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
|
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
|
||||||
class:compact={view == 'compact'}
|
class:compact={view == 'compact'}
|
||||||
style={$$props.style ?? ''}
|
{style}
|
||||||
>
|
>
|
||||||
{#if showCommunity && community && subscribed && showCommunity}
|
{#if showCommunity && community && subscribed && showCommunity}
|
||||||
<Popover bind:open={popoverOpen} manual>
|
<Popover bind:open={popoverOpen} manual>
|
||||||
@@ -280,7 +283,7 @@
|
|||||||
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
|
hover:text-primary-900 hover:dark:text-primary-100 transition-colors max-[480px]:!mt-0
|
||||||
{$userSettings.font == 'satoshi/nunito'
|
{$userSettings.font == 'satoshi/nunito'
|
||||||
? 'font-display font-semibold'
|
? 'font-display font-semibold'
|
||||||
: 'font-medium'} {$$props.titleClass ?? ''}"
|
: 'font-medium'} {titleClass}"
|
||||||
class:text-slate-600={$userSettings.markReadPosts && read}
|
class:text-slate-600={$userSettings.markReadPosts && read}
|
||||||
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
|
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
|
||||||
class:text-base={view == 'compact'}
|
class:text-base={view == 'compact'}
|
||||||
|
|||||||
@@ -93,6 +93,9 @@
|
|||||||
|
|
||||||
$: data = typeData(type)
|
$: data = typeData(type)
|
||||||
$: embedUrl = urlToEmbed(url)
|
$: embedUrl = urlToEmbed(url)
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -102,7 +105,7 @@
|
|||||||
{#if opened}
|
{#if opened}
|
||||||
{#if type == 'video'}
|
{#if type == 'video'}
|
||||||
<!-- svelte-ignore a11y-media-has-caption -->
|
<!-- 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} />
|
<source src={url} />
|
||||||
</video>
|
</video>
|
||||||
{:else}
|
{:else}
|
||||||
@@ -112,7 +115,7 @@
|
|||||||
frameborder="0"
|
frameborder="0"
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
allowfullscreen
|
allowfullscreen
|
||||||
class="aspect-video rounded-xl dark:bg-zinc-900 {$$props.class ?? ''}"
|
class="aspect-video rounded-xl dark:bg-zinc-900 {clazz ?? ''}"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -27,16 +27,17 @@
|
|||||||
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
|
view == 'compact' ? 'w-22 h-22 sm:w-28' : 'w-24 h-24 sm:w-32'
|
||||||
|
|
||||||
$: size = thumbnailSize(view)
|
$: size = thumbnailSize(view)
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@component
|
@component
|
||||||
Thumbnails for compact and list view posts.
|
Thumbnails for compact and list view posts.
|
||||||
-->
|
-->
|
||||||
<div
|
<div class="{size} relative group/media {clazz ?? ''}" {style}>
|
||||||
class="{size} relative group/media {$$props.class ?? ''}"
|
|
||||||
style={$$props.style ?? ''}
|
|
||||||
>
|
|
||||||
{#if post.alt_text}
|
{#if post.alt_text}
|
||||||
<Popover
|
<Popover
|
||||||
openOnHover
|
openOnHover
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
export let user: PersonView
|
export let user: PersonView
|
||||||
export let view: 'cozy' | 'compact' = 'compact'
|
export let view: 'cozy' | 'compact' = 'compact'
|
||||||
export let showCounts: boolean = true
|
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>
|
</script>
|
||||||
|
|
||||||
<div
|
<div class={clazz}>
|
||||||
class={$$props.class ??
|
|
||||||
'py-4 flex flex-col gap-4 text-sm max-w-full relative'}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex
|
class="flex
|
||||||
{view == 'cozy'
|
{view == 'cozy'
|
||||||
|
|||||||
@@ -65,11 +65,14 @@
|
|||||||
export let displayName = $userSettings.displayNames
|
export let displayName = $userSettings.displayNames
|
||||||
|
|
||||||
$: envBadge = getEnvBadge(user.actor_id)
|
$: envBadge = getEnvBadge(user.actor_id)
|
||||||
|
|
||||||
|
export let instanceClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<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}"
|
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
|
||||||
data-sveltekit-preload-data="tap"
|
data-sveltekit-preload-data="tap"
|
||||||
>
|
>
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{#if showInstance}
|
{#if showInstance}
|
||||||
<span
|
<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}
|
@{new URL(user.actor_id).hostname}
|
||||||
|
|||||||
@@ -10,12 +10,14 @@
|
|||||||
loading = true
|
loading = true
|
||||||
goto(`/search?q=${query}`).then(() => (loading = false))
|
goto(`/search?q=${query}`).then(() => (loading = false))
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</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
|
<TextInput
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
class="w-full h-full {$$props.class}"
|
class="w-full h-full {clazz}"
|
||||||
placeholder={$t('nav.search')}
|
placeholder={$t('nav.search')}
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -98,13 +98,17 @@
|
|||||||
export let noStyle: boolean = false
|
export let noStyle: boolean = false
|
||||||
|
|
||||||
$: tokens = marked.lexer(source)
|
$: tokens = marked.lexer(source)
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="{noStyle
|
class="{noStyle
|
||||||
? ''
|
? ''
|
||||||
: 'break-words flex flex-col gap-2 leading-[1.5]'} {$$props.class}"
|
: 'break-words flex flex-col gap-2 leading-[1.5]'} {clazz}"
|
||||||
style={$$props.style}
|
{style}
|
||||||
>
|
>
|
||||||
<SvelteMarkdown
|
<SvelteMarkdown
|
||||||
bind:source={tokens}
|
bind:source={tokens}
|
||||||
|
|||||||
@@ -93,6 +93,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: if (!previewing && value) adjustHeight()
|
$: if (!previewing && value) adjustHeight()
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if uploadingImage && images}
|
{#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
|
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
|
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring ring-slate-300
|
||||||
dark:ring-zinc-700 rounded-xl
|
dark:ring-zinc-700 rounded-xl
|
||||||
overflow-hidden transition-colors {$$props.class}"
|
overflow-hidden transition-colors {clazz}"
|
||||||
class:mt-1={label}
|
class:mt-1={label}
|
||||||
>
|
>
|
||||||
{#if previewing}
|
{#if previewing}
|
||||||
@@ -135,7 +138,7 @@ overflow-hidden transition-colors {$$props.class}"
|
|||||||
<!--Toolbar-->
|
<!--Toolbar-->
|
||||||
<div
|
<div
|
||||||
class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 border-b
|
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'
|
? 'opacity-60 pointer-events-none'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -38,6 +38,9 @@
|
|||||||
$: optimizedURLs = [2, 3, 6, -1].map((n) =>
|
$: optimizedURLs = [2, 3, 6, -1].map((n) =>
|
||||||
optimizeUrl(url, (res || width) * n)
|
optimizeUrl(url, (res || width) * n)
|
||||||
)
|
)
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if optimizedURLs[0] != undefined}
|
{#if optimizedURLs[0] != undefined}
|
||||||
@@ -49,15 +52,15 @@
|
|||||||
{alt}
|
{alt}
|
||||||
{width}
|
{width}
|
||||||
{title}
|
{title}
|
||||||
class="aspect-square object-cover overflow-hidden {$$props.class} flex-shrink-0"
|
class="aspect-square object-cover overflow-hidden {clazz} flex-shrink-0"
|
||||||
style="width: {width}px; height: {width}px; {$$props.style || undefined}"
|
style="width: {width}px; height: {width}px; {style}"
|
||||||
class:rounded-full={circle}
|
class:rounded-full={circle}
|
||||||
class:rounded-md={!circle}
|
class:rounded-md={!circle}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
style="width: {width}px; height: {width}px;"
|
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-full={circle}
|
||||||
class:rounded-md={!circle}
|
class:rounded-md={!circle}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex flex-row items-center
|
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">
|
<span class="font-medium text-left">
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
}[] = []
|
}[] = []
|
||||||
|
|
||||||
export let center: boolean = false
|
export let center: boolean = false
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
@@ -25,7 +28,7 @@
|
|||||||
padding="none"
|
padding="none"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
{...$$restProps}
|
{...$$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}
|
{#if banner || avatar}
|
||||||
<div class="max-h-36 overflow-visible">
|
<div class="max-h-36 overflow-visible">
|
||||||
|
|||||||
@@ -3,12 +3,11 @@
|
|||||||
import { Minus, Plus, Icon } from 'svelte-hero-icons'
|
import { Minus, Plus, Icon } from 'svelte-hero-icons'
|
||||||
export let open: boolean = false
|
export let open: boolean = false
|
||||||
export let icon: boolean = true
|
export let icon: boolean = true
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Disclosure
|
<Disclosure bind:open class="items-start justify-items-start gap-2 {clazz}">
|
||||||
bind:open
|
|
||||||
class="items-start justify-items-start gap-2 {$$props.class}"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
slot="summary"
|
slot="summary"
|
||||||
class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
|
class="font-medium w-full text-left flex flex-row items-center justify-between hover:text-primary-900
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
sharing = false
|
sharing = false
|
||||||
return file
|
return file
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $page.state.openImage || '' != ''}
|
{#if $page.state.openImage || '' != ''}
|
||||||
@@ -146,6 +148,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<button on:click={() => history.back()} class="contents {$$props.class}">
|
<button on:click={() => history.back()} class="contents {clazz}">
|
||||||
<slot />
|
<slot />
|
||||||
</button>
|
</button>
|
||||||
@@ -1,18 +1,25 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import FormattedNumber from "../util/FormattedNumber.svelte"
|
import FormattedNumber from '../util/FormattedNumber.svelte'
|
||||||
|
|
||||||
export let label: string
|
export let label: string
|
||||||
export let content: string
|
export let content: string
|
||||||
export let formatted: boolean = false
|
export let formatted: boolean = false
|
||||||
|
|
||||||
|
export let labelClass: string = ''
|
||||||
|
export let contentClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col {$$props.class}">
|
<div class="flex flex-col {clazz}">
|
||||||
<span class="text-slate-600 dark:text-zinc-400 text-xs {$$props.labelClass}">{label}</span>
|
<span class="text-slate-600 dark:text-zinc-400 text-xs {labelClass}">
|
||||||
<span class="text-base {$$props.contentClass}">
|
{label}
|
||||||
|
</span>
|
||||||
|
<span class="text-base {contentClass}">
|
||||||
{#if formatted}
|
{#if formatted}
|
||||||
<FormattedNumber number={Number(content)} />
|
<FormattedNumber number={Number(content)} />
|
||||||
{:else}
|
{:else}
|
||||||
{content}
|
{content}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -6,10 +6,12 @@
|
|||||||
export let title: string
|
export let title: string
|
||||||
export let description: string | undefined = undefined
|
export let description: string | undefined = undefined
|
||||||
export let center: boolean = false
|
export let center: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<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">
|
<div class="flex flex-row gap-4 items-center max-w-sm">
|
||||||
{#if icon}
|
{#if icon}
|
||||||
@@ -19,7 +21,7 @@
|
|||||||
<Icon src={icon} size="28" />
|
<Icon src={icon} size="28" />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class={$$props.class}>
|
<div class={clazz}>
|
||||||
<h1 class="text-slate-900 dark:text-zinc-100 text-lg font-medium">
|
<h1 class="text-slate-900 dark:text-zinc-100 text-lg font-medium">
|
||||||
{title}
|
{title}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let small: boolean = false
|
export let small: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class="{!small ? 'text-lg' : 'text-xs'} font-semibold {$$props.class}"
|
class="{!small ? 'text-lg' : 'text-xs'} font-semibold {clazz}"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
</script>
|
||||||
|
|
||||||
<aside
|
<aside
|
||||||
class="sticky top-0 left-0 break-words flex flex-shrink
|
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
|
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 />
|
<slot />
|
||||||
</aside>
|
</aside>
|
||||||
@@ -84,13 +84,16 @@
|
|||||||
|
|
||||||
$: sidePadding = calculatePadding($dockProps.noGap, $dockProps.top, false)
|
$: sidePadding = calculatePadding($dockProps.noGap, $dockProps.top, false)
|
||||||
$: topPanel = $dockProps.noGap && $dockProps.top
|
$: topPanel = $dockProps.noGap && $dockProps.top
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window bind:innerWidth={$screenWidth} />
|
<svelte:window bind:innerWidth={$screenWidth} />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class="shell bg-slate-50 dark:bg-zinc-950 {$$props.class}"
|
class="shell bg-slate-50 dark:bg-zinc-950 {clazz}"
|
||||||
style={$themeVars}
|
style={$themeVars}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
import { contentPadding } from '../Shell.svelte'
|
import { contentPadding } from '../Shell.svelte'
|
||||||
|
|
||||||
export let pageHeader = false
|
export let pageHeader = false
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -16,14 +20,12 @@
|
|||||||
"
|
"
|
||||||
style="{pageHeader
|
style="{pageHeader
|
||||||
? `margin-top: min(-6rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(6rem, calc(${$contentPadding.top}px));`
|
? `margin-top: min(-6rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(6rem, calc(${$contentPadding.top}px));`
|
||||||
: ''} {$$props.style};
|
: ''} {style};
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<h1
|
<h1
|
||||||
class="text-3xl font-medium flex gap-2 w-full
|
class="text-3xl font-medium flex gap-2 w-full
|
||||||
{$userSettings.font == 'satoshi/nunito'
|
{$userSettings.font == 'satoshi/nunito' ? 'font-display' : ''} {clazz ?? ''}"
|
||||||
? 'font-display'
|
|
||||||
: ''} {$$props.class ?? ''}"
|
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -20,11 +20,13 @@
|
|||||||
href: string
|
href: string
|
||||||
) => string = (route, href) => href
|
) => string = (route, href) => href
|
||||||
export let defaultRoute: string | undefined = undefined
|
export let defaultRoute: string | undefined = undefined
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-row items-center gap-1 p-1 rounded-full bg-white/60 dark:bg-zinc-800/60
|
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) {
|
function action(detail: any) {
|
||||||
dispatcher('action', detail)
|
dispatcher('action', detail)
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul
|
<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} />
|
<slot {action} />
|
||||||
</ul>
|
</ul>
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
$: isSelected = isSelectedFilter($page.url.pathname)
|
$: isSelected = isSelectedFilter($page.url.pathname)
|
||||||
$: isPanel = adaptive ? $dockProps.noGap : false
|
$: isPanel = adaptive ? $dockProps.noGap : false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -26,7 +28,7 @@
|
|||||||
? '@3xl:h-8 @3xl:px-3 @3xl:rounded-[10px] @3xl:w-auto'
|
? '@3xl:h-8 @3xl:px-3 @3xl:rounded-[10px] @3xl:w-auto'
|
||||||
: ''} {isSelected
|
: ''} {isSelected
|
||||||
? 'bg-slate-200 dark:bg-zinc-900 text-primary-900 dark:!text-primary-100'
|
? 'bg-slate-200 dark:bg-zinc-900 text-primary-900 dark:!text-primary-100'
|
||||||
: ''} {$$props.class ?? ''}"
|
: ''} {clazz}"
|
||||||
size="custom"
|
size="custom"
|
||||||
{href}
|
{href}
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
|
|||||||
@@ -40,15 +40,18 @@
|
|||||||
import { dockProps } from '../layout/Shell.svelte'
|
import { dockProps } from '../layout/Shell.svelte'
|
||||||
|
|
||||||
let promptOpen: boolean = false
|
let promptOpen: boolean = false
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<CommandsWrapper bind:open={promptOpen} />
|
<CommandsWrapper bind:open={promptOpen} />
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-row gap-2 items-center w-full mx-auto z-50 box-border p-0.5
|
class="flex flex-row gap-2 items-center w-full mx-auto z-50 box-border p-0.5
|
||||||
duration-150 @container
|
duration-150 @container
|
||||||
{$$props.class}
|
{clazz}
|
||||||
"
|
"
|
||||||
style={$$props.style}
|
{style}
|
||||||
>
|
>
|
||||||
<NavButton
|
<NavButton
|
||||||
on:contextmenu={(e) => {
|
on:contextmenu={(e) => {
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
|
|
||||||
let showInstance = false
|
let showInstance = false
|
||||||
|
|
||||||
|
export let buttonClass: string = ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if showInstance}
|
{#if showInstance}
|
||||||
@@ -60,7 +62,7 @@
|
|||||||
<button
|
<button
|
||||||
class="w-10 h-10 rounded-full border-2 border-slate-200 dark:border-zinc-700
|
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
|
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')}
|
title={$t('profile.profile')}
|
||||||
slot="target"
|
slot="target"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
import type { Action } from './actions'
|
import type { Action } from './actions'
|
||||||
|
|
||||||
export let action: Action
|
export let action: Action
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -18,7 +20,7 @@
|
|||||||
alignment="left"
|
alignment="left"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="lg"
|
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-code="viewport"
|
||||||
data-sveltekit-preload-data="tap"
|
data-sveltekit-preload-data="tap"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -22,12 +22,16 @@
|
|||||||
import { iconOfLink } from '../navbar/link'
|
import { iconOfLink } from '../navbar/link'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-col p-4 overflow-auto
|
class="flex flex-col p-4 overflow-auto
|
||||||
gap-1 h-fit max-h-screen {$$props.class}"
|
gap-1 h-fit max-h-screen {clazz}"
|
||||||
style={$$props.style}
|
{style}
|
||||||
>
|
>
|
||||||
{#if $userSettings.dock.pins?.length ?? 0 > 0}
|
{#if $userSettings.dock.pins?.length ?? 0 > 0}
|
||||||
<div class="flex items-center flex-wrap gap-2 pl-1.5">
|
<div class="flex items-center flex-wrap gap-2 pl-1.5">
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
selected = $page.url.pathname == href
|
selected = $page.url.pathname == href
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -23,7 +25,7 @@
|
|||||||
on:contextmenu
|
on:contextmenu
|
||||||
class="font-normal block !origin-left border border-transparent {!selected
|
class="font-normal block !origin-left border border-transparent {!selected
|
||||||
? 'text-slate-600 dark:text-zinc-400'
|
? 'text-slate-600 dark:text-zinc-400'
|
||||||
: ''} {$$props.class}"
|
: ''} {clazz}"
|
||||||
>
|
>
|
||||||
<slot {selected} name="icon" slot="prefix">
|
<slot {selected} name="icon" slot="prefix">
|
||||||
{#if icon}
|
{#if icon}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let wrap: keyof typeof wrapClass = 'wrap'
|
export let wrap: keyof typeof wrapClass = 'wrap'
|
||||||
|
|
||||||
$: classes = `${wrapClass[wrap]} ${$$props.class ?? ''}`
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
$: classes = `${wrapClass[wrap]} ${clazz ?? ''}`
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span class={classes}>
|
<span class={classes}>
|
||||||
|
|||||||
@@ -7,9 +7,12 @@
|
|||||||
notation: 'compact',
|
notation: 'compact',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
|
|
||||||
export { localeToUse as locale }
|
export { localeToUse as locale }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span class={$$props.class ?? ''}>
|
<span class={clazz ?? ''}>
|
||||||
{Intl.NumberFormat(localeToUse, options).format(number)}
|
{Intl.NumberFormat(localeToUse, options).format(number)}
|
||||||
</span>
|
</span>
|
||||||
@@ -57,13 +57,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: dateTime = toLocaleDateString(date)
|
$: dateTime = toLocaleDateString(date)
|
||||||
|
export let style: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<time
|
<time datetime={dateTime} title={dateTime} class={clazz} {style}>
|
||||||
datetime={dateTime}
|
|
||||||
title={dateTime}
|
|
||||||
class={$$props.class ?? ''}
|
|
||||||
style={$$props.style ?? ''}
|
|
||||||
>
|
|
||||||
{formatRelativeDate(date, options, $locale, relativeTo)}
|
{formatRelativeDate(date, options, $locale, relativeTo)}
|
||||||
</time>
|
</time>
|
||||||
@@ -1,52 +1,57 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let label: string = ''
|
export let label: string = ''
|
||||||
|
|
||||||
const badgeColor = {
|
const badgeColor = {
|
||||||
red: 'bg-red-500 text-white ring-transparent',
|
red: 'bg-red-500 text-white ring-transparent',
|
||||||
green: 'bg-green-500 text-white dark:text-black ring-transparent',
|
green: 'bg-green-500 text-white dark:text-black ring-transparent',
|
||||||
yellow: 'bg-yellow-500 text-black ring-transparent',
|
yellow: 'bg-yellow-500 text-black ring-transparent',
|
||||||
gray: 'bg-gray-600 text-white ring-transparent',
|
gray: 'bg-gray-600 text-white ring-transparent',
|
||||||
blue: 'bg-blue-500 text-white ring-transparent',
|
blue: 'bg-blue-500 text-white ring-transparent',
|
||||||
purple: 'bg-purple-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
|
'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`,
|
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`,
|
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`,
|
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`,
|
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`,
|
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`,
|
ring-purple-400 dark:ring-purple-500/30`,
|
||||||
custom: ''
|
custom: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const badgeRoundness = {
|
const badgeRoundness = {
|
||||||
full: 'rounded-full',
|
full: 'rounded-full',
|
||||||
md: 'rounded-md',
|
md: 'rounded-md',
|
||||||
custom: ''
|
custom: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
type BadgeColor = keyof typeof badgeColor
|
type BadgeColor = keyof typeof badgeColor
|
||||||
type BadgeRoundness = keyof typeof badgeRoundness
|
type BadgeRoundness = keyof typeof badgeRoundness
|
||||||
|
|
||||||
export let color: BadgeColor = 'gray-subtle'
|
export let color: BadgeColor = 'gray-subtle'
|
||||||
export let rounding: BadgeRoundness = 'full'
|
export let rounding: BadgeRoundness = 'full'
|
||||||
export let allowIconOnly: boolean = false
|
export let allowIconOnly: boolean = false
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="{allowIconOnly ? 'max-md:px-1.5 max-md:py-1.5' : ''} px-2.5 py-1 {badgeRoundness[
|
class="{allowIconOnly
|
||||||
rounding
|
? 'max-md:px-1.5 max-md:py-1.5'
|
||||||
]} text-xs font-medium flex items-center gap-1 ring-1 ring-inset {badgeColor[
|
: ''} px-2.5 py-1 {badgeRoundness[
|
||||||
color
|
rounding
|
||||||
]} {$$props.class}"
|
]} text-xs font-medium flex items-center gap-1 ring-1 ring-inset {badgeColor[
|
||||||
title={label}
|
color
|
||||||
|
]} {clazz}"
|
||||||
|
title={label}
|
||||||
>
|
>
|
||||||
<slot name="icon" />
|
<slot name="icon" />
|
||||||
<span class={allowIconOnly ? 'hidden md:contents' : 'contents'}>
|
<span class={allowIconOnly ? 'hidden md:contents' : 'contents'}>
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -130,6 +130,9 @@
|
|||||||
export let loaderWidth: number | undefined = undefined
|
export let loaderWidth: number | undefined = undefined
|
||||||
|
|
||||||
export let href: string | undefined = undefined
|
export let href: string | undefined = undefined
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:element
|
<svelte:element
|
||||||
@@ -155,7 +158,7 @@
|
|||||||
: alignment == 'left'
|
: alignment == 'left'
|
||||||
? 'origin-left'
|
? 'origin-left'
|
||||||
: 'origin-right'}
|
: 'origin-right'}
|
||||||
{$$props.class}"
|
{clazz}"
|
||||||
type={submit ? 'submit' : 'button'}
|
type={submit ? 'submit' : 'button'}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
navigator.clipboard.writeText(src)
|
navigator.clipboard.writeText(src)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
@@ -64,7 +67,7 @@
|
|||||||
<pre
|
<pre
|
||||||
bind:this={pre}
|
bind:this={pre}
|
||||||
{...$$restProps}
|
{...$$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}
|
{#if htmlSrc}
|
||||||
{@html htmlSrc}
|
{@html htmlSrc}
|
||||||
{:else if $$slots.default}
|
{:else if $$slots.default}
|
||||||
|
|||||||
@@ -10,11 +10,14 @@
|
|||||||
export let copy: boolean = true
|
export let copy: boolean = true
|
||||||
|
|
||||||
let copied = false
|
let copied = false
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<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
|
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">
|
<pre class="overflow-auto max-w-full whitespace-nowrap w-max">
|
||||||
{value}
|
{value}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
|
|
||||||
export let open: boolean = false
|
export let open: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div {...$$restProps} class={$$props.class}>
|
<div {...$$restProps} class={clazz}>
|
||||||
<button on:click={() => (open = !open)} class="w-full">
|
<button on:click={() => (open = !open)} class="w-full">
|
||||||
<slot name="summary" {open} />
|
<slot name="summary" {open} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -3,14 +3,12 @@
|
|||||||
|
|
||||||
export let group: string = generateID()
|
export let group: string = generateID()
|
||||||
export let row: boolean = true
|
export let row: boolean = true
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 max-w-full">
|
<div class="flex flex-col gap-1 max-w-full">
|
||||||
<div
|
<div class="flex {row ? 'flex-row flex-wrap' : 'flex-col'} gap-4 {clazz}">
|
||||||
class="flex {row
|
|
||||||
? 'flex-row flex-wrap'
|
|
||||||
: 'flex-col'} gap-4 {$$props.class || ''}"
|
|
||||||
>
|
|
||||||
<slot {group} />
|
<slot {group} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -13,9 +13,12 @@
|
|||||||
|
|
||||||
$: previewURLs =
|
$: previewURLs =
|
||||||
preview && files ? Array.from(files).map(URL.createObjectURL) : undefined
|
preview && files ? Array.from(files).map(URL.createObjectURL) : undefined
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {$$props.class}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
{#if $$slots.label || label}
|
{#if $$slots.label || label}
|
||||||
<Label for={id} text={label}>
|
<Label for={id} text={label}>
|
||||||
<slot name="label" />
|
<slot name="label" />
|
||||||
|
|||||||
@@ -1,22 +1,25 @@
|
|||||||
<script lang="ts">
|
<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>
|
</script>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
on:submit={(e) => dispatcher('submit', e)}
|
on:submit={(e) => dispatcher('submit', e)}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class="flex flex-col gap-4 {$$props.class}"
|
class="flex flex-col gap-4 {clazz}"
|
||||||
>
|
>
|
||||||
{#if title || $$slots.title}
|
{#if title || $$slots.title}
|
||||||
{#if $$slots.title}
|
{#if $$slots.title}
|
||||||
<slot name="title" />
|
<slot name="title" />
|
||||||
{:else if title}
|
{:else if title}
|
||||||
<h1 class="text-2xl font-bold">{title}</h1>
|
<h1 class="text-2xl font-bold">{title}</h1>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<slot />
|
<slot />
|
||||||
</form>
|
</form>
|
||||||
@@ -1,21 +1,24 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let forID: string | undefined = undefined
|
let forID: string | undefined = undefined
|
||||||
export { forID as for }
|
export { forID as for }
|
||||||
/**
|
/**
|
||||||
* The `text` prop will take precedence over the slot.
|
* The `text` prop will take precedence over the slot.
|
||||||
*/
|
*/
|
||||||
export let text: string | undefined = undefined
|
export let text: string | undefined = undefined
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:element
|
<svelte:element
|
||||||
this={forID ? 'label' : 'span'}
|
this={forID ? 'label' : 'span'}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
for={forID}
|
for={forID}
|
||||||
class="text-sm text-slate-800 dark:text-zinc-200 font-medium w-full {$$props.class || ''}"
|
class="text-sm text-slate-800 dark:text-zinc-200 font-medium w-full {clazz ||
|
||||||
|
''}"
|
||||||
>
|
>
|
||||||
{#if text}
|
{#if text}
|
||||||
{text}
|
{text}
|
||||||
{:else if $$slots.default}
|
{:else if $$slots.default}
|
||||||
<slot />
|
<slot />
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:element>
|
</svelte:element>
|
||||||
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
export let group: string = generateID()
|
export let group: string = generateID()
|
||||||
export let row: boolean = false
|
export let row: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<div
|
<div
|
||||||
class="flex {row
|
class="flex {row ? 'flex-row flex-wrap' : 'flex-col'} gap-4 {clazz || ''}"
|
||||||
? 'flex-row flex-wrap'
|
|
||||||
: 'flex-col'} gap-4 {$$props.class || ''}"
|
|
||||||
>
|
>
|
||||||
<slot {group} />
|
<slot {group} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,9 +48,11 @@
|
|||||||
contextmenu: any
|
contextmenu: any
|
||||||
input: any
|
input: any
|
||||||
}>()
|
}>()
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {$$props.class}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
{#if $$slots.label || label}
|
{#if $$slots.label || label}
|
||||||
<Label for={id} text={label}>
|
<Label for={id} text={label}>
|
||||||
<slot name="label" />
|
<slot name="label" />
|
||||||
@@ -67,7 +69,7 @@
|
|||||||
shadow
|
shadow
|
||||||
]} {buttonColor.secondary} appearance-none transition-colors rounded-lg text-sm
|
]} {buttonColor.secondary} appearance-none transition-colors rounded-lg text-sm
|
||||||
w-full min-w-full cursor-pointer pr-6 {buttonColor.secondary}
|
w-full min-w-full cursor-pointer pr-6 {buttonColor.secondary}
|
||||||
{$$props.class}"
|
{clazz}"
|
||||||
bind:value
|
bind:value
|
||||||
on:mousedown={(e) => {
|
on:mousedown={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let defaultValue: boolean = false
|
export let defaultValue: boolean = false
|
||||||
export let checked: boolean = defaultValue
|
export let checked: boolean = defaultValue
|
||||||
|
|
||||||
|
export let labelClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</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
|
<div
|
||||||
class="w-11 h-6 rounded-full relative z-[inherit] cursor-pointer flex flex-row transition-colors shadow-sm
|
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'}
|
{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"
|
rtl:peer-checked:-translate-x-5 rtl:group-active:peer-checked:-translate-x-4"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col {$$props.labelClass}">
|
<div class="flex flex-col {labelClass}">
|
||||||
<slot />
|
<slot />
|
||||||
{#if $$slots.description}
|
{#if $$slots.description}
|
||||||
<span class="font-normal text-sm text-slate-700 dark:text-zinc-300">
|
<span class="font-normal text-sm text-slate-700 dark:text-zinc-300">
|
||||||
|
|||||||
@@ -26,9 +26,11 @@
|
|||||||
const borderClass = `
|
const borderClass = `
|
||||||
border border-slate-200 dark:border-zinc-800
|
border border-slate-200 dark:border-zinc-800
|
||||||
`
|
`
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {$$props.class}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
{#if $$slots.label || label}
|
{#if $$slots.label || label}
|
||||||
<Label
|
<Label
|
||||||
for={id}
|
for={id}
|
||||||
@@ -41,7 +43,7 @@
|
|||||||
</Label>
|
</Label>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<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
|
<textarea
|
||||||
{id}
|
{id}
|
||||||
@@ -62,7 +64,7 @@
|
|||||||
dark:ring-zinc-200/50 transition-all text-sm w-full disabled:bg-slate-100
|
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
|
disabled:cursor-not-allowed disabled:dark:bg-zinc-900 invalid:!border-red-500
|
||||||
peer invalid:text-red-500 z-10
|
peer invalid:text-red-500 z-10
|
||||||
{$$props.class || ''}"
|
{clazz || ''}"
|
||||||
class:rounded-b-none={$$slots.suffix}
|
class:rounded-b-none={$$slots.suffix}
|
||||||
class:border-b-0={$$slots.suffix}
|
class:border-b-0={$$slots.suffix}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -32,9 +32,11 @@
|
|||||||
const borderClass = `
|
const borderClass = `
|
||||||
border border-slate-200 border-b-slate-300 dark:border-zinc-900 dark:border-t-zinc-800
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {$$props.class}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
{#if $$slots.label || label}
|
{#if $$slots.label || label}
|
||||||
<Label
|
<Label
|
||||||
for={id}
|
for={id}
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring-2
|
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring-2
|
||||||
ring-slate-300 dark:ring-zinc-700
|
ring-slate-300 dark:ring-zinc-700
|
||||||
transition-colors
|
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}
|
{#if $$slots.prefix}
|
||||||
<div
|
<div
|
||||||
@@ -78,7 +80,7 @@
|
|||||||
focus:outline-none rounded-lg text-sm w-full disabled:bg-slate-100
|
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
|
disabled:cursor-not-allowed disabled:dark:bg-zinc-950 invalid:!border-red-500
|
||||||
peer invalid:text-red-500 z-10
|
peer invalid:text-red-500 z-10
|
||||||
{$$props.class || ''}"
|
{clazz || ''}"
|
||||||
class:rounded-l-none={$$slots.prefix}
|
class:rounded-l-none={$$slots.prefix}
|
||||||
class:border-l-0={$$slots.prefix && inlineAffixes}
|
class:border-l-0={$$slots.prefix && inlineAffixes}
|
||||||
class:rounded-r-none={$$slots.suffix}
|
class:rounded-r-none={$$slots.suffix}
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
export let color: Color = 'default'
|
export let color: Color = 'default'
|
||||||
|
|
||||||
export let element: string = 'div'
|
export let element: string = 'div'
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:element
|
<svelte:element
|
||||||
@@ -64,7 +66,7 @@
|
|||||||
{roundedClass[rounding]}
|
{roundedClass[rounding]}
|
||||||
{colorClass[color]}
|
{colorClass[color]}
|
||||||
text-sm
|
text-sm
|
||||||
{$$props.class}
|
{clazz}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
flip(),
|
flip(),
|
||||||
]
|
]
|
||||||
export let strategy: Strategy = 'absolute'
|
export let strategy: Strategy = 'absolute'
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Popover
|
<Popover
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
bind:open
|
bind:open
|
||||||
popoverClass="backdrop-blur-xl rounded-xl w-full max-w-[280px]"
|
popoverClass="backdrop-blur-xl rounded-xl w-full max-w-[280px]"
|
||||||
class={$$props.class}
|
class={clazz}
|
||||||
>
|
>
|
||||||
<slot name="target" slot="target" />
|
<slot name="target" slot="target" />
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
export let alignment: ButtonAlignment = 'left'
|
export let alignment: ButtonAlignment = 'left'
|
||||||
export let href: string | undefined = undefined
|
export let href: string | undefined = undefined
|
||||||
export let disabled: boolean = false
|
export let disabled: boolean = false
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -19,7 +21,7 @@
|
|||||||
? 'opacity-70 pointer-events-none cursor-not-allowed'
|
? 'opacity-70 pointer-events-none cursor-not-allowed'
|
||||||
: ''} {color == 'tertiary'
|
: ''} {color == 'tertiary'
|
||||||
? 'hover:dark:bg-zinc-800/70'
|
? 'hover:dark:bg-zinc-800/70'
|
||||||
: ''} duration-100 {$$props.class}"
|
: ''} duration-100 {clazz}"
|
||||||
{alignment}
|
{alignment}
|
||||||
{href}
|
{href}
|
||||||
{disabled}
|
{disabled}
|
||||||
|
|||||||
@@ -62,6 +62,10 @@
|
|||||||
floatingRef(node)
|
floatingRef(node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let popoverClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:body
|
<svelte:body
|
||||||
@@ -92,9 +96,7 @@
|
|||||||
}}
|
}}
|
||||||
role="menu"
|
role="menu"
|
||||||
type="button"
|
type="button"
|
||||||
class="{canUseContents
|
class="{canUseContents ? 'contents text-left' : 'w-max h-max'} {clazz}"
|
||||||
? 'contents text-left'
|
|
||||||
: 'w-max h-max'} {$$props.class}"
|
|
||||||
bind:this={el}
|
bind:this={el}
|
||||||
use:customFloatingRef
|
use:customFloatingRef
|
||||||
>
|
>
|
||||||
@@ -106,7 +108,7 @@
|
|||||||
<Portal class="z-[150]">
|
<Portal class="z-[150]">
|
||||||
<div
|
<div
|
||||||
transition:scale={{ duration: 200, start: 0.96, easing: backOut }}
|
transition:scale={{ duration: 200, start: 0.96, easing: backOut }}
|
||||||
class="z-[150] {$$props.popoverClass}"
|
class="z-[150] {popoverClass}"
|
||||||
use:customFloatingContent
|
use:customFloatingContent
|
||||||
use:focusTrap
|
use:focusTrap
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,34 +1,37 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
|
|
||||||
// https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516
|
// https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516
|
||||||
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
||||||
let slottedElements: HTMLDivElement, portal: HTMLDivElement
|
let slottedElements: HTMLDivElement, portal: HTMLDivElement
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{ mounted: void }>()
|
const dispatch = createEventDispatcher<{ mounted: void }>()
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (!browser) return
|
if (!browser) return
|
||||||
portal = document?.createElement('div')
|
portal = document?.createElement('div')
|
||||||
if (portal) portal.className = 'portal-mount'
|
if (portal) portal.className = 'portal-mount'
|
||||||
document?.body.appendChild(portal)
|
document?.body.appendChild(portal)
|
||||||
portal?.appendChild(slottedElements)
|
portal?.appendChild(slottedElements)
|
||||||
dispatch('mounted')
|
dispatch('mounted')
|
||||||
})
|
})
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
portal.remove()
|
portal.remove()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="portal-initial-mount-point">
|
<div class="portal-initial-mount-point">
|
||||||
<div bind:this={slottedElements} class="portal-content {$$props.class || ''}">
|
<div bind:this={slottedElements} class="portal-content {clazz || ''}">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.portal-initial-mount-point {
|
.portal-initial-mount-point {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -6,9 +6,12 @@
|
|||||||
export let badge: string | undefined = undefined
|
export let badge: string | undefined = undefined
|
||||||
|
|
||||||
export let link: string = '#'
|
export let link: string = '#'
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col w-max {$$props.class}">
|
<div class="flex flex-col w-max {clazz}">
|
||||||
<a
|
<a
|
||||||
href={link}
|
href={link}
|
||||||
class="text-base font-medium inline-flex items-center gap-2 {link != '#'
|
class="text-base font-medium inline-flex items-center gap-2 {link != '#'
|
||||||
|
|||||||
@@ -15,10 +15,16 @@
|
|||||||
tablet: true,
|
tablet: true,
|
||||||
mobile: true,
|
mobile: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let mainClass: string = ''
|
||||||
|
export let itemsClass: string = ''
|
||||||
|
export let optionsClass: string = ''
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<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)}
|
{#if Object.values(supportedPlatforms).some((v) => v == false)}
|
||||||
<div class="flex items-center gap-2 flex-wrap">
|
<div class="flex items-center gap-2 flex-wrap">
|
||||||
@@ -43,10 +49,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<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
|
<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>
|
<h1 class="font-medium text-base"><slot name="title" /></h1>
|
||||||
{#if $$slots.description}
|
{#if $$slots.description}
|
||||||
@@ -58,7 +64,7 @@
|
|||||||
{#if $$slots.default}
|
{#if $$slots.default}
|
||||||
<div
|
<div
|
||||||
class="w-full flex flex-col gap-2 flex-1 max-w-full
|
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 />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,11 +5,14 @@
|
|||||||
export let value: string
|
export let value: string
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{ change: string }>()
|
const dispatch = createEventDispatcher<{ change: string }>()
|
||||||
|
|
||||||
|
let clazz: string = ''
|
||||||
|
export { clazz as class }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="w-full h-8 relative rounded-md border dark:border-zinc-600 hover:dark:border-zinc-400
|
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});"
|
style="background-color: rgb({value});"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in new issue
Block a user