fix(web): avoid nesting buttons inside links (#11425)

This commit is contained in:
Michel Heusschen
2024-07-29 16:36:10 +02:00
committed by GitHub
parent 7bb7f63d57
commit 2e059bfbfd
15 changed files with 216 additions and 96 deletions
@@ -1,16 +1,22 @@
<script lang="ts" context="module">
export type Color = 'transparent-primary' | 'transparent-gray';
type BaseProps = {
color?: Color;
};
export type Props = (LinkProps & BaseProps) | (ButtonProps & BaseProps);
</script>
<script lang="ts">
import Button from './button.svelte';
import Button, { type ButtonProps, type LinkProps } from '$lib/components/elements/buttons/button.svelte';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type $$Props = Props;
export let color: Color = 'transparent-gray';
export let disabled = false;
export let fullwidth = false;
export let title: string | undefined = undefined;
</script>
<Button {title} size="link" {color} shadow={false} rounded="lg" {disabled} on:click {fullwidth}>
<Button size="link" {color} shadow={false} rounded="lg" on:click {...$$restProps}>
<slot />
</Button>