design: add unified notifications button
This commit is contained in:
8 files changed
+112
-76
No files matched your search
@@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state'
|
||||
import { Button, buttonColor } from 'mono-svelte'
|
||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||
import { Button } from 'mono-svelte'
|
||||
import type { ButtonProps } from 'mono-svelte/button/Button.svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||
|
||||
interface Props extends ButtonProps {
|
||||
label: string
|
||||
@@ -35,31 +35,30 @@
|
||||
color="none"
|
||||
{...rest}
|
||||
class={[
|
||||
'shrink-0 rounded-full w-10 h-10 lg:w-max lg:h-8 lg:px-3 lg:rounded-xl',
|
||||
isSelected &&
|
||||
'bg-slate-200 dark:bg-zinc-900 text-primary-900 dark:text-primary-100!',
|
||||
!rest.color && buttonColor.tertiary,
|
||||
'shrink-0 rounded-full w-10 h-10 lg:w-max lg:h-8 lg:rounded-xl',
|
||||
!rest.color &&
|
||||
'lg:bg-white lg:dark:bg-zinc-900 border lg:border-slate-200 lg:border-b-slate-300 lg:dark:border-zinc-800 lg:dark:border-t-zinc-700/50 lg:hover:bg-slate-100 lg:dark:hover:bg-zinc-800 lg:active:bg-slate-200 lg:dark:active:bg-zinc-950',
|
||||
'hover:text-slate-900 dark:hover:text-zinc-50 transition-colors',
|
||||
isSelected
|
||||
? 'text-primary-900 dark:text-primary-100 max-lg:bg-slate-100 max-lg:dark:bg-zinc-800'
|
||||
: 'text-slate-600 dark:text-zinc-400',
|
||||
clazz,
|
||||
]}
|
||||
shadow="none"
|
||||
size="custom"
|
||||
rounding="none"
|
||||
{href}
|
||||
title={label}
|
||||
style="transition-property: background-color, filter;"
|
||||
aria-selected={isSelected}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
{#if icon}
|
||||
<div class="lg:hidden">
|
||||
<Icon src={icon} size="18" />
|
||||
</div>
|
||||
<div class="max-lg:hidden">
|
||||
<Icon src={icon} micro solid={isSelected} size="16" />
|
||||
</div>
|
||||
{:else}
|
||||
{@render customIcon?.({ size: 16, isSelected })}
|
||||
{/if}
|
||||
<div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}>
|
||||
{#if icon}
|
||||
<Icon src={icon} size="20" />
|
||||
{:else}
|
||||
{@render customIcon?.({ size: 16, isSelected })}
|
||||
{/if}
|
||||
</div>
|
||||
{/snippet}
|
||||
<span class="hidden {adaptive ? 'lg:block' : ''}">{label}</span>
|
||||
{@render children?.()}
|
||||
|
||||
Reference in new issue
Block a user