design: fix broken commands styling
This commit is contained in:
8 files changed
+44
-23
No files matched your search
@@ -57,7 +57,7 @@
|
||||
size="sm"
|
||||
class="text-slate-500 dark:text-zinc-400"
|
||||
onclick={() => (replying = !replying)}
|
||||
disabled={comment.post.locked || disabled}
|
||||
disabled={comment.post.locked || disabled || !profile.current.jwt}
|
||||
>
|
||||
<Icon src={ChatBubbleOvalLeft} size="15" micro />
|
||||
{$t('comment.reply')}
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<div class="flex flex-row">
|
||||
<MenuButton
|
||||
onclick={() => share()}
|
||||
class={['flex-1', !post.post.local && 'rounded-r-xl']}
|
||||
class={['flex-1', !post.post.local && 'rounded-r-lg']}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={Share} size="16" micro />
|
||||
@@ -84,11 +84,11 @@
|
||||
</MenuButton>
|
||||
<!--svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!--svelte-ignore a11y_click_events_have_key_events-->
|
||||
<div
|
||||
class="aspect-square w-max m-1 grid place-items-center"
|
||||
onclick={e => e.stopPropagation()}
|
||||
>
|
||||
{#if !post.post.local}
|
||||
{#if !post.post.local}
|
||||
<div
|
||||
class="aspect-square w-max m-1 grid place-items-center"
|
||||
onclick={e => e.stopPropagation()}
|
||||
>
|
||||
<Menu>
|
||||
{#snippet target()}
|
||||
<Button
|
||||
@@ -120,8 +120,8 @@
|
||||
{$t('filter.location.local')}
|
||||
</MenuButton>
|
||||
</Menu>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if profile.current?.jwt}
|
||||
<MenuButton
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
const sizes = {
|
||||
xs: 'text-xs px-3 mt-3 mb-1',
|
||||
xs: 'text-xs',
|
||||
sm: 'text-sm',
|
||||
md: 'text-base',
|
||||
lg: 'text-lg',
|
||||
}
|
||||
|
||||
const margins = {
|
||||
none: '',
|
||||
sm: 'mt-3 mb-1 px-3',
|
||||
md: 'mt-4 mb-2',
|
||||
lg: 'mt-5 mb-3',
|
||||
}
|
||||
|
||||
const colors = {
|
||||
subtle: 'text-slate-600 dark:text-zinc-400',
|
||||
none: '',
|
||||
@@ -17,6 +24,7 @@
|
||||
class?: ClassValue
|
||||
size?: keyof typeof sizes
|
||||
color?: keyof typeof colors
|
||||
margin?: keyof typeof margins
|
||||
border?: boolean
|
||||
children?: import('svelte').Snippet
|
||||
action?: import('svelte').Snippet
|
||||
@@ -29,6 +37,7 @@
|
||||
border = true,
|
||||
size = 'sm',
|
||||
color = 'subtle',
|
||||
margin = 'none',
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
@@ -37,6 +46,7 @@
|
||||
'flex flex-row items-center gap-2 flex-wrap',
|
||||
sizes[size],
|
||||
colors[color],
|
||||
margins[margin],
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
@@ -45,7 +55,7 @@
|
||||
</h3>
|
||||
<div
|
||||
class={[
|
||||
'flex-1 border-slate-200 dark:border-zinc-800 border-b',
|
||||
'flex-1 border-slate-200/70 dark:border-zinc-800 border-b',
|
||||
!border && 'opacity-0',
|
||||
]}
|
||||
></div>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
alignment="left"
|
||||
color="none"
|
||||
size="custom"
|
||||
class="block w-full"
|
||||
data-sveltekit-preload-code="viewport"
|
||||
data-sveltekit-preload-data="tap"
|
||||
{...rest}
|
||||
@@ -28,21 +29,27 @@
|
||||
{#if typeof action.icon === 'string'}
|
||||
<Avatar url={action.icon} width={20} />
|
||||
{:else}
|
||||
<Icon src={action.icon ?? QuestionMarkCircle} size="20" />
|
||||
<Icon
|
||||
src={action.icon ?? QuestionMarkCircle}
|
||||
solid
|
||||
size="20"
|
||||
class="text-slate-600 dark:text-zinc-400"
|
||||
/>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
<span class="mr-auto inline-flex flex-col">
|
||||
<div class="inline-flex flex-col">
|
||||
<span>{action.name}</span>
|
||||
{#if action.detail}
|
||||
<span class="font-normal text-xs">{action.detail}</span>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex-1"></div>
|
||||
{#if action.shortcut}
|
||||
<div class="flex items-center gap-0.5 text-xs font-medium">
|
||||
⌘ {action.shortcut}
|
||||
</div>
|
||||
{/if}
|
||||
{#if action.subActions}
|
||||
<Icon src={ArrowUturnDown} size="16" micro />
|
||||
<Icon src={ArrowUturnDown} size="16" micro class="" />
|
||||
{/if}
|
||||
</Button>
|
||||
@@ -13,6 +13,7 @@
|
||||
import CommandItem from './CommandItem.svelte'
|
||||
import { fuzzySearch } from '$lib/util.svelte'
|
||||
import CommonList from '../../layout/CommonList.svelte'
|
||||
import EndPlaceholder from '../../EndPlaceholder.svelte'
|
||||
|
||||
interface Props {
|
||||
open?: boolean
|
||||
@@ -253,7 +254,7 @@
|
||||
<div class="space-y-1" bind:this={container}>
|
||||
{#each filteredGroups as group, groupIndex}
|
||||
<div class="space-y-1">
|
||||
<span class="text-sm font-medium">{group.name}</span>
|
||||
<EndPlaceholder margin="md" size="sm">{group.name}</EndPlaceholder>
|
||||
<CommonList size="xs" class="p-0! sm:p-0! lg:p-0!">
|
||||
{#each group.actions as action, actionIndex}
|
||||
{@const globalIndex =
|
||||
@@ -263,7 +264,8 @@
|
||||
<li
|
||||
class={[
|
||||
'custom-size',
|
||||
globalIndex == selectedIndex && 'brightness-125',
|
||||
globalIndex == selectedIndex &&
|
||||
'brightness-95 dark:brightness-125',
|
||||
]}
|
||||
>
|
||||
<CommandItem
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
{style}
|
||||
>
|
||||
<ProfileSelection profiles={profile.meta.profiles} />
|
||||
<EndPlaceholder size="xs">{$t('profile.profile')}</EndPlaceholder>
|
||||
<EndPlaceholder margin="sm" size="xs">{$t('profile.profile')}</EndPlaceholder>
|
||||
{#if profile.current?.jwt}
|
||||
<SidebarButton
|
||||
icon={UserCircle}
|
||||
@@ -76,7 +76,7 @@
|
||||
icon={UserGroup}
|
||||
/>
|
||||
{/if}
|
||||
<EndPlaceholder size="xs">{$t('nav.menu.app')}</EndPlaceholder>
|
||||
<EndPlaceholder margin="sm" size="xs">{$t('nav.menu.app')}</EndPlaceholder>
|
||||
<SidebarButton
|
||||
href="/settings"
|
||||
label={$t('nav.menu.settings')}
|
||||
@@ -107,7 +107,9 @@
|
||||
</Select>
|
||||
<SidebarButton href="/theme" label={$t('nav.menu.theme')} icon={Swatch} />
|
||||
{#if profile.current?.user}
|
||||
<EndPlaceholder size="xs">{$t('content.communities')}</EndPlaceholder>
|
||||
<EndPlaceholder margin="sm" size="xs">
|
||||
{$t('content.communities')}
|
||||
</EndPlaceholder>
|
||||
|
||||
<div class="space-y-3">
|
||||
{#if profile.current?.user.moderates.length > 0}
|
||||
|
||||
@@ -102,7 +102,7 @@ bg-white/50 dark:bg-black/50 box-border p-4"
|
||||
dark:border-zinc-900
|
||||
rounded-3xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto
|
||||
p-5 flex flex-col gap-2 dark:bg-zinc-950
|
||||
bg-white relative {clazz}"
|
||||
bg-slate-50 relative {clazz}"
|
||||
>
|
||||
{#if dismissable}
|
||||
<Button
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
>
|
||||
{#snippet popover()}
|
||||
<div
|
||||
class="w-full max-w-sm origin-top-left max-h-128 overflow-auto list-none shadow-lg rounded-xl"
|
||||
class="w-full max-w-sm max-h-128 overflow-auto list-none shadow-lg rounded-xl"
|
||||
>
|
||||
<div
|
||||
class="flex flex-col p-1 list-none bg-white/80 dark:bg-zinc-900/90 rounded-xl
|
||||
border border-slate-300 dark:border-zinc-800 border-opacity-50 gap-px"
|
||||
border border-slate-200 dark:border-zinc-800 gap-px"
|
||||
>
|
||||
{@render children?.(open)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user