feat: receive messages

This commit is contained in:
Shibo Lyu 2024-09-01 17:51:07 +08:00
parent a0fd2df1e5
commit cd68c982c8
19 changed files with 276 additions and 27 deletions

View file

@ -4,8 +4,11 @@
type HTMLButtonOrAnchorAttributes = Partial<HTMLAnchorAttributes> & Partial<HTMLButtonAttributes>;
interface $$Props extends HTMLButtonOrAnchorAttributes {}
interface $$Props extends HTMLButtonOrAnchorAttributes {
variant?: 'primary' | 'secondary';
}
export let variant: $$Props['variant'] = 'secondary';
let className: string | null = '';
export { className as class };
@ -17,6 +20,8 @@
{href}
class={tw(
'inline-flex cursor-default items-center justify-center rounded-md px-2 py-1 text-sf-secondary shadow-sm ring-1 ring-ss-secondary transition-shadow duration-200 hover:ring-ss-primary active:shadow-inner',
variant === 'primary' &&
'relative text-slate-50 ring-0 duration-200 before:absolute before:-inset-px before:rounded-[7px] before:bg-gradient-to-b before:from-accent-400 before:from-40% before:to-accent-500 before:ring-1 before:ring-inset before:ring-black/10 before:transition-shadow active:before:shadow-inner',
className
)}
{...$$restProps}
@ -24,5 +29,9 @@
role="button"
tabindex="0"
>
<slot />
{#if variant === 'primary'}
<div class="z-10 drop-shadow-[0_-1px_0_theme(colors.black/0.2)]"><slot /></div>
{:else}
<slot />
{/if}
</svelte:element>