From 3f10d6707aa16b1c99bee5a476f26fc66ac62902 Mon Sep 17 00:00:00 2001 From: Huakun Shen Date: Sun, 12 May 2024 22:53:31 -0400 Subject: [PATCH] Implement UI for developer tab --- .../settings/Developer/Installation.vue | 178 ++++++++++++++++++ .../components/settings/DeveloperTab.vue | 22 ++- .../ui/alert-dialog/AlertDialog.vue | 14 ++ .../ui/alert-dialog/AlertDialogAction.vue | 20 ++ .../ui/alert-dialog/AlertDialogCancel.vue | 20 ++ .../ui/alert-dialog/AlertDialogContent.vue | 42 +++++ .../alert-dialog/AlertDialogDescription.vue | 25 +++ .../ui/alert-dialog/AlertDialogFooter.vue | 21 +++ .../ui/alert-dialog/AlertDialogHeader.vue | 16 ++ .../ui/alert-dialog/AlertDialogTitle.vue | 22 +++ .../ui/alert-dialog/AlertDialogTrigger.vue | 11 ++ .../components/ui/alert-dialog/index.ts | 9 + apps/desktop/components/ui/alert/Alert.vue | 16 ++ .../components/ui/alert/AlertDescription.vue | 14 ++ .../components/ui/alert/AlertTitle.vue | 14 ++ apps/desktop/components/ui/alert/index.ts | 23 +++ .../components/ui/hover-card/HoverCard.vue | 14 ++ .../ui/hover-card/HoverCardContent.vue | 41 ++++ .../ui/hover-card/HoverCardTrigger.vue | 11 ++ .../desktop/components/ui/hover-card/index.ts | 3 + .../ui/navigation-menu/NavigationMenu.vue | 33 ++++ .../navigation-menu/NavigationMenuContent.vue | 34 ++++ .../NavigationMenuIndicator.vue | 24 +++ .../ui/navigation-menu/NavigationMenuItem.vue | 11 ++ .../ui/navigation-menu/NavigationMenuLink.vue | 19 ++ .../ui/navigation-menu/NavigationMenuList.vue | 29 +++ .../navigation-menu/NavigationMenuTrigger.vue | 34 ++++ .../NavigationMenuViewport.vue | 33 ++++ .../components/ui/navigation-menu/index.ts | 12 ++ apps/desktop/package.json | 1 + apps/desktop/pages/settings.vue | 20 +- apps/desktop/tailwind.config.js | 2 +- pnpm-lock.yaml | 3 + 33 files changed, 776 insertions(+), 15 deletions(-) create mode 100644 apps/desktop/components/settings/Developer/Installation.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialog.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogAction.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogCancel.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogContent.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogDescription.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogFooter.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogHeader.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogTitle.vue create mode 100644 apps/desktop/components/ui/alert-dialog/AlertDialogTrigger.vue create mode 100644 apps/desktop/components/ui/alert-dialog/index.ts create mode 100644 apps/desktop/components/ui/alert/Alert.vue create mode 100644 apps/desktop/components/ui/alert/AlertDescription.vue create mode 100644 apps/desktop/components/ui/alert/AlertTitle.vue create mode 100644 apps/desktop/components/ui/alert/index.ts create mode 100644 apps/desktop/components/ui/hover-card/HoverCard.vue create mode 100644 apps/desktop/components/ui/hover-card/HoverCardContent.vue create mode 100644 apps/desktop/components/ui/hover-card/HoverCardTrigger.vue create mode 100644 apps/desktop/components/ui/hover-card/index.ts create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenu.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuContent.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuIndicator.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuItem.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuLink.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuList.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuTrigger.vue create mode 100644 apps/desktop/components/ui/navigation-menu/NavigationMenuViewport.vue create mode 100644 apps/desktop/components/ui/navigation-menu/index.ts diff --git a/apps/desktop/components/settings/Developer/Installation.vue b/apps/desktop/components/settings/Developer/Installation.vue new file mode 100644 index 00000000..a28a6448 --- /dev/null +++ b/apps/desktop/components/settings/Developer/Installation.vue @@ -0,0 +1,178 @@ + + + diff --git a/apps/desktop/components/settings/DeveloperTab.vue b/apps/desktop/components/settings/DeveloperTab.vue index 1084548f..0ea1134e 100644 --- a/apps/desktop/components/settings/DeveloperTab.vue +++ b/apps/desktop/components/settings/DeveloperTab.vue @@ -1,6 +1,24 @@ + \ No newline at end of file +
+ +
+

Tags

+ +
+
+ {{ tag }} +
+ +
+
+
+ +
+ diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialog.vue b/apps/desktop/components/ui/alert-dialog/AlertDialog.vue new file mode 100644 index 00000000..8fb30de8 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialog.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogAction.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogAction.vue new file mode 100644 index 00000000..092d6cd9 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogAction.vue @@ -0,0 +1,20 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogCancel.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogCancel.vue new file mode 100644 index 00000000..9935c064 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogCancel.vue @@ -0,0 +1,20 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogContent.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogContent.vue new file mode 100644 index 00000000..afc76e58 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogContent.vue @@ -0,0 +1,42 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogDescription.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogDescription.vue new file mode 100644 index 00000000..9682cbb1 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogDescription.vue @@ -0,0 +1,25 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogFooter.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogFooter.vue new file mode 100644 index 00000000..55d0a0eb --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogFooter.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogHeader.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogHeader.vue new file mode 100644 index 00000000..c61c4495 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogHeader.vue @@ -0,0 +1,16 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogTitle.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogTitle.vue new file mode 100644 index 00000000..50c583d0 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogTitle.vue @@ -0,0 +1,22 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/AlertDialogTrigger.vue b/apps/desktop/components/ui/alert-dialog/AlertDialogTrigger.vue new file mode 100644 index 00000000..4f5e2fd0 --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/AlertDialogTrigger.vue @@ -0,0 +1,11 @@ + + + diff --git a/apps/desktop/components/ui/alert-dialog/index.ts b/apps/desktop/components/ui/alert-dialog/index.ts new file mode 100644 index 00000000..91d138ae --- /dev/null +++ b/apps/desktop/components/ui/alert-dialog/index.ts @@ -0,0 +1,9 @@ +export { default as AlertDialog } from './AlertDialog.vue' +export { default as AlertDialogTrigger } from './AlertDialogTrigger.vue' +export { default as AlertDialogContent } from './AlertDialogContent.vue' +export { default as AlertDialogHeader } from './AlertDialogHeader.vue' +export { default as AlertDialogTitle } from './AlertDialogTitle.vue' +export { default as AlertDialogDescription } from './AlertDialogDescription.vue' +export { default as AlertDialogFooter } from './AlertDialogFooter.vue' +export { default as AlertDialogAction } from './AlertDialogAction.vue' +export { default as AlertDialogCancel } from './AlertDialogCancel.vue' diff --git a/apps/desktop/components/ui/alert/Alert.vue b/apps/desktop/components/ui/alert/Alert.vue new file mode 100644 index 00000000..b3502d52 --- /dev/null +++ b/apps/desktop/components/ui/alert/Alert.vue @@ -0,0 +1,16 @@ + + + diff --git a/apps/desktop/components/ui/alert/AlertDescription.vue b/apps/desktop/components/ui/alert/AlertDescription.vue new file mode 100644 index 00000000..2971a877 --- /dev/null +++ b/apps/desktop/components/ui/alert/AlertDescription.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/desktop/components/ui/alert/AlertTitle.vue b/apps/desktop/components/ui/alert/AlertTitle.vue new file mode 100644 index 00000000..e28dd37e --- /dev/null +++ b/apps/desktop/components/ui/alert/AlertTitle.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/desktop/components/ui/alert/index.ts b/apps/desktop/components/ui/alert/index.ts new file mode 100644 index 00000000..1ef58723 --- /dev/null +++ b/apps/desktop/components/ui/alert/index.ts @@ -0,0 +1,23 @@ +import { type VariantProps, cva } from 'class-variance-authority' + +export { default as Alert } from './Alert.vue' +export { default as AlertTitle } from './AlertTitle.vue' +export { default as AlertDescription } from './AlertDescription.vue' + +export const alertVariants = cva( + 'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7', + { + variants: { + variant: { + default: 'bg-background text-foreground', + destructive: + 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) + +export type AlertVariants = VariantProps diff --git a/apps/desktop/components/ui/hover-card/HoverCard.vue b/apps/desktop/components/ui/hover-card/HoverCard.vue new file mode 100644 index 00000000..f17c9d1f --- /dev/null +++ b/apps/desktop/components/ui/hover-card/HoverCard.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/desktop/components/ui/hover-card/HoverCardContent.vue b/apps/desktop/components/ui/hover-card/HoverCardContent.vue new file mode 100644 index 00000000..8affac42 --- /dev/null +++ b/apps/desktop/components/ui/hover-card/HoverCardContent.vue @@ -0,0 +1,41 @@ + + + diff --git a/apps/desktop/components/ui/hover-card/HoverCardTrigger.vue b/apps/desktop/components/ui/hover-card/HoverCardTrigger.vue new file mode 100644 index 00000000..3e300b95 --- /dev/null +++ b/apps/desktop/components/ui/hover-card/HoverCardTrigger.vue @@ -0,0 +1,11 @@ + + + diff --git a/apps/desktop/components/ui/hover-card/index.ts b/apps/desktop/components/ui/hover-card/index.ts new file mode 100644 index 00000000..c7bfd32d --- /dev/null +++ b/apps/desktop/components/ui/hover-card/index.ts @@ -0,0 +1,3 @@ +export { default as HoverCard } from './HoverCard.vue' +export { default as HoverCardTrigger } from './HoverCardTrigger.vue' +export { default as HoverCardContent } from './HoverCardContent.vue' diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenu.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenu.vue new file mode 100644 index 00000000..080d3bb1 --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenu.vue @@ -0,0 +1,33 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuContent.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuContent.vue new file mode 100644 index 00000000..03d8fbbc --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuContent.vue @@ -0,0 +1,34 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuIndicator.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuIndicator.vue new file mode 100644 index 00000000..1d53291e --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuIndicator.vue @@ -0,0 +1,24 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuItem.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuItem.vue new file mode 100644 index 00000000..50e1565f --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuItem.vue @@ -0,0 +1,11 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuLink.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuLink.vue new file mode 100644 index 00000000..30c91c61 --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuLink.vue @@ -0,0 +1,19 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuList.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuList.vue new file mode 100644 index 00000000..354365c5 --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuList.vue @@ -0,0 +1,29 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuTrigger.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuTrigger.vue new file mode 100644 index 00000000..3c37c3d6 --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuTrigger.vue @@ -0,0 +1,34 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/NavigationMenuViewport.vue b/apps/desktop/components/ui/navigation-menu/NavigationMenuViewport.vue new file mode 100644 index 00000000..db240ccc --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/NavigationMenuViewport.vue @@ -0,0 +1,33 @@ + + + diff --git a/apps/desktop/components/ui/navigation-menu/index.ts b/apps/desktop/components/ui/navigation-menu/index.ts new file mode 100644 index 00000000..70d4443b --- /dev/null +++ b/apps/desktop/components/ui/navigation-menu/index.ts @@ -0,0 +1,12 @@ +import { cva } from 'class-variance-authority' + +export { default as NavigationMenu } from './NavigationMenu.vue' +export { default as NavigationMenuList } from './NavigationMenuList.vue' +export { default as NavigationMenuItem } from './NavigationMenuItem.vue' +export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue' +export { default as NavigationMenuContent } from './NavigationMenuContent.vue' +export { default as NavigationMenuLink } from './NavigationMenuLink.vue' + +export const navigationMenuTriggerStyle = cva( + 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50', +) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 4d0c7190..1a67e772 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -40,6 +40,7 @@ "@nuxtjs/color-mode": "^3.4.1", "@nuxtjs/tailwindcss": "^6.12.0", "@pinia-plugin-persistedstate/nuxt": "^1.2.0", + "@tailwindcss/typography": "^0.5.13", "@tauri-apps/cli": "^1.5.6", "typescript": "^5.0.0" } diff --git a/apps/desktop/pages/settings.vue b/apps/desktop/pages/settings.vue index d761af6a..9e8d3cc1 100644 --- a/apps/desktop/pages/settings.vue +++ b/apps/desktop/pages/settings.vue @@ -1,27 +1,19 @@