create-tauri-ui 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -11
- package/dist/index.mjs +26 -26
- package/package.json +3 -2
- package/templates/.shared/app-icon.png +0 -0
- package/templates/.shared/src-tauri/Cargo.lock +270 -139
- package/templates/.shared/src-tauri/Cargo.toml +39 -36
- package/templates/.shared/src-tauri/src/main.rs +3 -0
- package/templates/.shared/src-tauri/tauri.conf.json +71 -79
- package/templates/next/components.json +15 -15
- package/templates/next/next.config.js +14 -14
- package/templates/next/package.json +18 -14
- package/templates/next/pnpm-lock.yaml +608 -566
- package/templates/next/src/app/examples/cards/components/date-picker.tsx +3 -1
- package/templates/next/src/app/examples/cards/components/github-card.tsx +2 -0
- package/templates/next/src/app/examples/cards/components/notifications.tsx +2 -0
- package/templates/next/src/app/examples/cards/components/payment-method.tsx +3 -1
- package/templates/next/src/app/examples/cards/components/team-members.tsx +3 -5
- package/templates/next/src/app/examples/forms/page.tsx +1 -1
- package/templates/next/src/app/layout.tsx +47 -47
- package/templates/next/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/templates/next/src/components/about-dialog.tsx +111 -0
- package/templates/next/src/components/icons.tsx +156 -154
- package/templates/next/src/components/menu-mode-toggle.tsx +47 -46
- package/templates/next/src/components/menu.tsx +223 -259
- package/templates/next/src/components/page-header.tsx +2 -0
- package/templates/next/src/components/ui/accordion.tsx +60 -60
- package/templates/next/src/components/ui/alert-dialog.tsx +145 -145
- package/templates/next/src/components/ui/alert.tsx +59 -59
- package/templates/next/src/components/ui/aspect-ratio.tsx +7 -7
- package/templates/next/src/components/ui/avatar.tsx +50 -50
- package/templates/next/src/components/ui/badge.tsx +36 -36
- package/templates/next/src/components/ui/button.tsx +56 -56
- package/templates/next/src/components/ui/calendar.tsx +64 -64
- package/templates/next/src/components/ui/card.tsx +79 -79
- package/templates/next/src/components/ui/checkbox.tsx +30 -30
- package/templates/next/src/components/ui/collapsible.tsx +11 -11
- package/templates/next/src/components/ui/command.tsx +155 -155
- package/templates/next/src/components/ui/context-menu.tsx +200 -200
- package/templates/next/src/components/ui/dialog.tsx +123 -123
- package/templates/next/src/components/ui/dropdown-menu.tsx +200 -200
- package/templates/next/src/components/ui/form.tsx +176 -176
- package/templates/next/src/components/ui/hover-card.tsx +29 -29
- package/templates/next/src/components/ui/input.tsx +25 -25
- package/templates/next/src/components/ui/label.tsx +26 -26
- package/templates/next/src/components/ui/menubar.tsx +236 -236
- package/templates/next/src/components/ui/navigation-menu.tsx +128 -128
- package/templates/next/src/components/ui/popover.tsx +31 -31
- package/templates/next/src/components/ui/progress.tsx +28 -28
- package/templates/next/src/components/ui/radio-group.tsx +44 -44
- package/templates/next/src/components/ui/scroll-area.tsx +48 -48
- package/templates/next/src/components/ui/select.tsx +121 -121
- package/templates/next/src/components/ui/separator.tsx +31 -31
- package/templates/next/src/components/ui/sheet.tsx +144 -144
- package/templates/next/src/components/ui/skeleton.tsx +15 -15
- package/templates/next/src/components/ui/slider.tsx +28 -28
- package/templates/next/src/components/ui/switch.tsx +29 -29
- package/templates/next/src/components/ui/table.tsx +114 -114
- package/templates/next/src/components/ui/tabs.tsx +55 -55
- package/templates/next/src/components/ui/textarea.tsx +24 -24
- package/templates/next/src/components/ui/toast.tsx +127 -127
- package/templates/next/src/components/ui/toaster.tsx +35 -35
- package/templates/next/src/components/ui/toggle.tsx +45 -45
- package/templates/next/src/components/ui/tooltip.tsx +30 -30
- package/templates/next/src/components/ui/use-toast.ts +192 -192
- package/templates/next/src/lib/utils.ts +6 -6
- package/templates/next/src/styles/globals.css +88 -86
- package/templates/next/src-tauri/Cargo.lock +3832 -3701
- package/templates/next/src-tauri/Cargo.toml +4 -1
- package/templates/next/src-tauri/src/main.rs +22 -19
- package/templates/next/src-tauri/tauri.conf.json +71 -79
- package/templates/next/tailwind.config.js +77 -77
- package/templates/next/tsconfig.json +34 -34
- package/templates/sveltekit/.github/workflows/release.yml +108 -108
- package/templates/sveltekit/package.json +22 -22
- package/templates/sveltekit/pnpm-lock.yaml +1069 -691
- package/templates/sveltekit/src/app.html +1 -1
- package/templates/sveltekit/src-tauri/Cargo.lock +136 -136
- package/templates/sveltekit/src-tauri/tauri.conf.json +2 -10
- package/templates/sveltekit/static/favicon.ico +0 -0
- package/templates/sveltekit/vite.config.js +10 -6
- package/templates/vite/components.json +15 -15
- package/templates/vite/index.html +1 -1
- package/templates/vite/package.json +20 -13
- package/templates/vite/pnpm-lock.yaml +598 -530
- package/templates/vite/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/templates/vite/src/components/about-dialog.tsx +101 -0
- package/templates/vite/src/components/icons.tsx +2 -2
- package/templates/vite/src/components/menu-mode-toggle.tsx +4 -3
- package/templates/vite/src/components/menu.tsx +177 -197
- package/templates/vite/src/components/ui/accordion.tsx +1 -3
- package/templates/vite/src/components/ui/alert-dialog.tsx +3 -10
- package/templates/vite/src/components/ui/alert.tsx +3 -5
- package/templates/vite/src/components/ui/aspect-ratio.tsx +0 -2
- package/templates/vite/src/components/ui/avatar.tsx +0 -2
- package/templates/vite/src/components/ui/badge.tsx +5 -5
- package/templates/vite/src/components/ui/button.tsx +15 -10
- package/templates/vite/src/components/ui/calendar.tsx +0 -2
- package/templates/vite/src/components/ui/card.tsx +1 -3
- package/templates/vite/src/components/ui/checkbox.tsx +2 -4
- package/templates/vite/src/components/ui/collapsible.tsx +0 -2
- package/templates/vite/src/components/ui/command.tsx +2 -4
- package/templates/vite/src/components/ui/context-menu.tsx +6 -8
- package/templates/vite/src/components/ui/dialog.tsx +4 -11
- package/templates/vite/src/components/ui/dropdown-menu.tsx +6 -8
- package/templates/vite/src/components/ui/form.tsx +176 -0
- package/templates/vite/src/components/ui/hover-card.tsx +1 -3
- package/templates/vite/src/components/ui/input.tsx +1 -3
- package/templates/vite/src/components/ui/label.tsx +1 -3
- package/templates/vite/src/components/ui/menubar.tsx +7 -9
- package/templates/vite/src/components/ui/navigation-menu.tsx +2 -4
- package/templates/vite/src/components/ui/popover.tsx +1 -3
- package/templates/vite/src/components/ui/progress.tsx +0 -2
- package/templates/vite/src/components/ui/radio-group.tsx +2 -4
- package/templates/vite/src/components/ui/scroll-area.tsx +0 -2
- package/templates/vite/src/components/ui/select.tsx +4 -5
- package/templates/vite/src/components/ui/separator.tsx +0 -2
- package/templates/vite/src/components/ui/sheet.tsx +22 -110
- package/templates/vite/src/components/ui/skeleton.tsx +0 -2
- package/templates/vite/src/components/ui/slider.tsx +0 -2
- package/templates/vite/src/components/ui/switch.tsx +1 -3
- package/templates/vite/src/components/ui/table.tsx +1 -1
- package/templates/vite/src/components/ui/tabs.tsx +1 -3
- package/templates/vite/src/components/ui/textarea.tsx +1 -3
- package/templates/vite/src/components/ui/toast.tsx +6 -8
- package/templates/vite/src/components/ui/toaster.tsx +0 -2
- package/templates/vite/src/components/ui/toggle.tsx +3 -5
- package/templates/vite/src/components/ui/tooltip.tsx +1 -3
- package/templates/vite/src/components/ui/use-toast.ts +5 -4
- package/templates/vite/src/styles/globals.css +5 -3
- package/templates/vite/src-tauri/Cargo.lock +270 -139
- package/templates/vite/src-tauri/Cargo.toml +4 -1
- package/templates/vite/src-tauri/src/main.rs +8 -2
- package/templates/vite/src-tauri/tauri.conf.json +71 -79
- package/templates/vite/vite.config.ts +2 -2
- package/templates/next/src/assets/Inter.var.woff2 +0 -0
- package/templates/vite/src/assets/Inter.var.woff2 +0 -0
- package/templates/viteuno/.github/workflows/release.yml +0 -108
- package/templates/viteuno/.vscode/extensions.json +0 -3
- package/templates/viteuno/README.md +0 -1
- package/templates/viteuno/app-icon.png +0 -0
- package/templates/viteuno/components.json +0 -16
- package/templates/viteuno/index.html +0 -16
- package/templates/viteuno/package.json +0 -73
- package/templates/viteuno/pnpm-lock.yaml +0 -5298
- package/templates/viteuno/preset.shadcn.ts +0 -160
- package/templates/viteuno/prettier.config.cjs +0 -34
- package/templates/viteuno/public/avatars/01.png +0 -0
- package/templates/viteuno/public/avatars/02.png +0 -0
- package/templates/viteuno/public/avatars/03.png +0 -0
- package/templates/viteuno/public/avatars/04.png +0 -0
- package/templates/viteuno/public/avatars/05.png +0 -0
- package/templates/viteuno/src/App.tsx +0 -39
- package/templates/viteuno/src/assets/Inter.var.woff2 +0 -0
- package/templates/viteuno/src/components/icons.tsx +0 -154
- package/templates/viteuno/src/components/menu-mode-toggle.tsx +0 -46
- package/templates/viteuno/src/components/menu.tsx +0 -232
- package/templates/viteuno/src/components/tailwind-indicator.tsx +0 -18
- package/templates/viteuno/src/components/theme-provider.tsx +0 -9
- package/templates/viteuno/src/components/ui/accordion.tsx +0 -60
- package/templates/viteuno/src/components/ui/alert-dialog.tsx +0 -150
- package/templates/viteuno/src/components/ui/alert.tsx +0 -61
- package/templates/viteuno/src/components/ui/aspect-ratio.tsx +0 -7
- package/templates/viteuno/src/components/ui/avatar.tsx +0 -50
- package/templates/viteuno/src/components/ui/badge.tsx +0 -36
- package/templates/viteuno/src/components/ui/button.tsx +0 -51
- package/templates/viteuno/src/components/ui/calendar.tsx +0 -64
- package/templates/viteuno/src/components/ui/card.tsx +0 -81
- package/templates/viteuno/src/components/ui/checkbox.tsx +0 -30
- package/templates/viteuno/src/components/ui/collapsible.tsx +0 -11
- package/templates/viteuno/src/components/ui/command.tsx +0 -155
- package/templates/viteuno/src/components/ui/context-menu.tsx +0 -200
- package/templates/viteuno/src/components/ui/dialog.tsx +0 -128
- package/templates/viteuno/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/viteuno/src/components/ui/hover-card.tsx +0 -29
- package/templates/viteuno/src/components/ui/index.ts +0 -0
- package/templates/viteuno/src/components/ui/input.tsx +0 -27
- package/templates/viteuno/src/components/ui/label.tsx +0 -26
- package/templates/viteuno/src/components/ui/menubar.tsx +0 -236
- package/templates/viteuno/src/components/ui/navigation-menu.tsx +0 -130
- package/templates/viteuno/src/components/ui/popover.tsx +0 -31
- package/templates/viteuno/src/components/ui/progress.tsx +0 -28
- package/templates/viteuno/src/components/ui/radio-group.tsx +0 -44
- package/templates/viteuno/src/components/ui/scroll-area.tsx +0 -48
- package/templates/viteuno/src/components/ui/select.tsx +0 -120
- package/templates/viteuno/src/components/ui/separator.tsx +0 -31
- package/templates/viteuno/src/components/ui/sheet.tsx +0 -230
- package/templates/viteuno/src/components/ui/skeleton.tsx +0 -17
- package/templates/viteuno/src/components/ui/slider.tsx +0 -28
- package/templates/viteuno/src/components/ui/switch.tsx +0 -29
- package/templates/viteuno/src/components/ui/table.tsx +0 -114
- package/templates/viteuno/src/components/ui/tabs.tsx +0 -55
- package/templates/viteuno/src/components/ui/textarea.tsx +0 -26
- package/templates/viteuno/src/components/ui/toast.tsx +0 -129
- package/templates/viteuno/src/components/ui/toaster.tsx +0 -35
- package/templates/viteuno/src/components/ui/toggle.tsx +0 -45
- package/templates/viteuno/src/components/ui/tooltip.tsx +0 -30
- package/templates/viteuno/src/components/ui/use-toast.ts +0 -191
- package/templates/viteuno/src/dashboard/components/date-range-picker.tsx +0 -66
- package/templates/viteuno/src/dashboard/components/main-nav.tsx +0 -38
- package/templates/viteuno/src/dashboard/components/overview.tsx +0 -78
- package/templates/viteuno/src/dashboard/components/recent-sales.tsx +0 -67
- package/templates/viteuno/src/dashboard/components/search.tsx +0 -13
- package/templates/viteuno/src/dashboard/components/team-switcher.tsx +0 -205
- package/templates/viteuno/src/dashboard/components/user-nav.tsx +0 -67
- package/templates/viteuno/src/dashboard/page.tsx +0 -140
- package/templates/viteuno/src/lib/utils.ts +0 -19
- package/templates/viteuno/src/main.tsx +0 -14
- package/templates/viteuno/src/styles/globals.css +0 -4
- package/templates/viteuno/src/vite-env.d.ts +0 -1
- package/templates/viteuno/src-tauri/Cargo.lock +0 -3701
- package/templates/viteuno/src-tauri/Cargo.toml +0 -36
- package/templates/viteuno/src-tauri/build.rs +0 -3
- package/templates/viteuno/src-tauri/icons/128x128.png +0 -0
- package/templates/viteuno/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/32x32.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/viteuno/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/viteuno/src-tauri/icons/icon.icns +0 -0
- package/templates/viteuno/src-tauri/icons/icon.ico +0 -0
- package/templates/viteuno/src-tauri/icons/icon.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/viteuno/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/viteuno/src-tauri/src/main.rs +0 -16
- package/templates/viteuno/src-tauri/tauri.conf.json +0 -79
- package/templates/viteuno/tsconfig.json +0 -26
- package/templates/viteuno/tsconfig.node.json +0 -9
- package/templates/viteuno/uno.config.ts +0 -111
- package/templates/viteuno/vite.config.ts +0 -33
- /package/templates/next/src/app/examples/forms/{profile-form.tsx → components/profile-form.tsx} +0 -0
|
Binary file
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
|
+
import { UpdateIcon } from "@radix-ui/react-icons"
|
|
4
|
+
import { getName, getTauriVersion, getVersion } from "@tauri-apps/plugin-app"
|
|
5
|
+
import { arch } from "@tauri-apps/plugin-os"
|
|
6
|
+
import { open } from "@tauri-apps/plugin-shell"
|
|
7
|
+
import {
|
|
8
|
+
GithubIcon,
|
|
9
|
+
HomeIcon,
|
|
10
|
+
LinkIcon,
|
|
11
|
+
LucideArrowUpRight,
|
|
12
|
+
} from "lucide-react"
|
|
13
|
+
|
|
14
|
+
import { Icons } from "./icons"
|
|
15
|
+
import { Button, buttonVariants } from "./ui/button"
|
|
16
|
+
import {
|
|
17
|
+
DialogContent,
|
|
18
|
+
DialogDescription,
|
|
19
|
+
DialogFooter,
|
|
20
|
+
DialogHeader,
|
|
21
|
+
DialogTitle,
|
|
22
|
+
} from "./ui/dialog"
|
|
23
|
+
|
|
24
|
+
export function AboutDialog() {
|
|
25
|
+
const [updateText, setUpdateText] = useState("")
|
|
26
|
+
const [version, setVersion] = useState("")
|
|
27
|
+
const [name, setName] = useState("")
|
|
28
|
+
const [tauriVersion, setTauriVersion] = useState("")
|
|
29
|
+
const [arc, setArc] = useState("")
|
|
30
|
+
getVersion().then((x) => setVersion(x))
|
|
31
|
+
getName().then((x) => setName(x))
|
|
32
|
+
getTauriVersion().then((x) => setTauriVersion(x))
|
|
33
|
+
arch().then((x) => setArc(x))
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<DialogContent className="overflow-clip pb-2">
|
|
37
|
+
<DialogHeader className="flex items-center text-center">
|
|
38
|
+
<div className="rounded-full bg-background p-[6px] text-slate-600 drop-shadow-none transition duration-1000 hover:text-slate-800 hover:drop-shadow-[0_0px_10px_rgba(0,10,50,0.50)] dark:hover:text-slate-400 ">
|
|
39
|
+
<Icons.logo className="h-12 w-12" />
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<DialogTitle className="flex flex-col items-center gap-2 pt-2">
|
|
43
|
+
Tauri UI ({name})
|
|
44
|
+
<span className="flex gap-1 font-mono text-xs font-medium">
|
|
45
|
+
Version {version} ({arc})
|
|
46
|
+
<span className="font-sans font-medium text-gray-400">
|
|
47
|
+
(
|
|
48
|
+
<span
|
|
49
|
+
className="cursor-pointer text-blue-500"
|
|
50
|
+
onClick={() =>
|
|
51
|
+
open("https://github.com/agmmnn/tauri-ui/releases/tag/v0.2.0")
|
|
52
|
+
}
|
|
53
|
+
>
|
|
54
|
+
release notes
|
|
55
|
+
</span>
|
|
56
|
+
)
|
|
57
|
+
</span>
|
|
58
|
+
</span>
|
|
59
|
+
</DialogTitle>
|
|
60
|
+
|
|
61
|
+
<DialogDescription className=" text-foreground">
|
|
62
|
+
App description.
|
|
63
|
+
</DialogDescription>
|
|
64
|
+
|
|
65
|
+
<span className="text-xs text-gray-400">{updateText}</span>
|
|
66
|
+
<DialogDescription className="flex flex-row"></DialogDescription>
|
|
67
|
+
</DialogHeader>
|
|
68
|
+
|
|
69
|
+
<span className="font-mono text-xs font-medium text-gray-400">
|
|
70
|
+
Tauri version: {tauriVersion}
|
|
71
|
+
</span>
|
|
72
|
+
<DialogFooter className="flex flex-row items-center border-t pt-2 text-slate-400 ">
|
|
73
|
+
<div className="mr-auto flex flex-row gap-2">
|
|
74
|
+
<HomeIcon
|
|
75
|
+
className="h-5 w-5 cursor-pointer transition hover:text-slate-300"
|
|
76
|
+
onClick={() => open("https://github.com/agmmnn/tauri-ui")}
|
|
77
|
+
/>
|
|
78
|
+
<GithubIcon
|
|
79
|
+
className="h-5 w-5 cursor-pointer transition hover:text-slate-300 "
|
|
80
|
+
onClick={() => open("https://github.com/agmmnn/tauri-ui")}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<Button
|
|
85
|
+
type="submit"
|
|
86
|
+
variant="outline"
|
|
87
|
+
className="h-7 gap-1"
|
|
88
|
+
onClick={() => setUpdateText("You have the latest version.")}
|
|
89
|
+
>
|
|
90
|
+
<UpdateIcon /> Check for Updates
|
|
91
|
+
</Button>
|
|
92
|
+
<DialogPrimitive.Close
|
|
93
|
+
type="submit"
|
|
94
|
+
className={buttonVariants({ variant: "ghost", className: "h-7" })}
|
|
95
|
+
>
|
|
96
|
+
Close
|
|
97
|
+
</DialogPrimitive.Close>
|
|
98
|
+
</DialogFooter>
|
|
99
|
+
</DialogContent>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
Twitter,
|
|
25
25
|
User,
|
|
26
26
|
X,
|
|
27
|
-
type
|
|
27
|
+
type XIcon as LucideIcon,
|
|
28
28
|
} from "lucide-react"
|
|
29
29
|
|
|
30
|
-
export type Icon = LucideIcon
|
|
30
|
+
export type Icon = typeof LucideIcon
|
|
31
31
|
|
|
32
32
|
export const Icons = {
|
|
33
33
|
logo: (props: LucideProps) => (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import { LaptopIcon, MoonIcon, SunIcon } from "@radix-ui/react-icons"
|
|
4
5
|
import { useTheme } from "next-themes"
|
|
5
6
|
|
|
6
7
|
import { Button } from "@/components/ui/button"
|
|
@@ -28,15 +29,15 @@ export function MenuModeToggle() {
|
|
|
28
29
|
<MenubarContent forceMount>
|
|
29
30
|
<MenubarRadioGroup value={theme}>
|
|
30
31
|
<MenubarRadioItem value="light" onClick={() => setTheme("light")}>
|
|
31
|
-
<
|
|
32
|
+
<SunIcon className="mr-2 h-4 w-4" />
|
|
32
33
|
<span>Light</span>
|
|
33
34
|
</MenubarRadioItem>
|
|
34
35
|
<MenubarRadioItem value="dark" onClick={() => setTheme("dark")}>
|
|
35
|
-
<
|
|
36
|
+
<MoonIcon className="mr-2 h-4 w-4" />
|
|
36
37
|
<span>Dark</span>
|
|
37
38
|
</MenubarRadioItem>
|
|
38
39
|
<MenubarRadioItem value="system" onClick={() => setTheme("system")}>
|
|
39
|
-
<
|
|
40
|
+
<LaptopIcon className="mr-2 h-4 w-4" />
|
|
40
41
|
<span>System</span>
|
|
41
42
|
</MenubarRadioItem>
|
|
42
43
|
</MenubarRadioGroup>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useState } from "react"
|
|
4
|
-
import
|
|
5
|
-
import { Globe,
|
|
4
|
+
import logo from "@/assets/logo.png"
|
|
5
|
+
import { Globe, Mic, Sailboat } from "lucide-react"
|
|
6
|
+
import { WindowTitlebar } from "tauri-controls"
|
|
6
7
|
|
|
7
|
-
import { Button } from "@/components/ui/button"
|
|
8
8
|
import {
|
|
9
9
|
Menubar,
|
|
10
10
|
MenubarCheckboxItem,
|
|
@@ -22,211 +22,191 @@ import {
|
|
|
22
22
|
MenubarTrigger,
|
|
23
23
|
} from "@/components/ui/menubar"
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { AboutDialog } from "./about-dialog"
|
|
26
26
|
import { MenuModeToggle } from "./menu-mode-toggle"
|
|
27
|
+
import { Dialog, DialogTrigger } from "./ui/dialog"
|
|
27
28
|
|
|
28
29
|
export function Menu() {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
appWindow?.maximize()
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const closeWindow = () => appWindow.close()
|
|
30
|
+
const closeWindow = useCallback(async () => {
|
|
31
|
+
const { appWindow } = await import("@tauri-apps/plugin-window")
|
|
32
|
+
|
|
33
|
+
appWindow.close()
|
|
34
|
+
}, [])
|
|
38
35
|
|
|
39
36
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
<WindowTitlebar
|
|
38
|
+
// controlsOrder="platform"
|
|
39
|
+
// windowControlsProps={{ platform: "macos", className: "" }}
|
|
40
|
+
>
|
|
41
|
+
<Menubar className="rounded-none border-b border-none pl-2 lg:pl-3">
|
|
42
|
+
<MenubarMenu>
|
|
43
|
+
<div className="inline-flex h-fit w-fit items-center text-cyan-500">
|
|
44
|
+
<Sailboat className="h-5 w-5" />
|
|
45
|
+
</div>
|
|
46
|
+
</MenubarMenu>
|
|
47
|
+
|
|
48
|
+
<MenubarMenu>
|
|
49
|
+
<MenubarTrigger className="font-bold">App</MenubarTrigger>
|
|
50
|
+
<Dialog modal={false}>
|
|
51
|
+
<MenubarContent>
|
|
52
|
+
<DialogTrigger asChild>
|
|
53
|
+
<MenubarItem>About App</MenubarItem>
|
|
54
|
+
</DialogTrigger>
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
<MenubarTrigger className="font-bold">App</MenubarTrigger>
|
|
50
|
-
<MenubarContent>
|
|
51
|
-
<MenubarItem>About App</MenubarItem>
|
|
52
|
-
<MenubarSeparator />
|
|
53
|
-
<MenubarItem>
|
|
54
|
-
Preferences... <MenubarShortcut>⌘,</MenubarShortcut>
|
|
55
|
-
</MenubarItem>
|
|
56
|
-
<MenubarSeparator />
|
|
57
|
-
<MenubarItem>
|
|
58
|
-
Hide Music... <MenubarShortcut>⌘H</MenubarShortcut>
|
|
59
|
-
</MenubarItem>
|
|
60
|
-
<MenubarItem>
|
|
61
|
-
Hide Others... <MenubarShortcut>⇧⌘H</MenubarShortcut>
|
|
62
|
-
</MenubarItem>
|
|
63
|
-
<MenubarShortcut />
|
|
64
|
-
<MenubarItem onClick={closeWindow}>
|
|
65
|
-
Quit Music <MenubarShortcut>⌘Q</MenubarShortcut>
|
|
66
|
-
</MenubarItem>
|
|
67
|
-
</MenubarContent>
|
|
68
|
-
</MenubarMenu>
|
|
69
|
-
<MenubarMenu>
|
|
70
|
-
<MenubarTrigger className="relative">File</MenubarTrigger>
|
|
71
|
-
<MenubarContent>
|
|
72
|
-
<MenubarSub>
|
|
73
|
-
<MenubarSubTrigger>New</MenubarSubTrigger>
|
|
74
|
-
<MenubarSubContent className="w-[230px]">
|
|
56
|
+
<MenubarSeparator />
|
|
75
57
|
<MenubarItem>
|
|
76
|
-
|
|
58
|
+
Preferences... <MenubarShortcut>⌘,</MenubarShortcut>
|
|
77
59
|
</MenubarItem>
|
|
78
|
-
<
|
|
79
|
-
|
|
60
|
+
<MenubarSeparator />
|
|
61
|
+
<MenubarItem>
|
|
62
|
+
Hide Music... <MenubarShortcut>⌘H</MenubarShortcut>
|
|
80
63
|
</MenubarItem>
|
|
81
64
|
<MenubarItem>
|
|
82
|
-
|
|
65
|
+
Hide Others... <MenubarShortcut>⇧⌘H</MenubarShortcut>
|
|
83
66
|
</MenubarItem>
|
|
84
|
-
<
|
|
85
|
-
<MenubarItem
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
</
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
<
|
|
159
|
-
</
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
67
|
+
<MenubarShortcut />
|
|
68
|
+
<MenubarItem onClick={closeWindow}>
|
|
69
|
+
Quit Music <MenubarShortcut>⌘Q</MenubarShortcut>
|
|
70
|
+
</MenubarItem>
|
|
71
|
+
</MenubarContent>
|
|
72
|
+
<AboutDialog />
|
|
73
|
+
</Dialog>
|
|
74
|
+
</MenubarMenu>
|
|
75
|
+
<MenubarMenu>
|
|
76
|
+
<MenubarTrigger className="relative">File</MenubarTrigger>
|
|
77
|
+
<MenubarContent>
|
|
78
|
+
<MenubarSub>
|
|
79
|
+
<MenubarSubTrigger>New</MenubarSubTrigger>
|
|
80
|
+
<MenubarSubContent className="w-[230px]">
|
|
81
|
+
<MenubarItem>
|
|
82
|
+
Playlist <MenubarShortcut>⌘N</MenubarShortcut>
|
|
83
|
+
</MenubarItem>
|
|
84
|
+
<MenubarItem disabled>
|
|
85
|
+
Playlist from Selection <MenubarShortcut>⇧⌘N</MenubarShortcut>
|
|
86
|
+
</MenubarItem>
|
|
87
|
+
<MenubarItem>
|
|
88
|
+
Smart Playlist... <MenubarShortcut>⌥⌘N</MenubarShortcut>
|
|
89
|
+
</MenubarItem>
|
|
90
|
+
<MenubarItem>Playlist Folder</MenubarItem>
|
|
91
|
+
<MenubarItem disabled>Genius Playlist</MenubarItem>
|
|
92
|
+
</MenubarSubContent>
|
|
93
|
+
</MenubarSub>
|
|
94
|
+
<MenubarItem>
|
|
95
|
+
Open Stream URL... <MenubarShortcut>⌘U</MenubarShortcut>
|
|
96
|
+
</MenubarItem>
|
|
97
|
+
<MenubarItem>
|
|
98
|
+
Close Window <MenubarShortcut>⌘W</MenubarShortcut>
|
|
99
|
+
</MenubarItem>
|
|
100
|
+
<MenubarSeparator />
|
|
101
|
+
<MenubarSub>
|
|
102
|
+
<MenubarSubTrigger>Library</MenubarSubTrigger>
|
|
103
|
+
<MenubarSubContent>
|
|
104
|
+
<MenubarItem>Update Cloud Library</MenubarItem>
|
|
105
|
+
<MenubarItem>Update Genius</MenubarItem>
|
|
106
|
+
<MenubarSeparator />
|
|
107
|
+
<MenubarItem>Organize Library...</MenubarItem>
|
|
108
|
+
<MenubarItem>Export Library...</MenubarItem>
|
|
109
|
+
<MenubarSeparator />
|
|
110
|
+
<MenubarItem>Import Playlist...</MenubarItem>
|
|
111
|
+
<MenubarItem disabled>Export Playlist...</MenubarItem>
|
|
112
|
+
<MenubarItem>Show Duplicate Items</MenubarItem>
|
|
113
|
+
<MenubarSeparator />
|
|
114
|
+
<MenubarItem>Get Album Artwork</MenubarItem>
|
|
115
|
+
<MenubarItem disabled>Get Track Names</MenubarItem>
|
|
116
|
+
</MenubarSubContent>
|
|
117
|
+
</MenubarSub>
|
|
118
|
+
<MenubarItem>
|
|
119
|
+
Import... <MenubarShortcut>⌘O</MenubarShortcut>
|
|
120
|
+
</MenubarItem>
|
|
121
|
+
<MenubarItem disabled>Burn Playlist to Disc...</MenubarItem>
|
|
122
|
+
<MenubarSeparator />
|
|
123
|
+
<MenubarItem>
|
|
124
|
+
Show in Finder <MenubarShortcut>⇧⌘R</MenubarShortcut>{" "}
|
|
125
|
+
</MenubarItem>
|
|
126
|
+
<MenubarItem>Convert</MenubarItem>
|
|
127
|
+
<MenubarSeparator />
|
|
128
|
+
<MenubarItem>Page Setup...</MenubarItem>
|
|
129
|
+
<MenubarItem disabled>
|
|
130
|
+
Print... <MenubarShortcut>⌘P</MenubarShortcut>
|
|
131
|
+
</MenubarItem>
|
|
132
|
+
</MenubarContent>
|
|
133
|
+
</MenubarMenu>
|
|
134
|
+
<MenubarMenu>
|
|
135
|
+
<MenubarTrigger>Edit</MenubarTrigger>
|
|
136
|
+
<MenubarContent>
|
|
137
|
+
<MenubarItem disabled>
|
|
138
|
+
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
139
|
+
</MenubarItem>
|
|
140
|
+
<MenubarItem disabled>
|
|
141
|
+
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
142
|
+
</MenubarItem>
|
|
143
|
+
<MenubarSeparator />
|
|
144
|
+
<MenubarItem disabled>
|
|
145
|
+
Cut <MenubarShortcut>⌘X</MenubarShortcut>
|
|
146
|
+
</MenubarItem>
|
|
147
|
+
<MenubarItem disabled>
|
|
148
|
+
Copy <MenubarShortcut>⌘C</MenubarShortcut>
|
|
149
|
+
</MenubarItem>
|
|
150
|
+
<MenubarItem disabled>
|
|
151
|
+
Paste <MenubarShortcut>⌘V</MenubarShortcut>
|
|
152
|
+
</MenubarItem>
|
|
153
|
+
<MenubarSeparator />
|
|
154
|
+
<MenubarItem>
|
|
155
|
+
Select All <MenubarShortcut>⌘A</MenubarShortcut>
|
|
156
|
+
</MenubarItem>
|
|
157
|
+
<MenubarItem disabled>
|
|
158
|
+
Deselect All <MenubarShortcut>⇧⌘A</MenubarShortcut>
|
|
159
|
+
</MenubarItem>
|
|
160
|
+
<MenubarSeparator />
|
|
161
|
+
<MenubarItem>
|
|
162
|
+
Smart Dictation...{" "}
|
|
163
|
+
<MenubarShortcut>
|
|
164
|
+
<Mic className="h-4 w-4" />
|
|
165
|
+
</MenubarShortcut>
|
|
166
|
+
</MenubarItem>
|
|
167
|
+
<MenubarItem>
|
|
168
|
+
Emoji & Symbols{" "}
|
|
169
|
+
<MenubarShortcut>
|
|
170
|
+
<Globe className="h-4 w-4" />
|
|
171
|
+
</MenubarShortcut>
|
|
172
|
+
</MenubarItem>
|
|
173
|
+
</MenubarContent>
|
|
174
|
+
</MenubarMenu>
|
|
175
|
+
<MenubarMenu>
|
|
176
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
177
|
+
<MenubarContent>
|
|
178
|
+
<MenubarCheckboxItem>Show Playing Next</MenubarCheckboxItem>
|
|
179
|
+
<MenubarCheckboxItem checked>Show Lyrics</MenubarCheckboxItem>
|
|
180
|
+
<MenubarSeparator />
|
|
181
|
+
<MenubarItem inset disabled>
|
|
182
|
+
Show Status Bar
|
|
183
|
+
</MenubarItem>
|
|
184
|
+
<MenubarSeparator />
|
|
185
|
+
<MenubarItem inset>Hide Sidebar</MenubarItem>
|
|
186
|
+
<MenubarItem disabled inset>
|
|
187
|
+
Enter Full Screen
|
|
188
|
+
</MenubarItem>
|
|
189
|
+
</MenubarContent>
|
|
190
|
+
</MenubarMenu>
|
|
191
|
+
<MenubarMenu>
|
|
192
|
+
<MenubarTrigger>Account</MenubarTrigger>
|
|
193
|
+
<MenubarContent forceMount>
|
|
194
|
+
<MenubarLabel inset>Switch Account</MenubarLabel>
|
|
195
|
+
<MenubarSeparator />
|
|
196
|
+
<MenubarRadioGroup value="benoit">
|
|
197
|
+
<MenubarRadioItem value="andy">Andy</MenubarRadioItem>
|
|
198
|
+
<MenubarRadioItem value="benoit">Benoit</MenubarRadioItem>
|
|
199
|
+
<MenubarRadioItem value="Luis">Luis</MenubarRadioItem>
|
|
200
|
+
</MenubarRadioGroup>
|
|
201
|
+
<MenubarSeparator />
|
|
202
|
+
<MenubarItem inset>Manage Famliy...</MenubarItem>
|
|
203
|
+
<MenubarSeparator />
|
|
204
|
+
<MenubarItem inset>Add Account...</MenubarItem>
|
|
205
|
+
</MenubarContent>
|
|
206
|
+
</MenubarMenu>
|
|
203
207
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
>
|
|
208
|
-
<Button
|
|
209
|
-
onClick={minimizeWindow}
|
|
210
|
-
variant="ghost"
|
|
211
|
-
className="h-8 focus:outline-none"
|
|
212
|
-
>
|
|
213
|
-
<Icons.minimize className="h-3 w-3" />
|
|
214
|
-
</Button>
|
|
215
|
-
<Button
|
|
216
|
-
onClick={maximizeWindow}
|
|
217
|
-
variant="ghost"
|
|
218
|
-
className="h-8 focus:outline-none"
|
|
219
|
-
>
|
|
220
|
-
<Maximize className="h-4 w-4" />
|
|
221
|
-
</Button>
|
|
222
|
-
<Button
|
|
223
|
-
onClick={closeWindow}
|
|
224
|
-
variant="ghost"
|
|
225
|
-
className="h-8 focus:outline-none"
|
|
226
|
-
>
|
|
227
|
-
<X className="h-4 w-4" />
|
|
228
|
-
</Button>
|
|
229
|
-
</div>
|
|
230
|
-
</Menubar>
|
|
208
|
+
<MenuModeToggle />
|
|
209
|
+
</Menubar>
|
|
210
|
+
</WindowTitlebar>
|
|
231
211
|
)
|
|
232
212
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
1
|
import * as React from "react"
|
|
4
2
|
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
5
3
|
import { ChevronDown } from "lucide-react"
|
|
@@ -34,7 +32,7 @@ const AccordionTrigger = React.forwardRef<
|
|
|
34
32
|
{...props}
|
|
35
33
|
>
|
|
36
34
|
{children}
|
|
37
|
-
<ChevronDown className="h-4 w-4 transition-transform duration-200" />
|
|
35
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
38
36
|
</AccordionPrimitive.Trigger>
|
|
39
37
|
</AccordionPrimitive.Header>
|
|
40
38
|
))
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
1
|
import * as React from "react"
|
|
4
2
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
3
|
|
|
@@ -12,14 +10,9 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
|
12
10
|
|
|
13
11
|
const AlertDialogPortal = ({
|
|
14
12
|
className,
|
|
15
|
-
children,
|
|
16
13
|
...props
|
|
17
14
|
}: AlertDialogPrimitive.AlertDialogPortalProps) => (
|
|
18
|
-
<AlertDialogPrimitive.Portal className={cn(className)} {...props}
|
|
19
|
-
<div className="fixed inset-0 z-50 flex items-end justify-center sm:items-center">
|
|
20
|
-
{children}
|
|
21
|
-
</div>
|
|
22
|
-
</AlertDialogPrimitive.Portal>
|
|
15
|
+
<AlertDialogPrimitive.Portal className={cn(className)} {...props} />
|
|
23
16
|
)
|
|
24
17
|
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName
|
|
25
18
|
|
|
@@ -29,7 +22,7 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
29
22
|
>(({ className, children, ...props }, ref) => (
|
|
30
23
|
<AlertDialogPrimitive.Overlay
|
|
31
24
|
className={cn(
|
|
32
|
-
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
25
|
+
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
33
26
|
className
|
|
34
27
|
)}
|
|
35
28
|
{...props}
|
|
@@ -47,7 +40,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
47
40
|
<AlertDialogPrimitive.Content
|
|
48
41
|
ref={ref}
|
|
49
42
|
className={cn(
|
|
50
|
-
"fixed z-50 grid w-full max-w-lg
|
|
43
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
|
|
51
44
|
className
|
|
52
45
|
)}
|
|
53
46
|
{...props}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
1
|
import * as React from "react"
|
|
4
|
-
import {
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
3
|
|
|
6
4
|
import { cn } from "@/lib/utils"
|
|
7
5
|
|
|
8
6
|
const alertVariants = cva(
|
|
9
|
-
"relative w-full rounded-lg border p-4 [&>svg]:
|
|
7
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
10
8
|
{
|
|
11
9
|
variants: {
|
|
12
10
|
variant: {
|
|
13
11
|
default: "bg-background text-foreground",
|
|
14
12
|
destructive:
|
|
15
|
-
"
|
|
13
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
16
14
|
},
|
|
17
15
|
},
|
|
18
16
|
defaultVariants: {
|