mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Upstream sync from shadcn-ui/ui (1686 commits since last merge base). Key changes: - packages/shadcn upgraded to 4.1.0 (CLI font transformers, scaffold from github, chart colors) - apps/v4 replaces apps/www as the primary docs/registry app - Font system: 25+ heading font registries, font markers utility, @supports override - Chart improvements: recharts v3 compat, radial chart fixes - templates/ updated with monorepo variants (astro, vite, react-router, start) - skills/shadcn AI skill definitions added - deprecated/ removed (auth, auth-firebase, cli, www) Preserved Hanzo-only paths: app/, pkg/, demo/, docs/, template/next/
129 lines
3.5 KiB
TypeScript
129 lines
3.5 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
|
|
import {
|
|
Avatar,
|
|
AvatarFallback,
|
|
AvatarImage,
|
|
} from "@/registry/bases/base/ui/avatar"
|
|
import { Button } from "@/registry/bases/base/ui/button"
|
|
import {
|
|
Card,
|
|
CardAction,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "@/registry/bases/base/ui/card"
|
|
import {
|
|
Combobox,
|
|
ComboboxChip,
|
|
ComboboxChips,
|
|
ComboboxChipsInput,
|
|
ComboboxContent,
|
|
ComboboxEmpty,
|
|
ComboboxItem,
|
|
ComboboxList,
|
|
ComboboxValue,
|
|
useComboboxAnchor,
|
|
} from "@/registry/bases/base/ui/combobox"
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from "@/registry/bases/base/ui/tooltip"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
// Users available for assignment.
|
|
const users = [
|
|
"shadcn",
|
|
"maxleiter",
|
|
"evilrabbit",
|
|
"pranathip",
|
|
"jorgezreik",
|
|
"shuding",
|
|
"rauchg",
|
|
]
|
|
|
|
export function AssignIssue() {
|
|
const anchor = useComboboxAnchor()
|
|
return (
|
|
<Card className="w-full max-w-sm" size="sm">
|
|
<CardHeader className="border-b">
|
|
<CardTitle className="text-sm">Assign Issue</CardTitle>
|
|
<CardDescription className="text-sm">
|
|
Select users to assign to this issue.
|
|
</CardDescription>
|
|
<CardAction>
|
|
<Tooltip>
|
|
<TooltipTrigger
|
|
render={<Button variant="outline" size="icon-xs" />}
|
|
>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
remixicon="RiAddLine"
|
|
/>
|
|
</TooltipTrigger>
|
|
<TooltipContent>Add user</TooltipContent>
|
|
</Tooltip>
|
|
</CardAction>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<Combobox
|
|
multiple
|
|
autoHighlight
|
|
items={users}
|
|
defaultValue={[users[0]]}
|
|
>
|
|
<ComboboxChips ref={anchor}>
|
|
<ComboboxValue>
|
|
{(values) => (
|
|
<React.Fragment>
|
|
{values.map((username: string) => (
|
|
<ComboboxChip key={username}>
|
|
<Avatar className="size-4">
|
|
<AvatarImage
|
|
src={`https://github.com/${username}.png`}
|
|
alt={username}
|
|
/>
|
|
<AvatarFallback>{username.charAt(0)}</AvatarFallback>
|
|
</Avatar>
|
|
{username}
|
|
</ComboboxChip>
|
|
))}
|
|
<ComboboxChipsInput
|
|
placeholder={
|
|
values.length > 0 ? undefined : "Select a item..."
|
|
}
|
|
/>
|
|
</React.Fragment>
|
|
)}
|
|
</ComboboxValue>
|
|
</ComboboxChips>
|
|
<ComboboxContent anchor={anchor}>
|
|
<ComboboxEmpty>No users found.</ComboboxEmpty>
|
|
<ComboboxList>
|
|
{(username) => (
|
|
<ComboboxItem key={username} value={username}>
|
|
<Avatar className="size-5">
|
|
<AvatarImage
|
|
src={`https://github.com/${username}.png`}
|
|
alt={username}
|
|
/>
|
|
<AvatarFallback>{username.charAt(0)}</AvatarFallback>
|
|
</Avatar>
|
|
{username}
|
|
</ComboboxItem>
|
|
)}
|
|
</ComboboxList>
|
|
</ComboboxContent>
|
|
</Combobox>
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|