mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
116 lines
3.8 KiB
TypeScript
116 lines
3.8 KiB
TypeScript
"use client"
|
|
|
|
import { useState } from "react"
|
|
import { MoreHorizontalIcon } from "lucide-react"
|
|
|
|
import { Button } from "@/registry/new-york-v4/ui/button"
|
|
import {
|
|
Dialog,
|
|
DialogClose,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@/registry/new-york-v4/ui/dialog"
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuGroup,
|
|
DropdownMenuItem,
|
|
DropdownMenuLabel,
|
|
DropdownMenuTrigger,
|
|
} from "@/registry/new-york-v4/ui/dropdown-menu"
|
|
import { Field, FieldGroup, FieldLabel } from "@/registry/new-york-v4/ui/field"
|
|
import { Input } from "@/registry/new-york-v4/ui/input"
|
|
import { Label } from "@/registry/new-york-v4/ui/label"
|
|
import { Textarea } from "@/registry/new-york-v4/ui/textarea"
|
|
|
|
export default function DropdownMenuDialog() {
|
|
const [showNewDialog, setShowNewDialog] = useState(false)
|
|
const [showShareDialog, setShowShareDialog] = useState(false)
|
|
|
|
return (
|
|
<>
|
|
<DropdownMenu modal={false}>
|
|
<DropdownMenuTrigger asChild>
|
|
<Button variant="outline" aria-label="Open menu" size="icon-sm">
|
|
<MoreHorizontalIcon />
|
|
</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent className="w-40" align="end">
|
|
<DropdownMenuLabel>File Actions</DropdownMenuLabel>
|
|
<DropdownMenuGroup>
|
|
<DropdownMenuItem onSelect={() => setShowNewDialog(true)}>
|
|
New File...
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem onSelect={() => setShowShareDialog(true)}>
|
|
Share...
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem disabled>Download</DropdownMenuItem>
|
|
</DropdownMenuGroup>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
<Dialog open={showNewDialog} onOpenChange={setShowNewDialog}>
|
|
<DialogContent className="sm:max-w-[425px]">
|
|
<DialogHeader>
|
|
<DialogTitle>Create New File</DialogTitle>
|
|
<DialogDescription>
|
|
Provide a name for your new file. Click create when you're
|
|
done.
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
<FieldGroup className="pb-3">
|
|
<Field>
|
|
<FieldLabel htmlFor="filename">File Name</FieldLabel>
|
|
<Input id="filename" name="filename" placeholder="document.txt" />
|
|
</Field>
|
|
</FieldGroup>
|
|
<DialogFooter>
|
|
<DialogClose asChild>
|
|
<Button variant="outline">Cancel</Button>
|
|
</DialogClose>
|
|
<Button type="submit">Create</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
<Dialog open={showShareDialog} onOpenChange={setShowShareDialog}>
|
|
<DialogContent className="sm:max-w-[425px]">
|
|
<DialogHeader>
|
|
<DialogTitle>Share File</DialogTitle>
|
|
<DialogDescription>
|
|
Anyone with the link will be able to view this file.
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
<FieldGroup className="py-3">
|
|
<Field>
|
|
<Label htmlFor="email">Email Address</Label>
|
|
<Input
|
|
id="email"
|
|
name="email"
|
|
type="email"
|
|
placeholder="[email protected]"
|
|
autoComplete="off"
|
|
/>
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="message">Message (Optional)</FieldLabel>
|
|
<Textarea
|
|
id="message"
|
|
name="message"
|
|
placeholder="Check out this file"
|
|
/>
|
|
</Field>
|
|
</FieldGroup>
|
|
<DialogFooter>
|
|
<DialogClose asChild>
|
|
<Button variant="outline">Cancel</Button>
|
|
</DialogClose>
|
|
<Button type="submit">Send Invite</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
</>
|
|
)
|
|
}
|