From ced66c5807575cd29f6aa5632e8ad02b38c8448a Mon Sep 17 00:00:00 2001
From: ivar <i@oiee.no>
Date: Sun, 28 Apr 2024 22:37:30 +0200
Subject: WIP new frontend

---
 .../dropdown-menu/dropdown-menu-sub-trigger.svelte | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 code/frontend/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte

(limited to 'code/frontend/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte')

diff --git a/code/frontend/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte b/code/frontend/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte
new file mode 100644
index 0000000..4967d2b
--- /dev/null
+++ b/code/frontend/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte
@@ -0,0 +1,32 @@
+<script lang="ts">
+	import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
+	import ChevronRight from 'svelte-radix/ChevronRight.svelte'
+	import { cn } from '$utils/ui'
+
+	type $$Props = DropdownMenuPrimitive.SubTriggerProps & {
+		inset?: boolean
+	}
+	type $$Events = DropdownMenuPrimitive.SubTriggerEvents
+
+	let className: $$Props['class'] = undefined
+	export let inset: $$Props['inset'] = undefined
+	export { className as class }
+</script>
+
+<DropdownMenuPrimitive.SubTrigger
+	class={cn(
+		'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground',
+		inset && 'pl-8',
+		className
+	)}
+	{...$$restProps}
+	on:click
+	on:keydown
+	on:focusin
+	on:focusout
+	on:pointerleave
+	on:pointermove
+>
+	<slot />
+	<ChevronRight class="ml-auto h-4 w-4" />
+</DropdownMenuPrimitive.SubTrigger>
-- 
cgit v1.3

