diff --git a/frontend/bun.lockb b/frontend/bun.lockb index 71b8e88..12c1b71 100755 Binary files a/frontend/bun.lockb and b/frontend/bun.lockb differ diff --git a/frontend/package.json b/frontend/package.json index b65beb3..9062b0d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,8 +35,9 @@ "@types/he": "^1.2.3", "apexcharts": "^3.44.0", "argon2": "^0.31.2", - "bits-ui": "^0.9.8", + "bits-ui": "^0.18.2", "clsx": "^2.0.0", + "cmdk-sv": "^0.0.13", "drizzle-orm": "^0.29.0", "formsnap": "^0.4.1", "he": "^1.2.0", diff --git a/frontend/src/lib/components/ui/command/command-dialog.svelte b/frontend/src/lib/components/ui/command/command-dialog.svelte new file mode 100644 index 0000000..ecbf940 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-dialog.svelte @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/frontend/src/lib/components/ui/command/command-empty.svelte b/frontend/src/lib/components/ui/command/command-empty.svelte new file mode 100644 index 0000000..dc74bf5 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-empty.svelte @@ -0,0 +1,12 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/command-group.svelte b/frontend/src/lib/components/ui/command/command-group.svelte new file mode 100644 index 0000000..198a3df --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-group.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/command-input.svelte b/frontend/src/lib/components/ui/command/command-input.svelte new file mode 100644 index 0000000..cfab3d9 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-input.svelte @@ -0,0 +1,23 @@ + + +
+ + +
diff --git a/frontend/src/lib/components/ui/command/command-item.svelte b/frontend/src/lib/components/ui/command/command-item.svelte new file mode 100644 index 0000000..1544991 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-item.svelte @@ -0,0 +1,24 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/command-list.svelte b/frontend/src/lib/components/ui/command/command-list.svelte new file mode 100644 index 0000000..6b1c915 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-list.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/command-separator.svelte b/frontend/src/lib/components/ui/command/command-separator.svelte new file mode 100644 index 0000000..51aa2da --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-separator.svelte @@ -0,0 +1,10 @@ + + + diff --git a/frontend/src/lib/components/ui/command/command-shortcut.svelte b/frontend/src/lib/components/ui/command/command-shortcut.svelte new file mode 100644 index 0000000..517e9e9 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command-shortcut.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/command.svelte b/frontend/src/lib/components/ui/command/command.svelte new file mode 100644 index 0000000..2806759 --- /dev/null +++ b/frontend/src/lib/components/ui/command/command.svelte @@ -0,0 +1,22 @@ + + + + + diff --git a/frontend/src/lib/components/ui/command/index.ts b/frontend/src/lib/components/ui/command/index.ts new file mode 100644 index 0000000..d8a2e7c --- /dev/null +++ b/frontend/src/lib/components/ui/command/index.ts @@ -0,0 +1,37 @@ +import { Command as CommandPrimitive } from "cmdk-sv"; + +import Root from "./command.svelte"; +import Dialog from "./command-dialog.svelte"; +import Empty from "./command-empty.svelte"; +import Group from "./command-group.svelte"; +import Item from "./command-item.svelte"; +import Input from "./command-input.svelte"; +import List from "./command-list.svelte"; +import Separator from "./command-separator.svelte"; +import Shortcut from "./command-shortcut.svelte"; + +const Loading = CommandPrimitive.Loading; + +export { + Root, + Dialog, + Empty, + Group, + Item, + Input, + List, + Separator, + Shortcut, + Loading, + // + Root as Command, + Dialog as CommandDialog, + Empty as CommandEmpty, + Group as CommandGroup, + Item as CommandItem, + Input as CommandInput, + List as CommandList, + Separator as CommandSeparator, + Shortcut as CommandShortcut, + Loading as CommandLoading, +}; diff --git a/frontend/src/lib/components/ui/popover/index.ts b/frontend/src/lib/components/ui/popover/index.ts new file mode 100644 index 0000000..fa05ad0 --- /dev/null +++ b/frontend/src/lib/components/ui/popover/index.ts @@ -0,0 +1,14 @@ +import { Popover as PopoverPrimitive } from "bits-ui"; +import Content from "./popover-content.svelte"; +const Root = PopoverPrimitive.Root; +const Trigger = PopoverPrimitive.Trigger; + +export { + Root, + Content, + Trigger, + // + Root as Popover, + Content as PopoverContent, + Trigger as PopoverTrigger, +}; diff --git a/frontend/src/lib/components/ui/popover/popover-content.svelte b/frontend/src/lib/components/ui/popover/popover-content.svelte new file mode 100644 index 0000000..a6cb199 --- /dev/null +++ b/frontend/src/lib/components/ui/popover/popover-content.svelte @@ -0,0 +1,22 @@ + + + + + diff --git a/frontend/src/routes/(app)/links/+page.server.ts b/frontend/src/routes/(app)/links/+page.server.ts index 7faed2d..a1e1f1a 100644 --- a/frontend/src/routes/(app)/links/+page.server.ts +++ b/frontend/src/routes/(app)/links/+page.server.ts @@ -9,7 +9,7 @@ export const load = (async (event) => { let project_id: number | undefined let selected_project: { value: null | string; label: string } = { value: null, - label: 'None', + label: 'All', } if (project_uuid) { diff --git a/frontend/src/routes/(app)/links/+page.svelte b/frontend/src/routes/(app)/links/+page.svelte index d7874f1..669f5c4 100644 --- a/frontend/src/routes/(app)/links/+page.svelte +++ b/frontend/src/routes/(app)/links/+page.svelte @@ -6,6 +6,8 @@ import * as Card from '$lib/components/ui/card' import * as DropdownMenu from '$lib/components/ui/dropdown-menu' import * as Select from '$lib/components/ui/select' + import * as Command from '$lib/components/ui/command' + import * as Popover from '$lib/components/ui/popover' import { Input } from '$lib/components/ui/input' import { Label } from '$lib/components/ui/label' import { Badge } from '$lib/components/ui/badge' @@ -15,15 +17,16 @@ Loader2, MoreVertical, QrCode, + Check, + ChevronsUpDown, } from 'lucide-svelte' import { goto, invalidateAll } from '$app/navigation' + import { cn } from '$lib/utils' import Qr from '$lib/components/QR.svelte' import AddShortenerDialog from './(component)/AddShortenerDialog.svelte' export let data: PageData - let selectedProject: any = data.selected_project - let dialogOpen = false let editDialogOpen = false @@ -32,6 +35,11 @@ let editShortenerCategory: any = undefined let isEditLoading = false + let open: boolean = false + let selectedProject: any = data.selected_project.label + + $: selectedProject = data.selected_project.label + const openEditDialog = (code: string, link: string) => { editDialogOpen = true editShortenerCode = code @@ -82,26 +90,51 @@
- - - - - - - Project - - None - - {#each data.projects as project} - - {project.name} + + + + + + + + No project found. + + + (open = false)}> + + All + - {/each} - - - - + {#each data.projects as project} + + (open = false)}> + + {project.name} + + + {/each} + + + +
{#if data.shorteners.length > 0}