Galerie aller shadcn/ui-Komponenten auf der Startseite
- Alle 63 Komponenten aus dem shadcn-Register installiert (Stil base-luma) - Galerie unter components/galerie mit 7 Kategorien und Sprungnavigation - Inhaltsbreite auf max-w-6xl erweitert - shadcn-Hauptfarbe auf E&P-Tiefblau, größter Radius eckig - App-Titel "UI-Galerie" Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
57d65f0f08
commit
78c8b702f0
79 files changed
+11234
-14
No files matched your search
@@ -0,0 +1,262 @@
|
||||
"use client";
|
||||
|
||||
import { CalendarDaysIcon, FileTextIcon, SearchIcon, XIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import {
|
||||
Attachment,
|
||||
AttachmentAction,
|
||||
AttachmentActions,
|
||||
AttachmentContent,
|
||||
AttachmentDescription,
|
||||
AttachmentGroup,
|
||||
AttachmentMedia,
|
||||
AttachmentTitle,
|
||||
} from "@/components/ui/attachment";
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import { Bubble, BubbleContent, BubbleGroup } from "@/components/ui/bubble";
|
||||
import {
|
||||
CodeBlock,
|
||||
CodeBlockActions,
|
||||
CodeBlockContent,
|
||||
CodeBlockCopyButton,
|
||||
CodeBlockHeader,
|
||||
CodeBlockLine,
|
||||
CodeBlockTitle,
|
||||
} from "@/components/ui/code-block";
|
||||
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker";
|
||||
import {
|
||||
Message,
|
||||
MessageAvatar,
|
||||
MessageContent,
|
||||
MessageGroup,
|
||||
MessageHeader,
|
||||
} from "@/components/ui/message";
|
||||
import {
|
||||
MessageScroller,
|
||||
MessageScrollerButton,
|
||||
MessageScrollerContent,
|
||||
MessageScrollerItem,
|
||||
MessageScrollerProvider,
|
||||
MessageScrollerViewport,
|
||||
} from "@/components/ui/message-scroller";
|
||||
import {
|
||||
Questionnaire,
|
||||
QuestionnaireActions,
|
||||
QuestionnaireChoice,
|
||||
QuestionnaireChoices,
|
||||
QuestionnaireInput,
|
||||
QuestionnaireItem,
|
||||
QuestionnaireNext,
|
||||
QuestionnairePrevious,
|
||||
QuestionnaireProgress,
|
||||
QuestionnaireSubmit,
|
||||
QuestionnaireTitle,
|
||||
} from "@/components/ui/questionnaire";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { toast } from "@/components/ui/toast";
|
||||
import {
|
||||
Trace,
|
||||
TraceCollapsible,
|
||||
TraceCollapsibleContent,
|
||||
TraceCollapsibleTrigger,
|
||||
TraceDescription,
|
||||
TraceIcon,
|
||||
TraceLine,
|
||||
TraceTitle,
|
||||
} from "@/components/ui/trace";
|
||||
import { useHighlightedCode } from "@/hooks/use-highlighted-code";
|
||||
|
||||
const BEISPIELCODE = `export function Begruessung({ name }: { name: string }) {
|
||||
return <p>Willkommen, {name}!</p>
|
||||
}`;
|
||||
|
||||
const VERLAUF = [
|
||||
{ id: "1", von: "kunde", text: "Hallo, ist die Island-Reise im Juli noch frei?" },
|
||||
{ id: "2", von: "service", text: "Ja, es gibt noch 4 Plätze." },
|
||||
{ id: "3", von: "kunde", text: "Super! Ist der Flug inklusive?" },
|
||||
{ id: "4", von: "service", text: "Ja, ab Frankfurt oder München." },
|
||||
{ id: "5", von: "kunde", text: "Dann buche ich für zwei Personen." },
|
||||
{ id: "6", von: "service", text: "Gern, ich schicke Ihnen das Angebot." },
|
||||
];
|
||||
|
||||
function CodeBeispiel() {
|
||||
const zeilen = useHighlightedCode(BEISPIELCODE, "tsx");
|
||||
|
||||
return (
|
||||
<CodeBlock size="sm">
|
||||
<CodeBlockHeader>
|
||||
<CodeBlockTitle>begruessung.tsx</CodeBlockTitle>
|
||||
<CodeBlockActions>
|
||||
<CodeBlockCopyButton value={BEISPIELCODE} />
|
||||
</CodeBlockActions>
|
||||
</CodeBlockHeader>
|
||||
<CodeBlockContent lineNumbers>
|
||||
{zeilen.map((zeile, index) => (
|
||||
<CodeBlockLine key={index}>{zeile}</CodeBlockLine>
|
||||
))}
|
||||
</CodeBlockContent>
|
||||
</CodeBlock>
|
||||
);
|
||||
}
|
||||
|
||||
export function ChatBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Attachment">
|
||||
<AttachmentGroup>
|
||||
<Attachment>
|
||||
<AttachmentMedia>
|
||||
<FileTextIcon />
|
||||
</AttachmentMedia>
|
||||
<AttachmentContent>
|
||||
<AttachmentTitle>Reiseplan.pdf</AttachmentTitle>
|
||||
<AttachmentDescription>240 KB</AttachmentDescription>
|
||||
</AttachmentContent>
|
||||
<AttachmentActions>
|
||||
<AttachmentAction aria-label="Entfernen">
|
||||
<XIcon />
|
||||
</AttachmentAction>
|
||||
</AttachmentActions>
|
||||
</Attachment>
|
||||
<Attachment state="uploading">
|
||||
<AttachmentMedia>
|
||||
<Spinner />
|
||||
</AttachmentMedia>
|
||||
<AttachmentContent>
|
||||
<AttachmentTitle>Pass.jpg</AttachmentTitle>
|
||||
<AttachmentDescription>Wird hochgeladen …</AttachmentDescription>
|
||||
</AttachmentContent>
|
||||
</Attachment>
|
||||
</AttachmentGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Bubble">
|
||||
<BubbleGroup className="w-full">
|
||||
<Bubble variant="muted">
|
||||
<BubbleContent>Wann geht der Transfer zum Hotel?</BubbleContent>
|
||||
</Bubble>
|
||||
<Bubble align="end">
|
||||
<BubbleContent>Direkt nach der Landung, gegen 14 Uhr.</BubbleContent>
|
||||
</Bubble>
|
||||
</BubbleGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Message">
|
||||
<MessageGroup className="w-full">
|
||||
<Message>
|
||||
<MessageAvatar>
|
||||
<Avatar size="sm">
|
||||
<AvatarFallback>EP</AvatarFallback>
|
||||
</Avatar>
|
||||
</MessageAvatar>
|
||||
<MessageContent>
|
||||
<MessageHeader>Service</MessageHeader>
|
||||
<Bubble variant="muted">
|
||||
<BubbleContent>Wie kann ich helfen?</BubbleContent>
|
||||
</Bubble>
|
||||
</MessageContent>
|
||||
</Message>
|
||||
<Message align="end">
|
||||
<MessageContent>
|
||||
<Bubble>
|
||||
<BubbleContent>Ich möchte meine Reise umbuchen.</BubbleContent>
|
||||
</Bubble>
|
||||
</MessageContent>
|
||||
</Message>
|
||||
</MessageGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Message Scroller">
|
||||
<MessageScrollerProvider>
|
||||
<MessageScroller className="h-48 border">
|
||||
<MessageScrollerViewport>
|
||||
<MessageScrollerContent className="gap-3 p-3">
|
||||
{VERLAUF.map((nachricht) => (
|
||||
<MessageScrollerItem key={nachricht.id} messageId={nachricht.id}>
|
||||
<Bubble
|
||||
variant={nachricht.von === "service" ? "muted" : "default"}
|
||||
align={nachricht.von === "service" ? "start" : "end"}
|
||||
>
|
||||
<BubbleContent>{nachricht.text}</BubbleContent>
|
||||
</Bubble>
|
||||
</MessageScrollerItem>
|
||||
))}
|
||||
</MessageScrollerContent>
|
||||
</MessageScrollerViewport>
|
||||
<MessageScrollerButton />
|
||||
</MessageScroller>
|
||||
</MessageScrollerProvider>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Marker">
|
||||
<div className="flex w-full flex-col gap-3">
|
||||
<Marker variant="separator">
|
||||
<MarkerContent>Heute</MarkerContent>
|
||||
</Marker>
|
||||
<Marker>
|
||||
<MarkerIcon>
|
||||
<CalendarDaysIcon />
|
||||
</MarkerIcon>
|
||||
<MarkerContent>Reise wurde auf den 12. Juli verschoben</MarkerContent>
|
||||
</Marker>
|
||||
</div>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Trace">
|
||||
<Trace>
|
||||
<TraceLine>
|
||||
<TraceIcon>
|
||||
<SearchIcon />
|
||||
</TraceIcon>
|
||||
<TraceTitle>Hotels in Reykjavík gesucht</TraceTitle>
|
||||
<TraceDescription>1,2 s</TraceDescription>
|
||||
</TraceLine>
|
||||
<TraceLine status="running">
|
||||
<TraceTitle>Preise werden verglichen</TraceTitle>
|
||||
</TraceLine>
|
||||
<TraceCollapsible>
|
||||
<TraceCollapsibleTrigger>
|
||||
<TraceLine>
|
||||
<TraceTitle>3 Angebote gefunden</TraceTitle>
|
||||
</TraceLine>
|
||||
</TraceCollapsibleTrigger>
|
||||
<TraceCollapsibleContent>Hotel Borg, Hotel Klettur, Center Hotel Plaza</TraceCollapsibleContent>
|
||||
</TraceCollapsible>
|
||||
</Trace>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Code Block">
|
||||
<CodeBeispiel />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Questionnaire" breit>
|
||||
<Questionnaire
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
toast.add({ title: "Danke!", description: "Ihre Antworten sind angekommen.", type: "success" });
|
||||
}}
|
||||
>
|
||||
<QuestionnaireProgress />
|
||||
<QuestionnaireItem name="reiseart" required>
|
||||
<QuestionnaireTitle>Wie reisen Sie am liebsten?</QuestionnaireTitle>
|
||||
<QuestionnaireChoices>
|
||||
<QuestionnaireChoice value="rund">Rundreise</QuestionnaireChoice>
|
||||
<QuestionnaireChoice value="kreuz">Kreuzfahrt</QuestionnaireChoice>
|
||||
<QuestionnaireChoice value="stadt">Städtereise</QuestionnaireChoice>
|
||||
</QuestionnaireChoices>
|
||||
</QuestionnaireItem>
|
||||
<QuestionnaireItem name="wunsch">
|
||||
<QuestionnaireTitle>Haben Sie besondere Wünsche?</QuestionnaireTitle>
|
||||
<QuestionnaireInput placeholder="z. B. Fensterplatz" />
|
||||
</QuestionnaireItem>
|
||||
<QuestionnaireActions>
|
||||
<QuestionnairePrevious>Zurück</QuestionnairePrevious>
|
||||
<QuestionnaireNext>Weiter</QuestionnaireNext>
|
||||
<QuestionnaireSubmit>Absenden</QuestionnaireSubmit>
|
||||
</QuestionnaireActions>
|
||||
</Questionnaire>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
"use client";
|
||||
|
||||
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
|
||||
import { ChevronRightIcon, PlaneIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import { Avatar, AvatarFallback, AvatarGroup } from "@/components/ui/avatar";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Carousel,
|
||||
CarouselContent,
|
||||
CarouselItem,
|
||||
CarouselNext,
|
||||
CarouselPrevious,
|
||||
} from "@/components/ui/carousel";
|
||||
import {
|
||||
ChartContainer,
|
||||
ChartTooltip,
|
||||
ChartTooltipContent,
|
||||
type ChartConfig,
|
||||
} from "@/components/ui/chart";
|
||||
import {
|
||||
Item,
|
||||
ItemActions,
|
||||
ItemContent,
|
||||
ItemDescription,
|
||||
ItemMedia,
|
||||
ItemTitle,
|
||||
} from "@/components/ui/item";
|
||||
import { Kbd, KbdGroup } from "@/components/ui/kbd";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
|
||||
const BUCHUNGEN = [
|
||||
{ monat: "Jan", buchungen: 18 },
|
||||
{ monat: "Feb", buchungen: 24 },
|
||||
{ monat: "Mär", buchungen: 31 },
|
||||
{ monat: "Apr", buchungen: 27 },
|
||||
{ monat: "Mai", buchungen: 42 },
|
||||
{ monat: "Jun", buchungen: 38 },
|
||||
];
|
||||
|
||||
const DIAGRAMM: ChartConfig = {
|
||||
buchungen: { label: "Buchungen", color: "var(--ep-tiefblau)" },
|
||||
};
|
||||
|
||||
const REISEN = [
|
||||
{ ziel: "Island", tage: 10, preis: "2.490 €" },
|
||||
{ ziel: "Japan", tage: 14, preis: "4.190 €" },
|
||||
{ ziel: "Peru", tage: 16, preis: "3.780 €" },
|
||||
];
|
||||
|
||||
export function DatenBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Card">
|
||||
<Card className="w-full">
|
||||
<CardHeader>
|
||||
<CardTitle>Island Rundreise</CardTitle>
|
||||
<CardDescription>10 Tage · ab 2.490 €</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="text-sm">Gletscher, Geysire und Polarlichter.</CardContent>
|
||||
<CardFooter>
|
||||
<Button size="sm">Details</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Table">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Ziel</TableHead>
|
||||
<TableHead>Tage</TableHead>
|
||||
<TableHead className="text-right">Preis</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{REISEN.map((reise) => (
|
||||
<TableRow key={reise.ziel}>
|
||||
<TableCell>{reise.ziel}</TableCell>
|
||||
<TableCell>{reise.tage}</TableCell>
|
||||
<TableCell className="text-right">{reise.preis}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Avatar">
|
||||
<Avatar>
|
||||
<AvatarFallback>FB</AvatarFallback>
|
||||
</Avatar>
|
||||
<AvatarGroup>
|
||||
<Avatar>
|
||||
<AvatarFallback>AK</AvatarFallback>
|
||||
</Avatar>
|
||||
<Avatar>
|
||||
<AvatarFallback>MS</AvatarFallback>
|
||||
</Avatar>
|
||||
<Avatar>
|
||||
<AvatarFallback>LW</AvatarFallback>
|
||||
</Avatar>
|
||||
</AvatarGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Chart">
|
||||
<ChartContainer config={DIAGRAMM} className="h-44 w-full">
|
||||
<BarChart data={BUCHUNGEN}>
|
||||
<CartesianGrid vertical={false} />
|
||||
<XAxis dataKey="monat" tickLine={false} axisLine={false} />
|
||||
<ChartTooltip content={<ChartTooltipContent />} />
|
||||
<Bar dataKey="buchungen" fill="var(--color-buchungen)" />
|
||||
</BarChart>
|
||||
</ChartContainer>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Carousel">
|
||||
<Carousel className="mx-12 w-full">
|
||||
<CarouselContent>
|
||||
{["Island", "Japan", "Peru"].map((ziel) => (
|
||||
<CarouselItem key={ziel}>
|
||||
<div className="flex h-28 items-center justify-center bg-accent-soft font-bold">{ziel}</div>
|
||||
</CarouselItem>
|
||||
))}
|
||||
</CarouselContent>
|
||||
<CarouselPrevious />
|
||||
<CarouselNext />
|
||||
</Carousel>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Item">
|
||||
<Item variant="outline" className="w-full">
|
||||
<ItemMedia variant="icon">
|
||||
<PlaneIcon />
|
||||
</ItemMedia>
|
||||
<ItemContent>
|
||||
<ItemTitle>Flug LH 450</ItemTitle>
|
||||
<ItemDescription>Frankfurt → Reykjavík · 08:40 Uhr</ItemDescription>
|
||||
</ItemContent>
|
||||
<ItemActions>
|
||||
<ChevronRightIcon className="size-4" />
|
||||
</ItemActions>
|
||||
</Item>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Kbd">
|
||||
<KbdGroup>
|
||||
<Kbd>Strg</Kbd>
|
||||
<Kbd>K</Kbd>
|
||||
</KbdGroup>
|
||||
<span className="text-sm text-ink-muted">öffnet die Suche</span>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
"use client";
|
||||
|
||||
import { InfoIcon, InboxIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Empty,
|
||||
EmptyContent,
|
||||
EmptyDescription,
|
||||
EmptyHeader,
|
||||
EmptyMedia,
|
||||
EmptyTitle,
|
||||
} from "@/components/ui/empty";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { toast } from "@/components/ui/toast";
|
||||
|
||||
export function FeedbackBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Alert">
|
||||
<Alert>
|
||||
<InfoIcon />
|
||||
<AlertTitle>Hinweis</AlertTitle>
|
||||
<AlertDescription>Für diese Reise ist ein gültiger Reisepass nötig.</AlertDescription>
|
||||
</Alert>
|
||||
<Alert variant="destructive">
|
||||
<AlertTitle>Fehler</AlertTitle>
|
||||
<AlertDescription>Die Buchung konnte nicht gespeichert werden.</AlertDescription>
|
||||
</Alert>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Toast">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
toast.add({
|
||||
title: "Gespeichert",
|
||||
description: "Die Reise wurde angelegt.",
|
||||
type: "success",
|
||||
})
|
||||
}
|
||||
>
|
||||
Toast anzeigen
|
||||
</Button>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Progress">
|
||||
<Progress value={60} className="w-full" />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Skeleton">
|
||||
<div className="flex w-full items-center gap-3">
|
||||
<Skeleton className="size-10 rounded-full" />
|
||||
<div className="flex flex-1 flex-col gap-2">
|
||||
<Skeleton className="h-4 w-3/4" />
|
||||
<Skeleton className="h-4 w-1/2" />
|
||||
</div>
|
||||
</div>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Spinner">
|
||||
<Spinner />
|
||||
<Button disabled>
|
||||
<Spinner /> Wird geladen
|
||||
</Button>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Badge">
|
||||
<Badge>Neu</Badge>
|
||||
<Badge variant="secondary">Entwurf</Badge>
|
||||
<Badge variant="outline">Archiv</Badge>
|
||||
<Badge variant="destructive">Storniert</Badge>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Empty">
|
||||
<Empty className="border border-dashed">
|
||||
<EmptyHeader>
|
||||
<EmptyMedia variant="icon">
|
||||
<InboxIcon />
|
||||
</EmptyMedia>
|
||||
<EmptyTitle>Noch keine Buchungen</EmptyTitle>
|
||||
<EmptyDescription>Sobald jemand bucht, erscheint es hier.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
<EmptyContent>
|
||||
<Button size="sm">Buchung anlegen</Button>
|
||||
</EmptyContent>
|
||||
</Empty>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { format } from "date-fns";
|
||||
import { de } from "date-fns/locale";
|
||||
import { BoldIcon, CalendarIcon, ItalicIcon, SearchIcon, UnderlineIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ButtonGroup } from "@/components/ui/button-group";
|
||||
import { Calendar } from "@/components/ui/calendar";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
Combobox,
|
||||
ComboboxContent,
|
||||
ComboboxEmpty,
|
||||
ComboboxInput,
|
||||
ComboboxItem,
|
||||
ComboboxList,
|
||||
} from "@/components/ui/combobox";
|
||||
import { Field, FieldDescription, FieldLabel } from "@/components/ui/field";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group";
|
||||
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "@/components/ui/input-otp";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Slider } from "@/components/ui/slider";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Toggle } from "@/components/ui/toggle";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
|
||||
const REISEZIELE = ["Island", "Japan", "Kanada", "Namibia", "Norwegen", "Peru"];
|
||||
|
||||
const ZIMMER = [
|
||||
{ label: "Einzelzimmer", value: "ez" },
|
||||
{ label: "Doppelzimmer", value: "dz" },
|
||||
{ label: "Suite", value: "suite" },
|
||||
];
|
||||
|
||||
export function FormularBeispiele() {
|
||||
const [datum, setDatum] = React.useState<Date | undefined>(new Date());
|
||||
const [reisedatum, setReisedatum] = React.useState<Date | undefined>();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Button">
|
||||
<Button>Standard</Button>
|
||||
<Button variant="secondary">Sekundär</Button>
|
||||
<Button variant="outline">Umriss</Button>
|
||||
<Button variant="ghost">Ghost</Button>
|
||||
<Button variant="destructive">Löschen</Button>
|
||||
<Button variant="link">Link</Button>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Button Group">
|
||||
<ButtonGroup>
|
||||
<Button variant="outline">Zurück</Button>
|
||||
<Button variant="outline">Heute</Button>
|
||||
<Button variant="outline">Weiter</Button>
|
||||
</ButtonGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Input">
|
||||
<Input placeholder="Name der Reise" />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Input Group">
|
||||
<InputGroup>
|
||||
<InputGroupInput placeholder="Hotels suchen …" />
|
||||
<InputGroupAddon>
|
||||
<SearchIcon />
|
||||
</InputGroupAddon>
|
||||
<InputGroupAddon align="inline-end">12 Treffer</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Input OTP">
|
||||
<InputOTP maxLength={6}>
|
||||
<InputOTPGroup>
|
||||
<InputOTPSlot index={0} />
|
||||
<InputOTPSlot index={1} />
|
||||
<InputOTPSlot index={2} />
|
||||
</InputOTPGroup>
|
||||
<InputOTPSeparator />
|
||||
<InputOTPGroup>
|
||||
<InputOTPSlot index={3} />
|
||||
<InputOTPSlot index={4} />
|
||||
<InputOTPSlot index={5} />
|
||||
</InputOTPGroup>
|
||||
</InputOTP>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Textarea">
|
||||
<Textarea placeholder="Besondere Wünsche zur Reise …" />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Label">
|
||||
<Label htmlFor="galerie-label">Vorname</Label>
|
||||
<Input id="galerie-label" placeholder="Max" />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Field">
|
||||
<Field>
|
||||
<FieldLabel htmlFor="galerie-email">E-Mail</FieldLabel>
|
||||
<Input id="galerie-email" type="email" placeholder="[email protected]" />
|
||||
<FieldDescription>Wir senden die Bestätigung an diese Adresse.</FieldDescription>
|
||||
</Field>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Checkbox">
|
||||
<Label>
|
||||
<Checkbox defaultChecked /> Reiserücktrittsversicherung
|
||||
</Label>
|
||||
<Label>
|
||||
<Checkbox /> Newsletter
|
||||
</Label>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Radio Group">
|
||||
<RadioGroup defaultValue="bahn">
|
||||
<Label>
|
||||
<RadioGroupItem value="bahn" /> Anreise mit der Bahn
|
||||
</Label>
|
||||
<Label>
|
||||
<RadioGroupItem value="flug" /> Anreise mit dem Flugzeug
|
||||
</Label>
|
||||
</RadioGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Switch">
|
||||
<Label>
|
||||
<Switch defaultChecked /> Benachrichtigungen
|
||||
</Label>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Slider">
|
||||
<Slider defaultValue={[40]} max={100} />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Select">
|
||||
<Select items={ZIMMER} defaultValue="dz">
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
{ZIMMER.map((zimmer) => (
|
||||
<SelectItem key={zimmer.value} value={zimmer.value}>
|
||||
{zimmer.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Native Select">
|
||||
<NativeSelect defaultValue="">
|
||||
<NativeSelectOption value="" disabled>
|
||||
Verpflegung wählen
|
||||
</NativeSelectOption>
|
||||
<NativeSelectOption value="fr">Frühstück</NativeSelectOption>
|
||||
<NativeSelectOption value="hp">Halbpension</NativeSelectOption>
|
||||
<NativeSelectOption value="vp">Vollpension</NativeSelectOption>
|
||||
</NativeSelect>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Combobox">
|
||||
<Combobox items={REISEZIELE}>
|
||||
<ComboboxInput placeholder="Reiseziel wählen" />
|
||||
<ComboboxContent>
|
||||
<ComboboxEmpty>Kein Reiseziel gefunden.</ComboboxEmpty>
|
||||
<ComboboxList>
|
||||
{(ziel: string) => (
|
||||
<ComboboxItem key={ziel} value={ziel}>
|
||||
{ziel}
|
||||
</ComboboxItem>
|
||||
)}
|
||||
</ComboboxList>
|
||||
</ComboboxContent>
|
||||
</Combobox>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Calendar">
|
||||
<Calendar mode="single" selected={datum} onSelect={setDatum} />
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Date Picker (Calendar + Popover)">
|
||||
<Popover>
|
||||
<PopoverTrigger render={<Button variant="outline" className="justify-start" />}>
|
||||
<CalendarIcon />
|
||||
{reisedatum ? format(reisedatum, "d. MMMM yyyy", { locale: de }) : "Reisedatum wählen"}
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-auto p-0">
|
||||
<Calendar mode="single" selected={reisedatum} onSelect={setReisedatum} />
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Toggle">
|
||||
<Toggle aria-label="Fett">
|
||||
<BoldIcon />
|
||||
</Toggle>
|
||||
<Toggle variant="outline" aria-label="Kursiv">
|
||||
<ItalicIcon />
|
||||
</Toggle>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Toggle Group">
|
||||
<ToggleGroup variant="outline" defaultValue={["fett"]}>
|
||||
<ToggleGroupItem value="fett" aria-label="Fett">
|
||||
<BoldIcon />
|
||||
</ToggleGroupItem>
|
||||
<ToggleGroupItem value="kursiv" aria-label="Kursiv">
|
||||
<ItalicIcon />
|
||||
</ToggleGroupItem>
|
||||
<ToggleGroupItem value="unterstrichen" aria-label="Unterstrichen">
|
||||
<UnderlineIcon />
|
||||
</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
"use client";
|
||||
|
||||
import { ChevronsUpDownIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} from "@/components/ui/accordion";
|
||||
import { AspectRatio } from "@/components/ui/aspect-ratio";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
||||
import { DirectionProvider } from "@/components/ui/direction";
|
||||
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { Slider } from "@/components/ui/slider";
|
||||
|
||||
const LAENDER = [
|
||||
"Argentinien", "Australien", "Chile", "China", "Costa Rica", "Indien", "Island", "Japan",
|
||||
"Kanada", "Kenia", "Marokko", "Namibia", "Neuseeland", "Norwegen", "Peru", "Vietnam",
|
||||
];
|
||||
|
||||
export function LayoutBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Accordion">
|
||||
<Accordion className="w-full">
|
||||
<AccordionItem value="leistungen">
|
||||
<AccordionTrigger>Was ist enthalten?</AccordionTrigger>
|
||||
<AccordionContent>Flug, Hotel, Frühstück und Reiseleitung.</AccordionContent>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="storno">
|
||||
<AccordionTrigger>Wie storniere ich?</AccordionTrigger>
|
||||
<AccordionContent>Bis 30 Tage vor Abreise kostenlos.</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Collapsible">
|
||||
<Collapsible className="w-full">
|
||||
<CollapsibleTrigger render={<Button variant="ghost" size="sm" />}>
|
||||
Reiseverlauf anzeigen <ChevronsUpDownIcon />
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="mt-2 flex flex-col gap-1 text-sm text-ink-muted">
|
||||
<p>Tag 1: Ankunft in Reykjavík</p>
|
||||
<p>Tag 2: Golden Circle</p>
|
||||
<p>Tag 3: Südküste</p>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Aspect Ratio">
|
||||
<div className="w-full">
|
||||
<AspectRatio ratio={16 / 9} className="flex items-center justify-center bg-accent-soft text-sm">
|
||||
16 : 9
|
||||
</AspectRatio>
|
||||
</div>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Resizable">
|
||||
<ResizablePanelGroup orientation="horizontal" className="min-h-28 border">
|
||||
<ResizablePanel defaultSize="50%">
|
||||
<div className="flex h-full items-center justify-center text-sm">Links</div>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle withHandle />
|
||||
<ResizablePanel defaultSize="50%">
|
||||
<div className="flex h-full items-center justify-center text-sm">Rechts</div>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Scroll Area">
|
||||
<ScrollArea className="h-36 w-full border">
|
||||
<div className="p-3">
|
||||
{LAENDER.map((land, index) => (
|
||||
<div key={land}>
|
||||
{index > 0 && <Separator className="my-2" />}
|
||||
<p className="text-sm">{land}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Separator">
|
||||
<div className="flex h-5 items-center gap-3 text-sm">
|
||||
<span>Flüge</span>
|
||||
<Separator orientation="vertical" />
|
||||
<span>Hotels</span>
|
||||
<Separator orientation="vertical" />
|
||||
<span>Mietwagen</span>
|
||||
</div>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Direction (rechts nach links)">
|
||||
<DirectionProvider direction="rtl">
|
||||
<div dir="rtl" className="w-full">
|
||||
<Slider defaultValue={[30]} max={100} />
|
||||
</div>
|
||||
</DirectionProvider>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
"use client";
|
||||
|
||||
import { HomeIcon, MapIcon, PlaneIcon, SettingsIcon } from "lucide-react";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
BreadcrumbLink,
|
||||
BreadcrumbList,
|
||||
BreadcrumbPage,
|
||||
BreadcrumbSeparator,
|
||||
} from "@/components/ui/breadcrumb";
|
||||
import {
|
||||
Command,
|
||||
CommandEmpty,
|
||||
CommandGroup,
|
||||
CommandInput,
|
||||
CommandItem,
|
||||
CommandList,
|
||||
CommandShortcut,
|
||||
} from "@/components/ui/command";
|
||||
import {
|
||||
Menubar,
|
||||
MenubarContent,
|
||||
MenubarItem,
|
||||
MenubarMenu,
|
||||
MenubarSeparator,
|
||||
MenubarShortcut,
|
||||
MenubarTrigger,
|
||||
} from "@/components/ui/menubar";
|
||||
import {
|
||||
NavigationMenu,
|
||||
NavigationMenuContent,
|
||||
NavigationMenuItem,
|
||||
NavigationMenuLink,
|
||||
NavigationMenuList,
|
||||
NavigationMenuTrigger,
|
||||
} from "@/components/ui/navigation-menu";
|
||||
import {
|
||||
Pagination,
|
||||
PaginationContent,
|
||||
PaginationEllipsis,
|
||||
PaginationItem,
|
||||
PaginationLink,
|
||||
PaginationNext,
|
||||
PaginationPrevious,
|
||||
} from "@/components/ui/pagination";
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
SidebarGroup,
|
||||
SidebarGroupContent,
|
||||
SidebarGroupLabel,
|
||||
SidebarInset,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
SidebarProvider,
|
||||
} from "@/components/ui/sidebar";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
||||
const SEITENLEISTE = [
|
||||
{ titel: "Übersicht", icon: HomeIcon, aktiv: true },
|
||||
{ titel: "Reisen", icon: PlaneIcon, aktiv: false },
|
||||
{ titel: "Ziele", icon: MapIcon, aktiv: false },
|
||||
{ titel: "Einstellungen", icon: SettingsIcon, aktiv: false },
|
||||
];
|
||||
|
||||
export function NavigationBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Breadcrumb">
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink href="#">Start</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink href="#">Reisen</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>Island</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Navigation Menu">
|
||||
<NavigationMenu>
|
||||
<NavigationMenuList>
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuTrigger>Reisen</NavigationMenuTrigger>
|
||||
<NavigationMenuContent>
|
||||
<ul className="grid w-56 gap-1">
|
||||
<li>
|
||||
<NavigationMenuLink href="#">Rundreisen</NavigationMenuLink>
|
||||
</li>
|
||||
<li>
|
||||
<NavigationMenuLink href="#">Kreuzfahrten</NavigationMenuLink>
|
||||
</li>
|
||||
<li>
|
||||
<NavigationMenuLink href="#">Städtereisen</NavigationMenuLink>
|
||||
</li>
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuLink href="#">Kontakt</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
</NavigationMenuList>
|
||||
</NavigationMenu>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Menubar">
|
||||
<Menubar>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>Datei</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarItem>
|
||||
Neu <MenubarShortcut>⌘N</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarItem>Öffnen</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem>Drucken</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
<MenubarMenu>
|
||||
<MenubarTrigger>Bearbeiten</MenubarTrigger>
|
||||
<MenubarContent>
|
||||
<MenubarItem>Rückgängig</MenubarItem>
|
||||
<MenubarItem>Wiederholen</MenubarItem>
|
||||
</MenubarContent>
|
||||
</MenubarMenu>
|
||||
</Menubar>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Pagination">
|
||||
<Pagination>
|
||||
<PaginationContent>
|
||||
<PaginationItem>
|
||||
<PaginationPrevious href="#" />
|
||||
</PaginationItem>
|
||||
<PaginationItem>
|
||||
<PaginationLink href="#">1</PaginationLink>
|
||||
</PaginationItem>
|
||||
<PaginationItem>
|
||||
<PaginationLink href="#" isActive>
|
||||
2
|
||||
</PaginationLink>
|
||||
</PaginationItem>
|
||||
<PaginationItem>
|
||||
<PaginationEllipsis />
|
||||
</PaginationItem>
|
||||
<PaginationItem>
|
||||
<PaginationNext href="#" />
|
||||
</PaginationItem>
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Tabs">
|
||||
<Tabs defaultValue="flug" className="w-full">
|
||||
<TabsList>
|
||||
<TabsTrigger value="flug">Flug</TabsTrigger>
|
||||
<TabsTrigger value="hotel">Hotel</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="flug" className="text-sm text-ink-muted">
|
||||
Direktflug ab Frankfurt.
|
||||
</TabsContent>
|
||||
<TabsContent value="hotel" className="text-sm text-ink-muted">
|
||||
4 Nächte im Hotel am Hafen.
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Command">
|
||||
<Command className="border">
|
||||
<CommandInput placeholder="Befehl suchen …" />
|
||||
<CommandList>
|
||||
<CommandEmpty>Nichts gefunden.</CommandEmpty>
|
||||
<CommandGroup heading="Vorschläge">
|
||||
<CommandItem>
|
||||
Neue Reise anlegen <CommandShortcut>⌘R</CommandShortcut>
|
||||
</CommandItem>
|
||||
<CommandItem>Kunden suchen</CommandItem>
|
||||
<CommandItem>Einstellungen</CommandItem>
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
</Command>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Sidebar" breit>
|
||||
<SidebarProvider className="min-h-0 overflow-hidden border">
|
||||
<Sidebar collapsible="none">
|
||||
<SidebarContent>
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel>Menü</SidebarGroupLabel>
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenu>
|
||||
{SEITENLEISTE.map((eintrag) => (
|
||||
<SidebarMenuItem key={eintrag.titel}>
|
||||
<SidebarMenuButton isActive={eintrag.aktiv}>
|
||||
<eintrag.icon />
|
||||
<span>{eintrag.titel}</span>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
</SidebarContent>
|
||||
</Sidebar>
|
||||
<SidebarInset className="p-4 text-sm text-ink-muted">Hier steht der Seiteninhalt.</SidebarInset>
|
||||
</SidebarProvider>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
"use client";
|
||||
|
||||
import { Eintrag } from "@/components/galerie/eintrag";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
ContextMenu,
|
||||
ContextMenuContent,
|
||||
ContextMenuItem,
|
||||
ContextMenuSeparator,
|
||||
ContextMenuTrigger,
|
||||
} from "@/components/ui/context-menu";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import {
|
||||
Drawer,
|
||||
DrawerContent,
|
||||
DrawerDescription,
|
||||
DrawerHeader,
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from "@/components/ui/drawer";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverDescription,
|
||||
PopoverHeader,
|
||||
PopoverTitle,
|
||||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetDescription,
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from "@/components/ui/sheet";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
|
||||
export function OverlayBeispiele() {
|
||||
return (
|
||||
<>
|
||||
<Eintrag name="Dialog">
|
||||
<Dialog>
|
||||
<DialogTrigger render={<Button variant="outline" />}>Dialog öffnen</DialogTrigger>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Reise umbenennen</DialogTitle>
|
||||
<DialogDescription>Der neue Name erscheint in allen Übersichten.</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Input defaultValue="Island Rundreise" />
|
||||
<DialogFooter showCloseButton>
|
||||
<Button>Speichern</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Alert Dialog">
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger render={<Button variant="destructive" />}>Reise löschen</AlertDialogTrigger>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Reise wirklich löschen?</AlertDialogTitle>
|
||||
<AlertDialogDescription>Das lässt sich nicht rückgängig machen.</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Abbrechen</AlertDialogCancel>
|
||||
<AlertDialogAction>Löschen</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Sheet">
|
||||
<Sheet>
|
||||
<SheetTrigger render={<Button variant="outline" />}>Seitenleiste öffnen</SheetTrigger>
|
||||
<SheetContent side="right">
|
||||
<SheetHeader>
|
||||
<SheetTitle>Filter</SheetTitle>
|
||||
<SheetDescription>Reisen nach Region und Dauer eingrenzen.</SheetDescription>
|
||||
</SheetHeader>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Drawer">
|
||||
<Drawer>
|
||||
<DrawerTrigger render={<Button variant="outline" />}>Drawer öffnen</DrawerTrigger>
|
||||
<DrawerContent>
|
||||
<DrawerHeader>
|
||||
<DrawerTitle>Reisedetails</DrawerTitle>
|
||||
<DrawerDescription>Nach unten wischen zum Schließen.</DrawerDescription>
|
||||
</DrawerHeader>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Popover">
|
||||
<Popover>
|
||||
<PopoverTrigger render={<Button variant="outline" />}>Popover öffnen</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<PopoverHeader>
|
||||
<PopoverTitle>Reisende</PopoverTitle>
|
||||
<PopoverDescription>2 Erwachsene, 1 Kind</PopoverDescription>
|
||||
</PopoverHeader>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Tooltip">
|
||||
<Tooltip>
|
||||
<TooltipTrigger render={<Button variant="outline" />}>Mit der Maus darüber</TooltipTrigger>
|
||||
<TooltipContent>Zusätzliche Information</TooltipContent>
|
||||
</Tooltip>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Hover Card">
|
||||
<HoverCard>
|
||||
<HoverCardTrigger href="#">@reiseleitung</HoverCardTrigger>
|
||||
<HoverCardContent className="text-sm">
|
||||
<p className="font-bold">Reiseleitung Island</p>
|
||||
<p className="text-ink-muted">Begleitet seit 2015 Gruppen durch Island.</p>
|
||||
</HoverCardContent>
|
||||
</HoverCard>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Dropdown Menu">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger render={<Button variant="outline" />}>Aktionen</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuLabel>Reise</DropdownMenuLabel>
|
||||
<DropdownMenuItem>Bearbeiten</DropdownMenuItem>
|
||||
<DropdownMenuItem>Duplizieren</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem variant="destructive">Löschen</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</Eintrag>
|
||||
|
||||
<Eintrag name="Context Menu">
|
||||
<ContextMenu>
|
||||
<ContextMenuTrigger className="flex h-24 w-full items-center justify-center border border-dashed text-sm text-ink-muted">
|
||||
Rechtsklick hier
|
||||
</ContextMenuTrigger>
|
||||
<ContextMenuContent>
|
||||
<ContextMenuItem>Kopieren</ContextMenuItem>
|
||||
<ContextMenuItem>Einfügen</ContextMenuItem>
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem variant="destructive">Entfernen</ContextMenuItem>
|
||||
</ContextMenuContent>
|
||||
</ContextMenu>
|
||||
</Eintrag>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Eine Kachel der Galerie: Name der Komponente und ein lebendes Beispiel.
|
||||
// "breit" belegt auf größeren Bildschirmen zwei Spalten.
|
||||
export function Eintrag({
|
||||
name,
|
||||
breit = false,
|
||||
children,
|
||||
}: {
|
||||
name: string;
|
||||
breit?: boolean;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<section className={cn("ep-karte flex min-w-0 flex-col gap-4", breit && "sm:col-span-2")}>
|
||||
<h3 className="text-sm font-bold text-ink-muted">{name}</h3>
|
||||
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-3">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { ChatBeispiele } from "@/components/galerie/beispiele/chat";
|
||||
import { DatenBeispiele } from "@/components/galerie/beispiele/daten";
|
||||
import { FeedbackBeispiele } from "@/components/galerie/beispiele/feedback";
|
||||
import { FormularBeispiele } from "@/components/galerie/beispiele/formulare";
|
||||
import { LayoutBeispiele } from "@/components/galerie/beispiele/layout";
|
||||
import { NavigationBeispiele } from "@/components/galerie/beispiele/navigation";
|
||||
import { OverlayBeispiele } from "@/components/galerie/beispiele/overlays";
|
||||
import { Toaster } from "@/components/ui/toast";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
|
||||
// Alle shadcn/ui-Komponenten aus components/ui, nach Kategorien geordnet.
|
||||
// Neue Komponente: in der passenden Datei unter beispiele/ eine <Eintrag>-Kachel ergänzen.
|
||||
const KATEGORIEN = [
|
||||
{ id: "formulare", titel: "Formulare & Eingaben", Inhalt: FormularBeispiele },
|
||||
{ id: "navigation", titel: "Navigation", Inhalt: NavigationBeispiele },
|
||||
{ id: "overlays", titel: "Overlays & Menüs", Inhalt: OverlayBeispiele },
|
||||
{ id: "feedback", titel: "Feedback & Status", Inhalt: FeedbackBeispiele },
|
||||
{ id: "daten", titel: "Datenanzeige", Inhalt: DatenBeispiele },
|
||||
{ id: "layout", titel: "Layout", Inhalt: LayoutBeispiele },
|
||||
{ id: "chat", titel: "Chat & KI", Inhalt: ChatBeispiele },
|
||||
];
|
||||
|
||||
export function Galerie() {
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<nav aria-label="Kategorien" className="mb-10 flex flex-wrap gap-x-5 gap-y-2 text-sm">
|
||||
{KATEGORIEN.map((kategorie) => (
|
||||
<a key={kategorie.id} href={`#${kategorie.id}`}>
|
||||
{kategorie.titel}
|
||||
</a>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
<div className="flex flex-col gap-14">
|
||||
{KATEGORIEN.map(({ id, titel, Inhalt }) => (
|
||||
<section key={id} id={id} aria-labelledby={`${id}-titel`} className="scroll-mt-6">
|
||||
<h2 id={`${id}-titel`} className="ep-ueberschrift mb-6 text-2xl">
|
||||
{titel}
|
||||
</h2>
|
||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Inhalt />
|
||||
</div>
|
||||
</section>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Toaster />
|
||||
</TooltipProvider>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user