diff --git a/packages/web/bun.lockb b/packages/web/bun.lockb index 49fff1e..099b785 100755 Binary files a/packages/web/bun.lockb and b/packages/web/bun.lockb differ diff --git a/packages/web/package.json b/packages/web/package.json index 689b9e6..8936f8c 100755 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -25,12 +25,15 @@ "@types/eslint": "9.6.1", "@types/pg": "^8.11.10", "autoprefixer": "^10.4.20", + "bits-ui": "^0.22.0", "clsx": "^2.1.1", + "cmdk-sv": "^0.0.18", "drizzle-kit": "^0.30.1", "eslint": "9.17.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-svelte": "^2.46.1", "globals": "15.14.0", + "lucide-svelte": "^0.473.0", "postcss": "^8.4.49", "prettier": "3.4.2", "prettier-plugin-svelte": "3.3.2", @@ -48,6 +51,7 @@ "dependencies": { "@sveltejs/adapter-node": "^5.2.11", "drizzle-orm": "^0.38.3", + "mode-watcher": "^0.5.0", "postgres": "^3.4.5" } } diff --git a/packages/web/src/lib/components/ui/button/button.svelte b/packages/web/src/lib/components/ui/button/button.svelte new file mode 100644 index 0000000..86827f3 --- /dev/null +++ b/packages/web/src/lib/components/ui/button/button.svelte @@ -0,0 +1,25 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/button/index.ts b/packages/web/src/lib/components/ui/button/index.ts new file mode 100644 index 0000000..af1e188 --- /dev/null +++ b/packages/web/src/lib/components/ui/button/index.ts @@ -0,0 +1,49 @@ +import { type VariantProps, tv } from "tailwind-variants"; +import type { Button as ButtonPrimitive } from "bits-ui"; +import Root from "./button.svelte"; + +const buttonVariants = tv({ + base: "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + variants: { + variant: { + default: "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border-input bg-background hover:bg-accent hover:text-accent-foreground border", + secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, +}); + +type Variant = VariantProps["variant"]; +type Size = VariantProps["size"]; + +type Props = ButtonPrimitive.Props & { + variant?: Variant; + size?: Size; +}; + +type Events = ButtonPrimitive.Events; + +export { + Root, + type Props, + type Events, + // + Root as Button, + type Props as ButtonProps, + type Events as ButtonEvents, + buttonVariants, +}; diff --git a/packages/web/src/lib/components/ui/command/command-dialog.svelte b/packages/web/src/lib/components/ui/command/command-dialog.svelte new file mode 100644 index 0000000..68398a8 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-dialog.svelte @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/packages/web/src/lib/components/ui/command/command-empty.svelte b/packages/web/src/lib/components/ui/command/command-empty.svelte new file mode 100644 index 0000000..3a0819d --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-empty.svelte @@ -0,0 +1,12 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/command-group.svelte b/packages/web/src/lib/components/ui/command/command-group.svelte new file mode 100644 index 0000000..22f49a4 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-group.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/command-input.svelte b/packages/web/src/lib/components/ui/command/command-input.svelte new file mode 100644 index 0000000..3c50f23 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-input.svelte @@ -0,0 +1,23 @@ + + +
+ + +
diff --git a/packages/web/src/lib/components/ui/command/command-item.svelte b/packages/web/src/lib/components/ui/command/command-item.svelte new file mode 100644 index 0000000..a75acc8 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-item.svelte @@ -0,0 +1,24 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/command-list.svelte b/packages/web/src/lib/components/ui/command/command-list.svelte new file mode 100644 index 0000000..8ceda03 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-list.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/command-separator.svelte b/packages/web/src/lib/components/ui/command/command-separator.svelte new file mode 100644 index 0000000..71688b8 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-separator.svelte @@ -0,0 +1,10 @@ + + + diff --git a/packages/web/src/lib/components/ui/command/command-shortcut.svelte b/packages/web/src/lib/components/ui/command/command-shortcut.svelte new file mode 100644 index 0000000..c89bd61 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command-shortcut.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/command.svelte b/packages/web/src/lib/components/ui/command/command.svelte new file mode 100644 index 0000000..3889696 --- /dev/null +++ b/packages/web/src/lib/components/ui/command/command.svelte @@ -0,0 +1,22 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/command/index.ts b/packages/web/src/lib/components/ui/command/index.ts new file mode 100644 index 0000000..d8a2e7c --- /dev/null +++ b/packages/web/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/packages/web/src/lib/components/ui/dialog/dialog-content.svelte b/packages/web/src/lib/components/ui/dialog/dialog-content.svelte new file mode 100644 index 0000000..a06ccb2 --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-content.svelte @@ -0,0 +1,36 @@ + + + + + + + + + Close + + + diff --git a/packages/web/src/lib/components/ui/dialog/dialog-description.svelte b/packages/web/src/lib/components/ui/dialog/dialog-description.svelte new file mode 100644 index 0000000..8bc70cc --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-description.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/dialog/dialog-footer.svelte b/packages/web/src/lib/components/ui/dialog/dialog-footer.svelte new file mode 100644 index 0000000..a235d1f --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-footer.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/packages/web/src/lib/components/ui/dialog/dialog-header.svelte b/packages/web/src/lib/components/ui/dialog/dialog-header.svelte new file mode 100644 index 0000000..6b4448c --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/packages/web/src/lib/components/ui/dialog/dialog-overlay.svelte b/packages/web/src/lib/components/ui/dialog/dialog-overlay.svelte new file mode 100644 index 0000000..1d376e4 --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-overlay.svelte @@ -0,0 +1,21 @@ + + + diff --git a/packages/web/src/lib/components/ui/dialog/dialog-portal.svelte b/packages/web/src/lib/components/ui/dialog/dialog-portal.svelte new file mode 100644 index 0000000..eb5d0a5 --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-portal.svelte @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/dialog/dialog-title.svelte b/packages/web/src/lib/components/ui/dialog/dialog-title.svelte new file mode 100644 index 0000000..06574f3 --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/dialog-title.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/packages/web/src/lib/components/ui/dialog/index.ts b/packages/web/src/lib/components/ui/dialog/index.ts new file mode 100644 index 0000000..b17ba5e --- /dev/null +++ b/packages/web/src/lib/components/ui/dialog/index.ts @@ -0,0 +1,37 @@ +import { Dialog as DialogPrimitive } from "bits-ui"; + +import Title from "./dialog-title.svelte"; +import Portal from "./dialog-portal.svelte"; +import Footer from "./dialog-footer.svelte"; +import Header from "./dialog-header.svelte"; +import Overlay from "./dialog-overlay.svelte"; +import Content from "./dialog-content.svelte"; +import Description from "./dialog-description.svelte"; + +const Root = DialogPrimitive.Root; +const Trigger = DialogPrimitive.Trigger; +const Close = DialogPrimitive.Close; + +export { + Root, + Title, + Portal, + Footer, + Header, + Trigger, + Overlay, + Content, + Description, + Close, + // + Root as Dialog, + Title as DialogTitle, + Portal as DialogPortal, + Footer as DialogFooter, + Header as DialogHeader, + Trigger as DialogTrigger, + Overlay as DialogOverlay, + Content as DialogContent, + Description as DialogDescription, + Close as DialogClose, +}; diff --git a/packages/web/src/lib/components/ui/popover/index.ts b/packages/web/src/lib/components/ui/popover/index.ts new file mode 100644 index 0000000..63aecf9 --- /dev/null +++ b/packages/web/src/lib/components/ui/popover/index.ts @@ -0,0 +1,17 @@ +import { Popover as PopoverPrimitive } from "bits-ui"; +import Content from "./popover-content.svelte"; +const Root = PopoverPrimitive.Root; +const Trigger = PopoverPrimitive.Trigger; +const Close = PopoverPrimitive.Close; + +export { + Root, + Content, + Trigger, + Close, + // + Root as Popover, + Content as PopoverContent, + Trigger as PopoverTrigger, + Close as PopoverClose, +}; diff --git a/packages/web/src/lib/components/ui/popover/popover-content.svelte b/packages/web/src/lib/components/ui/popover/popover-content.svelte new file mode 100644 index 0000000..1d86206 --- /dev/null +++ b/packages/web/src/lib/components/ui/popover/popover-content.svelte @@ -0,0 +1,22 @@ + + + + + diff --git a/packages/web/src/routes/+layout.svelte b/packages/web/src/routes/+layout.svelte index f4ee004..18ccc64 100755 --- a/packages/web/src/routes/+layout.svelte +++ b/packages/web/src/routes/+layout.svelte @@ -1,5 +1,6 @@

{data.task?.name}

-

topics ({data.task?.tasksToTopics.length})

-
- - {#if addTopicsDropdownShown} -
- - -
- {/if} -
+

Topics ({data.task?.tasksToTopics.length})

+ + + + + + + + + + No topic found. + + {#each data.topics as topic} + { + value = topic.id.toString(); + closeAndFocusTrigger(); + }} + > + + {topic.name} + + {/each} + + + + +