Skip to content

Commit 7198256

Browse files
committed
feat: create new gallery banner
1 parent 084771d commit 7198256

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

apps/kit/lib/layout.shared.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@ export const linkItems: LinkItemType[] = [
1313
url: "/docs",
1414
active: "nested-url",
1515
},
16+
{
17+
text: "Components",
18+
url: "/docs/components/button",
19+
active: "nested-url",
20+
},
1621
{
1722
text: "Changelog",
1823
url: "/changelog",
1924
active: "nested-url",
2025
},
26+
{
27+
text: "Gallery",
28+
url: "https://gallery.uxpatterns.dev",
29+
external: false,
30+
},
2131
];
2232

2333
export function baseOptions(): HomeLayoutProps {
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
"use client";
2+
3+
import { cn } from "@ux-patterns/ui/lib/utils";
4+
import { ArrowRight, Sparkles } from "lucide-react";
5+
import Link from "next/link";
6+
import { usePlausible } from "next-plausible";
7+
8+
type GalleryBannerProps = {
9+
title?: string;
10+
description?: string;
11+
galleryPath?: string;
12+
className?: string;
13+
};
14+
15+
export const GalleryBanner = ({
16+
title = "Explore Pattern Gallery",
17+
description = "See real-world implementations and examples",
18+
galleryPath = "https://gallery.uxpatterns.dev",
19+
className,
20+
}: GalleryBannerProps) => {
21+
const plausible = usePlausible();
22+
23+
return (
24+
<Link
25+
href={galleryPath}
26+
className={cn(
27+
"not-prose group relative mb-8 flex items-center justify-between rounded-lg",
28+
"border border-border/50 overflow-hidden",
29+
"px-4 py-3 transition-all duration-200",
30+
"hover:border-primary/30 hover:shadow-md",
31+
className,
32+
)}
33+
onClick={() => {
34+
plausible("Gallery Banner Click", {
35+
props: {
36+
gallery_path: galleryPath,
37+
title: title,
38+
},
39+
});
40+
}}
41+
>
42+
{/* Background gradient animation */}
43+
<div className="absolute inset-0 bg-gradient-to-r from-purple-500/10 via-pink-500/10 to-orange-500/10 opacity-50 group-hover:opacity-70 transition-opacity" />
44+
45+
{/* Animated SVG pattern */}
46+
<svg
47+
className="absolute inset-0 w-full h-full opacity-10"
48+
xmlns="http://www.w3.org/2000/svg"
49+
>
50+
<defs>
51+
<pattern
52+
id="gallery-pattern"
53+
x="0"
54+
y="0"
55+
width="40"
56+
height="40"
57+
patternUnits="userSpaceOnUse"
58+
>
59+
<circle
60+
cx="20"
61+
cy="20"
62+
r="1.5"
63+
fill="currentColor"
64+
className="text-primary"
65+
>
66+
<animate
67+
attributeName="r"
68+
values="1.5;2.5;1.5"
69+
dur="3s"
70+
repeatCount="indefinite"
71+
/>
72+
</circle>
73+
</pattern>
74+
</defs>
75+
<rect width="100%" height="100%" fill="url(#gallery-pattern)" />
76+
</svg>
77+
78+
<div className="relative flex items-center gap-3">
79+
<div className="flex h-10 w-10 items-center justify-center rounded-md bg-gradient-to-br from-purple-500/20 to-pink-500/20 backdrop-blur-sm">
80+
<Sparkles className="h-5 w-5 text-primary" />
81+
</div>
82+
<div className="flex flex-col">
83+
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wider">
84+
UX Patterns Gallery
85+
</span>
86+
<span className="text-sm font-semibold bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent">
87+
{title}
88+
</span>
89+
<span className="text-xs text-muted-foreground mt-0.5">
90+
{description}
91+
</span>
92+
</div>
93+
</div>
94+
<ArrowRight className="relative h-4 w-4 text-muted-foreground transition-all group-hover:translate-x-1 group-hover:text-primary" />
95+
</Link>
96+
);
97+
};

apps/web/content/patterns/content-management/popover.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ icon: MessageSquare
66
status: complete
77
---
88

9+
<GalleryBanner
10+
title="View Popover Examples"
11+
description="Discover what to do (and avoid) from real implementations"
12+
galleryPath="https://gallery.uxpatterns.dev/web/feedback/popover"
13+
/>
14+
915
## Overview
1016

1117
**Popovers** overlay the main content to give users additional information or actions.
@@ -383,6 +389,12 @@ These design tokens follow the [Design Tokens Format](https://design-tokens.gith
383389
}
384390
```
385391

392+
<GalleryBanner
393+
title="Ready to see it in action?"
394+
description="Discover what to do (and avoid) from real implementations"
395+
galleryPath="https://gallery.uxpatterns.dev/web/feedback/popover"
396+
/>
397+
386398
## Related Patterns
387399

388400
Consider these related patterns when implementing popovers:

apps/web/mdx-components.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BrowserSupport } from "@/components/browser-support";
44
import { BuildEffort } from "@/components/build-effort";
55
import { ComponentPreviewWithMetadata } from "@/components/component-preview-wrapper";
66
import { FaqStructuredData } from "@/components/faq-structured-data";
7+
import { GalleryBanner } from "@/components/gallery-banner";
78
import { KitBanner } from "@/components/kit-banner";
89
import { LinkCustom } from "@/components/link-custom";
910
import { LazyMermaid } from "@/components/mdx/lazy-mermaid";
@@ -32,6 +33,7 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
3233
RelatedPatternsCard,
3334
PatternGuideList,
3435
KitBanner,
36+
GalleryBanner,
3537
...components,
3638
};
3739
}

0 commit comments

Comments
 (0)