Skip to content

Commit c89c653

Browse files
committed
feat: add icons to cards and improve UI
1 parent 703edc9 commit c89c653

File tree

8 files changed

+108
-24
lines changed

8 files changed

+108
-24
lines changed

app/_components/sections/overview-grid.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { cn } from '@/app/_utils/cn'
22
import { getPatterns } from '@app/_utils/get-patterns'
3+
import { type LucideIcon } from 'lucide-react'
34
import { LinkCustom } from '../link-custom'
45
import { Badge } from '../ui/badge'
56

67
type Pattern = {
78
title: string
89
description: string
10+
icon?: LucideIcon;
911
href?: string
1012
comingSoon?: boolean
1113
}
@@ -34,7 +36,7 @@ export const OverviewGrid = async ({ lang }: { lang: string }) => {
3436
const PatternWrapper = ({ pattern }: { pattern: Pattern }) => {
3537
const wrapperClasses = cn(
3638
"relative rounded-xl border border-neutral-200 dark:border-neutral-800",
37-
!pattern.comingSoon && "hover:border-neutral-400 dark:hover:border-neutral-600 hover:scale-105 transition-all duration-100 ease-in-out"
39+
!pattern.comingSoon && "border-neutral-400 dark:border-neutral-600 hover:bg-neutral-100 hover:border-neutral-200 dark:hover:bg-neutral-900 dark:hover:border-neutral-400 hover:scale-105 transition-all duration-100 ease-in-out"
3840
)
3941

4042
const content = <PatternContent pattern={pattern} />
@@ -56,21 +58,27 @@ const PatternWrapper = ({ pattern }: { pattern: Pattern }) => {
5658

5759
const PatternContent = ({ pattern }: { pattern: Pattern }) => (
5860
<div className={cn(
59-
"relative overflow-hidden rounded-xl p-5 transition-all duration-300",
60-
!pattern.comingSoon ? "hover:animate-card-hover cursor-pointer" : "opacity-75 cursor-not-allowed"
61+
"relative flex flex-col gap-4 overflow-hidden rounded-xl p-5 transition-all duration-300",
62+
!pattern.comingSoon ? "hover:animate-card-hover cursor-pointer" : "opacity-60 cursor-not-allowed"
6163
)}>
64+
6265
<div className="flex items-center justify-between">
63-
<h3 className="font-display text-xl font-semibold text-foreground">
64-
{pattern.title}
65-
</h3>
66+
{pattern.icon && <pattern.icon className="h-8 w-8 text-primary" />}
67+
{pattern.comingSoon && (
68+
<Badge variant="outline">
69+
Coming soon
70+
</Badge>
71+
)}
72+
</div>
73+
<div className="flex flex-col gap-2">
74+
<div className="flex items-center justify-between">
75+
<h3 className="font-display text-xl font-semibold text-foreground">
76+
{pattern.title}
77+
</h3>
78+
</div>
79+
<p className="mb-3 text-sm text-foreground leading-6!">
80+
{pattern.description}
81+
</p>
6682
</div>
67-
<p className="mt-2 mb-3 text-sm text-foreground leading-6!">
68-
{pattern.description}
69-
</p>
70-
{pattern.comingSoon && (
71-
<Badge variant="outline">
72-
Coming soon
73-
</Badge>
74-
)}
7583
</div>
7684
)

app/_components/stars.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function Stars() {
1717
}, [])
1818

1919
if (stars === null) return <div className="flex items-center justify-center gap-2">
20-
<span className="inline-flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 text-sm font-medium text-gray-900 dark:text-gray-100 rounded-lg border border-gray-200 dark:border-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-200 dark:focus:ring-gray-700">Loading...</span>
20+
<span className="inline-flex items-center gap-2 px-4 py-2 bg-white dark:bg-neutral-800 hover:bg-neutral-50 dark:hover:bg-neutral-700 text-sm font-medium text-neutral-900 dark:text-neutral-100 rounded-lg border border-neutral-200 dark:border-neutral-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200 dark:focus:ring-neutral-700">Loading...</span>
2121
</div>
2222

2323
return (
@@ -26,11 +26,11 @@ export function Stars() {
2626
href={PROJECT_URL}
2727
target="_blank"
2828
rel="noopener noreferrer"
29-
className="plausible-event-name=Star+Github inline-flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 text-sm font-medium text-gray-900 dark:text-gray-100 rounded-lg border border-gray-200 dark:border-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-200 dark:focus:ring-gray-700"
29+
className="plausible-event-name=Star+Github inline-flex items-center gap-2 px-4 py-2 bg-white dark:bg-neutral-900 hover:bg-neutral-50 dark:hover:bg-neutral-700 text-sm font-medium text-neutral-900 dark:text-neutral-100 rounded-lg border border-neutral-400 dark:border-neutral-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200 dark:focus:ring-neutral-700"
3030
>
3131
<GitHubIcon className="w-4 h-4" />
3232
<span className="hidden lg:inline">Star on GitHub</span>
33-
<span className="inline-flex items-center px-2 py-0.5 rounded bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-100">
33+
<span className="inline-flex items-center px-2 py-0.5 rounded bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100">
3434
<StarIcon className="w-4 h-4 mr-1" />
3535
{stars}
3636
</span>

app/_components/subscribe.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const SubscribeForm = () => {
6161
};
6262

6363
return (
64-
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-200 dark:border-neutral-800 rounded-xl">
64+
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-400 dark:border-neutral-800 rounded-xl">
6565
<h2 className="text-2xl font-bold mb-5 text-foreground">
6666
Get notified when new patterns are added!
6767
</h2>

app/_components/suggest-pattern.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button } from './ui/button'
33

44
export function SuggestPattern() {
55
return (
6-
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-200 dark:border-neutral-800 rounded-xl">
6+
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-400 dark:border-neutral-800 rounded-xl">
77
<h2 className="text-2xl font-bold mb-5 text-foreground">Got a pattern request?</h2>
88
<p className="text-lg text-muted-foreground mb-6">
99
Let us know, and we&apos;ll add it!
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1+
import { ChevronDown, Grab, MessageCircle, RotateCw, Square } from "lucide-react";
2+
13
export const contentManagementPatterns = [
24
{
35
title: 'Accordion',
46
description: 'Expand and collapse content sections',
7+
icon: ChevronDown
58
},
69
{
710
title: 'Carousel',
811
description: 'Display multiple items in a rotating view',
12+
icon: RotateCw
913
},
1014
{
1115
title: 'Drag and Drop',
1216
description: 'Allow users to reorder items intuitively',
17+
icon: Grab
1318
},
1419
{
1520
title: 'Modal',
1621
description: 'Display focused content or actions',
22+
icon: Square
1723
},
1824
{
1925
title: 'Tooltip',
2026
description: 'Provide additional context on hover',
27+
icon: MessageCircle
2128
}
22-
] as const
29+
] as const;

app/_constants/patterns/forms.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,150 @@
1+
import {
2+
Calendar,
3+
CalendarDays,
4+
CalendarRange,
5+
CheckSquare,
6+
CircleDot,
7+
Clock,
8+
DollarSign,
9+
FileUp,
10+
KeyRound,
11+
List,
12+
ListFilter,
13+
Lock,
14+
MousePointerClick,
15+
Palette,
16+
Pen,
17+
PenTool,
18+
Phone,
19+
Search,
20+
ShieldCheck,
21+
Sliders,
22+
Star,
23+
Tags,
24+
Text,
25+
ToggleLeft,
26+
} from "lucide-react";
27+
128
export const formPatterns = [
229
{
330
title: 'Button',
431
description: 'Trigger actions and submit forms',
5-
href: '/docs/forms/button'
32+
href: '/docs/forms/button',
33+
icon: MousePointerClick
634
},
735
{
836
title: 'Checkbox',
937
description: 'Allow users to select multiple options',
38+
icon: CheckSquare
1039
},
1140
{
1241
title: 'Code Confirmation',
1342
description: 'Verify codes with segmented input',
43+
icon: KeyRound
1444
},
1545
{
1646
title: 'Color Picker',
1747
description: 'Select colors with visual feedback',
48+
icon: Palette
1849
},
1950
{
2051
title: 'Currency Input',
2152
description: 'Enter and format monetary values',
53+
icon: DollarSign
2254
},
2355
{
2456
title: 'Date Input',
2557
description: 'Enter dates in a structured format',
58+
icon: Calendar
2659
},
2760
{
2861
title: 'Date Picker',
2962
description: 'Select dates from a calendar interface',
63+
icon: CalendarDays
3064
},
3165
{
3266
title: 'Date Range',
3367
description: 'Select a range between two dates',
68+
icon: CalendarRange
3469
},
3570
{
3671
title: 'File Input',
3772
description: 'Upload and handle files',
73+
icon: FileUp
3874
},
3975
{
4076
title: 'Form Validation',
4177
description: 'Validate and provide feedback',
78+
icon: ShieldCheck
4279
},
4380
{
4481
title: 'Multi-select Input',
4582
description: 'Choose multiple items from a list',
83+
icon: List
4684
},
4785
{
4886
title: 'Password',
4987
description: 'Secure password entry with feedback',
88+
icon: Lock
5089
},
5190
{
5291
title: 'Phone Number',
5392
description: 'Format and validate phone numbers',
93+
icon: Phone
5494
},
5595
{
5696
title: 'Radio',
5797
description: 'Select a single option from a group',
98+
icon: CircleDot
5899
},
59100
{
60101
title: 'Search Field',
61102
description: 'Search through content efficiently',
103+
icon: Search
62104
},
63105
{
64106
title: 'Selection Input',
65107
description: 'Choose from predefined options',
108+
icon: ListFilter
66109
},
67110
{
68111
title: 'Slider',
69112
description: 'Select values from a range',
113+
icon: Sliders
70114
},
71115
{
72116
title: 'Text Field',
73117
description: 'Enter and edit text content',
118+
icon: Text
74119
},
75120
{
76121
title: 'Time Input',
77122
description: 'Enter time in a structured format',
123+
icon: Clock
78124
},
79125
{
80126
title: 'Toggle',
81127
description: 'Switch between two states',
128+
icon: ToggleLeft
82129
},
83130
{
84131
title: 'Rich Text Editor',
85132
description: 'Edit and format text content',
133+
icon: PenTool
86134
},
87135
{
88136
title: 'Tag Input',
89137
description: 'Enter and format tags',
138+
icon: Tags
90139
},
91140
{
92141
title: 'Rating Input',
93142
description: 'Rate something with a number of stars',
143+
icon: Star
94144
},
95145
{
96146
title: 'Signature Pad',
97147
description: 'Allow users to sign their name',
148+
icon: Pen
98149
},
99-
] as const
150+
] as const;

app/_constants/patterns/navigation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
1+
import { ArrowUp, Grid3X3, Layout, LayoutDashboard, Menu, Navigation2, SidebarIcon } from "lucide-react";
2+
13
export const navigationPatterns = [
24
{
35
title: 'Breadcrumb',
46
description: 'Help users understand their current location',
5-
href: '/docs/navigation/breadcrumb'
7+
href: '/docs/navigation/breadcrumb',
8+
icon: Navigation2,
69
},
710
{
811
title: 'Back to Top',
912
description: 'Quickly navigate back to the top of the page',
13+
icon: ArrowUp,
1014
},
1115
{
1216
title: 'Hamburger Menu',
1317
description: 'Display a menu icon for mobile devices',
18+
icon: Menu,
1419
},
1520
{
1621
title: 'Megamenu',
1722
description: 'Display a large number of links in a single menu',
23+
icon: Grid3X3,
1824
},
1925
{
2026
title: 'Navigation Menu',
2127
description: 'Organize and structure site navigation',
28+
icon: LayoutDashboard,
2229
},
2330
{
2431
title: 'Pagination',
2532
description: 'Navigate through multiple pages of content',
33+
icon: Navigation2,
2634
},
2735
{
2836
title: 'Sidebar',
2937
description: 'Organize and structure site navigation',
38+
icon: SidebarIcon,
3039
},
3140
{
3241
title: 'Tabs',
3342
description: 'Switch between different views',
43+
icon: Layout,
3444
}
3545
] as const
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1+
import { AlertCircle, Bell, Cookie, Loader, LoaderCircle, Loader as ProgressLoader } from "lucide-react";
2+
13
export const userFeedbackPatterns = [
24
{
35
title: 'Empty States',
46
description: 'Guide users when no content is available',
7+
icon: AlertCircle
58
},
69
{
710
title: 'Loading Indicator',
811
description: 'Show users that content is being loaded',
12+
icon: Loader
913
},
1014
{
1115
title: 'Notification',
1216
description: 'Inform users about important updates',
17+
icon: Bell
1318
},
1419
{
1520
title: 'Progress Indicator',
1621
description: 'Show completion status of an operation',
22+
icon: ProgressLoader
1723
},
1824
{
1925
title: 'Skeleton',
2026
description: 'Show users that content is being loaded',
27+
icon: LoaderCircle
2128
},
2229
{
2330
title: 'Cookie Consent',
2431
description: 'Inform users about the use of cookies',
32+
icon: Cookie
2533
}
26-
] as const
34+
] as const;

0 commit comments

Comments
 (0)