aboutsummaryrefslogtreecommitdiffstats
path: root/code/frontend/src/components/ui/button/button.svelte
blob: 9dbc777fc59627f7b95f3248a3bcddffa2aa0c88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script lang="ts">
	import { Button as ButtonPrimitive } from 'bits-ui'
	import { type Events, type Props, buttonVariants } from './index'
	import { cn } from '$utils/ui'

	type $$Props = Props
	type $$Events = Events

	let className: $$Props['class'] = undefined
	export let variant: $$Props['variant'] = 'default'
	export let size: $$Props['size'] = 'default'
	export let builders: $$Props['builders'] = []
	export { className as class }
</script>

<ButtonPrimitive.Root
	{builders}
	class={cn(buttonVariants({ variant, size, className }))}
	type="button"
	{...$$restProps}
	on:click
	on:keydown
>
	<slot />
</ButtonPrimitive.Root>