feat: better components
This commit is contained in:
27
client/src/lib/ui/dropdown-menu/dropdown-menu-item.svelte
Normal file
27
client/src/lib/ui/dropdown-menu/dropdown-menu-item.svelte
Normal file
@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { cn } from '$lib/utils.js';
|
||||
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
class: className,
|
||||
...restProps
|
||||
}: DropdownMenuPrimitive.ItemProps = $props();
|
||||
</script>
|
||||
|
||||
<DropdownMenuPrimitive.Item
|
||||
bind:ref
|
||||
data-slot="dropdown-menu-item"
|
||||
class={cn(
|
||||
'focus:bg-surface text-text relative flex cursor-pointer items-center gap-2 px-4 py-2 text-sm outline-hidden transition-all select-none',
|
||||
|
||||
// Disabled
|
||||
'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
||||
|
||||
// Images
|
||||
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
||||
|
||||
className
|
||||
)}
|
||||
{...restProps}
|
||||
/>
|
Reference in New Issue
Block a user