Spaces:
Sleeping
Sleeping
add: Frontend added
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- Frontend/.gitignore +27 -0
- Frontend/app/blogs/page.tsx +111 -0
- Frontend/app/contact/page.tsx +113 -0
- Frontend/app/education/page.tsx +172 -0
- Frontend/app/events/page.tsx +111 -0
- Frontend/app/globals.css +166 -0
- Frontend/app/join/page.tsx +185 -0
- Frontend/app/layout.tsx +129 -0
- Frontend/app/page.tsx +24 -0
- Frontend/app/research/page.tsx +88 -0
- Frontend/app/reviews/page.tsx +112 -0
- Frontend/app/teams/page.tsx +100 -0
- Frontend/components.json +21 -0
- Frontend/components/featured-projects.tsx +108 -0
- Frontend/components/features-section.tsx +72 -0
- Frontend/components/footer.tsx +143 -0
- Frontend/components/header.tsx +168 -0
- Frontend/components/ribbon-hero.tsx +397 -0
- Frontend/components/share-problem.tsx +146 -0
- Frontend/components/theme-provider.tsx +11 -0
- Frontend/components/theme-toggle.tsx +53 -0
- Frontend/components/ui/accordion.tsx +66 -0
- Frontend/components/ui/alert-dialog.tsx +157 -0
- Frontend/components/ui/alert.tsx +66 -0
- Frontend/components/ui/aspect-ratio.tsx +11 -0
- Frontend/components/ui/avatar.tsx +53 -0
- Frontend/components/ui/badge.tsx +46 -0
- Frontend/components/ui/breadcrumb.tsx +109 -0
- Frontend/components/ui/button-group.tsx +83 -0
- Frontend/components/ui/button.tsx +60 -0
- Frontend/components/ui/calendar.tsx +213 -0
- Frontend/components/ui/card.tsx +92 -0
- Frontend/components/ui/carousel.tsx +241 -0
- Frontend/components/ui/chart.tsx +353 -0
- Frontend/components/ui/checkbox.tsx +32 -0
- Frontend/components/ui/collapsible.tsx +33 -0
- Frontend/components/ui/command.tsx +184 -0
- Frontend/components/ui/context-menu.tsx +252 -0
- Frontend/components/ui/dialog.tsx +143 -0
- Frontend/components/ui/drawer.tsx +135 -0
- Frontend/components/ui/dropdown-menu.tsx +257 -0
- Frontend/components/ui/empty.tsx +104 -0
- Frontend/components/ui/field.tsx +244 -0
- Frontend/components/ui/form.tsx +167 -0
- Frontend/components/ui/hover-card.tsx +44 -0
- Frontend/components/ui/input-group.tsx +169 -0
- Frontend/components/ui/input-otp.tsx +77 -0
- Frontend/components/ui/input.tsx +21 -0
- Frontend/components/ui/item.tsx +193 -0
- Frontend/components/ui/kbd.tsx +28 -0
Frontend/.gitignore
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
| 2 |
+
|
| 3 |
+
# dependencies
|
| 4 |
+
/node_modules
|
| 5 |
+
|
| 6 |
+
# next.js
|
| 7 |
+
/.next/
|
| 8 |
+
/out/
|
| 9 |
+
|
| 10 |
+
# production
|
| 11 |
+
/build
|
| 12 |
+
|
| 13 |
+
# debug
|
| 14 |
+
npm-debug.log*
|
| 15 |
+
yarn-debug.log*
|
| 16 |
+
yarn-error.log*
|
| 17 |
+
.pnpm-debug.log*
|
| 18 |
+
|
| 19 |
+
# env files
|
| 20 |
+
.env*
|
| 21 |
+
|
| 22 |
+
# vercel
|
| 23 |
+
.vercel
|
| 24 |
+
|
| 25 |
+
# typescript
|
| 26 |
+
*.tsbuildinfo
|
| 27 |
+
next-env.d.ts
|
Frontend/app/blogs/page.tsx
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Blogs - Ignite Community',
|
| 6 |
+
description: 'Stories, insights, and tutorials from the Nepali tech community',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function BlogsPage() {
|
| 10 |
+
const blogs = [
|
| 11 |
+
{
|
| 12 |
+
id: 1,
|
| 13 |
+
title: 'Getting Started with Open Source in Nepal',
|
| 14 |
+
excerpt: 'A beginner\'s guide to contributing to open source projects and building your portfolio.',
|
| 15 |
+
category: 'Tutorial',
|
| 16 |
+
date: 'January 20, 2024',
|
| 17 |
+
author: 'Anil Sharma',
|
| 18 |
+
readTime: '8 min read',
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
id: 2,
|
| 22 |
+
title: 'Building AgriTech Solutions for Nepali Farmers',
|
| 23 |
+
excerpt: 'Real-world case study of how technology can solve agricultural challenges in Nepal.',
|
| 24 |
+
category: 'Case Study',
|
| 25 |
+
date: 'January 15, 2024',
|
| 26 |
+
author: 'Priya Poudel',
|
| 27 |
+
readTime: '12 min read',
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
id: 3,
|
| 31 |
+
title: 'Healthcare Tech: Bridging the Gap in Rural Nepal',
|
| 32 |
+
excerpt: 'Exploring innovative healthcare solutions and how open source communities can contribute.',
|
| 33 |
+
category: 'Innovation',
|
| 34 |
+
date: 'January 10, 2024',
|
| 35 |
+
author: 'Ravi Khanal',
|
| 36 |
+
readTime: '10 min read',
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
id: 4,
|
| 40 |
+
title: 'Women in Tech: Inspiring Stories from Nepal',
|
| 41 |
+
excerpt: 'Interviews with pioneering female developers and tech entrepreneurs in Nepal.',
|
| 42 |
+
category: 'Community',
|
| 43 |
+
date: 'January 5, 2024',
|
| 44 |
+
author: 'Nikita Joshi',
|
| 45 |
+
readTime: '15 min read',
|
| 46 |
+
},
|
| 47 |
+
]
|
| 48 |
+
|
| 49 |
+
return (
|
| 50 |
+
<main className="min-h-screen flex flex-col">
|
| 51 |
+
<Header />
|
| 52 |
+
<div className="flex-1 bg-background">
|
| 53 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 54 |
+
<div className="max-w-5xl">
|
| 55 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 56 |
+
Community Blogs
|
| 57 |
+
</h1>
|
| 58 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 59 |
+
Stories, insights, and tutorials from developers in the Nepali tech community.
|
| 60 |
+
</p>
|
| 61 |
+
|
| 62 |
+
<div className="grid gap-8">
|
| 63 |
+
{blogs.map((blog) => (
|
| 64 |
+
<article
|
| 65 |
+
key={blog.id}
|
| 66 |
+
className="p-8 bg-card rounded-lg border border-border hover:shadow-lg hover:border-primary/50 transition-all cursor-pointer group"
|
| 67 |
+
>
|
| 68 |
+
<div className="flex flex-col gap-4">
|
| 69 |
+
<div className="flex items-center gap-3 flex-wrap">
|
| 70 |
+
<span className="px-3 py-1 bg-primary/10 text-primary rounded-full text-sm font-semibold">
|
| 71 |
+
{blog.category}
|
| 72 |
+
</span>
|
| 73 |
+
<span className="text-sm text-muted-foreground">{blog.date}</span>
|
| 74 |
+
</div>
|
| 75 |
+
<h2 className="text-2xl md:text-3xl font-bold text-foreground group-hover:text-primary transition-colors">
|
| 76 |
+
{blog.title}
|
| 77 |
+
</h2>
|
| 78 |
+
<p className="text-muted-foreground text-lg leading-relaxed">
|
| 79 |
+
{blog.excerpt}
|
| 80 |
+
</p>
|
| 81 |
+
<div className="flex items-center justify-between pt-4 border-t border-border">
|
| 82 |
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
| 83 |
+
<span>By {blog.author}</span>
|
| 84 |
+
<span className="text-xs">•</span>
|
| 85 |
+
<span>{blog.readTime}</span>
|
| 86 |
+
</div>
|
| 87 |
+
<span className="text-primary font-semibold group-hover:translate-x-2 transition-transform">
|
| 88 |
+
Read More →
|
| 89 |
+
</span>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</article>
|
| 93 |
+
))}
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div className="mt-16 p-8 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 97 |
+
<h2 className="text-2xl font-bold text-foreground mb-3">Share Your Story</h2>
|
| 98 |
+
<p className="text-muted-foreground mb-6">
|
| 99 |
+
Have a blog post or story to share with the community? We'd love to feature it!
|
| 100 |
+
</p>
|
| 101 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 102 |
+
Submit Article
|
| 103 |
+
</button>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
<Footer />
|
| 109 |
+
</main>
|
| 110 |
+
)
|
| 111 |
+
}
|
Frontend/app/contact/page.tsx
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Contact Us - Ignite Community',
|
| 6 |
+
description: 'Get in touch with the Ignite Open Source Community team',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function ContactPage() {
|
| 10 |
+
return (
|
| 11 |
+
<main className="min-h-screen flex flex-col">
|
| 12 |
+
<Header />
|
| 13 |
+
<div className="flex-1 bg-background">
|
| 14 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 15 |
+
<div className="max-w-5xl">
|
| 16 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 17 |
+
Get in Touch
|
| 18 |
+
</h1>
|
| 19 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 20 |
+
Have questions or want to collaborate? We'd love to hear from you!
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
<div className="grid md:grid-cols-2 gap-12">
|
| 24 |
+
{/* Contact Form */}
|
| 25 |
+
<div>
|
| 26 |
+
<h2 className="text-2xl font-bold text-foreground mb-6">Send us a Message</h2>
|
| 27 |
+
<form className="space-y-4">
|
| 28 |
+
<div>
|
| 29 |
+
<label className="block text-sm font-semibold text-foreground mb-2">Name</label>
|
| 30 |
+
<input
|
| 31 |
+
type="text"
|
| 32 |
+
className="w-full px-4 py-2 bg-input border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary"
|
| 33 |
+
placeholder="Your name"
|
| 34 |
+
/>
|
| 35 |
+
</div>
|
| 36 |
+
<div>
|
| 37 |
+
<label className="block text-sm font-semibold text-foreground mb-2">Email</label>
|
| 38 |
+
<input
|
| 39 |
+
type="email"
|
| 40 |
+
className="w-full px-4 py-2 bg-input border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary"
|
| 41 |
+
placeholder="your@email.com"
|
| 42 |
+
/>
|
| 43 |
+
</div>
|
| 44 |
+
<div>
|
| 45 |
+
<label className="block text-sm font-semibold text-foreground mb-2">Subject</label>
|
| 46 |
+
<input
|
| 47 |
+
type="text"
|
| 48 |
+
className="w-full px-4 py-2 bg-input border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary"
|
| 49 |
+
placeholder="What is this about?"
|
| 50 |
+
/>
|
| 51 |
+
</div>
|
| 52 |
+
<div>
|
| 53 |
+
<label className="block text-sm font-semibold text-foreground mb-2">Message</label>
|
| 54 |
+
<textarea
|
| 55 |
+
rows={5}
|
| 56 |
+
className="w-full px-4 py-2 bg-input border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary resize-none"
|
| 57 |
+
placeholder="Tell us more..."
|
| 58 |
+
/>
|
| 59 |
+
</div>
|
| 60 |
+
<button
|
| 61 |
+
type="submit"
|
| 62 |
+
className="w-full px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors"
|
| 63 |
+
>
|
| 64 |
+
Send Message
|
| 65 |
+
</button>
|
| 66 |
+
</form>
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
{/* Contact Info */}
|
| 70 |
+
<div>
|
| 71 |
+
<h2 className="text-2xl font-bold text-foreground mb-6">Contact Information</h2>
|
| 72 |
+
<div className="space-y-6">
|
| 73 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 74 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">📧 Email</h3>
|
| 75 |
+
<p className="text-muted-foreground">contact@ignitenepal.org</p>
|
| 76 |
+
<p className="text-sm text-muted-foreground/70 mt-1">We'll respond within 24 hours</p>
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 80 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">🌐 Social Media</h3>
|
| 81 |
+
<div className="space-y-2 text-muted-foreground">
|
| 82 |
+
<p>Twitter: @IgniteNepal</p>
|
| 83 |
+
<p>Discord: Join our server</p>
|
| 84 |
+
<p>LinkedIn: Ignite Open Source Community</p>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 89 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">📍 Location</h3>
|
| 90 |
+
<p className="text-muted-foreground">
|
| 91 |
+
Kathmandu, Nepal<br />
|
| 92 |
+
Open to collaboration worldwide
|
| 93 |
+
</p>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 97 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">⏰ Office Hours</h3>
|
| 98 |
+
<p className="text-muted-foreground">
|
| 99 |
+
Monday - Friday: 9 AM - 6 PM (NPT)<br />
|
| 100 |
+
Saturday: 10 AM - 3 PM<br />
|
| 101 |
+
Sunday: Closed
|
| 102 |
+
</p>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
<Footer />
|
| 111 |
+
</main>
|
| 112 |
+
)
|
| 113 |
+
}
|
Frontend/app/education/page.tsx
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Educational Content - Ignite Community',
|
| 6 |
+
description: 'Learning resources, tutorials, and courses for developers in Nepal',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function EducationPage() {
|
| 10 |
+
const courses = [
|
| 11 |
+
{
|
| 12 |
+
id: 1,
|
| 13 |
+
title: 'Open Source Fundamentals',
|
| 14 |
+
level: 'Beginner',
|
| 15 |
+
duration: '4 weeks',
|
| 16 |
+
description: 'Learn the basics of open source, Git, GitHub, and how to contribute to projects.',
|
| 17 |
+
topics: ['Git & GitHub', 'Open Source Culture', 'Contributing Guide', 'Code Review'],
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
id: 2,
|
| 21 |
+
title: 'Full Stack Web Development',
|
| 22 |
+
level: 'Intermediate',
|
| 23 |
+
duration: '8 weeks',
|
| 24 |
+
description: 'Build modern web applications with React, Node.js, and databases.',
|
| 25 |
+
topics: ['React Fundamentals', 'Backend with Node.js', 'Database Design', 'Deployment'],
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
id: 3,
|
| 29 |
+
title: 'Building for Impact: Tech Solutions for Social Good',
|
| 30 |
+
level: 'Advanced',
|
| 31 |
+
duration: '6 weeks',
|
| 32 |
+
description: 'Create technology solutions that address real-world problems in Nepal.',
|
| 33 |
+
topics: ['Problem Identification', 'User Research', 'Scalable Architecture', 'Community Impact'],
|
| 34 |
+
},
|
| 35 |
+
]
|
| 36 |
+
|
| 37 |
+
const resources = [
|
| 38 |
+
{
|
| 39 |
+
title: 'Git & Version Control',
|
| 40 |
+
type: 'Tutorial Series',
|
| 41 |
+
format: 'Video',
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
title: 'Nepali Tech Ecosystem Report',
|
| 45 |
+
type: 'Research Paper',
|
| 46 |
+
format: 'PDF',
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
title: 'Building AgriTech Solutions',
|
| 50 |
+
type: 'Case Study',
|
| 51 |
+
format: 'Article',
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
title: 'Open Source Project Setup',
|
| 55 |
+
type: 'Guide',
|
| 56 |
+
format: 'Documentation',
|
| 57 |
+
},
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
return (
|
| 61 |
+
<main className="min-h-screen flex flex-col">
|
| 62 |
+
<Header />
|
| 63 |
+
<div className="flex-1 bg-background">
|
| 64 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 65 |
+
<div className="max-w-5xl">
|
| 66 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 67 |
+
Learning Hub
|
| 68 |
+
</h1>
|
| 69 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 70 |
+
Develop your skills with our curated courses, tutorials, and resources designed for the Nepali tech community.
|
| 71 |
+
</p>
|
| 72 |
+
|
| 73 |
+
{/* Featured Courses */}
|
| 74 |
+
<section className="mb-16">
|
| 75 |
+
<h2 className="text-3xl font-bold text-foreground mb-8">Featured Courses</h2>
|
| 76 |
+
<div className="space-y-6">
|
| 77 |
+
{courses.map((course) => (
|
| 78 |
+
<div
|
| 79 |
+
key={course.id}
|
| 80 |
+
className="p-8 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all group"
|
| 81 |
+
>
|
| 82 |
+
<div className="flex flex-col gap-4">
|
| 83 |
+
<div className="flex items-start justify-between gap-4 flex-wrap">
|
| 84 |
+
<div>
|
| 85 |
+
<h3 className="text-2xl font-bold text-foreground group-hover:text-primary transition-colors mb-2">
|
| 86 |
+
{course.title}
|
| 87 |
+
</h3>
|
| 88 |
+
<p className="text-muted-foreground">{course.description}</p>
|
| 89 |
+
</div>
|
| 90 |
+
<div className="flex flex-col gap-2 text-right whitespace-nowrap">
|
| 91 |
+
<span className="px-3 py-1 bg-primary/20 text-primary rounded-full text-sm font-semibold">
|
| 92 |
+
{course.level}
|
| 93 |
+
</span>
|
| 94 |
+
<span className="text-sm text-muted-foreground">⏱ {course.duration}</span>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<div className="pt-4 border-t border-border">
|
| 99 |
+
<p className="text-sm font-semibold text-muted-foreground mb-3">Topics Covered:</p>
|
| 100 |
+
<div className="flex flex-wrap gap-2">
|
| 101 |
+
{course.topics.map((topic) => (
|
| 102 |
+
<span key={topic} className="px-3 py-1 bg-muted text-muted-foreground rounded-full text-sm">
|
| 103 |
+
{topic}
|
| 104 |
+
</span>
|
| 105 |
+
))}
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<button className="self-start mt-4 px-6 py-2 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 110 |
+
Enroll Now
|
| 111 |
+
</button>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
))}
|
| 115 |
+
</div>
|
| 116 |
+
</section>
|
| 117 |
+
|
| 118 |
+
{/* Learning Resources */}
|
| 119 |
+
<section className="mb-16">
|
| 120 |
+
<h2 className="text-3xl font-bold text-foreground mb-8">Learning Resources</h2>
|
| 121 |
+
<div className="grid md:grid-cols-2 gap-6">
|
| 122 |
+
{resources.map((resource, idx) => (
|
| 123 |
+
<div
|
| 124 |
+
key={idx}
|
| 125 |
+
className="p-6 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all group cursor-pointer"
|
| 126 |
+
>
|
| 127 |
+
<div className="flex items-start justify-between mb-3">
|
| 128 |
+
<span className="text-sm font-semibold text-primary bg-primary/10 px-3 py-1 rounded-full">
|
| 129 |
+
{resource.type}
|
| 130 |
+
</span>
|
| 131 |
+
<span className="text-xs text-muted-foreground">{resource.format}</span>
|
| 132 |
+
</div>
|
| 133 |
+
<h3 className="text-lg font-semibold text-foreground group-hover:text-primary transition-colors">
|
| 134 |
+
{resource.title}
|
| 135 |
+
</h3>
|
| 136 |
+
<div className="mt-4">
|
| 137 |
+
<button className="text-primary font-semibold text-sm hover:underline">
|
| 138 |
+
Access Resource →
|
| 139 |
+
</button>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
))}
|
| 143 |
+
</div>
|
| 144 |
+
</section>
|
| 145 |
+
|
| 146 |
+
{/* Community Learning */}
|
| 147 |
+
<section>
|
| 148 |
+
<div className="p-12 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 149 |
+
<h2 className="text-3xl font-bold text-foreground mb-4">Learn Together</h2>
|
| 150 |
+
<p className="text-lg text-muted-foreground mb-6">
|
| 151 |
+
Join study groups, participate in workshops, and learn from experienced mentors in the community.
|
| 152 |
+
</p>
|
| 153 |
+
<div className="grid md:grid-cols-3 gap-4">
|
| 154 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 155 |
+
Join Study Group
|
| 156 |
+
</button>
|
| 157 |
+
<button className="px-6 py-3 bg-secondary text-secondary-foreground rounded-lg font-semibold hover:bg-secondary/90 transition-colors">
|
| 158 |
+
Find a Mentor
|
| 159 |
+
</button>
|
| 160 |
+
<button className="px-6 py-3 bg-accent text-accent-foreground rounded-lg font-semibold hover:bg-accent/90 transition-colors">
|
| 161 |
+
Propose a Course
|
| 162 |
+
</button>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
</section>
|
| 166 |
+
</div>
|
| 167 |
+
</div>
|
| 168 |
+
</div>
|
| 169 |
+
<Footer />
|
| 170 |
+
</main>
|
| 171 |
+
)
|
| 172 |
+
}
|
Frontend/app/events/page.tsx
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Events - Ignite Community',
|
| 6 |
+
description: 'Upcoming events, meetups, and webinars organized by Ignite Community',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function EventsPage() {
|
| 10 |
+
const events = [
|
| 11 |
+
{
|
| 12 |
+
id: 1,
|
| 13 |
+
title: 'Nepal Open Source Hackathon 2024',
|
| 14 |
+
date: 'February 10-12, 2024',
|
| 15 |
+
location: 'Kathmandu',
|
| 16 |
+
description: 'A 48-hour hackathon bringing together developers to build innovative solutions for Nepali problems.',
|
| 17 |
+
status: 'Upcoming',
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
id: 2,
|
| 21 |
+
title: 'Community Meetup: Getting Started with Open Source',
|
| 22 |
+
date: 'February 3, 2024',
|
| 23 |
+
location: 'Online',
|
| 24 |
+
description: 'Learn the basics of open source contribution and how to get involved with beginner-friendly projects.',
|
| 25 |
+
status: 'Upcoming',
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
id: 3,
|
| 29 |
+
title: 'Tech Talk: AI in Healthcare',
|
| 30 |
+
date: 'January 28, 2024',
|
| 31 |
+
location: 'Online',
|
| 32 |
+
description: 'Join our expert panel discussing the role of AI in revolutionizing healthcare in Nepal.',
|
| 33 |
+
status: 'Upcoming',
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
id: 4,
|
| 37 |
+
title: 'Workshop: Building Scalable Web Applications',
|
| 38 |
+
date: 'January 20, 2024',
|
| 39 |
+
location: 'Pokhara',
|
| 40 |
+
description: 'Hands-on workshop on modern web development practices and architectural patterns.',
|
| 41 |
+
status: 'Upcoming',
|
| 42 |
+
},
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
return (
|
| 46 |
+
<main className="min-h-screen flex flex-col">
|
| 47 |
+
<Header />
|
| 48 |
+
<div className="flex-1 bg-background">
|
| 49 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 50 |
+
<div className="max-w-5xl">
|
| 51 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 52 |
+
Community Events
|
| 53 |
+
</h1>
|
| 54 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 55 |
+
Join us for meetups, workshops, hackathons, and tech talks happening across Nepal.
|
| 56 |
+
</p>
|
| 57 |
+
|
| 58 |
+
<div className="space-y-6">
|
| 59 |
+
{events.map((event) => (
|
| 60 |
+
<div
|
| 61 |
+
key={event.id}
|
| 62 |
+
className="p-8 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all group"
|
| 63 |
+
>
|
| 64 |
+
<div className="flex flex-col gap-4">
|
| 65 |
+
<div className="flex items-center justify-between flex-wrap gap-4">
|
| 66 |
+
<div>
|
| 67 |
+
<h2 className="text-2xl md:text-3xl font-bold text-foreground group-hover:text-primary transition-colors mb-2">
|
| 68 |
+
{event.title}
|
| 69 |
+
</h2>
|
| 70 |
+
<p className="text-muted-foreground text-lg">{event.description}</p>
|
| 71 |
+
</div>
|
| 72 |
+
<span className="px-4 py-2 bg-primary/20 text-primary rounded-full font-semibold whitespace-nowrap">
|
| 73 |
+
{event.status}
|
| 74 |
+
</span>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div className="flex flex-wrap gap-6 pt-4 border-t border-border">
|
| 78 |
+
<div className="flex items-center gap-2 text-muted-foreground">
|
| 79 |
+
<span className="text-xl">📅</span>
|
| 80 |
+
<span>{event.date}</span>
|
| 81 |
+
</div>
|
| 82 |
+
<div className="flex items-center gap-2 text-muted-foreground">
|
| 83 |
+
<span className="text-xl">📍</span>
|
| 84 |
+
<span>{event.location}</span>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<button className="self-start px-6 py-2 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 89 |
+
Learn More
|
| 90 |
+
</button>
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
))}
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div className="mt-16 p-8 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 97 |
+
<h2 className="text-2xl font-bold text-foreground mb-3">Want to Host an Event?</h2>
|
| 98 |
+
<p className="text-muted-foreground mb-6">
|
| 99 |
+
We're looking for community members to organize and host events. Contact us to collaborate!
|
| 100 |
+
</p>
|
| 101 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 102 |
+
Propose an Event
|
| 103 |
+
</button>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
<Footer />
|
| 109 |
+
</main>
|
| 110 |
+
)
|
| 111 |
+
}
|
Frontend/app/globals.css
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import 'tailwindcss';
|
| 2 |
+
@import 'tw-animate-css';
|
| 3 |
+
|
| 4 |
+
@custom-variant dark (&:is(.dark *));
|
| 5 |
+
|
| 6 |
+
:root {
|
| 7 |
+
--background: oklch(0.98 0.001 0);
|
| 8 |
+
--foreground: oklch(0.15 0.02 0);
|
| 9 |
+
--card: oklch(1 0 0);
|
| 10 |
+
--card-foreground: oklch(0.15 0.02 0);
|
| 11 |
+
--popover: oklch(1 0 0);
|
| 12 |
+
--popover-foreground: oklch(0.15 0.02 0);
|
| 13 |
+
--primary: #5E60CE;
|
| 14 |
+
--primary-foreground: oklch(1 0 0);
|
| 15 |
+
--secondary: #48CAE4;
|
| 16 |
+
--secondary-foreground: oklch(1 0 0);
|
| 17 |
+
--accent: #FF9F1C;
|
| 18 |
+
--accent-foreground: oklch(1 0 0);
|
| 19 |
+
--feature-blue: #5E60CE;
|
| 20 |
+
--feature-purple: #48CAE4;
|
| 21 |
+
--feature-green: #9EF01A;
|
| 22 |
+
--muted: #C7CEEA;
|
| 23 |
+
--muted-foreground: #2D3748;
|
| 24 |
+
--destructive: #FF6B6B;
|
| 25 |
+
--destructive-foreground: oklch(1 0 0);
|
| 26 |
+
--border: #E0E0E0;
|
| 27 |
+
--input: #F8F9FA;
|
| 28 |
+
--ring: #5E60CE;
|
| 29 |
+
--chart-1: #5E60CE;
|
| 30 |
+
--chart-2: #48CAE4;
|
| 31 |
+
--chart-3: #9EF01A;
|
| 32 |
+
--chart-4: #FF9F1C;
|
| 33 |
+
--chart-5: #C7CEEA;
|
| 34 |
+
--radius: 0.625rem;
|
| 35 |
+
--sidebar: #F8F9FA;
|
| 36 |
+
--sidebar-foreground: #2D3748;
|
| 37 |
+
--sidebar-primary: #5E60CE;
|
| 38 |
+
--sidebar-primary-foreground: #F8F9FA;
|
| 39 |
+
--sidebar-accent: #48CAE4;
|
| 40 |
+
--sidebar-accent-foreground: #0D1B2A;
|
| 41 |
+
--sidebar-border: #E0E0E0;
|
| 42 |
+
--sidebar-ring: #5E60CE;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.dark {
|
| 46 |
+
--background: #0D1B2A;
|
| 47 |
+
--foreground: #F8F9FA;
|
| 48 |
+
--card: #1a2332;
|
| 49 |
+
--card-foreground: #F8F9FA;
|
| 50 |
+
--popover: #1a2332;
|
| 51 |
+
--popover-foreground: #F8F9FA;
|
| 52 |
+
--primary: #5E60CE;
|
| 53 |
+
--primary-foreground: #F8F9FA;
|
| 54 |
+
--secondary: #48CAE4;
|
| 55 |
+
--secondary-foreground: #0D1B2A;
|
| 56 |
+
--accent: #FF9F1C;
|
| 57 |
+
--accent-foreground: #0D1B2A;
|
| 58 |
+
--feature-blue: #5E60CE;
|
| 59 |
+
--feature-purple: #48CAE4;
|
| 60 |
+
--feature-green: #9EF01A;
|
| 61 |
+
--muted: #2D3748;
|
| 62 |
+
--muted-foreground: #C7CEEA;
|
| 63 |
+
--destructive: #FF6B6B;
|
| 64 |
+
--destructive-foreground: #F8F9FA;
|
| 65 |
+
--border: #2D3748;
|
| 66 |
+
--input: #1a2332;
|
| 67 |
+
--ring: #48CAE4;
|
| 68 |
+
--chart-1: #5E60CE;
|
| 69 |
+
--chart-2: #48CAE4;
|
| 70 |
+
--chart-3: #9EF01A;
|
| 71 |
+
--chart-4: #FF9F1C;
|
| 72 |
+
--chart-5: #C7CEEA;
|
| 73 |
+
--sidebar: #1a2332;
|
| 74 |
+
--sidebar-foreground: #F8F9FA;
|
| 75 |
+
--sidebar-primary: #5E60CE;
|
| 76 |
+
--sidebar-primary-foreground: #F8F9FA;
|
| 77 |
+
--sidebar-accent: #48CAE4;
|
| 78 |
+
--sidebar-accent-foreground: #0D1B2A;
|
| 79 |
+
--sidebar-border: #2D3748;
|
| 80 |
+
--sidebar-ring: #48CAE4;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
@theme inline {
|
| 84 |
+
--font-sans: 'Inter', 'Inter Fallback', system-ui, sans-serif;
|
| 85 |
+
--font-mono: 'Geist Mono', 'Geist Mono Fallback', monospace;
|
| 86 |
+
|
| 87 |
+
/* Custom breakpoint for extra small screens */
|
| 88 |
+
--breakpoint-xs: 400px;
|
| 89 |
+
--color-background: var(--background);
|
| 90 |
+
--color-foreground: var(--foreground);
|
| 91 |
+
--color-card: var(--card);
|
| 92 |
+
--color-card-foreground: var(--card-foreground);
|
| 93 |
+
--color-popover: var(--popover);
|
| 94 |
+
--color-popover-foreground: var(--popover-foreground);
|
| 95 |
+
--color-primary: var(--primary);
|
| 96 |
+
--color-primary-foreground: var(--primary-foreground);
|
| 97 |
+
--color-secondary: var(--secondary);
|
| 98 |
+
--color-secondary-foreground: var(--secondary-foreground);
|
| 99 |
+
--color-muted: var(--muted);
|
| 100 |
+
--color-muted-foreground: var(--muted-foreground);
|
| 101 |
+
--color-accent: var(--accent);
|
| 102 |
+
--color-accent-foreground: var(--accent-foreground);
|
| 103 |
+
--color-destructive: var(--destructive);
|
| 104 |
+
--color-destructive-foreground: var(--destructive-foreground);
|
| 105 |
+
--color-border: var(--border);
|
| 106 |
+
--color-input: var(--input);
|
| 107 |
+
--color-ring: var(--ring);
|
| 108 |
+
--color-chart-1: var(--chart-1);
|
| 109 |
+
--color-chart-2: var(--chart-2);
|
| 110 |
+
--color-chart-3: var(--chart-3);
|
| 111 |
+
--color-chart-4: var(--chart-4);
|
| 112 |
+
--color-chart-5: var(--chart-5);
|
| 113 |
+
--radius-sm: calc(var(--radius) - 4px);
|
| 114 |
+
--radius-md: calc(var(--radius) - 2px);
|
| 115 |
+
--radius-lg: var(--radius);
|
| 116 |
+
--radius-xl: calc(var(--radius) + 4px);
|
| 117 |
+
--color-sidebar: var(--sidebar);
|
| 118 |
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
| 119 |
+
--color-sidebar-primary: var(--sidebar-primary);
|
| 120 |
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
| 121 |
+
--color-sidebar-accent: var(--sidebar-accent);
|
| 122 |
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
| 123 |
+
--color-sidebar-border: var(--sidebar-border);
|
| 124 |
+
--color-sidebar-ring: var(--sidebar-ring);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
@layer base {
|
| 128 |
+
* {
|
| 129 |
+
@apply border-border outline-ring/50;
|
| 130 |
+
}
|
| 131 |
+
body {
|
| 132 |
+
@apply bg-background text-foreground;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* Smooth scrolling for anchor links */
|
| 136 |
+
html {
|
| 137 |
+
scroll-behavior: smooth;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Improve touch targets on mobile */
|
| 141 |
+
@media (max-width: 768px) {
|
| 142 |
+
button,
|
| 143 |
+
a,
|
| 144 |
+
input,
|
| 145 |
+
textarea,
|
| 146 |
+
select {
|
| 147 |
+
min-height: 44px;
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
/* Better focus states for accessibility */
|
| 152 |
+
:focus-visible {
|
| 153 |
+
outline: 2px solid var(--primary);
|
| 154 |
+
outline-offset: 2px;
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
/* Utility for line clamping */
|
| 159 |
+
@layer utilities {
|
| 160 |
+
.line-clamp-3 {
|
| 161 |
+
display: -webkit-box;
|
| 162 |
+
-webkit-line-clamp: 3;
|
| 163 |
+
-webkit-box-orient: vertical;
|
| 164 |
+
overflow: hidden;
|
| 165 |
+
}
|
| 166 |
+
}
|
Frontend/app/join/page.tsx
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Join Community - Ignite',
|
| 6 |
+
description: 'Join the Ignite Open Source Community and start your journey',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function JoinPage() {
|
| 10 |
+
return (
|
| 11 |
+
<main className="min-h-screen flex flex-col">
|
| 12 |
+
<Header />
|
| 13 |
+
<div className="flex-1 bg-background">
|
| 14 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 15 |
+
<div className="max-w-4xl">
|
| 16 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 17 |
+
Join Our Community
|
| 18 |
+
</h1>
|
| 19 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 20 |
+
Become part of a vibrant community dedicated to open source and innovation in Nepal.
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
<div className="space-y-12">
|
| 24 |
+
{/* Membership Tiers */}
|
| 25 |
+
<section>
|
| 26 |
+
<h2 className="text-3xl font-bold text-foreground mb-8">Choose Your Path</h2>
|
| 27 |
+
<div className="grid md:grid-cols-3 gap-6">
|
| 28 |
+
<div className="p-8 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all">
|
| 29 |
+
<h3 className="text-2xl font-bold text-foreground mb-4">Contributor</h3>
|
| 30 |
+
<p className="text-muted-foreground mb-6">Perfect for developers looking to contribute to open source projects.</p>
|
| 31 |
+
<ul className="space-y-3 text-muted-foreground mb-8">
|
| 32 |
+
<li className="flex items-center gap-2">
|
| 33 |
+
<span className="text-primary">✓</span>
|
| 34 |
+
<span>Access to projects</span>
|
| 35 |
+
</li>
|
| 36 |
+
<li className="flex items-center gap-2">
|
| 37 |
+
<span className="text-primary">✓</span>
|
| 38 |
+
<span>Community forums</span>
|
| 39 |
+
</li>
|
| 40 |
+
<li className="flex items-center gap-2">
|
| 41 |
+
<span className="text-primary">✓</span>
|
| 42 |
+
<span>Event access</span>
|
| 43 |
+
</li>
|
| 44 |
+
<li className="flex items-center gap-2">
|
| 45 |
+
<span className="text-primary">✓</span>
|
| 46 |
+
<span>Learning resources</span>
|
| 47 |
+
</li>
|
| 48 |
+
</ul>
|
| 49 |
+
<button className="w-full px-6 py-3 bg-primary/20 text-primary rounded-lg font-semibold hover:bg-primary/30 transition-colors">
|
| 50 |
+
Get Started
|
| 51 |
+
</button>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
<div className="p-8 bg-gradient-to-br from-primary/10 to-secondary/10 rounded-lg border-2 border-primary hover:shadow-xl transition-all">
|
| 55 |
+
<div className="absolute -top-3 left-4 px-3 py-1 bg-primary text-primary-foreground rounded-full text-xs font-bold">
|
| 56 |
+
POPULAR
|
| 57 |
+
</div>
|
| 58 |
+
<h3 className="text-2xl font-bold text-foreground mb-4">Collaborator</h3>
|
| 59 |
+
<p className="text-muted-foreground mb-6">For active members seeking deeper involvement and mentorship.</p>
|
| 60 |
+
<ul className="space-y-3 text-muted-foreground mb-8">
|
| 61 |
+
<li className="flex items-center gap-2">
|
| 62 |
+
<span className="text-primary">✓</span>
|
| 63 |
+
<span>Everything in Contributor</span>
|
| 64 |
+
</li>
|
| 65 |
+
<li className="flex items-center gap-2">
|
| 66 |
+
<span className="text-primary">✓</span>
|
| 67 |
+
<span>Mentorship program</span>
|
| 68 |
+
</li>
|
| 69 |
+
<li className="flex items-center gap-2">
|
| 70 |
+
<span className="text-primary">✓</span>
|
| 71 |
+
<span>Leadership opportunities</span>
|
| 72 |
+
</li>
|
| 73 |
+
<li className="flex items-center gap-2">
|
| 74 |
+
<span className="text-primary">✓</span>
|
| 75 |
+
<span>Priority support</span>
|
| 76 |
+
</li>
|
| 77 |
+
</ul>
|
| 78 |
+
<button className="w-full px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 79 |
+
Join Now
|
| 80 |
+
</button>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<div className="p-8 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all">
|
| 84 |
+
<h3 className="text-2xl font-bold text-foreground mb-4">Partner</h3>
|
| 85 |
+
<p className="text-muted-foreground mb-6">For organizations interested in partnering with our community.</p>
|
| 86 |
+
<ul className="space-y-3 text-muted-foreground mb-8">
|
| 87 |
+
<li className="flex items-center gap-2">
|
| 88 |
+
<span className="text-primary">✓</span>
|
| 89 |
+
<span>Co-hosted events</span>
|
| 90 |
+
</li>
|
| 91 |
+
<li className="flex items-center gap-2">
|
| 92 |
+
<span className="text-primary">✓</span>
|
| 93 |
+
<span>Sponsored projects</span>
|
| 94 |
+
</li>
|
| 95 |
+
<li className="flex items-center gap-2">
|
| 96 |
+
<span className="text-primary">✓</span>
|
| 97 |
+
<span>Talent access</span>
|
| 98 |
+
</li>
|
| 99 |
+
<li className="flex items-center gap-2">
|
| 100 |
+
<span className="text-primary">✓</span>
|
| 101 |
+
<span>Brand visibility</span>
|
| 102 |
+
</li>
|
| 103 |
+
</ul>
|
| 104 |
+
<button className="w-full px-6 py-3 bg-primary/20 text-primary rounded-lg font-semibold hover:bg-primary/30 transition-colors">
|
| 105 |
+
Contact Us
|
| 106 |
+
</button>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</section>
|
| 110 |
+
|
| 111 |
+
{/* How to Join */}
|
| 112 |
+
<section>
|
| 113 |
+
<h2 className="text-3xl font-bold text-foreground mb-8">How to Get Started</h2>
|
| 114 |
+
<div className="space-y-4">
|
| 115 |
+
{[
|
| 116 |
+
{ step: 1, title: 'Sign Up', description: 'Create an account and join our Discord server' },
|
| 117 |
+
{ step: 2, title: 'Introduce Yourself', description: 'Tell us about your interests and goals' },
|
| 118 |
+
{ step: 3, title: 'Explore Projects', description: 'Browse active projects and find one that interests you' },
|
| 119 |
+
{ step: 4, title: 'Start Contributing', description: 'Make your first contribution and get mentored' },
|
| 120 |
+
].map((item) => (
|
| 121 |
+
<div key={item.step} className="p-6 bg-card rounded-lg border border-border hover:border-primary/50 transition-all">
|
| 122 |
+
<div className="flex gap-6">
|
| 123 |
+
<div className="flex-shrink-0">
|
| 124 |
+
<div className="flex items-center justify-center h-12 w-12 rounded-lg bg-primary text-primary-foreground font-bold">
|
| 125 |
+
{item.step}
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
<div>
|
| 129 |
+
<h3 className="text-lg font-semibold text-foreground">{item.title}</h3>
|
| 130 |
+
<p className="text-muted-foreground mt-1">{item.description}</p>
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
))}
|
| 135 |
+
</div>
|
| 136 |
+
</section>
|
| 137 |
+
|
| 138 |
+
{/* FAQ */}
|
| 139 |
+
<section>
|
| 140 |
+
<h2 className="text-3xl font-bold text-foreground mb-8">Frequently Asked Questions</h2>
|
| 141 |
+
<div className="space-y-4">
|
| 142 |
+
{[
|
| 143 |
+
{
|
| 144 |
+
q: 'Is there a cost to join?',
|
| 145 |
+
a: 'No, joining Ignite is completely free! We believe in open and accessible community.',
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
q: 'Do I need prior experience?',
|
| 149 |
+
a: 'No experience necessary! We welcome beginners and provide learning resources and mentorship.',
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
q: 'Can I participate remotely?',
|
| 153 |
+
a: 'Absolutely! Many of our members participate remotely. We host both online and in-person events.',
|
| 154 |
+
},
|
| 155 |
+
{
|
| 156 |
+
q: 'How can I contribute?',
|
| 157 |
+
a: 'You can contribute code, documentation, design, research, or help organize community events.',
|
| 158 |
+
},
|
| 159 |
+
].map((item, idx) => (
|
| 160 |
+
<div key={idx} className="p-6 bg-card rounded-lg border border-border">
|
| 161 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">{item.q}</h3>
|
| 162 |
+
<p className="text-muted-foreground">{item.a}</p>
|
| 163 |
+
</div>
|
| 164 |
+
))}
|
| 165 |
+
</div>
|
| 166 |
+
</section>
|
| 167 |
+
|
| 168 |
+
{/* CTA */}
|
| 169 |
+
<div className="p-12 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20 text-center">
|
| 170 |
+
<h2 className="text-3xl font-bold text-foreground mb-4">Ready to Start?</h2>
|
| 171 |
+
<p className="text-lg text-muted-foreground mb-8 max-w-2xl mx-auto">
|
| 172 |
+
Join thousands of developers, researchers, and innovators building the future of tech in Nepal.
|
| 173 |
+
</p>
|
| 174 |
+
<button className="px-8 py-4 bg-primary text-primary-foreground rounded-lg font-bold text-lg hover:bg-primary/90 transition-colors">
|
| 175 |
+
Join Ignite Today
|
| 176 |
+
</button>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
<Footer />
|
| 183 |
+
</main>
|
| 184 |
+
)
|
| 185 |
+
}
|
Frontend/app/layout.tsx
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from "react"
|
| 2 |
+
import type { Metadata, Viewport } from 'next'
|
| 3 |
+
import { Inter } from 'next/font/google'
|
| 4 |
+
import { Analytics } from '@vercel/analytics/next'
|
| 5 |
+
import { ThemeProvider } from '@/components/theme-provider'
|
| 6 |
+
import './globals.css'
|
| 7 |
+
|
| 8 |
+
const inter = Inter({
|
| 9 |
+
subsets: ["latin"],
|
| 10 |
+
display: 'swap',
|
| 11 |
+
variable: '--font-inter',
|
| 12 |
+
})
|
| 13 |
+
|
| 14 |
+
export const metadata: Metadata = {
|
| 15 |
+
metadataBase: new URL('https://ignite.community'),
|
| 16 |
+
title: {
|
| 17 |
+
default: 'Ignite - Open Source Community for Nepal Tech',
|
| 18 |
+
template: '%s | Ignite Nepal',
|
| 19 |
+
},
|
| 20 |
+
description: 'Empowering Nepali tech community through open-source collaboration, research, and innovation. Join our student-led community driving technology solutions for Nepal.',
|
| 21 |
+
keywords: [
|
| 22 |
+
'open source',
|
| 23 |
+
'Nepal tech',
|
| 24 |
+
'technology community',
|
| 25 |
+
'student developers',
|
| 26 |
+
'research',
|
| 27 |
+
'Nepali developers',
|
| 28 |
+
'tech innovation',
|
| 29 |
+
'community driven',
|
| 30 |
+
'agritech',
|
| 31 |
+
'healthtech',
|
| 32 |
+
'education technology',
|
| 33 |
+
],
|
| 34 |
+
authors: [{ name: 'Ignite Open Source Community' }],
|
| 35 |
+
creator: 'Ignite Open Source Community',
|
| 36 |
+
publisher: 'Ignite Open Source Community',
|
| 37 |
+
formatDetection: {
|
| 38 |
+
email: false,
|
| 39 |
+
address: false,
|
| 40 |
+
telephone: false,
|
| 41 |
+
},
|
| 42 |
+
openGraph: {
|
| 43 |
+
type: 'website',
|
| 44 |
+
locale: 'en_US',
|
| 45 |
+
url: 'https://ignite.community',
|
| 46 |
+
siteName: 'Ignite Open Source Community',
|
| 47 |
+
title: 'Ignite - Empowering Nepali Tech',
|
| 48 |
+
description: 'Student-led open source community driving technology innovation in Nepal through collaboration, research, and impactful projects.',
|
| 49 |
+
images: [
|
| 50 |
+
{
|
| 51 |
+
url: '/og-image.jpg',
|
| 52 |
+
width: 1200,
|
| 53 |
+
height: 630,
|
| 54 |
+
alt: 'Ignite Open Source Community - Empowering Nepali Tech',
|
| 55 |
+
},
|
| 56 |
+
],
|
| 57 |
+
},
|
| 58 |
+
twitter: {
|
| 59 |
+
card: 'summary_large_image',
|
| 60 |
+
title: 'Ignite - Empowering Nepali Tech',
|
| 61 |
+
description: 'Student-led open source community driving technology innovation in Nepal.',
|
| 62 |
+
creator: '@ignite_nepal',
|
| 63 |
+
images: ['/og-image.jpg'],
|
| 64 |
+
},
|
| 65 |
+
robots: {
|
| 66 |
+
index: true,
|
| 67 |
+
follow: true,
|
| 68 |
+
googleBot: {
|
| 69 |
+
index: true,
|
| 70 |
+
follow: true,
|
| 71 |
+
'max-video-preview': -1,
|
| 72 |
+
'max-image-preview': 'large',
|
| 73 |
+
'max-snippet': -1,
|
| 74 |
+
},
|
| 75 |
+
},
|
| 76 |
+
icons: {
|
| 77 |
+
icon: [
|
| 78 |
+
{ url: '/favicon-16x16.png', sizes: '16x16', type: 'image/png' },
|
| 79 |
+
{ url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
|
| 80 |
+
{ url: '/icon.svg', type: 'image/svg+xml' },
|
| 81 |
+
],
|
| 82 |
+
shortcut: '/favicon.ico',
|
| 83 |
+
apple: [
|
| 84 |
+
{ url: '/apple-touch-icon.png', sizes: '180x180', type: 'image/png' },
|
| 85 |
+
],
|
| 86 |
+
},
|
| 87 |
+
manifest: '/site.webmanifest',
|
| 88 |
+
alternates: {
|
| 89 |
+
canonical: 'https://ignite.community',
|
| 90 |
+
},
|
| 91 |
+
generator: 'v0.app'
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
export const viewport: Viewport = {
|
| 95 |
+
themeColor: [
|
| 96 |
+
{ media: '(prefers-color-scheme: light)', color: '#F8F9FA' },
|
| 97 |
+
{ media: '(prefers-color-scheme: dark)', color: '#0D1B2A' },
|
| 98 |
+
],
|
| 99 |
+
width: 'device-width',
|
| 100 |
+
initialScale: 1,
|
| 101 |
+
maximumScale: 5,
|
| 102 |
+
userScalable: true,
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
export default function RootLayout({
|
| 106 |
+
children,
|
| 107 |
+
}: Readonly<{
|
| 108 |
+
children: React.ReactNode
|
| 109 |
+
}>) {
|
| 110 |
+
return (
|
| 111 |
+
<html lang="en" className={inter.variable} suppressHydrationWarning>
|
| 112 |
+
<head>
|
| 113 |
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 114 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
| 115 |
+
</head>
|
| 116 |
+
<body className="font-sans antialiased min-h-screen bg-background text-foreground">
|
| 117 |
+
<ThemeProvider
|
| 118 |
+
attribute="class"
|
| 119 |
+
defaultTheme="system"
|
| 120 |
+
enableSystem
|
| 121 |
+
storageKey="ignite-theme"
|
| 122 |
+
>
|
| 123 |
+
{children}
|
| 124 |
+
</ThemeProvider>
|
| 125 |
+
<Analytics />
|
| 126 |
+
</body>
|
| 127 |
+
</html>
|
| 128 |
+
)
|
| 129 |
+
}
|
Frontend/app/page.tsx
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { RibbonHero } from '@/components/ribbon-hero'
|
| 3 |
+
import { FeaturesSection } from '@/components/features-section'
|
| 4 |
+
import { FeaturedProjects } from '@/components/featured-projects'
|
| 5 |
+
import { ShareProblemSection } from '@/components/share-problem'
|
| 6 |
+
import { Footer } from '@/components/footer'
|
| 7 |
+
|
| 8 |
+
export default function Home() {
|
| 9 |
+
return (
|
| 10 |
+
<>
|
| 11 |
+
<a href="#main-content" className="sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-primary focus:text-primary-foreground focus:rounded-md">
|
| 12 |
+
Skip to main content
|
| 13 |
+
</a>
|
| 14 |
+
<Header />
|
| 15 |
+
<main id="main-content" className="min-h-screen bg-background pt-16 sm:pt-20">
|
| 16 |
+
<RibbonHero />
|
| 17 |
+
<FeaturesSection />
|
| 18 |
+
<FeaturedProjects />
|
| 19 |
+
<ShareProblemSection />
|
| 20 |
+
</main>
|
| 21 |
+
<Footer />
|
| 22 |
+
</>
|
| 23 |
+
)
|
| 24 |
+
}
|
Frontend/app/research/page.tsx
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Research - Ignite Community',
|
| 6 |
+
description: 'Collaborative research on open source technologies and Nepali market innovations',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function ResearchPage() {
|
| 10 |
+
return (
|
| 11 |
+
<main className="min-h-screen flex flex-col">
|
| 12 |
+
<Header />
|
| 13 |
+
<div className="flex-1 bg-background">
|
| 14 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 15 |
+
<div className="max-w-4xl">
|
| 16 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 17 |
+
Open Research
|
| 18 |
+
</h1>
|
| 19 |
+
<p className="text-xl text-muted-foreground mb-12 leading-relaxed">
|
| 20 |
+
We believe in advancing knowledge through collaborative research. Our community focuses on understanding the unique challenges of the Nepali tech ecosystem and developing innovative solutions.
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
<div className="space-y-12">
|
| 24 |
+
<section>
|
| 25 |
+
<h2 className="text-3xl font-bold text-foreground mb-4">Active Research Areas</h2>
|
| 26 |
+
<div className="grid md:grid-cols-2 gap-6">
|
| 27 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 28 |
+
<h3 className="text-xl font-semibold text-foreground mb-3">Nepali Tech Ecosystem</h3>
|
| 29 |
+
<p className="text-muted-foreground">
|
| 30 |
+
Understanding market gaps, user needs, and opportunities unique to Nepal's technology landscape.
|
| 31 |
+
</p>
|
| 32 |
+
</div>
|
| 33 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 34 |
+
<h3 className="text-xl font-semibold text-foreground mb-3">Open Source Impact</h3>
|
| 35 |
+
<p className="text-muted-foreground">
|
| 36 |
+
Measuring the effectiveness and reach of open source solutions in developing regions.
|
| 37 |
+
</p>
|
| 38 |
+
</div>
|
| 39 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 40 |
+
<h3 className="text-xl font-semibold text-foreground mb-3">Agricultural Tech</h3>
|
| 41 |
+
<p className="text-muted-foreground">
|
| 42 |
+
Research on technology solutions for farming and agricultural development in Nepal.
|
| 43 |
+
</p>
|
| 44 |
+
</div>
|
| 45 |
+
<div className="p-6 bg-card rounded-lg border border-border">
|
| 46 |
+
<h3 className="text-xl font-semibold text-foreground mb-3">Healthcare Innovation</h3>
|
| 47 |
+
<p className="text-muted-foreground">
|
| 48 |
+
Exploring tech-driven healthcare solutions for underserved communities.
|
| 49 |
+
</p>
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
</section>
|
| 53 |
+
|
| 54 |
+
<section>
|
| 55 |
+
<h2 className="text-3xl font-bold text-foreground mb-4">Research Publications</h2>
|
| 56 |
+
<div className="space-y-4">
|
| 57 |
+
<article className="p-6 bg-card rounded-lg border border-border hover:shadow-lg transition-shadow">
|
| 58 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">State of Open Source in Nepal 2024</h3>
|
| 59 |
+
<p className="text-sm text-muted-foreground mb-3">Published January 2024</p>
|
| 60 |
+
<p className="text-muted-foreground">Comprehensive analysis of open source adoption, challenges, and opportunities in the Nepali developer community.</p>
|
| 61 |
+
</article>
|
| 62 |
+
<article className="p-6 bg-card rounded-lg border border-border hover:shadow-lg transition-shadow">
|
| 63 |
+
<h3 className="text-lg font-semibold text-foreground mb-2">Tech Accessibility in Rural Nepal</h3>
|
| 64 |
+
<p className="text-sm text-muted-foreground mb-3">Published November 2023</p>
|
| 65 |
+
<p className="text-muted-foreground">Study on barriers to technology adoption and solutions for extending connectivity to rural areas.</p>
|
| 66 |
+
</article>
|
| 67 |
+
</div>
|
| 68 |
+
</section>
|
| 69 |
+
|
| 70 |
+
<section>
|
| 71 |
+
<h2 className="text-3xl font-bold text-foreground mb-4">Join Our Research</h2>
|
| 72 |
+
<div className="p-8 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 73 |
+
<p className="text-muted-foreground mb-4">
|
| 74 |
+
We're always looking for contributors interested in research, data collection, and analysis.
|
| 75 |
+
</p>
|
| 76 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 77 |
+
Get Involved
|
| 78 |
+
</button>
|
| 79 |
+
</div>
|
| 80 |
+
</section>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<Footer />
|
| 86 |
+
</main>
|
| 87 |
+
)
|
| 88 |
+
}
|
Frontend/app/reviews/page.tsx
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Reviews - Ignite Community',
|
| 6 |
+
description: 'Community reviews and testimonials from members and partners',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function ReviewsPage() {
|
| 10 |
+
const reviews = [
|
| 11 |
+
{
|
| 12 |
+
id: 1,
|
| 13 |
+
name: 'Amit Kunal',
|
| 14 |
+
role: 'Software Developer',
|
| 15 |
+
company: 'Tech Startup',
|
| 16 |
+
review: 'Ignite has been instrumental in my career growth. The community support and collaborative environment helped me contribute to meaningful projects.',
|
| 17 |
+
rating: 5,
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
id: 2,
|
| 21 |
+
name: 'Shruti Patel',
|
| 22 |
+
role: 'Open Source Contributor',
|
| 23 |
+
company: 'Independent',
|
| 24 |
+
review: 'The research resources and mentorship provided by Ignite have given me valuable insights into the Nepali tech ecosystem.',
|
| 25 |
+
rating: 5,
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
id: 3,
|
| 29 |
+
name: 'Rajesh Kumar',
|
| 30 |
+
role: 'AgriTech Entrepreneur',
|
| 31 |
+
company: 'GreenTech Solutions',
|
| 32 |
+
review: 'Working with Ignite on our agricultural tech project connected us with talented developers and helped us bring our vision to life.',
|
| 33 |
+
rating: 5,
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
id: 4,
|
| 37 |
+
name: 'Neha Singh',
|
| 38 |
+
role: 'Student Developer',
|
| 39 |
+
company: 'Tribhuvan University',
|
| 40 |
+
review: 'As a beginner, Ignite made open source accessible. The supportive community and educational content accelerated my learning journey.',
|
| 41 |
+
rating: 5,
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
id: 5,
|
| 45 |
+
name: 'Bikram Thapa',
|
| 46 |
+
role: 'Tech Lead',
|
| 47 |
+
company: 'Web Agency Nepal',
|
| 48 |
+
review: 'The events and meetups organized by Ignite are fantastic for networking and staying updated with industry trends.',
|
| 49 |
+
rating: 5,
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
id: 6,
|
| 53 |
+
name: 'Ananya Gupta',
|
| 54 |
+
role: 'Healthcare Professional',
|
| 55 |
+
company: 'Digital Health Initiative',
|
| 56 |
+
review: 'Ignite\'s focus on solving real-world problems in healthcare is commendable. Great partnership for our initiatives.',
|
| 57 |
+
rating: 5,
|
| 58 |
+
},
|
| 59 |
+
]
|
| 60 |
+
|
| 61 |
+
return (
|
| 62 |
+
<main className="min-h-screen flex flex-col">
|
| 63 |
+
<Header />
|
| 64 |
+
<div className="flex-1 bg-background">
|
| 65 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 66 |
+
<div className="max-w-5xl">
|
| 67 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 68 |
+
Community Reviews
|
| 69 |
+
</h1>
|
| 70 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 71 |
+
Hear from developers, students, and entrepreneurs about their experience with Ignite.
|
| 72 |
+
</p>
|
| 73 |
+
|
| 74 |
+
<div className="grid md:grid-cols-2 gap-8">
|
| 75 |
+
{reviews.map((review) => (
|
| 76 |
+
<div
|
| 77 |
+
key={review.id}
|
| 78 |
+
className="p-6 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all"
|
| 79 |
+
>
|
| 80 |
+
<div className="flex gap-1 mb-4">
|
| 81 |
+
{[...Array(review.rating)].map((_, i) => (
|
| 82 |
+
<span key={i} className="text-2xl">⭐</span>
|
| 83 |
+
))}
|
| 84 |
+
</div>
|
| 85 |
+
<p className="text-muted-foreground mb-6 text-lg leading-relaxed italic">
|
| 86 |
+
"{review.review}"
|
| 87 |
+
</p>
|
| 88 |
+
<div className="border-t border-border pt-4">
|
| 89 |
+
<h3 className="font-bold text-foreground">{review.name}</h3>
|
| 90 |
+
<p className="text-sm text-muted-foreground">{review.role}</p>
|
| 91 |
+
<p className="text-xs text-muted-foreground/70">{review.company}</p>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
))}
|
| 95 |
+
</div>
|
| 96 |
+
|
| 97 |
+
<div className="mt-16 p-8 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 98 |
+
<h2 className="text-2xl font-bold text-foreground mb-3">Share Your Experience</h2>
|
| 99 |
+
<p className="text-muted-foreground mb-6">
|
| 100 |
+
Have a story to share about your experience with Ignite? We'd love to hear from you!
|
| 101 |
+
</p>
|
| 102 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 103 |
+
Submit Review
|
| 104 |
+
</button>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
<Footer />
|
| 110 |
+
</main>
|
| 111 |
+
)
|
| 112 |
+
}
|
Frontend/app/teams/page.tsx
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Header } from '@/components/header'
|
| 2 |
+
import { Footer } from '@/components/footer'
|
| 3 |
+
|
| 4 |
+
export const metadata = {
|
| 5 |
+
title: 'Teams - Ignite Community',
|
| 6 |
+
description: 'Meet the talented developers and contributors behind Ignite Open Source Community',
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
export default function TeamsPage() {
|
| 10 |
+
const teams = [
|
| 11 |
+
{
|
| 12 |
+
name: 'Leadership',
|
| 13 |
+
description: 'Guiding the vision and strategy of the community',
|
| 14 |
+
members: [
|
| 15 |
+
{ name: 'Samrat Nepal', role: 'Community Lead', avatar: '👨💼' },
|
| 16 |
+
{ name: 'Priya Singh', role: 'Tech Lead', avatar: '👩💻' },
|
| 17 |
+
{ name: 'Bikash Thapa', role: 'Operations Lead', avatar: '👨💼' },
|
| 18 |
+
],
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
name: 'Development',
|
| 22 |
+
description: 'Building and maintaining open source projects',
|
| 23 |
+
members: [
|
| 24 |
+
{ name: 'Anil Chaudhary', role: 'Senior Developer', avatar: '👨💻' },
|
| 25 |
+
{ name: 'Rupali Sharma', role: 'Backend Developer', avatar: '👩💻' },
|
| 26 |
+
{ name: 'Harsh Patel', role: 'Frontend Developer', avatar: '👨💻' },
|
| 27 |
+
{ name: 'Neha Verma', role: 'Full Stack Developer', avatar: '👩💻' },
|
| 28 |
+
],
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
name: 'Research & Innovation',
|
| 32 |
+
description: 'Driving research initiatives and market insights',
|
| 33 |
+
members: [
|
| 34 |
+
{ name: 'Dr. Rajesh Pandey', role: 'Research Director', avatar: '👨🔬' },
|
| 35 |
+
{ name: 'Ananya Gupta', role: 'Market Researcher', avatar: '👩🔬' },
|
| 36 |
+
{ name: 'Saurav Mishra', role: 'Data Analyst', avatar: '👨💼' },
|
| 37 |
+
],
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
name: 'Community & Events',
|
| 41 |
+
description: 'Organizing events and fostering community engagement',
|
| 42 |
+
members: [
|
| 43 |
+
{ name: 'Divya Patel', role: 'Community Manager', avatar: '👩💼' },
|
| 44 |
+
{ name: 'Karan Singh', role: 'Event Coordinator', avatar: '👨💼' },
|
| 45 |
+
{ name: 'Zara Khan', role: 'Social Media Lead', avatar: '👩💼' },
|
| 46 |
+
],
|
| 47 |
+
},
|
| 48 |
+
]
|
| 49 |
+
|
| 50 |
+
return (
|
| 51 |
+
<main className="min-h-screen flex flex-col">
|
| 52 |
+
<Header />
|
| 53 |
+
<div className="flex-1 bg-background">
|
| 54 |
+
<div className="container mx-auto px-4 py-16 md:py-24">
|
| 55 |
+
<div className="max-w-5xl">
|
| 56 |
+
<h1 className="text-5xl md:text-6xl font-black text-foreground mb-6 text-balance">
|
| 57 |
+
Our Teams
|
| 58 |
+
</h1>
|
| 59 |
+
<p className="text-xl text-muted-foreground mb-12">
|
| 60 |
+
Meet the talented and passionate people driving the Ignite Open Source Community forward.
|
| 61 |
+
</p>
|
| 62 |
+
|
| 63 |
+
<div className="space-y-16">
|
| 64 |
+
{teams.map((team) => (
|
| 65 |
+
<section key={team.name} className="space-y-6">
|
| 66 |
+
<div>
|
| 67 |
+
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-2">{team.name}</h2>
|
| 68 |
+
<p className="text-lg text-muted-foreground">{team.description}</p>
|
| 69 |
+
</div>
|
| 70 |
+
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 71 |
+
{team.members.map((member) => (
|
| 72 |
+
<div key={member.name} className="p-6 bg-card rounded-lg border border-border hover:border-primary/50 hover:shadow-lg transition-all group">
|
| 73 |
+
<div className="text-5xl mb-4">{member.avatar}</div>
|
| 74 |
+
<h3 className="text-xl font-bold text-foreground group-hover:text-primary transition-colors">
|
| 75 |
+
{member.name}
|
| 76 |
+
</h3>
|
| 77 |
+
<p className="text-muted-foreground mt-2 font-medium">{member.role}</p>
|
| 78 |
+
</div>
|
| 79 |
+
))}
|
| 80 |
+
</div>
|
| 81 |
+
</section>
|
| 82 |
+
))}
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<section className="mt-16 p-8 bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg border border-primary/20">
|
| 86 |
+
<h2 className="text-2xl font-bold text-foreground mb-3">Join Our Team</h2>
|
| 87 |
+
<p className="text-muted-foreground mb-6">
|
| 88 |
+
We're always looking for talented developers, researchers, and community builders to join us.
|
| 89 |
+
</p>
|
| 90 |
+
<button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
|
| 91 |
+
Get Involved
|
| 92 |
+
</button>
|
| 93 |
+
</section>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
<Footer />
|
| 98 |
+
</main>
|
| 99 |
+
)
|
| 100 |
+
}
|
Frontend/components.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://ui.shadcn.com/schema.json",
|
| 3 |
+
"style": "new-york",
|
| 4 |
+
"rsc": true,
|
| 5 |
+
"tsx": true,
|
| 6 |
+
"tailwind": {
|
| 7 |
+
"config": "",
|
| 8 |
+
"css": "app/globals.css",
|
| 9 |
+
"baseColor": "neutral",
|
| 10 |
+
"cssVariables": true,
|
| 11 |
+
"prefix": ""
|
| 12 |
+
},
|
| 13 |
+
"aliases": {
|
| 14 |
+
"components": "@/components",
|
| 15 |
+
"utils": "@/lib/utils",
|
| 16 |
+
"ui": "@/components/ui",
|
| 17 |
+
"lib": "@/lib",
|
| 18 |
+
"hooks": "@/hooks"
|
| 19 |
+
},
|
| 20 |
+
"iconLibrary": "lucide"
|
| 21 |
+
}
|
Frontend/components/featured-projects.tsx
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { ArrowRight } from 'lucide-react'
|
| 4 |
+
import { Button } from '@/components/ui/button'
|
| 5 |
+
|
| 6 |
+
const projects = [
|
| 7 |
+
{
|
| 8 |
+
title: 'AgriTech Nepal',
|
| 9 |
+
description: 'Smart agricultural solutions connecting farmers with modern technology to improve crop yield and reduce costs',
|
| 10 |
+
image: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
| 11 |
+
tags: ['Agriculture', 'IoT', 'Data Analytics'],
|
| 12 |
+
contributors: 12,
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
title: 'WDUBot',
|
| 16 |
+
description: 'An intelligent bot platform for Nepali universities providing academic support and administrative assistance',
|
| 17 |
+
image: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
|
| 18 |
+
tags: ['AI', 'Education', 'Chatbot'],
|
| 19 |
+
contributors: 8,
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
title: 'HealthLink',
|
| 23 |
+
description: 'Connecting patients with healthcare providers in remote areas of Nepal through telemedicine platform',
|
| 24 |
+
image: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
|
| 25 |
+
tags: ['Healthcare', 'Telemedicine', 'Web'],
|
| 26 |
+
contributors: 15,
|
| 27 |
+
},
|
| 28 |
+
]
|
| 29 |
+
|
| 30 |
+
export function FeaturedProjects() {
|
| 31 |
+
return (
|
| 32 |
+
<section id="featured-projects" className="py-12 sm:py-16 md:py-20 px-4 md:px-6 bg-muted/30 scroll-mt-20" aria-labelledby="projects-heading">
|
| 33 |
+
<div className="container mx-auto">
|
| 34 |
+
<div className="text-center mb-10 sm:mb-12 md:mb-16">
|
| 35 |
+
<h2 id="projects-heading" className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-3 sm:mb-4">
|
| 36 |
+
Featured Projects
|
| 37 |
+
</h2>
|
| 38 |
+
<p className="text-sm sm:text-base md:text-lg text-muted-foreground max-w-2xl mx-auto px-2">
|
| 39 |
+
Showcasing innovative solutions built by our community members
|
| 40 |
+
</p>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 md:gap-8 max-w-6xl mx-auto">
|
| 44 |
+
{projects.map((project, index) => (
|
| 45 |
+
<article
|
| 46 |
+
key={index}
|
| 47 |
+
className="bg-card rounded-xl sm:rounded-2xl overflow-hidden border border-border hover:border-primary transition-all duration-300 hover:shadow-xl group"
|
| 48 |
+
>
|
| 49 |
+
{/* Project Image */}
|
| 50 |
+
<div
|
| 51 |
+
className="h-36 sm:h-40 md:h-48 bg-cover bg-center group-hover:scale-110 transition-transform duration-300"
|
| 52 |
+
style={{ background: project.image }}
|
| 53 |
+
role="img"
|
| 54 |
+
aria-label={`${project.title} project visual`}
|
| 55 |
+
/>
|
| 56 |
+
|
| 57 |
+
{/* Project Content */}
|
| 58 |
+
<div className="p-4 sm:p-5 md:p-6">
|
| 59 |
+
<h3 className="text-lg sm:text-xl md:text-2xl font-bold text-foreground mb-1.5 sm:mb-2">
|
| 60 |
+
{project.title}
|
| 61 |
+
</h3>
|
| 62 |
+
<p className="text-sm sm:text-base text-muted-foreground mb-3 sm:mb-4 leading-relaxed line-clamp-3">
|
| 63 |
+
{project.description}
|
| 64 |
+
</p>
|
| 65 |
+
|
| 66 |
+
{/* Tags */}
|
| 67 |
+
<div className="flex flex-wrap gap-1.5 sm:gap-2 mb-3 sm:mb-4">
|
| 68 |
+
{project.tags.map((tag) => (
|
| 69 |
+
<span
|
| 70 |
+
key={tag}
|
| 71 |
+
className="text-[10px] sm:text-xs font-medium bg-primary/10 text-primary px-2 sm:px-3 py-0.5 sm:py-1 rounded-full"
|
| 72 |
+
>
|
| 73 |
+
{tag}
|
| 74 |
+
</span>
|
| 75 |
+
))}
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
{/* Contributors and View Button */}
|
| 79 |
+
<div className="flex items-center justify-between">
|
| 80 |
+
<div className="text-xs sm:text-sm text-muted-foreground">
|
| 81 |
+
<span className="font-semibold text-foreground">{project.contributors}</span> contributors
|
| 82 |
+
</div>
|
| 83 |
+
<Button
|
| 84 |
+
variant="ghost"
|
| 85 |
+
size="sm"
|
| 86 |
+
className="text-primary hover:text-primary/80 text-xs sm:text-sm px-2 sm:px-3"
|
| 87 |
+
>
|
| 88 |
+
View <ArrowRight className="w-3 h-3 sm:w-4 sm:h-4 ml-1 sm:ml-2" aria-hidden="true" />
|
| 89 |
+
</Button>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</article>
|
| 93 |
+
))}
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
{/* See All Projects Button */}
|
| 97 |
+
<div className="text-center mt-8 sm:mt-10 md:mt-12">
|
| 98 |
+
<Button
|
| 99 |
+
size="lg"
|
| 100 |
+
className="bg-gradient-to-r from-primary to-secondary hover:opacity-90 text-sm sm:text-base px-6 sm:px-8"
|
| 101 |
+
>
|
| 102 |
+
See All Projects
|
| 103 |
+
</Button>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</section>
|
| 107 |
+
)
|
| 108 |
+
}
|
Frontend/components/features-section.tsx
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { Code2, BookOpen, Lightbulb } from 'lucide-react'
|
| 4 |
+
|
| 5 |
+
const features = [
|
| 6 |
+
{
|
| 7 |
+
title: 'Open Source',
|
| 8 |
+
description: 'Building and contributing to open-source projects that impact the Nepali tech community',
|
| 9 |
+
icon: Code2,
|
| 10 |
+
color: 'from-green-400 to-green-600',
|
| 11 |
+
bgColor: 'bg-green-50 dark:bg-green-900/50',
|
| 12 |
+
hoverBg: 'hover:bg-green-100 dark:hover:bg-green-800/60',
|
| 13 |
+
borderColor: 'border-green-200 dark:border-green-700',
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
title: 'Open Research',
|
| 17 |
+
description: 'Advancing knowledge through collaborative research on local tech challenges',
|
| 18 |
+
icon: BookOpen,
|
| 19 |
+
color: 'from-purple-400 to-purple-600',
|
| 20 |
+
bgColor: 'bg-purple-50 dark:bg-purple-900/50',
|
| 21 |
+
hoverBg: 'hover:bg-purple-100 dark:hover:bg-purple-800/60',
|
| 22 |
+
borderColor: 'border-purple-200 dark:border-purple-700',
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
title: 'Nepal Needs',
|
| 26 |
+
description: 'Identifying and solving real problems faced by businesses and communities in Nepal',
|
| 27 |
+
icon: Lightbulb,
|
| 28 |
+
color: 'from-blue-400 to-blue-600',
|
| 29 |
+
bgColor: 'bg-blue-50 dark:bg-blue-900/50',
|
| 30 |
+
hoverBg: 'hover:bg-blue-100 dark:hover:bg-blue-800/60',
|
| 31 |
+
borderColor: 'border-blue-200 dark:border-blue-700',
|
| 32 |
+
},
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
+
export function FeaturesSection() {
|
| 36 |
+
return (
|
| 37 |
+
<section className="py-12 sm:py-16 md:py-20 px-4 md:px-6 bg-background" aria-labelledby="features-heading">
|
| 38 |
+
<div className="container mx-auto">
|
| 39 |
+
<div className="text-center mb-10 sm:mb-12 md:mb-16">
|
| 40 |
+
<h2 id="features-heading" className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-3 sm:mb-4">
|
| 41 |
+
What We Do
|
| 42 |
+
</h2>
|
| 43 |
+
<p className="text-sm sm:text-base md:text-lg text-muted-foreground max-w-2xl mx-auto px-2">
|
| 44 |
+
We focus on three core pillars to drive innovation in Nepal's tech ecosystem
|
| 45 |
+
</p>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 md:gap-8 max-w-6xl mx-auto">
|
| 49 |
+
{features.map((feature, index) => {
|
| 50 |
+
const Icon = feature.icon
|
| 51 |
+
return (
|
| 52 |
+
<article
|
| 53 |
+
key={index}
|
| 54 |
+
className={`${feature.bgColor} ${feature.hoverBg} ${feature.borderColor} p-5 sm:p-6 md:p-8 rounded-xl sm:rounded-2xl transition-all duration-300 hover:shadow-xl sm:hover:scale-105 border group cursor-pointer`}
|
| 55 |
+
>
|
| 56 |
+
<div className={`w-12 h-12 sm:w-14 sm:h-14 md:w-16 md:h-16 rounded-lg sm:rounded-xl bg-gradient-to-br ${feature.color} flex items-center justify-center mb-4 sm:mb-5 md:mb-6 group-hover:scale-110 transition-transform shadow-lg`}>
|
| 57 |
+
<Icon className="w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 text-white" aria-hidden="true" />
|
| 58 |
+
</div>
|
| 59 |
+
<h3 className="text-lg sm:text-xl md:text-2xl font-bold text-foreground mb-2 sm:mb-3">
|
| 60 |
+
{feature.title}
|
| 61 |
+
</h3>
|
| 62 |
+
<p className="text-sm sm:text-base text-muted-foreground leading-relaxed">
|
| 63 |
+
{feature.description}
|
| 64 |
+
</p>
|
| 65 |
+
</article>
|
| 66 |
+
)
|
| 67 |
+
})}
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
</section>
|
| 71 |
+
)
|
| 72 |
+
}
|
Frontend/components/footer.tsx
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { Github, Twitter, Linkedin, Mail, ExternalLink } from 'lucide-react'
|
| 4 |
+
|
| 5 |
+
export function Footer() {
|
| 6 |
+
const currentYear = new Date().getFullYear()
|
| 7 |
+
|
| 8 |
+
const sections = [
|
| 9 |
+
{
|
| 10 |
+
title: 'Community',
|
| 11 |
+
links: [
|
| 12 |
+
{ label: 'About Us', href: '#' },
|
| 13 |
+
{ label: 'Join Community', href: '#' },
|
| 14 |
+
{ label: 'Code of Conduct', href: '#' },
|
| 15 |
+
{ label: 'Events', href: '#' },
|
| 16 |
+
],
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
title: 'Resources',
|
| 20 |
+
links: [
|
| 21 |
+
{ label: 'Documentation', href: '#' },
|
| 22 |
+
{ label: 'Blog', href: '#' },
|
| 23 |
+
{ label: 'Research Papers', href: '#' },
|
| 24 |
+
{ label: 'Tutorials', href: '#' },
|
| 25 |
+
],
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
title: 'Projects',
|
| 29 |
+
links: [
|
| 30 |
+
{ label: 'All Projects', href: '#' },
|
| 31 |
+
{ label: 'Contribute', href: '#' },
|
| 32 |
+
{ label: 'Featured', href: '#' },
|
| 33 |
+
{ label: 'GitHub', href: '#' },
|
| 34 |
+
],
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
title: 'Legal',
|
| 38 |
+
links: [
|
| 39 |
+
{ label: 'Privacy Policy', href: '#' },
|
| 40 |
+
{ label: 'Terms of Service', href: '#' },
|
| 41 |
+
{ label: 'Contact', href: '#' },
|
| 42 |
+
{ label: 'Support', href: '#' },
|
| 43 |
+
],
|
| 44 |
+
},
|
| 45 |
+
]
|
| 46 |
+
|
| 47 |
+
const socialLinks = [
|
| 48 |
+
{ icon: Github, href: '#', label: 'GitHub' },
|
| 49 |
+
{ icon: Twitter, href: '#', label: 'Twitter' },
|
| 50 |
+
{ icon: Linkedin, href: '#', label: 'LinkedIn' },
|
| 51 |
+
{ icon: Mail, href: '#', label: 'Email' },
|
| 52 |
+
]
|
| 53 |
+
|
| 54 |
+
return (
|
| 55 |
+
<footer className="bg-slate-900 dark:bg-slate-950 text-slate-100 py-10 sm:py-12 md:py-16" role="contentinfo">
|
| 56 |
+
<div className="container mx-auto px-4 md:px-6">
|
| 57 |
+
{/* Main Footer Content */}
|
| 58 |
+
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-6 sm:gap-8 mb-8 sm:mb-12">
|
| 59 |
+
{/* Brand Column */}
|
| 60 |
+
<div className="col-span-2 sm:col-span-3 lg:col-span-1">
|
| 61 |
+
<div className="flex items-center gap-2 mb-3 sm:mb-4">
|
| 62 |
+
<div className="w-8 h-8 sm:w-10 sm:h-10 rounded-lg bg-gradient-to-br from-primary to-secondary flex items-center justify-center text-white font-bold text-sm sm:text-lg">
|
| 63 |
+
I
|
| 64 |
+
</div>
|
| 65 |
+
<div>
|
| 66 |
+
<h3 className="font-bold text-base sm:text-lg text-white">Ignite</h3>
|
| 67 |
+
<p className="text-[10px] sm:text-xs text-slate-400">Open Source</p>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
<p className="text-xs sm:text-sm text-slate-400 mb-4 sm:mb-6 leading-relaxed max-w-xs">
|
| 71 |
+
Empowering Nepal's tech community through open-source collaboration, research, and innovation.
|
| 72 |
+
</p>
|
| 73 |
+
|
| 74 |
+
{/* Social Links */}
|
| 75 |
+
<div className="flex gap-2 sm:gap-3">
|
| 76 |
+
{socialLinks.map(({ icon: Icon, href, label }) => (
|
| 77 |
+
<a
|
| 78 |
+
key={label}
|
| 79 |
+
href={href}
|
| 80 |
+
aria-label={label}
|
| 81 |
+
className="w-8 h-8 sm:w-10 sm:h-10 rounded-lg bg-slate-800 hover:bg-primary flex items-center justify-center transition-colors group"
|
| 82 |
+
>
|
| 83 |
+
<Icon className="w-4 h-4 sm:w-5 sm:h-5 text-slate-400 group-hover:text-white" aria-hidden="true" />
|
| 84 |
+
</a>
|
| 85 |
+
))}
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
{/* Link Columns */}
|
| 90 |
+
{sections.map((section) => (
|
| 91 |
+
<nav key={section.title} aria-label={`${section.title} links`}>
|
| 92 |
+
<h4 className="font-semibold text-white mb-2 sm:mb-4 text-xs sm:text-sm uppercase tracking-wide">
|
| 93 |
+
{section.title}
|
| 94 |
+
</h4>
|
| 95 |
+
<ul className="space-y-1.5 sm:space-y-3">
|
| 96 |
+
{section.links.map((link) => (
|
| 97 |
+
<li key={link.label}>
|
| 98 |
+
<a
|
| 99 |
+
href={link.href}
|
| 100 |
+
className="text-xs sm:text-sm text-slate-400 hover:text-white transition-colors flex items-center gap-1 group"
|
| 101 |
+
>
|
| 102 |
+
{link.label}
|
| 103 |
+
<ExternalLink className="w-2.5 h-2.5 sm:w-3 sm:h-3 opacity-0 group-hover:opacity-100 transition-opacity" aria-hidden="true" />
|
| 104 |
+
</a>
|
| 105 |
+
</li>
|
| 106 |
+
))}
|
| 107 |
+
</ul>
|
| 108 |
+
</nav>
|
| 109 |
+
))}
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
{/* Divider */}
|
| 113 |
+
<div className="border-t border-slate-800 my-6 sm:my-8" />
|
| 114 |
+
|
| 115 |
+
{/* Bottom Section */}
|
| 116 |
+
<div className="flex flex-col gap-4 sm:gap-0 sm:flex-row items-center justify-between">
|
| 117 |
+
<p className="text-xs sm:text-sm text-slate-500 text-center sm:text-left order-2 sm:order-1">
|
| 118 |
+
© {currentYear} Ignite Open Source Community. Made with love in Nepal.
|
| 119 |
+
</p>
|
| 120 |
+
|
| 121 |
+
{/* Newsletter Signup */}
|
| 122 |
+
<div className="w-full sm:w-auto order-1 sm:order-2">
|
| 123 |
+
<form className="flex gap-2">
|
| 124 |
+
<label htmlFor="newsletter-email" className="sr-only">Email for newsletter</label>
|
| 125 |
+
<input
|
| 126 |
+
type="email"
|
| 127 |
+
id="newsletter-email"
|
| 128 |
+
placeholder="Enter your email"
|
| 129 |
+
className="px-3 sm:px-4 py-2 rounded-lg bg-slate-800 text-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-primary text-xs sm:text-sm flex-1 sm:flex-none min-w-0"
|
| 130 |
+
/>
|
| 131 |
+
<button
|
| 132 |
+
type="submit"
|
| 133 |
+
className="px-4 sm:px-6 py-2 bg-gradient-to-r from-primary to-secondary rounded-lg font-medium text-white hover:opacity-90 transition-opacity text-xs sm:text-sm whitespace-nowrap"
|
| 134 |
+
>
|
| 135 |
+
Subscribe
|
| 136 |
+
</button>
|
| 137 |
+
</form>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</footer>
|
| 142 |
+
)
|
| 143 |
+
}
|
Frontend/components/header.tsx
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import React from "react"
|
| 4 |
+
|
| 5 |
+
import { useState } from 'react'
|
| 6 |
+
import { ChevronDown, Menu, X } from 'lucide-react'
|
| 7 |
+
import Link from 'next/link'
|
| 8 |
+
import { ThemeToggle } from '@/components/theme-toggle'
|
| 9 |
+
|
| 10 |
+
export function Header() {
|
| 11 |
+
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
| 12 |
+
const [isMoreOpen, setIsMoreOpen] = useState(false)
|
| 13 |
+
|
| 14 |
+
const handleProjectsClick = (e: React.MouseEvent) => {
|
| 15 |
+
e.preventDefault()
|
| 16 |
+
const element = document.getElementById('featured-projects')
|
| 17 |
+
if (element) {
|
| 18 |
+
element.scrollIntoView({ behavior: 'smooth' })
|
| 19 |
+
setIsMenuOpen(false)
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
const menuItems = [
|
| 24 |
+
{ label: 'Home', href: '/' },
|
| 25 |
+
{ label: 'Projects', href: '#featured-projects', onClick: handleProjectsClick },
|
| 26 |
+
{ label: 'Research', href: '/research' },
|
| 27 |
+
{ label: 'Blogs', href: '/blogs' },
|
| 28 |
+
{ label: 'Teams', href: '/teams' },
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
const moreItems = [
|
| 32 |
+
{ label: 'Events', href: '/events' },
|
| 33 |
+
{ label: 'People Review', href: '/reviews' },
|
| 34 |
+
{ label: 'Contact Us', href: '/contact' },
|
| 35 |
+
{ label: 'Join Community', href: '/join' },
|
| 36 |
+
{ label: 'Educational Content', href: '/education' },
|
| 37 |
+
]
|
| 38 |
+
|
| 39 |
+
return (
|
| 40 |
+
<header className="fixed top-0 left-0 right-0 z-50 bg-background/95 backdrop-blur-md border-b border-border" role="banner">
|
| 41 |
+
<div className="container mx-auto px-3 sm:px-4 lg:px-6">
|
| 42 |
+
{/* Top Bar */}
|
| 43 |
+
<div className="flex items-center justify-between py-3 sm:py-4">
|
| 44 |
+
{/* Logo and Brand */}
|
| 45 |
+
<Link href="/" className="flex items-center gap-2 sm:gap-3 hover:opacity-80 transition-opacity" aria-label="Ignite - Home">
|
| 46 |
+
<div className="w-8 h-8 sm:w-10 sm:h-10 rounded-lg bg-gradient-to-br from-primary to-secondary flex items-center justify-center text-white font-bold text-sm sm:text-lg">
|
| 47 |
+
I
|
| 48 |
+
</div>
|
| 49 |
+
<div className="hidden xs:block">
|
| 50 |
+
<h1 className="text-lg sm:text-xl font-bold text-foreground">Ignite</h1>
|
| 51 |
+
<p className="text-[10px] sm:text-xs text-muted-foreground">Open Source Community</p>
|
| 52 |
+
</div>
|
| 53 |
+
</Link>
|
| 54 |
+
|
| 55 |
+
{/* Desktop Navigation */}
|
| 56 |
+
<nav className="hidden md:flex items-center gap-1">
|
| 57 |
+
{menuItems.map((item) => (
|
| 58 |
+
<button
|
| 59 |
+
key={item.label}
|
| 60 |
+
onClick={item.onClick}
|
| 61 |
+
as={item.onClick ? 'button' : undefined}
|
| 62 |
+
>
|
| 63 |
+
<Link
|
| 64 |
+
href={item.href}
|
| 65 |
+
className="px-4 py-2 text-sm font-medium text-foreground hover:text-primary transition-colors rounded-md hover:bg-muted inline-block"
|
| 66 |
+
onClick={(e) => {
|
| 67 |
+
if (item.onClick) {
|
| 68 |
+
item.onClick(e as any)
|
| 69 |
+
}
|
| 70 |
+
}}
|
| 71 |
+
>
|
| 72 |
+
{item.label}
|
| 73 |
+
</Link>
|
| 74 |
+
</button>
|
| 75 |
+
))}
|
| 76 |
+
|
| 77 |
+
{/* More Dropdown */}
|
| 78 |
+
<div className="relative group">
|
| 79 |
+
<button className="px-4 py-2 text-sm font-medium text-foreground hover:text-primary transition-colors rounded-md hover:bg-muted flex items-center gap-1">
|
| 80 |
+
More
|
| 81 |
+
<ChevronDown className="w-4 h-4" />
|
| 82 |
+
</button>
|
| 83 |
+
<div className="absolute right-0 mt-0 w-48 bg-card border border-border rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200">
|
| 84 |
+
{moreItems.map((item) => (
|
| 85 |
+
<Link
|
| 86 |
+
key={item.label}
|
| 87 |
+
href={item.href}
|
| 88 |
+
className="block px-4 py-2 text-sm text-foreground hover:bg-primary hover:text-primary-foreground first:rounded-t-lg last:rounded-b-lg transition-colors"
|
| 89 |
+
>
|
| 90 |
+
{item.label}
|
| 91 |
+
</Link>
|
| 92 |
+
))}
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
{/* Theme Toggle */}
|
| 97 |
+
<ThemeToggle />
|
| 98 |
+
</nav>
|
| 99 |
+
|
| 100 |
+
{/* Mobile Actions */}
|
| 101 |
+
<div className="flex items-center gap-1 md:hidden">
|
| 102 |
+
<ThemeToggle />
|
| 103 |
+
<button
|
| 104 |
+
className="p-2"
|
| 105 |
+
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
| 106 |
+
aria-label={isMenuOpen ? 'Close menu' : 'Open menu'}
|
| 107 |
+
>
|
| 108 |
+
{isMenuOpen ? (
|
| 109 |
+
<X className="w-6 h-6" />
|
| 110 |
+
) : (
|
| 111 |
+
<Menu className="w-6 h-6" />
|
| 112 |
+
)}
|
| 113 |
+
</button>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
{/* Mobile Navigation */}
|
| 118 |
+
{isMenuOpen && (
|
| 119 |
+
<nav className="md:hidden pb-4 space-y-1 max-h-[70vh] overflow-y-auto" aria-label="Mobile navigation">
|
| 120 |
+
{menuItems.map((item) => (
|
| 121 |
+
<button
|
| 122 |
+
key={item.label}
|
| 123 |
+
onClick={() => {
|
| 124 |
+
if (item.onClick) {
|
| 125 |
+
item.onClick({ preventDefault: () => {} } as any)
|
| 126 |
+
}
|
| 127 |
+
setIsMenuOpen(false)
|
| 128 |
+
}}
|
| 129 |
+
className="w-full text-left"
|
| 130 |
+
>
|
| 131 |
+
<Link
|
| 132 |
+
href={item.href}
|
| 133 |
+
className="block px-3 py-2.5 text-sm font-medium text-foreground hover:text-primary hover:bg-muted rounded-md transition-colors active:bg-muted/80"
|
| 134 |
+
>
|
| 135 |
+
{item.label}
|
| 136 |
+
</Link>
|
| 137 |
+
</button>
|
| 138 |
+
))}
|
| 139 |
+
|
| 140 |
+
{/* Mobile More */}
|
| 141 |
+
<button
|
| 142 |
+
onClick={() => setIsMoreOpen(!isMoreOpen)}
|
| 143 |
+
className="w-full text-left px-3 py-2.5 text-sm font-medium text-foreground hover:text-primary hover:bg-muted rounded-md transition-colors flex items-center gap-1"
|
| 144 |
+
aria-expanded={isMoreOpen}
|
| 145 |
+
>
|
| 146 |
+
More
|
| 147 |
+
<ChevronDown className={`w-4 h-4 transition-transform duration-200 ${isMoreOpen ? 'rotate-180' : ''}`} />
|
| 148 |
+
</button>
|
| 149 |
+
{isMoreOpen && (
|
| 150 |
+
<div className="pl-3 space-y-1 border-l-2 border-muted ml-3">
|
| 151 |
+
{moreItems.map((item) => (
|
| 152 |
+
<Link
|
| 153 |
+
key={item.label}
|
| 154 |
+
href={item.href}
|
| 155 |
+
className="block px-3 py-2 text-sm text-foreground hover:text-primary hover:bg-muted rounded-md transition-colors active:bg-muted/80"
|
| 156 |
+
onClick={() => setIsMenuOpen(false)}
|
| 157 |
+
>
|
| 158 |
+
{item.label}
|
| 159 |
+
</Link>
|
| 160 |
+
))}
|
| 161 |
+
</div>
|
| 162 |
+
)}
|
| 163 |
+
</nav>
|
| 164 |
+
)}
|
| 165 |
+
</div>
|
| 166 |
+
</header>
|
| 167 |
+
)
|
| 168 |
+
}
|
Frontend/components/ribbon-hero.tsx
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { useEffect, useRef, useState } from 'react'
|
| 4 |
+
|
| 5 |
+
interface WaveParticle {
|
| 6 |
+
x: number
|
| 7 |
+
y: number
|
| 8 |
+
baseX: number
|
| 9 |
+
waveIndex: number
|
| 10 |
+
t: number
|
| 11 |
+
speed: number
|
| 12 |
+
size: number
|
| 13 |
+
opacity: number
|
| 14 |
+
orbitRadius: number
|
| 15 |
+
orbitSpeed: number
|
| 16 |
+
trail: Array<{ x: number; y: number; opacity: number }>
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
interface Ribbon {
|
| 20 |
+
yOffset: number
|
| 21 |
+
amplitude: number
|
| 22 |
+
frequency: number
|
| 23 |
+
phase: number
|
| 24 |
+
speed: number
|
| 25 |
+
color1: string
|
| 26 |
+
color2: string
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
export function RibbonHero() {
|
| 30 |
+
const canvasRef = useRef<HTMLCanvasElement>(null)
|
| 31 |
+
const [isLoaded, setIsLoaded] = useState(false)
|
| 32 |
+
const [isMobile, setIsMobile] = useState(false)
|
| 33 |
+
|
| 34 |
+
useEffect(() => {
|
| 35 |
+
setIsLoaded(true)
|
| 36 |
+
const checkMobile = () => setIsMobile(window.innerWidth < 768)
|
| 37 |
+
checkMobile()
|
| 38 |
+
window.addEventListener('resize', checkMobile)
|
| 39 |
+
return () => window.removeEventListener('resize', checkMobile)
|
| 40 |
+
}, [])
|
| 41 |
+
|
| 42 |
+
useEffect(() => {
|
| 43 |
+
const canvas = canvasRef.current
|
| 44 |
+
if (!canvas) return
|
| 45 |
+
|
| 46 |
+
const ctx = canvas.getContext('2d')
|
| 47 |
+
if (!ctx) return
|
| 48 |
+
|
| 49 |
+
let width = 0
|
| 50 |
+
let height = 0
|
| 51 |
+
const isMobileDevice = window.innerWidth < 768
|
| 52 |
+
|
| 53 |
+
const resizeCanvas = () => {
|
| 54 |
+
width = window.innerWidth
|
| 55 |
+
// Adjust height for mobile - shorter hero on small screens
|
| 56 |
+
height = isMobileDevice ? Math.min(window.innerHeight * 0.6, 450) : window.innerHeight * 0.75
|
| 57 |
+
canvas.width = width
|
| 58 |
+
canvas.height = height
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
resizeCanvas()
|
| 62 |
+
window.addEventListener('resize', resizeCanvas)
|
| 63 |
+
|
| 64 |
+
// Define ribbons - fewer and smaller on mobile
|
| 65 |
+
const mobileRibbons: Ribbon[] = [
|
| 66 |
+
{ yOffset: 0.3, amplitude: 25, frequency: 0.01, phase: 0, speed: 0.35, color1: '#00f0ff', color2: '#c300ff' },
|
| 67 |
+
{ yOffset: 0.5, amplitude: 35, frequency: 0.008, phase: Math.PI * 0.5, speed: 0.4, color1: '#00bfff', color2: '#ff00aa' },
|
| 68 |
+
{ yOffset: 0.7, amplitude: 25, frequency: 0.009, phase: Math.PI, speed: 0.38, color1: '#00f0ff', color2: '#c300ff' },
|
| 69 |
+
]
|
| 70 |
+
|
| 71 |
+
const desktopRibbons: Ribbon[] = [
|
| 72 |
+
{ yOffset: 0.25, amplitude: 45, frequency: 0.008, phase: 0, speed: 0.4, color1: '#00f0ff', color2: '#c300ff' },
|
| 73 |
+
{ yOffset: 0.35, amplitude: 55, frequency: 0.006, phase: Math.PI * 0.3, speed: 0.35, color1: '#00bfff', color2: '#ff00aa' },
|
| 74 |
+
{ yOffset: 0.5, amplitude: 65, frequency: 0.007, phase: Math.PI * 0.6, speed: 0.45, color1: '#00f0ff', color2: '#c300ff' },
|
| 75 |
+
{ yOffset: 0.65, amplitude: 50, frequency: 0.009, phase: Math.PI * 0.9, speed: 0.38, color1: '#00bfff', color2: '#ff00aa' },
|
| 76 |
+
{ yOffset: 0.75, amplitude: 40, frequency: 0.005, phase: Math.PI * 1.2, speed: 0.42, color1: '#00f0ff', color2: '#c300ff' },
|
| 77 |
+
]
|
| 78 |
+
|
| 79 |
+
const ribbons = isMobileDevice ? mobileRibbons : desktopRibbons
|
| 80 |
+
|
| 81 |
+
// Create particles - significantly fewer on mobile for performance
|
| 82 |
+
const waveParticles: WaveParticle[] = []
|
| 83 |
+
const particleCount = isMobileDevice ? 80 : 300
|
| 84 |
+
|
| 85 |
+
for (let i = 0; i < particleCount; i++) {
|
| 86 |
+
const waveIndex = Math.floor(Math.random() * ribbons.length)
|
| 87 |
+
waveParticles.push({
|
| 88 |
+
x: 0,
|
| 89 |
+
y: 0,
|
| 90 |
+
baseX: Math.random() * width,
|
| 91 |
+
waveIndex,
|
| 92 |
+
t: Math.random() * Math.PI * 2,
|
| 93 |
+
speed: Math.random() * 0.3 + 0.1,
|
| 94 |
+
size: Math.random() * 1.5 + 0.5,
|
| 95 |
+
opacity: Math.random() * 0.6 + 0.4,
|
| 96 |
+
orbitRadius: Math.random() * 8 + 2,
|
| 97 |
+
orbitSpeed: Math.random() * 0.02 + 0.01,
|
| 98 |
+
trail: [],
|
| 99 |
+
})
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
// Calculate spindle thickness based on x position
|
| 103 |
+
const getSpindleThickness = (x: number, maxThickness: number): number => {
|
| 104 |
+
const normalizedX = x / width
|
| 105 |
+
// Gaussian-like curve: thin at edges, thick in center
|
| 106 |
+
const thickness = Math.exp(-Math.pow((normalizedX - 0.5) * 3, 2)) * maxThickness
|
| 107 |
+
return Math.max(thickness, 1)
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
// Calculate wave Y position
|
| 111 |
+
const getWaveY = (x: number, ribbon: Ribbon, time: number): number => {
|
| 112 |
+
return (
|
| 113 |
+
ribbon.yOffset * height +
|
| 114 |
+
Math.sin(x * ribbon.frequency + time * ribbon.speed + ribbon.phase) * ribbon.amplitude +
|
| 115 |
+
Math.sin(x * ribbon.frequency * 0.5 + time * ribbon.speed * 0.7) * (ribbon.amplitude * 0.3)
|
| 116 |
+
)
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
// Interpolate colors
|
| 120 |
+
const lerpColor = (color1: string, color2: string, t: number): string => {
|
| 121 |
+
const c1 = {
|
| 122 |
+
r: Number.parseInt(color1.slice(1, 3), 16),
|
| 123 |
+
g: Number.parseInt(color1.slice(3, 5), 16),
|
| 124 |
+
b: Number.parseInt(color1.slice(5, 7), 16),
|
| 125 |
+
}
|
| 126 |
+
const c2 = {
|
| 127 |
+
r: Number.parseInt(color2.slice(1, 3), 16),
|
| 128 |
+
g: Number.parseInt(color2.slice(3, 5), 16),
|
| 129 |
+
b: Number.parseInt(color2.slice(5, 7), 16),
|
| 130 |
+
}
|
| 131 |
+
const r = Math.round(c1.r + (c2.r - c1.r) * t)
|
| 132 |
+
const g = Math.round(c1.g + (c2.g - c1.g) * t)
|
| 133 |
+
const b = Math.round(c1.b + (c2.b - c1.b) * t)
|
| 134 |
+
return `rgb(${r}, ${g}, ${b})`
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
let animationFrameId = 0
|
| 138 |
+
let time = 0
|
| 139 |
+
|
| 140 |
+
const animate = () => {
|
| 141 |
+
time += 0.016
|
| 142 |
+
|
| 143 |
+
// Dark cosmic background
|
| 144 |
+
ctx.fillStyle = '#0a0e17'
|
| 145 |
+
ctx.fillRect(0, 0, width, height)
|
| 146 |
+
|
| 147 |
+
// Draw subtle nebula/starfield overlay - fewer stars on mobile
|
| 148 |
+
const starCount = isMobileDevice ? 40 : 100
|
| 149 |
+
ctx.globalAlpha = 0.3
|
| 150 |
+
for (let i = 0; i < starCount; i++) {
|
| 151 |
+
const sx = (Math.sin(i * 127.1 + time * 0.01) * 0.5 + 0.5) * width
|
| 152 |
+
const sy = (Math.cos(i * 311.7 + time * 0.008) * 0.5 + 0.5) * height
|
| 153 |
+
const starSize = Math.sin(i * 17.3 + time) * 0.3 + 0.5
|
| 154 |
+
ctx.fillStyle = `rgba(255, 255, 255, ${Math.random() * 0.3 + 0.1})`
|
| 155 |
+
ctx.beginPath()
|
| 156 |
+
ctx.arc(sx, sy, starSize, 0, Math.PI * 2)
|
| 157 |
+
ctx.fill()
|
| 158 |
+
}
|
| 159 |
+
ctx.globalAlpha = 1
|
| 160 |
+
|
| 161 |
+
// Draw ribbons with spindle shape - larger step size on mobile for performance
|
| 162 |
+
const stepSize = isMobileDevice ? 6 : 3
|
| 163 |
+
const coreStepSize = isMobileDevice ? 4 : 2
|
| 164 |
+
const maxGlowPasses = isMobileDevice ? 2 : 4
|
| 165 |
+
|
| 166 |
+
ctx.globalCompositeOperation = 'screen'
|
| 167 |
+
|
| 168 |
+
ribbons.forEach((ribbon, ribbonIndex) => {
|
| 169 |
+
// Draw glow layer - fewer passes on mobile
|
| 170 |
+
for (let glowPass = maxGlowPasses - 1; glowPass >= 0; glowPass--) {
|
| 171 |
+
ctx.beginPath()
|
| 172 |
+
|
| 173 |
+
const glowMultiplier = 1 + glowPass * 0.8
|
| 174 |
+
const glowOpacity = 0.15 - glowPass * 0.03
|
| 175 |
+
|
| 176 |
+
for (let x = 0; x <= width; x += stepSize) {
|
| 177 |
+
const y = getWaveY(x, ribbon, time)
|
| 178 |
+
const thickness = getSpindleThickness(x, (isMobileDevice ? 25 : 35) * glowMultiplier)
|
| 179 |
+
|
| 180 |
+
if (x === 0) {
|
| 181 |
+
ctx.moveTo(x, y - thickness / 2)
|
| 182 |
+
} else {
|
| 183 |
+
ctx.lineTo(x, y - thickness / 2)
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
for (let x = width; x >= 0; x -= stepSize) {
|
| 188 |
+
const y = getWaveY(x, ribbon, time)
|
| 189 |
+
const thickness = getSpindleThickness(x, (isMobileDevice ? 25 : 35) * glowMultiplier)
|
| 190 |
+
ctx.lineTo(x, y + thickness / 2)
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
ctx.closePath()
|
| 194 |
+
|
| 195 |
+
const gradient = ctx.createLinearGradient(0, 0, width, 0)
|
| 196 |
+
const colorT = (Math.sin(time * 0.5 + ribbonIndex) + 1) / 2
|
| 197 |
+
const color = lerpColor(ribbon.color1, ribbon.color2, colorT)
|
| 198 |
+
|
| 199 |
+
gradient.addColorStop(0, `rgba(0, 0, 0, 0)`)
|
| 200 |
+
gradient.addColorStop(0.15, color)
|
| 201 |
+
gradient.addColorStop(0.5, color)
|
| 202 |
+
gradient.addColorStop(0.85, color)
|
| 203 |
+
gradient.addColorStop(1, `rgba(0, 0, 0, 0)`)
|
| 204 |
+
|
| 205 |
+
ctx.fillStyle = gradient
|
| 206 |
+
ctx.globalAlpha = glowOpacity
|
| 207 |
+
ctx.fill()
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
// Draw core ribbon
|
| 211 |
+
ctx.beginPath()
|
| 212 |
+
|
| 213 |
+
for (let x = 0; x <= width; x += coreStepSize) {
|
| 214 |
+
const y = getWaveY(x, ribbon, time)
|
| 215 |
+
const thickness = getSpindleThickness(x, isMobileDevice ? 15 : 20)
|
| 216 |
+
|
| 217 |
+
if (x === 0) {
|
| 218 |
+
ctx.moveTo(x, y - thickness / 2)
|
| 219 |
+
} else {
|
| 220 |
+
ctx.lineTo(x, y - thickness / 2)
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
for (let x = width; x >= 0; x -= coreStepSize) {
|
| 225 |
+
const y = getWaveY(x, ribbon, time)
|
| 226 |
+
const thickness = getSpindleThickness(x, isMobileDevice ? 15 : 20)
|
| 227 |
+
ctx.lineTo(x, y + thickness / 2)
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
ctx.closePath()
|
| 231 |
+
|
| 232 |
+
const coreGradient = ctx.createLinearGradient(0, 0, width, 0)
|
| 233 |
+
const coreColorT = (Math.sin(time * 0.5 + ribbonIndex) + 1) / 2
|
| 234 |
+
const coreColor = lerpColor(ribbon.color1, ribbon.color2, coreColorT)
|
| 235 |
+
|
| 236 |
+
coreGradient.addColorStop(0, `rgba(0, 0, 0, 0)`)
|
| 237 |
+
coreGradient.addColorStop(0.2, coreColor)
|
| 238 |
+
coreGradient.addColorStop(0.5, coreColor)
|
| 239 |
+
coreGradient.addColorStop(0.8, coreColor)
|
| 240 |
+
coreGradient.addColorStop(1, `rgba(0, 0, 0, 0)`)
|
| 241 |
+
|
| 242 |
+
ctx.fillStyle = coreGradient
|
| 243 |
+
ctx.globalAlpha = 0.6
|
| 244 |
+
ctx.fill()
|
| 245 |
+
})
|
| 246 |
+
|
| 247 |
+
ctx.globalAlpha = 1
|
| 248 |
+
ctx.globalCompositeOperation = 'source-over'
|
| 249 |
+
|
| 250 |
+
// Update and draw particles along wave paths
|
| 251 |
+
waveParticles.forEach((particle) => {
|
| 252 |
+
const ribbon = ribbons[particle.waveIndex]
|
| 253 |
+
|
| 254 |
+
// Move particle along wave
|
| 255 |
+
particle.baseX += particle.speed * 2
|
| 256 |
+
if (particle.baseX > width) {
|
| 257 |
+
particle.baseX = 0
|
| 258 |
+
particle.trail = []
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
particle.t += particle.orbitSpeed
|
| 262 |
+
|
| 263 |
+
// Calculate position on wave with orbit
|
| 264 |
+
const waveY = getWaveY(particle.baseX, ribbon, time)
|
| 265 |
+
particle.x = particle.baseX + Math.cos(particle.t) * particle.orbitRadius
|
| 266 |
+
particle.y = waveY + Math.sin(particle.t) * particle.orbitRadius
|
| 267 |
+
|
| 268 |
+
// Add to trail
|
| 269 |
+
particle.trail.push({ x: particle.x, y: particle.y, opacity: particle.opacity })
|
| 270 |
+
if (particle.trail.length > 8) {
|
| 271 |
+
particle.trail.shift()
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
// Calculate opacity based on x position (fade at edges)
|
| 275 |
+
const edgeFade = Math.sin((particle.baseX / width) * Math.PI)
|
| 276 |
+
const finalOpacity = particle.opacity * edgeFade
|
| 277 |
+
|
| 278 |
+
// Draw trail (comet dust effect)
|
| 279 |
+
ctx.globalCompositeOperation = 'screen'
|
| 280 |
+
particle.trail.forEach((point, index) => {
|
| 281 |
+
const trailOpacity = (index / particle.trail.length) * finalOpacity * 0.3
|
| 282 |
+
const trailSize = particle.size * (index / particle.trail.length) * 0.5
|
| 283 |
+
|
| 284 |
+
ctx.fillStyle = `rgba(200, 220, 255, ${trailOpacity})`
|
| 285 |
+
ctx.beginPath()
|
| 286 |
+
ctx.arc(point.x, point.y, trailSize, 0, Math.PI * 2)
|
| 287 |
+
ctx.fill()
|
| 288 |
+
})
|
| 289 |
+
|
| 290 |
+
// Draw particle glow
|
| 291 |
+
ctx.fillStyle = `rgba(0, 240, 255, ${finalOpacity * 0.3})`
|
| 292 |
+
ctx.beginPath()
|
| 293 |
+
ctx.arc(particle.x, particle.y, particle.size * 3, 0, Math.PI * 2)
|
| 294 |
+
ctx.fill()
|
| 295 |
+
|
| 296 |
+
// Draw particle core
|
| 297 |
+
ctx.fillStyle = `rgba(255, 255, 255, ${finalOpacity})`
|
| 298 |
+
ctx.beginPath()
|
| 299 |
+
ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2)
|
| 300 |
+
ctx.fill()
|
| 301 |
+
|
| 302 |
+
ctx.globalCompositeOperation = 'source-over'
|
| 303 |
+
})
|
| 304 |
+
|
| 305 |
+
// Draw connecting thread lines between nearby particles - skip on mobile for performance
|
| 306 |
+
if (!isMobileDevice) {
|
| 307 |
+
ctx.globalCompositeOperation = 'screen'
|
| 308 |
+
ctx.strokeStyle = 'rgba(0, 200, 255, 0.15)'
|
| 309 |
+
ctx.lineWidth = 0.5
|
| 310 |
+
|
| 311 |
+
for (let i = 0; i < waveParticles.length; i++) {
|
| 312 |
+
for (let j = i + 1; j < Math.min(i + 20, waveParticles.length); j++) {
|
| 313 |
+
const p1 = waveParticles[i]
|
| 314 |
+
const p2 = waveParticles[j]
|
| 315 |
+
|
| 316 |
+
if (p1.waveIndex === p2.waveIndex) {
|
| 317 |
+
const dx = p1.x - p2.x
|
| 318 |
+
const dy = p1.y - p2.y
|
| 319 |
+
const dist = Math.sqrt(dx * dx + dy * dy)
|
| 320 |
+
|
| 321 |
+
if (dist < 80) {
|
| 322 |
+
const edgeFade1 = Math.sin((p1.baseX / width) * Math.PI)
|
| 323 |
+
const edgeFade2 = Math.sin((p2.baseX / width) * Math.PI)
|
| 324 |
+
const lineOpacity = (1 - dist / 80) * 0.2 * edgeFade1 * edgeFade2
|
| 325 |
+
|
| 326 |
+
ctx.globalAlpha = lineOpacity
|
| 327 |
+
ctx.beginPath()
|
| 328 |
+
ctx.moveTo(p1.x, p1.y)
|
| 329 |
+
ctx.lineTo(p2.x, p2.y)
|
| 330 |
+
ctx.stroke()
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
+
}
|
| 334 |
+
}
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
ctx.globalAlpha = 1
|
| 338 |
+
ctx.globalCompositeOperation = 'source-over'
|
| 339 |
+
|
| 340 |
+
animationFrameId = requestAnimationFrame(animate)
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
animate()
|
| 344 |
+
|
| 345 |
+
return () => {
|
| 346 |
+
cancelAnimationFrame(animationFrameId)
|
| 347 |
+
window.removeEventListener('resize', resizeCanvas)
|
| 348 |
+
}
|
| 349 |
+
}, [])
|
| 350 |
+
|
| 351 |
+
return (
|
| 352 |
+
<section
|
| 353 |
+
className="relative w-full min-h-[60vh] sm:min-h-[65vh] md:min-h-[70vh] lg:h-[75vh] overflow-hidden bg-[#0a0e17]"
|
| 354 |
+
aria-label="Hero section - Empowering Nepali Tech"
|
| 355 |
+
>
|
| 356 |
+
{/* Canvas for Ribbons and Particles */}
|
| 357 |
+
<canvas
|
| 358 |
+
ref={canvasRef}
|
| 359 |
+
className="absolute inset-0 w-full h-full"
|
| 360 |
+
aria-hidden="true"
|
| 361 |
+
/>
|
| 362 |
+
|
| 363 |
+
{/* Content Overlay with Holographic Text */}
|
| 364 |
+
<div className="absolute inset-0 flex flex-col items-start justify-end p-4 xs:p-5 sm:p-8 md:p-12 lg:p-16 z-10">
|
| 365 |
+
<div className="max-w-4xl space-y-3 sm:space-y-4 md:space-y-6">
|
| 366 |
+
<div
|
| 367 |
+
className={`space-y-1 sm:space-y-2 md:space-y-3 transition-all duration-1000 ${isLoaded ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}
|
| 368 |
+
>
|
| 369 |
+
<h1
|
| 370 |
+
className="text-2xl xs:text-3xl sm:text-4xl md:text-5xl lg:text-6xl xl:text-7xl 2xl:text-8xl font-black text-white leading-tight sm:leading-none tracking-tight"
|
| 371 |
+
style={{
|
| 372 |
+
textShadow: isMobile
|
| 373 |
+
? '0 0 20px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.2)'
|
| 374 |
+
: '0 0 40px rgba(0, 240, 255, 0.5), 0 0 80px rgba(0, 240, 255, 0.3), 0 0 120px rgba(195, 0, 255, 0.2)',
|
| 375 |
+
}}
|
| 376 |
+
>
|
| 377 |
+
<span className="block">EMPOWERING</span>
|
| 378 |
+
<span className="block">NEPALI TECH.</span>
|
| 379 |
+
<span className="block text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-purple-500">
|
| 380 |
+
OPEN TO ALL
|
| 381 |
+
</span>
|
| 382 |
+
</h1>
|
| 383 |
+
</div>
|
| 384 |
+
|
| 385 |
+
<p
|
| 386 |
+
className={`text-[10px] xs:text-xs sm:text-sm md:text-base font-semibold text-gray-300 uppercase tracking-[0.15em] sm:tracking-[0.2em] md:tracking-[0.3em] transition-all duration-1000 delay-300 max-w-xs sm:max-w-none ${isLoaded ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}
|
| 387 |
+
style={{
|
| 388 |
+
textShadow: '0 0 20px rgba(0, 240, 255, 0.4)',
|
| 389 |
+
}}
|
| 390 |
+
>
|
| 391 |
+
STUDENT-LED. OPEN SOURCE. COMMUNITY DRIVEN
|
| 392 |
+
</p>
|
| 393 |
+
</div>
|
| 394 |
+
</div>
|
| 395 |
+
</section>
|
| 396 |
+
)
|
| 397 |
+
}
|
Frontend/components/share-problem.tsx
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import React from "react"
|
| 4 |
+
|
| 5 |
+
import { useState } from 'react'
|
| 6 |
+
import { Send } from 'lucide-react'
|
| 7 |
+
import { Button } from '@/components/ui/button'
|
| 8 |
+
|
| 9 |
+
export function ShareProblemSection() {
|
| 10 |
+
const [formData, setFormData] = useState({
|
| 11 |
+
name: '',
|
| 12 |
+
email: '',
|
| 13 |
+
problem: '',
|
| 14 |
+
})
|
| 15 |
+
const [isSubmitting, setIsSubmitting] = useState(false)
|
| 16 |
+
const [submitStatus, setSubmitStatus] = useState<'idle' | 'success' | 'error'>('idle')
|
| 17 |
+
|
| 18 |
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
| 19 |
+
const { name, value } = e.target
|
| 20 |
+
setFormData(prev => ({
|
| 21 |
+
...prev,
|
| 22 |
+
[name]: value,
|
| 23 |
+
}))
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
const handleSubmit = async (e: React.FormEvent) => {
|
| 27 |
+
e.preventDefault()
|
| 28 |
+
setIsSubmitting(true)
|
| 29 |
+
|
| 30 |
+
try {
|
| 31 |
+
// Simulate form submission
|
| 32 |
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
| 33 |
+
setSubmitStatus('success')
|
| 34 |
+
setFormData({ name: '', email: '', problem: '' })
|
| 35 |
+
setTimeout(() => setSubmitStatus('idle'), 3000)
|
| 36 |
+
} catch (error) {
|
| 37 |
+
setSubmitStatus('error')
|
| 38 |
+
setTimeout(() => setSubmitStatus('idle'), 3000)
|
| 39 |
+
} finally {
|
| 40 |
+
setIsSubmitting(false)
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
return (
|
| 45 |
+
<section className="py-12 sm:py-16 md:py-20 px-4 md:px-6 bg-gradient-to-b from-background via-muted/20 to-background" aria-labelledby="share-problem-heading">
|
| 46 |
+
<div className="container mx-auto max-w-3xl">
|
| 47 |
+
<div className="bg-card border border-border rounded-2xl sm:rounded-3xl p-5 sm:p-8 md:p-12 shadow-lg">
|
| 48 |
+
<div className="text-center mb-6 sm:mb-8">
|
| 49 |
+
<h2 id="share-problem-heading" className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-3 sm:mb-4">
|
| 50 |
+
Share Your Problem
|
| 51 |
+
</h2>
|
| 52 |
+
<p className="text-sm sm:text-base md:text-lg text-muted-foreground px-2">
|
| 53 |
+
Have a challenge you'd like the community to help solve? Tell us about it and let's innovate together.
|
| 54 |
+
</p>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<form onSubmit={handleSubmit} className="space-y-4 sm:space-y-6">
|
| 58 |
+
{/* Name Field */}
|
| 59 |
+
<div>
|
| 60 |
+
<label htmlFor="name" className="block text-xs sm:text-sm font-semibold text-foreground mb-1.5 sm:mb-2">
|
| 61 |
+
Your Name
|
| 62 |
+
</label>
|
| 63 |
+
<input
|
| 64 |
+
type="text"
|
| 65 |
+
id="name"
|
| 66 |
+
name="name"
|
| 67 |
+
value={formData.name}
|
| 68 |
+
onChange={handleChange}
|
| 69 |
+
required
|
| 70 |
+
placeholder="Enter your full name"
|
| 71 |
+
className="w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary transition-all text-sm sm:text-base"
|
| 72 |
+
/>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
{/* Email Field */}
|
| 76 |
+
<div>
|
| 77 |
+
<label htmlFor="email" className="block text-xs sm:text-sm font-semibold text-foreground mb-1.5 sm:mb-2">
|
| 78 |
+
Email Address
|
| 79 |
+
</label>
|
| 80 |
+
<input
|
| 81 |
+
type="email"
|
| 82 |
+
id="email"
|
| 83 |
+
name="email"
|
| 84 |
+
value={formData.email}
|
| 85 |
+
onChange={handleChange}
|
| 86 |
+
required
|
| 87 |
+
placeholder="your.email@example.com"
|
| 88 |
+
className="w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary transition-all text-sm sm:text-base"
|
| 89 |
+
/>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
{/* Problem Field */}
|
| 93 |
+
<div>
|
| 94 |
+
<label htmlFor="problem" className="block text-xs sm:text-sm font-semibold text-foreground mb-1.5 sm:mb-2">
|
| 95 |
+
Describe Your Problem
|
| 96 |
+
</label>
|
| 97 |
+
<textarea
|
| 98 |
+
id="problem"
|
| 99 |
+
name="problem"
|
| 100 |
+
value={formData.problem}
|
| 101 |
+
onChange={handleChange}
|
| 102 |
+
required
|
| 103 |
+
placeholder="Tell us about the challenge you're facing. What problem are you trying to solve?"
|
| 104 |
+
rows={5}
|
| 105 |
+
className="w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary transition-all resize-none text-sm sm:text-base"
|
| 106 |
+
/>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
{/* Submit Button and Status */}
|
| 110 |
+
<div className="flex flex-col gap-4">
|
| 111 |
+
<Button
|
| 112 |
+
type="submit"
|
| 113 |
+
disabled={isSubmitting || submitStatus === 'success'}
|
| 114 |
+
className="w-full bg-gradient-to-r from-primary to-secondary hover:opacity-90 disabled:opacity-50 text-white py-3 rounded-lg font-semibold flex items-center justify-center gap-2"
|
| 115 |
+
>
|
| 116 |
+
{isSubmitting ? (
|
| 117 |
+
<>
|
| 118 |
+
<span className="animate-spin inline-block w-4 h-4 border-2 border-white border-t-transparent rounded-full" />
|
| 119 |
+
Submitting...
|
| 120 |
+
</>
|
| 121 |
+
) : (
|
| 122 |
+
<>
|
| 123 |
+
<Send className="w-4 h-4" />
|
| 124 |
+
Share Problem with Community
|
| 125 |
+
</>
|
| 126 |
+
)}
|
| 127 |
+
</Button>
|
| 128 |
+
|
| 129 |
+
{submitStatus === 'success' && (
|
| 130 |
+
<div className="bg-green-50 dark:bg-green-950/50 border border-green-200 dark:border-green-800 text-green-700 dark:text-green-400 px-4 py-3 rounded-lg text-center text-sm">
|
| 131 |
+
Thank you! We've received your problem and will review it shortly.
|
| 132 |
+
</div>
|
| 133 |
+
)}
|
| 134 |
+
|
| 135 |
+
{submitStatus === 'error' && (
|
| 136 |
+
<div className="bg-red-50 dark:bg-red-950/50 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400 px-4 py-3 rounded-lg text-center text-sm">
|
| 137 |
+
Something went wrong. Please try again.
|
| 138 |
+
</div>
|
| 139 |
+
)}
|
| 140 |
+
</div>
|
| 141 |
+
</form>
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
</section>
|
| 145 |
+
)
|
| 146 |
+
}
|
Frontend/components/theme-provider.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import {
|
| 5 |
+
ThemeProvider as NextThemesProvider,
|
| 6 |
+
type ThemeProviderProps,
|
| 7 |
+
} from 'next-themes'
|
| 8 |
+
|
| 9 |
+
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
| 10 |
+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
|
| 11 |
+
}
|
Frontend/components/theme-toggle.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { useTheme } from 'next-themes'
|
| 4 |
+
import { useEffect, useState } from 'react'
|
| 5 |
+
import { Moon, Sun } from 'lucide-react'
|
| 6 |
+
import { Button } from '@/components/ui/button'
|
| 7 |
+
|
| 8 |
+
export function ThemeToggle() {
|
| 9 |
+
const { setTheme, resolvedTheme } = useTheme()
|
| 10 |
+
const [mounted, setMounted] = useState(false)
|
| 11 |
+
|
| 12 |
+
useEffect(() => {
|
| 13 |
+
setMounted(true)
|
| 14 |
+
}, [])
|
| 15 |
+
|
| 16 |
+
const toggleTheme = () => {
|
| 17 |
+
const newTheme = resolvedTheme === 'dark' ? 'light' : 'dark'
|
| 18 |
+
setTheme(newTheme)
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
// Show placeholder during SSR/hydration
|
| 22 |
+
if (!mounted) {
|
| 23 |
+
return (
|
| 24 |
+
<Button
|
| 25 |
+
variant="outline"
|
| 26 |
+
size="icon"
|
| 27 |
+
className="w-9 h-9 rounded-full border-border bg-transparent"
|
| 28 |
+
aria-label="Toggle theme"
|
| 29 |
+
disabled
|
| 30 |
+
>
|
| 31 |
+
<div className="w-4 h-4 bg-muted rounded-full animate-pulse" />
|
| 32 |
+
</Button>
|
| 33 |
+
)
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
const isDark = resolvedTheme === 'dark'
|
| 37 |
+
|
| 38 |
+
return (
|
| 39 |
+
<Button
|
| 40 |
+
variant="outline"
|
| 41 |
+
size="icon"
|
| 42 |
+
onClick={toggleTheme}
|
| 43 |
+
className="w-9 h-9 rounded-full border-border hover:bg-muted transition-colors bg-transparent"
|
| 44 |
+
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
|
| 45 |
+
>
|
| 46 |
+
{isDark ? (
|
| 47 |
+
<Sun className="w-4 h-4 text-amber-400" />
|
| 48 |
+
) : (
|
| 49 |
+
<Moon className="w-4 h-4 text-slate-700" />
|
| 50 |
+
)}
|
| 51 |
+
</Button>
|
| 52 |
+
)
|
| 53 |
+
}
|
Frontend/components/ui/accordion.tsx
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as AccordionPrimitive from '@radix-ui/react-accordion'
|
| 5 |
+
import { ChevronDownIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function Accordion({
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
| 12 |
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function AccordionItem({
|
| 16 |
+
className,
|
| 17 |
+
...props
|
| 18 |
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
| 19 |
+
return (
|
| 20 |
+
<AccordionPrimitive.Item
|
| 21 |
+
data-slot="accordion-item"
|
| 22 |
+
className={cn('border-b last:border-b-0', className)}
|
| 23 |
+
{...props}
|
| 24 |
+
/>
|
| 25 |
+
)
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
function AccordionTrigger({
|
| 29 |
+
className,
|
| 30 |
+
children,
|
| 31 |
+
...props
|
| 32 |
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
| 33 |
+
return (
|
| 34 |
+
<AccordionPrimitive.Header className="flex">
|
| 35 |
+
<AccordionPrimitive.Trigger
|
| 36 |
+
data-slot="accordion-trigger"
|
| 37 |
+
className={cn(
|
| 38 |
+
'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
|
| 39 |
+
className,
|
| 40 |
+
)}
|
| 41 |
+
{...props}
|
| 42 |
+
>
|
| 43 |
+
{children}
|
| 44 |
+
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
|
| 45 |
+
</AccordionPrimitive.Trigger>
|
| 46 |
+
</AccordionPrimitive.Header>
|
| 47 |
+
)
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
function AccordionContent({
|
| 51 |
+
className,
|
| 52 |
+
children,
|
| 53 |
+
...props
|
| 54 |
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
| 55 |
+
return (
|
| 56 |
+
<AccordionPrimitive.Content
|
| 57 |
+
data-slot="accordion-content"
|
| 58 |
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
| 59 |
+
{...props}
|
| 60 |
+
>
|
| 61 |
+
<div className={cn('pt-0 pb-4', className)}>{children}</div>
|
| 62 |
+
</AccordionPrimitive.Content>
|
| 63 |
+
)
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
Frontend/components/ui/alert-dialog.tsx
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
import { buttonVariants } from '@/components/ui/button'
|
| 8 |
+
|
| 9 |
+
function AlertDialog({
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
| 12 |
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function AlertDialogTrigger({
|
| 16 |
+
...props
|
| 17 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
| 18 |
+
return (
|
| 19 |
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
| 20 |
+
)
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
function AlertDialogPortal({
|
| 24 |
+
...props
|
| 25 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
| 26 |
+
return (
|
| 27 |
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
| 28 |
+
)
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
function AlertDialogOverlay({
|
| 32 |
+
className,
|
| 33 |
+
...props
|
| 34 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
| 35 |
+
return (
|
| 36 |
+
<AlertDialogPrimitive.Overlay
|
| 37 |
+
data-slot="alert-dialog-overlay"
|
| 38 |
+
className={cn(
|
| 39 |
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
| 40 |
+
className,
|
| 41 |
+
)}
|
| 42 |
+
{...props}
|
| 43 |
+
/>
|
| 44 |
+
)
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
function AlertDialogContent({
|
| 48 |
+
className,
|
| 49 |
+
...props
|
| 50 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
| 51 |
+
return (
|
| 52 |
+
<AlertDialogPortal>
|
| 53 |
+
<AlertDialogOverlay />
|
| 54 |
+
<AlertDialogPrimitive.Content
|
| 55 |
+
data-slot="alert-dialog-content"
|
| 56 |
+
className={cn(
|
| 57 |
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
|
| 58 |
+
className,
|
| 59 |
+
)}
|
| 60 |
+
{...props}
|
| 61 |
+
/>
|
| 62 |
+
</AlertDialogPortal>
|
| 63 |
+
)
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
function AlertDialogHeader({
|
| 67 |
+
className,
|
| 68 |
+
...props
|
| 69 |
+
}: React.ComponentProps<'div'>) {
|
| 70 |
+
return (
|
| 71 |
+
<div
|
| 72 |
+
data-slot="alert-dialog-header"
|
| 73 |
+
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
|
| 74 |
+
{...props}
|
| 75 |
+
/>
|
| 76 |
+
)
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
function AlertDialogFooter({
|
| 80 |
+
className,
|
| 81 |
+
...props
|
| 82 |
+
}: React.ComponentProps<'div'>) {
|
| 83 |
+
return (
|
| 84 |
+
<div
|
| 85 |
+
data-slot="alert-dialog-footer"
|
| 86 |
+
className={cn(
|
| 87 |
+
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
|
| 88 |
+
className,
|
| 89 |
+
)}
|
| 90 |
+
{...props}
|
| 91 |
+
/>
|
| 92 |
+
)
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
function AlertDialogTitle({
|
| 96 |
+
className,
|
| 97 |
+
...props
|
| 98 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
| 99 |
+
return (
|
| 100 |
+
<AlertDialogPrimitive.Title
|
| 101 |
+
data-slot="alert-dialog-title"
|
| 102 |
+
className={cn('text-lg font-semibold', className)}
|
| 103 |
+
{...props}
|
| 104 |
+
/>
|
| 105 |
+
)
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
function AlertDialogDescription({
|
| 109 |
+
className,
|
| 110 |
+
...props
|
| 111 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
| 112 |
+
return (
|
| 113 |
+
<AlertDialogPrimitive.Description
|
| 114 |
+
data-slot="alert-dialog-description"
|
| 115 |
+
className={cn('text-muted-foreground text-sm', className)}
|
| 116 |
+
{...props}
|
| 117 |
+
/>
|
| 118 |
+
)
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
function AlertDialogAction({
|
| 122 |
+
className,
|
| 123 |
+
...props
|
| 124 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
| 125 |
+
return (
|
| 126 |
+
<AlertDialogPrimitive.Action
|
| 127 |
+
className={cn(buttonVariants(), className)}
|
| 128 |
+
{...props}
|
| 129 |
+
/>
|
| 130 |
+
)
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
function AlertDialogCancel({
|
| 134 |
+
className,
|
| 135 |
+
...props
|
| 136 |
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
| 137 |
+
return (
|
| 138 |
+
<AlertDialogPrimitive.Cancel
|
| 139 |
+
className={cn(buttonVariants({ variant: 'outline' }), className)}
|
| 140 |
+
{...props}
|
| 141 |
+
/>
|
| 142 |
+
)
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
export {
|
| 146 |
+
AlertDialog,
|
| 147 |
+
AlertDialogPortal,
|
| 148 |
+
AlertDialogOverlay,
|
| 149 |
+
AlertDialogTrigger,
|
| 150 |
+
AlertDialogContent,
|
| 151 |
+
AlertDialogHeader,
|
| 152 |
+
AlertDialogFooter,
|
| 153 |
+
AlertDialogTitle,
|
| 154 |
+
AlertDialogDescription,
|
| 155 |
+
AlertDialogAction,
|
| 156 |
+
AlertDialogCancel,
|
| 157 |
+
}
|
Frontend/components/ui/alert.tsx
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 3 |
+
|
| 4 |
+
import { cn } from '@/lib/utils'
|
| 5 |
+
|
| 6 |
+
const alertVariants = cva(
|
| 7 |
+
'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
|
| 8 |
+
{
|
| 9 |
+
variants: {
|
| 10 |
+
variant: {
|
| 11 |
+
default: 'bg-card text-card-foreground',
|
| 12 |
+
destructive:
|
| 13 |
+
'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
|
| 14 |
+
},
|
| 15 |
+
},
|
| 16 |
+
defaultVariants: {
|
| 17 |
+
variant: 'default',
|
| 18 |
+
},
|
| 19 |
+
},
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
function Alert({
|
| 23 |
+
className,
|
| 24 |
+
variant,
|
| 25 |
+
...props
|
| 26 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {
|
| 27 |
+
return (
|
| 28 |
+
<div
|
| 29 |
+
data-slot="alert"
|
| 30 |
+
role="alert"
|
| 31 |
+
className={cn(alertVariants({ variant }), className)}
|
| 32 |
+
{...props}
|
| 33 |
+
/>
|
| 34 |
+
)
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
| 38 |
+
return (
|
| 39 |
+
<div
|
| 40 |
+
data-slot="alert-title"
|
| 41 |
+
className={cn(
|
| 42 |
+
'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight',
|
| 43 |
+
className,
|
| 44 |
+
)}
|
| 45 |
+
{...props}
|
| 46 |
+
/>
|
| 47 |
+
)
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
function AlertDescription({
|
| 51 |
+
className,
|
| 52 |
+
...props
|
| 53 |
+
}: React.ComponentProps<'div'>) {
|
| 54 |
+
return (
|
| 55 |
+
<div
|
| 56 |
+
data-slot="alert-description"
|
| 57 |
+
className={cn(
|
| 58 |
+
'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
|
| 59 |
+
className,
|
| 60 |
+
)}
|
| 61 |
+
{...props}
|
| 62 |
+
/>
|
| 63 |
+
)
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
export { Alert, AlertTitle, AlertDescription }
|
Frontend/components/ui/aspect-ratio.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio'
|
| 4 |
+
|
| 5 |
+
function AspectRatio({
|
| 6 |
+
...props
|
| 7 |
+
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
| 8 |
+
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
export { AspectRatio }
|
Frontend/components/ui/avatar.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
|
| 8 |
+
function Avatar({
|
| 9 |
+
className,
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
| 12 |
+
return (
|
| 13 |
+
<AvatarPrimitive.Root
|
| 14 |
+
data-slot="avatar"
|
| 15 |
+
className={cn(
|
| 16 |
+
'relative flex size-8 shrink-0 overflow-hidden rounded-full',
|
| 17 |
+
className,
|
| 18 |
+
)}
|
| 19 |
+
{...props}
|
| 20 |
+
/>
|
| 21 |
+
)
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
function AvatarImage({
|
| 25 |
+
className,
|
| 26 |
+
...props
|
| 27 |
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
| 28 |
+
return (
|
| 29 |
+
<AvatarPrimitive.Image
|
| 30 |
+
data-slot="avatar-image"
|
| 31 |
+
className={cn('aspect-square size-full', className)}
|
| 32 |
+
{...props}
|
| 33 |
+
/>
|
| 34 |
+
)
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function AvatarFallback({
|
| 38 |
+
className,
|
| 39 |
+
...props
|
| 40 |
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
| 41 |
+
return (
|
| 42 |
+
<AvatarPrimitive.Fallback
|
| 43 |
+
data-slot="avatar-fallback"
|
| 44 |
+
className={cn(
|
| 45 |
+
'bg-muted flex size-full items-center justify-center rounded-full',
|
| 46 |
+
className,
|
| 47 |
+
)}
|
| 48 |
+
{...props}
|
| 49 |
+
/>
|
| 50 |
+
)
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
export { Avatar, AvatarImage, AvatarFallback }
|
Frontend/components/ui/badge.tsx
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 3 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 4 |
+
|
| 5 |
+
import { cn } from '@/lib/utils'
|
| 6 |
+
|
| 7 |
+
const badgeVariants = cva(
|
| 8 |
+
'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
|
| 9 |
+
{
|
| 10 |
+
variants: {
|
| 11 |
+
variant: {
|
| 12 |
+
default:
|
| 13 |
+
'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
| 14 |
+
secondary:
|
| 15 |
+
'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
| 16 |
+
destructive:
|
| 17 |
+
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
| 18 |
+
outline:
|
| 19 |
+
'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
| 20 |
+
},
|
| 21 |
+
},
|
| 22 |
+
defaultVariants: {
|
| 23 |
+
variant: 'default',
|
| 24 |
+
},
|
| 25 |
+
},
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
function Badge({
|
| 29 |
+
className,
|
| 30 |
+
variant,
|
| 31 |
+
asChild = false,
|
| 32 |
+
...props
|
| 33 |
+
}: React.ComponentProps<'span'> &
|
| 34 |
+
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
| 35 |
+
const Comp = asChild ? Slot : 'span'
|
| 36 |
+
|
| 37 |
+
return (
|
| 38 |
+
<Comp
|
| 39 |
+
data-slot="badge"
|
| 40 |
+
className={cn(badgeVariants({ variant }), className)}
|
| 41 |
+
{...props}
|
| 42 |
+
/>
|
| 43 |
+
)
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
export { Badge, badgeVariants }
|
Frontend/components/ui/breadcrumb.tsx
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 3 |
+
import { ChevronRight, MoreHorizontal } from 'lucide-react'
|
| 4 |
+
|
| 5 |
+
import { cn } from '@/lib/utils'
|
| 6 |
+
|
| 7 |
+
function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) {
|
| 8 |
+
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
|
| 12 |
+
return (
|
| 13 |
+
<ol
|
| 14 |
+
data-slot="breadcrumb-list"
|
| 15 |
+
className={cn(
|
| 16 |
+
'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
|
| 17 |
+
className,
|
| 18 |
+
)}
|
| 19 |
+
{...props}
|
| 20 |
+
/>
|
| 21 |
+
)
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
|
| 25 |
+
return (
|
| 26 |
+
<li
|
| 27 |
+
data-slot="breadcrumb-item"
|
| 28 |
+
className={cn('inline-flex items-center gap-1.5', className)}
|
| 29 |
+
{...props}
|
| 30 |
+
/>
|
| 31 |
+
)
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
function BreadcrumbLink({
|
| 35 |
+
asChild,
|
| 36 |
+
className,
|
| 37 |
+
...props
|
| 38 |
+
}: React.ComponentProps<'a'> & {
|
| 39 |
+
asChild?: boolean
|
| 40 |
+
}) {
|
| 41 |
+
const Comp = asChild ? Slot : 'a'
|
| 42 |
+
|
| 43 |
+
return (
|
| 44 |
+
<Comp
|
| 45 |
+
data-slot="breadcrumb-link"
|
| 46 |
+
className={cn('hover:text-foreground transition-colors', className)}
|
| 47 |
+
{...props}
|
| 48 |
+
/>
|
| 49 |
+
)
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
|
| 53 |
+
return (
|
| 54 |
+
<span
|
| 55 |
+
data-slot="breadcrumb-page"
|
| 56 |
+
role="link"
|
| 57 |
+
aria-disabled="true"
|
| 58 |
+
aria-current="page"
|
| 59 |
+
className={cn('text-foreground font-normal', className)}
|
| 60 |
+
{...props}
|
| 61 |
+
/>
|
| 62 |
+
)
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
function BreadcrumbSeparator({
|
| 66 |
+
children,
|
| 67 |
+
className,
|
| 68 |
+
...props
|
| 69 |
+
}: React.ComponentProps<'li'>) {
|
| 70 |
+
return (
|
| 71 |
+
<li
|
| 72 |
+
data-slot="breadcrumb-separator"
|
| 73 |
+
role="presentation"
|
| 74 |
+
aria-hidden="true"
|
| 75 |
+
className={cn('[&>svg]:size-3.5', className)}
|
| 76 |
+
{...props}
|
| 77 |
+
>
|
| 78 |
+
{children ?? <ChevronRight />}
|
| 79 |
+
</li>
|
| 80 |
+
)
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
function BreadcrumbEllipsis({
|
| 84 |
+
className,
|
| 85 |
+
...props
|
| 86 |
+
}: React.ComponentProps<'span'>) {
|
| 87 |
+
return (
|
| 88 |
+
<span
|
| 89 |
+
data-slot="breadcrumb-ellipsis"
|
| 90 |
+
role="presentation"
|
| 91 |
+
aria-hidden="true"
|
| 92 |
+
className={cn('flex size-9 items-center justify-center', className)}
|
| 93 |
+
{...props}
|
| 94 |
+
>
|
| 95 |
+
<MoreHorizontal className="size-4" />
|
| 96 |
+
<span className="sr-only">More</span>
|
| 97 |
+
</span>
|
| 98 |
+
)
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
export {
|
| 102 |
+
Breadcrumb,
|
| 103 |
+
BreadcrumbList,
|
| 104 |
+
BreadcrumbItem,
|
| 105 |
+
BreadcrumbLink,
|
| 106 |
+
BreadcrumbPage,
|
| 107 |
+
BreadcrumbSeparator,
|
| 108 |
+
BreadcrumbEllipsis,
|
| 109 |
+
}
|
Frontend/components/ui/button-group.tsx
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 2 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 3 |
+
|
| 4 |
+
import { cn } from '@/lib/utils'
|
| 5 |
+
import { Separator } from '@/components/ui/separator'
|
| 6 |
+
|
| 7 |
+
const buttonGroupVariants = cva(
|
| 8 |
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
| 9 |
+
{
|
| 10 |
+
variants: {
|
| 11 |
+
orientation: {
|
| 12 |
+
horizontal:
|
| 13 |
+
'[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
|
| 14 |
+
vertical:
|
| 15 |
+
'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',
|
| 16 |
+
},
|
| 17 |
+
},
|
| 18 |
+
defaultVariants: {
|
| 19 |
+
orientation: 'horizontal',
|
| 20 |
+
},
|
| 21 |
+
},
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
function ButtonGroup({
|
| 25 |
+
className,
|
| 26 |
+
orientation,
|
| 27 |
+
...props
|
| 28 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
|
| 29 |
+
return (
|
| 30 |
+
<div
|
| 31 |
+
role="group"
|
| 32 |
+
data-slot="button-group"
|
| 33 |
+
data-orientation={orientation}
|
| 34 |
+
className={cn(buttonGroupVariants({ orientation }), className)}
|
| 35 |
+
{...props}
|
| 36 |
+
/>
|
| 37 |
+
)
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
function ButtonGroupText({
|
| 41 |
+
className,
|
| 42 |
+
asChild = false,
|
| 43 |
+
...props
|
| 44 |
+
}: React.ComponentProps<'div'> & {
|
| 45 |
+
asChild?: boolean
|
| 46 |
+
}) {
|
| 47 |
+
const Comp = asChild ? Slot : 'div'
|
| 48 |
+
|
| 49 |
+
return (
|
| 50 |
+
<Comp
|
| 51 |
+
className={cn(
|
| 52 |
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
| 53 |
+
className,
|
| 54 |
+
)}
|
| 55 |
+
{...props}
|
| 56 |
+
/>
|
| 57 |
+
)
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
function ButtonGroupSeparator({
|
| 61 |
+
className,
|
| 62 |
+
orientation = 'vertical',
|
| 63 |
+
...props
|
| 64 |
+
}: React.ComponentProps<typeof Separator>) {
|
| 65 |
+
return (
|
| 66 |
+
<Separator
|
| 67 |
+
data-slot="button-group-separator"
|
| 68 |
+
orientation={orientation}
|
| 69 |
+
className={cn(
|
| 70 |
+
'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',
|
| 71 |
+
className,
|
| 72 |
+
)}
|
| 73 |
+
{...props}
|
| 74 |
+
/>
|
| 75 |
+
)
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
export {
|
| 79 |
+
ButtonGroup,
|
| 80 |
+
ButtonGroupSeparator,
|
| 81 |
+
ButtonGroupText,
|
| 82 |
+
buttonGroupVariants,
|
| 83 |
+
}
|
Frontend/components/ui/button.tsx
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 3 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 4 |
+
|
| 5 |
+
import { cn } from '@/lib/utils'
|
| 6 |
+
|
| 7 |
+
const buttonVariants = cva(
|
| 8 |
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
| 9 |
+
{
|
| 10 |
+
variants: {
|
| 11 |
+
variant: {
|
| 12 |
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
| 13 |
+
destructive:
|
| 14 |
+
'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
| 15 |
+
outline:
|
| 16 |
+
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
| 17 |
+
secondary:
|
| 18 |
+
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
| 19 |
+
ghost:
|
| 20 |
+
'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
| 21 |
+
link: 'text-primary underline-offset-4 hover:underline',
|
| 22 |
+
},
|
| 23 |
+
size: {
|
| 24 |
+
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
| 25 |
+
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
| 26 |
+
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
| 27 |
+
icon: 'size-9',
|
| 28 |
+
'icon-sm': 'size-8',
|
| 29 |
+
'icon-lg': 'size-10',
|
| 30 |
+
},
|
| 31 |
+
},
|
| 32 |
+
defaultVariants: {
|
| 33 |
+
variant: 'default',
|
| 34 |
+
size: 'default',
|
| 35 |
+
},
|
| 36 |
+
},
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
function Button({
|
| 40 |
+
className,
|
| 41 |
+
variant,
|
| 42 |
+
size,
|
| 43 |
+
asChild = false,
|
| 44 |
+
...props
|
| 45 |
+
}: React.ComponentProps<'button'> &
|
| 46 |
+
VariantProps<typeof buttonVariants> & {
|
| 47 |
+
asChild?: boolean
|
| 48 |
+
}) {
|
| 49 |
+
const Comp = asChild ? Slot : 'button'
|
| 50 |
+
|
| 51 |
+
return (
|
| 52 |
+
<Comp
|
| 53 |
+
data-slot="button"
|
| 54 |
+
className={cn(buttonVariants({ variant, size, className }))}
|
| 55 |
+
{...props}
|
| 56 |
+
/>
|
| 57 |
+
)
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
export { Button, buttonVariants }
|
Frontend/components/ui/calendar.tsx
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import {
|
| 5 |
+
ChevronDownIcon,
|
| 6 |
+
ChevronLeftIcon,
|
| 7 |
+
ChevronRightIcon,
|
| 8 |
+
} from 'lucide-react'
|
| 9 |
+
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'
|
| 10 |
+
|
| 11 |
+
import { cn } from '@/lib/utils'
|
| 12 |
+
import { Button, buttonVariants } from '@/components/ui/button'
|
| 13 |
+
|
| 14 |
+
function Calendar({
|
| 15 |
+
className,
|
| 16 |
+
classNames,
|
| 17 |
+
showOutsideDays = true,
|
| 18 |
+
captionLayout = 'label',
|
| 19 |
+
buttonVariant = 'ghost',
|
| 20 |
+
formatters,
|
| 21 |
+
components,
|
| 22 |
+
...props
|
| 23 |
+
}: React.ComponentProps<typeof DayPicker> & {
|
| 24 |
+
buttonVariant?: React.ComponentProps<typeof Button>['variant']
|
| 25 |
+
}) {
|
| 26 |
+
const defaultClassNames = getDefaultClassNames()
|
| 27 |
+
|
| 28 |
+
return (
|
| 29 |
+
<DayPicker
|
| 30 |
+
showOutsideDays={showOutsideDays}
|
| 31 |
+
className={cn(
|
| 32 |
+
'bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
| 33 |
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
| 34 |
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
| 35 |
+
className,
|
| 36 |
+
)}
|
| 37 |
+
captionLayout={captionLayout}
|
| 38 |
+
formatters={{
|
| 39 |
+
formatMonthDropdown: (date) =>
|
| 40 |
+
date.toLocaleString('default', { month: 'short' }),
|
| 41 |
+
...formatters,
|
| 42 |
+
}}
|
| 43 |
+
classNames={{
|
| 44 |
+
root: cn('w-fit', defaultClassNames.root),
|
| 45 |
+
months: cn(
|
| 46 |
+
'flex gap-4 flex-col md:flex-row relative',
|
| 47 |
+
defaultClassNames.months,
|
| 48 |
+
),
|
| 49 |
+
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
| 50 |
+
nav: cn(
|
| 51 |
+
'flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between',
|
| 52 |
+
defaultClassNames.nav,
|
| 53 |
+
),
|
| 54 |
+
button_previous: cn(
|
| 55 |
+
buttonVariants({ variant: buttonVariant }),
|
| 56 |
+
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
| 57 |
+
defaultClassNames.button_previous,
|
| 58 |
+
),
|
| 59 |
+
button_next: cn(
|
| 60 |
+
buttonVariants({ variant: buttonVariant }),
|
| 61 |
+
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
| 62 |
+
defaultClassNames.button_next,
|
| 63 |
+
),
|
| 64 |
+
month_caption: cn(
|
| 65 |
+
'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)',
|
| 66 |
+
defaultClassNames.month_caption,
|
| 67 |
+
),
|
| 68 |
+
dropdowns: cn(
|
| 69 |
+
'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5',
|
| 70 |
+
defaultClassNames.dropdowns,
|
| 71 |
+
),
|
| 72 |
+
dropdown_root: cn(
|
| 73 |
+
'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',
|
| 74 |
+
defaultClassNames.dropdown_root,
|
| 75 |
+
),
|
| 76 |
+
dropdown: cn(
|
| 77 |
+
'absolute bg-popover inset-0 opacity-0',
|
| 78 |
+
defaultClassNames.dropdown,
|
| 79 |
+
),
|
| 80 |
+
caption_label: cn(
|
| 81 |
+
'select-none font-medium',
|
| 82 |
+
captionLayout === 'label'
|
| 83 |
+
? 'text-sm'
|
| 84 |
+
: 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5',
|
| 85 |
+
defaultClassNames.caption_label,
|
| 86 |
+
),
|
| 87 |
+
table: 'w-full border-collapse',
|
| 88 |
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
| 89 |
+
weekday: cn(
|
| 90 |
+
'text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none',
|
| 91 |
+
defaultClassNames.weekday,
|
| 92 |
+
),
|
| 93 |
+
week: cn('flex w-full mt-2', defaultClassNames.week),
|
| 94 |
+
week_number_header: cn(
|
| 95 |
+
'select-none w-(--cell-size)',
|
| 96 |
+
defaultClassNames.week_number_header,
|
| 97 |
+
),
|
| 98 |
+
week_number: cn(
|
| 99 |
+
'text-[0.8rem] select-none text-muted-foreground',
|
| 100 |
+
defaultClassNames.week_number,
|
| 101 |
+
),
|
| 102 |
+
day: cn(
|
| 103 |
+
'relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none',
|
| 104 |
+
defaultClassNames.day,
|
| 105 |
+
),
|
| 106 |
+
range_start: cn(
|
| 107 |
+
'rounded-l-md bg-accent',
|
| 108 |
+
defaultClassNames.range_start,
|
| 109 |
+
),
|
| 110 |
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
| 111 |
+
range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
|
| 112 |
+
today: cn(
|
| 113 |
+
'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',
|
| 114 |
+
defaultClassNames.today,
|
| 115 |
+
),
|
| 116 |
+
outside: cn(
|
| 117 |
+
'text-muted-foreground aria-selected:text-muted-foreground',
|
| 118 |
+
defaultClassNames.outside,
|
| 119 |
+
),
|
| 120 |
+
disabled: cn(
|
| 121 |
+
'text-muted-foreground opacity-50',
|
| 122 |
+
defaultClassNames.disabled,
|
| 123 |
+
),
|
| 124 |
+
hidden: cn('invisible', defaultClassNames.hidden),
|
| 125 |
+
...classNames,
|
| 126 |
+
}}
|
| 127 |
+
components={{
|
| 128 |
+
Root: ({ className, rootRef, ...props }) => {
|
| 129 |
+
return (
|
| 130 |
+
<div
|
| 131 |
+
data-slot="calendar"
|
| 132 |
+
ref={rootRef}
|
| 133 |
+
className={cn(className)}
|
| 134 |
+
{...props}
|
| 135 |
+
/>
|
| 136 |
+
)
|
| 137 |
+
},
|
| 138 |
+
Chevron: ({ className, orientation, ...props }) => {
|
| 139 |
+
if (orientation === 'left') {
|
| 140 |
+
return (
|
| 141 |
+
<ChevronLeftIcon className={cn('size-4', className)} {...props} />
|
| 142 |
+
)
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
if (orientation === 'right') {
|
| 146 |
+
return (
|
| 147 |
+
<ChevronRightIcon
|
| 148 |
+
className={cn('size-4', className)}
|
| 149 |
+
{...props}
|
| 150 |
+
/>
|
| 151 |
+
)
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
return (
|
| 155 |
+
<ChevronDownIcon className={cn('size-4', className)} {...props} />
|
| 156 |
+
)
|
| 157 |
+
},
|
| 158 |
+
DayButton: CalendarDayButton,
|
| 159 |
+
WeekNumber: ({ children, ...props }) => {
|
| 160 |
+
return (
|
| 161 |
+
<td {...props}>
|
| 162 |
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
| 163 |
+
{children}
|
| 164 |
+
</div>
|
| 165 |
+
</td>
|
| 166 |
+
)
|
| 167 |
+
},
|
| 168 |
+
...components,
|
| 169 |
+
}}
|
| 170 |
+
{...props}
|
| 171 |
+
/>
|
| 172 |
+
)
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
function CalendarDayButton({
|
| 176 |
+
className,
|
| 177 |
+
day,
|
| 178 |
+
modifiers,
|
| 179 |
+
...props
|
| 180 |
+
}: React.ComponentProps<typeof DayButton>) {
|
| 181 |
+
const defaultClassNames = getDefaultClassNames()
|
| 182 |
+
|
| 183 |
+
const ref = React.useRef<HTMLButtonElement>(null)
|
| 184 |
+
React.useEffect(() => {
|
| 185 |
+
if (modifiers.focused) ref.current?.focus()
|
| 186 |
+
}, [modifiers.focused])
|
| 187 |
+
|
| 188 |
+
return (
|
| 189 |
+
<Button
|
| 190 |
+
ref={ref}
|
| 191 |
+
variant="ghost"
|
| 192 |
+
size="icon"
|
| 193 |
+
data-day={day.date.toLocaleDateString()}
|
| 194 |
+
data-selected-single={
|
| 195 |
+
modifiers.selected &&
|
| 196 |
+
!modifiers.range_start &&
|
| 197 |
+
!modifiers.range_end &&
|
| 198 |
+
!modifiers.range_middle
|
| 199 |
+
}
|
| 200 |
+
data-range-start={modifiers.range_start}
|
| 201 |
+
data-range-end={modifiers.range_end}
|
| 202 |
+
data-range-middle={modifiers.range_middle}
|
| 203 |
+
className={cn(
|
| 204 |
+
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70',
|
| 205 |
+
defaultClassNames.day,
|
| 206 |
+
className,
|
| 207 |
+
)}
|
| 208 |
+
{...props}
|
| 209 |
+
/>
|
| 210 |
+
)
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
export { Calendar, CalendarDayButton }
|
Frontend/components/ui/card.tsx
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
|
| 3 |
+
import { cn } from '@/lib/utils'
|
| 4 |
+
|
| 5 |
+
function Card({ className, ...props }: React.ComponentProps<'div'>) {
|
| 6 |
+
return (
|
| 7 |
+
<div
|
| 8 |
+
data-slot="card"
|
| 9 |
+
className={cn(
|
| 10 |
+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
| 11 |
+
className,
|
| 12 |
+
)}
|
| 13 |
+
{...props}
|
| 14 |
+
/>
|
| 15 |
+
)
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
| 19 |
+
return (
|
| 20 |
+
<div
|
| 21 |
+
data-slot="card-header"
|
| 22 |
+
className={cn(
|
| 23 |
+
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
| 24 |
+
className,
|
| 25 |
+
)}
|
| 26 |
+
{...props}
|
| 27 |
+
/>
|
| 28 |
+
)
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
| 32 |
+
return (
|
| 33 |
+
<div
|
| 34 |
+
data-slot="card-title"
|
| 35 |
+
className={cn('leading-none font-semibold', className)}
|
| 36 |
+
{...props}
|
| 37 |
+
/>
|
| 38 |
+
)
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
| 42 |
+
return (
|
| 43 |
+
<div
|
| 44 |
+
data-slot="card-description"
|
| 45 |
+
className={cn('text-muted-foreground text-sm', className)}
|
| 46 |
+
{...props}
|
| 47 |
+
/>
|
| 48 |
+
)
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
| 52 |
+
return (
|
| 53 |
+
<div
|
| 54 |
+
data-slot="card-action"
|
| 55 |
+
className={cn(
|
| 56 |
+
'col-start-2 row-span-2 row-start-1 self-start justify-self-end',
|
| 57 |
+
className,
|
| 58 |
+
)}
|
| 59 |
+
{...props}
|
| 60 |
+
/>
|
| 61 |
+
)
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
| 65 |
+
return (
|
| 66 |
+
<div
|
| 67 |
+
data-slot="card-content"
|
| 68 |
+
className={cn('px-6', className)}
|
| 69 |
+
{...props}
|
| 70 |
+
/>
|
| 71 |
+
)
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
| 75 |
+
return (
|
| 76 |
+
<div
|
| 77 |
+
data-slot="card-footer"
|
| 78 |
+
className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
|
| 79 |
+
{...props}
|
| 80 |
+
/>
|
| 81 |
+
)
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
export {
|
| 85 |
+
Card,
|
| 86 |
+
CardHeader,
|
| 87 |
+
CardFooter,
|
| 88 |
+
CardTitle,
|
| 89 |
+
CardAction,
|
| 90 |
+
CardDescription,
|
| 91 |
+
CardContent,
|
| 92 |
+
}
|
Frontend/components/ui/carousel.tsx
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import useEmblaCarousel, {
|
| 5 |
+
type UseEmblaCarouselType,
|
| 6 |
+
} from 'embla-carousel-react'
|
| 7 |
+
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
| 8 |
+
|
| 9 |
+
import { cn } from '@/lib/utils'
|
| 10 |
+
import { Button } from '@/components/ui/button'
|
| 11 |
+
|
| 12 |
+
type CarouselApi = UseEmblaCarouselType[1]
|
| 13 |
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
| 14 |
+
type CarouselOptions = UseCarouselParameters[0]
|
| 15 |
+
type CarouselPlugin = UseCarouselParameters[1]
|
| 16 |
+
|
| 17 |
+
type CarouselProps = {
|
| 18 |
+
opts?: CarouselOptions
|
| 19 |
+
plugins?: CarouselPlugin
|
| 20 |
+
orientation?: 'horizontal' | 'vertical'
|
| 21 |
+
setApi?: (api: CarouselApi) => void
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
type CarouselContextProps = {
|
| 25 |
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0]
|
| 26 |
+
api: ReturnType<typeof useEmblaCarousel>[1]
|
| 27 |
+
scrollPrev: () => void
|
| 28 |
+
scrollNext: () => void
|
| 29 |
+
canScrollPrev: boolean
|
| 30 |
+
canScrollNext: boolean
|
| 31 |
+
} & CarouselProps
|
| 32 |
+
|
| 33 |
+
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
| 34 |
+
|
| 35 |
+
function useCarousel() {
|
| 36 |
+
const context = React.useContext(CarouselContext)
|
| 37 |
+
|
| 38 |
+
if (!context) {
|
| 39 |
+
throw new Error('useCarousel must be used within a <Carousel />')
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
return context
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function Carousel({
|
| 46 |
+
orientation = 'horizontal',
|
| 47 |
+
opts,
|
| 48 |
+
setApi,
|
| 49 |
+
plugins,
|
| 50 |
+
className,
|
| 51 |
+
children,
|
| 52 |
+
...props
|
| 53 |
+
}: React.ComponentProps<'div'> & CarouselProps) {
|
| 54 |
+
const [carouselRef, api] = useEmblaCarousel(
|
| 55 |
+
{
|
| 56 |
+
...opts,
|
| 57 |
+
axis: orientation === 'horizontal' ? 'x' : 'y',
|
| 58 |
+
},
|
| 59 |
+
plugins,
|
| 60 |
+
)
|
| 61 |
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false)
|
| 62 |
+
const [canScrollNext, setCanScrollNext] = React.useState(false)
|
| 63 |
+
|
| 64 |
+
const onSelect = React.useCallback((api: CarouselApi) => {
|
| 65 |
+
if (!api) return
|
| 66 |
+
setCanScrollPrev(api.canScrollPrev())
|
| 67 |
+
setCanScrollNext(api.canScrollNext())
|
| 68 |
+
}, [])
|
| 69 |
+
|
| 70 |
+
const scrollPrev = React.useCallback(() => {
|
| 71 |
+
api?.scrollPrev()
|
| 72 |
+
}, [api])
|
| 73 |
+
|
| 74 |
+
const scrollNext = React.useCallback(() => {
|
| 75 |
+
api?.scrollNext()
|
| 76 |
+
}, [api])
|
| 77 |
+
|
| 78 |
+
const handleKeyDown = React.useCallback(
|
| 79 |
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
| 80 |
+
if (event.key === 'ArrowLeft') {
|
| 81 |
+
event.preventDefault()
|
| 82 |
+
scrollPrev()
|
| 83 |
+
} else if (event.key === 'ArrowRight') {
|
| 84 |
+
event.preventDefault()
|
| 85 |
+
scrollNext()
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
[scrollPrev, scrollNext],
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
React.useEffect(() => {
|
| 92 |
+
if (!api || !setApi) return
|
| 93 |
+
setApi(api)
|
| 94 |
+
}, [api, setApi])
|
| 95 |
+
|
| 96 |
+
React.useEffect(() => {
|
| 97 |
+
if (!api) return
|
| 98 |
+
onSelect(api)
|
| 99 |
+
api.on('reInit', onSelect)
|
| 100 |
+
api.on('select', onSelect)
|
| 101 |
+
|
| 102 |
+
return () => {
|
| 103 |
+
api?.off('select', onSelect)
|
| 104 |
+
}
|
| 105 |
+
}, [api, onSelect])
|
| 106 |
+
|
| 107 |
+
return (
|
| 108 |
+
<CarouselContext.Provider
|
| 109 |
+
value={{
|
| 110 |
+
carouselRef,
|
| 111 |
+
api: api,
|
| 112 |
+
opts,
|
| 113 |
+
orientation:
|
| 114 |
+
orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
| 115 |
+
scrollPrev,
|
| 116 |
+
scrollNext,
|
| 117 |
+
canScrollPrev,
|
| 118 |
+
canScrollNext,
|
| 119 |
+
}}
|
| 120 |
+
>
|
| 121 |
+
<div
|
| 122 |
+
onKeyDownCapture={handleKeyDown}
|
| 123 |
+
className={cn('relative', className)}
|
| 124 |
+
role="region"
|
| 125 |
+
aria-roledescription="carousel"
|
| 126 |
+
data-slot="carousel"
|
| 127 |
+
{...props}
|
| 128 |
+
>
|
| 129 |
+
{children}
|
| 130 |
+
</div>
|
| 131 |
+
</CarouselContext.Provider>
|
| 132 |
+
)
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
|
| 136 |
+
const { carouselRef, orientation } = useCarousel()
|
| 137 |
+
|
| 138 |
+
return (
|
| 139 |
+
<div
|
| 140 |
+
ref={carouselRef}
|
| 141 |
+
className="overflow-hidden"
|
| 142 |
+
data-slot="carousel-content"
|
| 143 |
+
>
|
| 144 |
+
<div
|
| 145 |
+
className={cn(
|
| 146 |
+
'flex',
|
| 147 |
+
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
|
| 148 |
+
className,
|
| 149 |
+
)}
|
| 150 |
+
{...props}
|
| 151 |
+
/>
|
| 152 |
+
</div>
|
| 153 |
+
)
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
|
| 157 |
+
const { orientation } = useCarousel()
|
| 158 |
+
|
| 159 |
+
return (
|
| 160 |
+
<div
|
| 161 |
+
role="group"
|
| 162 |
+
aria-roledescription="slide"
|
| 163 |
+
data-slot="carousel-item"
|
| 164 |
+
className={cn(
|
| 165 |
+
'min-w-0 shrink-0 grow-0 basis-full',
|
| 166 |
+
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
| 167 |
+
className,
|
| 168 |
+
)}
|
| 169 |
+
{...props}
|
| 170 |
+
/>
|
| 171 |
+
)
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
function CarouselPrevious({
|
| 175 |
+
className,
|
| 176 |
+
variant = 'outline',
|
| 177 |
+
size = 'icon',
|
| 178 |
+
...props
|
| 179 |
+
}: React.ComponentProps<typeof Button>) {
|
| 180 |
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel()
|
| 181 |
+
|
| 182 |
+
return (
|
| 183 |
+
<Button
|
| 184 |
+
data-slot="carousel-previous"
|
| 185 |
+
variant={variant}
|
| 186 |
+
size={size}
|
| 187 |
+
className={cn(
|
| 188 |
+
'absolute size-8 rounded-full',
|
| 189 |
+
orientation === 'horizontal'
|
| 190 |
+
? 'top-1/2 -left-12 -translate-y-1/2'
|
| 191 |
+
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
| 192 |
+
className,
|
| 193 |
+
)}
|
| 194 |
+
disabled={!canScrollPrev}
|
| 195 |
+
onClick={scrollPrev}
|
| 196 |
+
{...props}
|
| 197 |
+
>
|
| 198 |
+
<ArrowLeft />
|
| 199 |
+
<span className="sr-only">Previous slide</span>
|
| 200 |
+
</Button>
|
| 201 |
+
)
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
function CarouselNext({
|
| 205 |
+
className,
|
| 206 |
+
variant = 'outline',
|
| 207 |
+
size = 'icon',
|
| 208 |
+
...props
|
| 209 |
+
}: React.ComponentProps<typeof Button>) {
|
| 210 |
+
const { orientation, scrollNext, canScrollNext } = useCarousel()
|
| 211 |
+
|
| 212 |
+
return (
|
| 213 |
+
<Button
|
| 214 |
+
data-slot="carousel-next"
|
| 215 |
+
variant={variant}
|
| 216 |
+
size={size}
|
| 217 |
+
className={cn(
|
| 218 |
+
'absolute size-8 rounded-full',
|
| 219 |
+
orientation === 'horizontal'
|
| 220 |
+
? 'top-1/2 -right-12 -translate-y-1/2'
|
| 221 |
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
| 222 |
+
className,
|
| 223 |
+
)}
|
| 224 |
+
disabled={!canScrollNext}
|
| 225 |
+
onClick={scrollNext}
|
| 226 |
+
{...props}
|
| 227 |
+
>
|
| 228 |
+
<ArrowRight />
|
| 229 |
+
<span className="sr-only">Next slide</span>
|
| 230 |
+
</Button>
|
| 231 |
+
)
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
export {
|
| 235 |
+
type CarouselApi,
|
| 236 |
+
Carousel,
|
| 237 |
+
CarouselContent,
|
| 238 |
+
CarouselItem,
|
| 239 |
+
CarouselPrevious,
|
| 240 |
+
CarouselNext,
|
| 241 |
+
}
|
Frontend/components/ui/chart.tsx
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as RechartsPrimitive from 'recharts'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
|
| 8 |
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
| 9 |
+
const THEMES = { light: '', dark: '.dark' } as const
|
| 10 |
+
|
| 11 |
+
export type ChartConfig = {
|
| 12 |
+
[k in string]: {
|
| 13 |
+
label?: React.ReactNode
|
| 14 |
+
icon?: React.ComponentType
|
| 15 |
+
} & (
|
| 16 |
+
| { color?: string; theme?: never }
|
| 17 |
+
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
| 18 |
+
)
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
type ChartContextProps = {
|
| 22 |
+
config: ChartConfig
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
const ChartContext = React.createContext<ChartContextProps | null>(null)
|
| 26 |
+
|
| 27 |
+
function useChart() {
|
| 28 |
+
const context = React.useContext(ChartContext)
|
| 29 |
+
|
| 30 |
+
if (!context) {
|
| 31 |
+
throw new Error('useChart must be used within a <ChartContainer />')
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return context
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function ChartContainer({
|
| 38 |
+
id,
|
| 39 |
+
className,
|
| 40 |
+
children,
|
| 41 |
+
config,
|
| 42 |
+
...props
|
| 43 |
+
}: React.ComponentProps<'div'> & {
|
| 44 |
+
config: ChartConfig
|
| 45 |
+
children: React.ComponentProps<
|
| 46 |
+
typeof RechartsPrimitive.ResponsiveContainer
|
| 47 |
+
>['children']
|
| 48 |
+
}) {
|
| 49 |
+
const uniqueId = React.useId()
|
| 50 |
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`
|
| 51 |
+
|
| 52 |
+
return (
|
| 53 |
+
<ChartContext.Provider value={{ config }}>
|
| 54 |
+
<div
|
| 55 |
+
data-slot="chart"
|
| 56 |
+
data-chart={chartId}
|
| 57 |
+
className={cn(
|
| 58 |
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
| 59 |
+
className,
|
| 60 |
+
)}
|
| 61 |
+
{...props}
|
| 62 |
+
>
|
| 63 |
+
<ChartStyle id={chartId} config={config} />
|
| 64 |
+
<RechartsPrimitive.ResponsiveContainer>
|
| 65 |
+
{children}
|
| 66 |
+
</RechartsPrimitive.ResponsiveContainer>
|
| 67 |
+
</div>
|
| 68 |
+
</ChartContext.Provider>
|
| 69 |
+
)
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
| 73 |
+
const colorConfig = Object.entries(config).filter(
|
| 74 |
+
([, config]) => config.theme || config.color,
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
if (!colorConfig.length) {
|
| 78 |
+
return null
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
return (
|
| 82 |
+
<style
|
| 83 |
+
dangerouslySetInnerHTML={{
|
| 84 |
+
__html: Object.entries(THEMES)
|
| 85 |
+
.map(
|
| 86 |
+
([theme, prefix]) => `
|
| 87 |
+
${prefix} [data-chart=${id}] {
|
| 88 |
+
${colorConfig
|
| 89 |
+
.map(([key, itemConfig]) => {
|
| 90 |
+
const color =
|
| 91 |
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
| 92 |
+
itemConfig.color
|
| 93 |
+
return color ? ` --color-${key}: ${color};` : null
|
| 94 |
+
})
|
| 95 |
+
.join('\n')}
|
| 96 |
+
}
|
| 97 |
+
`,
|
| 98 |
+
)
|
| 99 |
+
.join('\n'),
|
| 100 |
+
}}
|
| 101 |
+
/>
|
| 102 |
+
)
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
const ChartTooltip = RechartsPrimitive.Tooltip
|
| 106 |
+
|
| 107 |
+
function ChartTooltipContent({
|
| 108 |
+
active,
|
| 109 |
+
payload,
|
| 110 |
+
className,
|
| 111 |
+
indicator = 'dot',
|
| 112 |
+
hideLabel = false,
|
| 113 |
+
hideIndicator = false,
|
| 114 |
+
label,
|
| 115 |
+
labelFormatter,
|
| 116 |
+
labelClassName,
|
| 117 |
+
formatter,
|
| 118 |
+
color,
|
| 119 |
+
nameKey,
|
| 120 |
+
labelKey,
|
| 121 |
+
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
| 122 |
+
React.ComponentProps<'div'> & {
|
| 123 |
+
hideLabel?: boolean
|
| 124 |
+
hideIndicator?: boolean
|
| 125 |
+
indicator?: 'line' | 'dot' | 'dashed'
|
| 126 |
+
nameKey?: string
|
| 127 |
+
labelKey?: string
|
| 128 |
+
}) {
|
| 129 |
+
const { config } = useChart()
|
| 130 |
+
|
| 131 |
+
const tooltipLabel = React.useMemo(() => {
|
| 132 |
+
if (hideLabel || !payload?.length) {
|
| 133 |
+
return null
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
const [item] = payload
|
| 137 |
+
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`
|
| 138 |
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
| 139 |
+
const value =
|
| 140 |
+
!labelKey && typeof label === 'string'
|
| 141 |
+
? config[label as keyof typeof config]?.label || label
|
| 142 |
+
: itemConfig?.label
|
| 143 |
+
|
| 144 |
+
if (labelFormatter) {
|
| 145 |
+
return (
|
| 146 |
+
<div className={cn('font-medium', labelClassName)}>
|
| 147 |
+
{labelFormatter(value, payload)}
|
| 148 |
+
</div>
|
| 149 |
+
)
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
if (!value) {
|
| 153 |
+
return null
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
return <div className={cn('font-medium', labelClassName)}>{value}</div>
|
| 157 |
+
}, [
|
| 158 |
+
label,
|
| 159 |
+
labelFormatter,
|
| 160 |
+
payload,
|
| 161 |
+
hideLabel,
|
| 162 |
+
labelClassName,
|
| 163 |
+
config,
|
| 164 |
+
labelKey,
|
| 165 |
+
])
|
| 166 |
+
|
| 167 |
+
if (!active || !payload?.length) {
|
| 168 |
+
return null
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
const nestLabel = payload.length === 1 && indicator !== 'dot'
|
| 172 |
+
|
| 173 |
+
return (
|
| 174 |
+
<div
|
| 175 |
+
className={cn(
|
| 176 |
+
'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
|
| 177 |
+
className,
|
| 178 |
+
)}
|
| 179 |
+
>
|
| 180 |
+
{!nestLabel ? tooltipLabel : null}
|
| 181 |
+
<div className="grid gap-1.5">
|
| 182 |
+
{payload.map((item, index) => {
|
| 183 |
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`
|
| 184 |
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
| 185 |
+
const indicatorColor = color || item.payload.fill || item.color
|
| 186 |
+
|
| 187 |
+
return (
|
| 188 |
+
<div
|
| 189 |
+
key={item.dataKey}
|
| 190 |
+
className={cn(
|
| 191 |
+
'[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
|
| 192 |
+
indicator === 'dot' && 'items-center',
|
| 193 |
+
)}
|
| 194 |
+
>
|
| 195 |
+
{formatter && item?.value !== undefined && item.name ? (
|
| 196 |
+
formatter(item.value, item.name, item, index, item.payload)
|
| 197 |
+
) : (
|
| 198 |
+
<>
|
| 199 |
+
{itemConfig?.icon ? (
|
| 200 |
+
<itemConfig.icon />
|
| 201 |
+
) : (
|
| 202 |
+
!hideIndicator && (
|
| 203 |
+
<div
|
| 204 |
+
className={cn(
|
| 205 |
+
'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',
|
| 206 |
+
{
|
| 207 |
+
'h-2.5 w-2.5': indicator === 'dot',
|
| 208 |
+
'w-1': indicator === 'line',
|
| 209 |
+
'w-0 border-[1.5px] border-dashed bg-transparent':
|
| 210 |
+
indicator === 'dashed',
|
| 211 |
+
'my-0.5': nestLabel && indicator === 'dashed',
|
| 212 |
+
},
|
| 213 |
+
)}
|
| 214 |
+
style={
|
| 215 |
+
{
|
| 216 |
+
'--color-bg': indicatorColor,
|
| 217 |
+
'--color-border': indicatorColor,
|
| 218 |
+
} as React.CSSProperties
|
| 219 |
+
}
|
| 220 |
+
/>
|
| 221 |
+
)
|
| 222 |
+
)}
|
| 223 |
+
<div
|
| 224 |
+
className={cn(
|
| 225 |
+
'flex flex-1 justify-between leading-none',
|
| 226 |
+
nestLabel ? 'items-end' : 'items-center',
|
| 227 |
+
)}
|
| 228 |
+
>
|
| 229 |
+
<div className="grid gap-1.5">
|
| 230 |
+
{nestLabel ? tooltipLabel : null}
|
| 231 |
+
<span className="text-muted-foreground">
|
| 232 |
+
{itemConfig?.label || item.name}
|
| 233 |
+
</span>
|
| 234 |
+
</div>
|
| 235 |
+
{item.value && (
|
| 236 |
+
<span className="text-foreground font-mono font-medium tabular-nums">
|
| 237 |
+
{item.value.toLocaleString()}
|
| 238 |
+
</span>
|
| 239 |
+
)}
|
| 240 |
+
</div>
|
| 241 |
+
</>
|
| 242 |
+
)}
|
| 243 |
+
</div>
|
| 244 |
+
)
|
| 245 |
+
})}
|
| 246 |
+
</div>
|
| 247 |
+
</div>
|
| 248 |
+
)
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
const ChartLegend = RechartsPrimitive.Legend
|
| 252 |
+
|
| 253 |
+
function ChartLegendContent({
|
| 254 |
+
className,
|
| 255 |
+
hideIcon = false,
|
| 256 |
+
payload,
|
| 257 |
+
verticalAlign = 'bottom',
|
| 258 |
+
nameKey,
|
| 259 |
+
}: React.ComponentProps<'div'> &
|
| 260 |
+
Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
| 261 |
+
hideIcon?: boolean
|
| 262 |
+
nameKey?: string
|
| 263 |
+
}) {
|
| 264 |
+
const { config } = useChart()
|
| 265 |
+
|
| 266 |
+
if (!payload?.length) {
|
| 267 |
+
return null
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
return (
|
| 271 |
+
<div
|
| 272 |
+
className={cn(
|
| 273 |
+
'flex items-center justify-center gap-4',
|
| 274 |
+
verticalAlign === 'top' ? 'pb-3' : 'pt-3',
|
| 275 |
+
className,
|
| 276 |
+
)}
|
| 277 |
+
>
|
| 278 |
+
{payload.map((item) => {
|
| 279 |
+
const key = `${nameKey || item.dataKey || 'value'}`
|
| 280 |
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
| 281 |
+
|
| 282 |
+
return (
|
| 283 |
+
<div
|
| 284 |
+
key={item.value}
|
| 285 |
+
className={
|
| 286 |
+
'[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'
|
| 287 |
+
}
|
| 288 |
+
>
|
| 289 |
+
{itemConfig?.icon && !hideIcon ? (
|
| 290 |
+
<itemConfig.icon />
|
| 291 |
+
) : (
|
| 292 |
+
<div
|
| 293 |
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
| 294 |
+
style={{
|
| 295 |
+
backgroundColor: item.color,
|
| 296 |
+
}}
|
| 297 |
+
/>
|
| 298 |
+
)}
|
| 299 |
+
{itemConfig?.label}
|
| 300 |
+
</div>
|
| 301 |
+
)
|
| 302 |
+
})}
|
| 303 |
+
</div>
|
| 304 |
+
)
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
// Helper to extract item config from a payload.
|
| 308 |
+
function getPayloadConfigFromPayload(
|
| 309 |
+
config: ChartConfig,
|
| 310 |
+
payload: unknown,
|
| 311 |
+
key: string,
|
| 312 |
+
) {
|
| 313 |
+
if (typeof payload !== 'object' || payload === null) {
|
| 314 |
+
return undefined
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
const payloadPayload =
|
| 318 |
+
'payload' in payload &&
|
| 319 |
+
typeof payload.payload === 'object' &&
|
| 320 |
+
payload.payload !== null
|
| 321 |
+
? payload.payload
|
| 322 |
+
: undefined
|
| 323 |
+
|
| 324 |
+
let configLabelKey: string = key
|
| 325 |
+
|
| 326 |
+
if (
|
| 327 |
+
key in payload &&
|
| 328 |
+
typeof payload[key as keyof typeof payload] === 'string'
|
| 329 |
+
) {
|
| 330 |
+
configLabelKey = payload[key as keyof typeof payload] as string
|
| 331 |
+
} else if (
|
| 332 |
+
payloadPayload &&
|
| 333 |
+
key in payloadPayload &&
|
| 334 |
+
typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'
|
| 335 |
+
) {
|
| 336 |
+
configLabelKey = payloadPayload[
|
| 337 |
+
key as keyof typeof payloadPayload
|
| 338 |
+
] as string
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
return configLabelKey in config
|
| 342 |
+
? config[configLabelKey]
|
| 343 |
+
: config[key as keyof typeof config]
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
export {
|
| 347 |
+
ChartContainer,
|
| 348 |
+
ChartTooltip,
|
| 349 |
+
ChartTooltipContent,
|
| 350 |
+
ChartLegend,
|
| 351 |
+
ChartLegendContent,
|
| 352 |
+
ChartStyle,
|
| 353 |
+
}
|
Frontend/components/ui/checkbox.tsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
| 5 |
+
import { CheckIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function Checkbox({
|
| 10 |
+
className,
|
| 11 |
+
...props
|
| 12 |
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
| 13 |
+
return (
|
| 14 |
+
<CheckboxPrimitive.Root
|
| 15 |
+
data-slot="checkbox"
|
| 16 |
+
className={cn(
|
| 17 |
+
'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
| 18 |
+
className,
|
| 19 |
+
)}
|
| 20 |
+
{...props}
|
| 21 |
+
>
|
| 22 |
+
<CheckboxPrimitive.Indicator
|
| 23 |
+
data-slot="checkbox-indicator"
|
| 24 |
+
className="flex items-center justify-center text-current transition-none"
|
| 25 |
+
>
|
| 26 |
+
<CheckIcon className="size-3.5" />
|
| 27 |
+
</CheckboxPrimitive.Indicator>
|
| 28 |
+
</CheckboxPrimitive.Root>
|
| 29 |
+
)
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
export { Checkbox }
|
Frontend/components/ui/collapsible.tsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'
|
| 4 |
+
|
| 5 |
+
function Collapsible({
|
| 6 |
+
...props
|
| 7 |
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
| 8 |
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
function CollapsibleTrigger({
|
| 12 |
+
...props
|
| 13 |
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
| 14 |
+
return (
|
| 15 |
+
<CollapsiblePrimitive.CollapsibleTrigger
|
| 16 |
+
data-slot="collapsible-trigger"
|
| 17 |
+
{...props}
|
| 18 |
+
/>
|
| 19 |
+
)
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
function CollapsibleContent({
|
| 23 |
+
...props
|
| 24 |
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
| 25 |
+
return (
|
| 26 |
+
<CollapsiblePrimitive.CollapsibleContent
|
| 27 |
+
data-slot="collapsible-content"
|
| 28 |
+
{...props}
|
| 29 |
+
/>
|
| 30 |
+
)
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
Frontend/components/ui/command.tsx
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import { Command as CommandPrimitive } from 'cmdk'
|
| 5 |
+
import { SearchIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
import {
|
| 9 |
+
Dialog,
|
| 10 |
+
DialogContent,
|
| 11 |
+
DialogDescription,
|
| 12 |
+
DialogHeader,
|
| 13 |
+
DialogTitle,
|
| 14 |
+
} from '@/components/ui/dialog'
|
| 15 |
+
|
| 16 |
+
function Command({
|
| 17 |
+
className,
|
| 18 |
+
...props
|
| 19 |
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
| 20 |
+
return (
|
| 21 |
+
<CommandPrimitive
|
| 22 |
+
data-slot="command"
|
| 23 |
+
className={cn(
|
| 24 |
+
'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',
|
| 25 |
+
className,
|
| 26 |
+
)}
|
| 27 |
+
{...props}
|
| 28 |
+
/>
|
| 29 |
+
)
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
function CommandDialog({
|
| 33 |
+
title = 'Command Palette',
|
| 34 |
+
description = 'Search for a command to run...',
|
| 35 |
+
children,
|
| 36 |
+
className,
|
| 37 |
+
showCloseButton = true,
|
| 38 |
+
...props
|
| 39 |
+
}: React.ComponentProps<typeof Dialog> & {
|
| 40 |
+
title?: string
|
| 41 |
+
description?: string
|
| 42 |
+
className?: string
|
| 43 |
+
showCloseButton?: boolean
|
| 44 |
+
}) {
|
| 45 |
+
return (
|
| 46 |
+
<Dialog {...props}>
|
| 47 |
+
<DialogHeader className="sr-only">
|
| 48 |
+
<DialogTitle>{title}</DialogTitle>
|
| 49 |
+
<DialogDescription>{description}</DialogDescription>
|
| 50 |
+
</DialogHeader>
|
| 51 |
+
<DialogContent
|
| 52 |
+
className={cn('overflow-hidden p-0', className)}
|
| 53 |
+
showCloseButton={showCloseButton}
|
| 54 |
+
>
|
| 55 |
+
<Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
| 56 |
+
{children}
|
| 57 |
+
</Command>
|
| 58 |
+
</DialogContent>
|
| 59 |
+
</Dialog>
|
| 60 |
+
)
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
function CommandInput({
|
| 64 |
+
className,
|
| 65 |
+
...props
|
| 66 |
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
| 67 |
+
return (
|
| 68 |
+
<div
|
| 69 |
+
data-slot="command-input-wrapper"
|
| 70 |
+
className="flex h-9 items-center gap-2 border-b px-3"
|
| 71 |
+
>
|
| 72 |
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
| 73 |
+
<CommandPrimitive.Input
|
| 74 |
+
data-slot="command-input"
|
| 75 |
+
className={cn(
|
| 76 |
+
'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
|
| 77 |
+
className,
|
| 78 |
+
)}
|
| 79 |
+
{...props}
|
| 80 |
+
/>
|
| 81 |
+
</div>
|
| 82 |
+
)
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
function CommandList({
|
| 86 |
+
className,
|
| 87 |
+
...props
|
| 88 |
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
| 89 |
+
return (
|
| 90 |
+
<CommandPrimitive.List
|
| 91 |
+
data-slot="command-list"
|
| 92 |
+
className={cn(
|
| 93 |
+
'max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto',
|
| 94 |
+
className,
|
| 95 |
+
)}
|
| 96 |
+
{...props}
|
| 97 |
+
/>
|
| 98 |
+
)
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
function CommandEmpty({
|
| 102 |
+
...props
|
| 103 |
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
| 104 |
+
return (
|
| 105 |
+
<CommandPrimitive.Empty
|
| 106 |
+
data-slot="command-empty"
|
| 107 |
+
className="py-6 text-center text-sm"
|
| 108 |
+
{...props}
|
| 109 |
+
/>
|
| 110 |
+
)
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
function CommandGroup({
|
| 114 |
+
className,
|
| 115 |
+
...props
|
| 116 |
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
| 117 |
+
return (
|
| 118 |
+
<CommandPrimitive.Group
|
| 119 |
+
data-slot="command-group"
|
| 120 |
+
className={cn(
|
| 121 |
+
'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',
|
| 122 |
+
className,
|
| 123 |
+
)}
|
| 124 |
+
{...props}
|
| 125 |
+
/>
|
| 126 |
+
)
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
function CommandSeparator({
|
| 130 |
+
className,
|
| 131 |
+
...props
|
| 132 |
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
| 133 |
+
return (
|
| 134 |
+
<CommandPrimitive.Separator
|
| 135 |
+
data-slot="command-separator"
|
| 136 |
+
className={cn('bg-border -mx-1 h-px', className)}
|
| 137 |
+
{...props}
|
| 138 |
+
/>
|
| 139 |
+
)
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
function CommandItem({
|
| 143 |
+
className,
|
| 144 |
+
...props
|
| 145 |
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
| 146 |
+
return (
|
| 147 |
+
<CommandPrimitive.Item
|
| 148 |
+
data-slot="command-item"
|
| 149 |
+
className={cn(
|
| 150 |
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 151 |
+
className,
|
| 152 |
+
)}
|
| 153 |
+
{...props}
|
| 154 |
+
/>
|
| 155 |
+
)
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
function CommandShortcut({
|
| 159 |
+
className,
|
| 160 |
+
...props
|
| 161 |
+
}: React.ComponentProps<'span'>) {
|
| 162 |
+
return (
|
| 163 |
+
<span
|
| 164 |
+
data-slot="command-shortcut"
|
| 165 |
+
className={cn(
|
| 166 |
+
'text-muted-foreground ml-auto text-xs tracking-widest',
|
| 167 |
+
className,
|
| 168 |
+
)}
|
| 169 |
+
{...props}
|
| 170 |
+
/>
|
| 171 |
+
)
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
export {
|
| 175 |
+
Command,
|
| 176 |
+
CommandDialog,
|
| 177 |
+
CommandInput,
|
| 178 |
+
CommandList,
|
| 179 |
+
CommandEmpty,
|
| 180 |
+
CommandGroup,
|
| 181 |
+
CommandItem,
|
| 182 |
+
CommandShortcut,
|
| 183 |
+
CommandSeparator,
|
| 184 |
+
}
|
Frontend/components/ui/context-menu.tsx
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu'
|
| 5 |
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function ContextMenu({
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
| 12 |
+
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function ContextMenuTrigger({
|
| 16 |
+
...props
|
| 17 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
| 18 |
+
return (
|
| 19 |
+
<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
|
| 20 |
+
)
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
function ContextMenuGroup({
|
| 24 |
+
...props
|
| 25 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
| 26 |
+
return (
|
| 27 |
+
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
| 28 |
+
)
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
function ContextMenuPortal({
|
| 32 |
+
...props
|
| 33 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
| 34 |
+
return (
|
| 35 |
+
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
| 36 |
+
)
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
function ContextMenuSub({
|
| 40 |
+
...props
|
| 41 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
| 42 |
+
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function ContextMenuRadioGroup({
|
| 46 |
+
...props
|
| 47 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
| 48 |
+
return (
|
| 49 |
+
<ContextMenuPrimitive.RadioGroup
|
| 50 |
+
data-slot="context-menu-radio-group"
|
| 51 |
+
{...props}
|
| 52 |
+
/>
|
| 53 |
+
)
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function ContextMenuSubTrigger({
|
| 57 |
+
className,
|
| 58 |
+
inset,
|
| 59 |
+
children,
|
| 60 |
+
...props
|
| 61 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
| 62 |
+
inset?: boolean
|
| 63 |
+
}) {
|
| 64 |
+
return (
|
| 65 |
+
<ContextMenuPrimitive.SubTrigger
|
| 66 |
+
data-slot="context-menu-sub-trigger"
|
| 67 |
+
data-inset={inset}
|
| 68 |
+
className={cn(
|
| 69 |
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 70 |
+
className,
|
| 71 |
+
)}
|
| 72 |
+
{...props}
|
| 73 |
+
>
|
| 74 |
+
{children}
|
| 75 |
+
<ChevronRightIcon className="ml-auto" />
|
| 76 |
+
</ContextMenuPrimitive.SubTrigger>
|
| 77 |
+
)
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
function ContextMenuSubContent({
|
| 81 |
+
className,
|
| 82 |
+
...props
|
| 83 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
| 84 |
+
return (
|
| 85 |
+
<ContextMenuPrimitive.SubContent
|
| 86 |
+
data-slot="context-menu-sub-content"
|
| 87 |
+
className={cn(
|
| 88 |
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
| 89 |
+
className,
|
| 90 |
+
)}
|
| 91 |
+
{...props}
|
| 92 |
+
/>
|
| 93 |
+
)
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
function ContextMenuContent({
|
| 97 |
+
className,
|
| 98 |
+
...props
|
| 99 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
| 100 |
+
return (
|
| 101 |
+
<ContextMenuPrimitive.Portal>
|
| 102 |
+
<ContextMenuPrimitive.Content
|
| 103 |
+
data-slot="context-menu-content"
|
| 104 |
+
className={cn(
|
| 105 |
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
| 106 |
+
className,
|
| 107 |
+
)}
|
| 108 |
+
{...props}
|
| 109 |
+
/>
|
| 110 |
+
</ContextMenuPrimitive.Portal>
|
| 111 |
+
)
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
function ContextMenuItem({
|
| 115 |
+
className,
|
| 116 |
+
inset,
|
| 117 |
+
variant = 'default',
|
| 118 |
+
...props
|
| 119 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
| 120 |
+
inset?: boolean
|
| 121 |
+
variant?: 'default' | 'destructive'
|
| 122 |
+
}) {
|
| 123 |
+
return (
|
| 124 |
+
<ContextMenuPrimitive.Item
|
| 125 |
+
data-slot="context-menu-item"
|
| 126 |
+
data-inset={inset}
|
| 127 |
+
data-variant={variant}
|
| 128 |
+
className={cn(
|
| 129 |
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 130 |
+
className,
|
| 131 |
+
)}
|
| 132 |
+
{...props}
|
| 133 |
+
/>
|
| 134 |
+
)
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
function ContextMenuCheckboxItem({
|
| 138 |
+
className,
|
| 139 |
+
children,
|
| 140 |
+
checked,
|
| 141 |
+
...props
|
| 142 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
| 143 |
+
return (
|
| 144 |
+
<ContextMenuPrimitive.CheckboxItem
|
| 145 |
+
data-slot="context-menu-checkbox-item"
|
| 146 |
+
className={cn(
|
| 147 |
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 148 |
+
className,
|
| 149 |
+
)}
|
| 150 |
+
checked={checked}
|
| 151 |
+
{...props}
|
| 152 |
+
>
|
| 153 |
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
| 154 |
+
<ContextMenuPrimitive.ItemIndicator>
|
| 155 |
+
<CheckIcon className="size-4" />
|
| 156 |
+
</ContextMenuPrimitive.ItemIndicator>
|
| 157 |
+
</span>
|
| 158 |
+
{children}
|
| 159 |
+
</ContextMenuPrimitive.CheckboxItem>
|
| 160 |
+
)
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
function ContextMenuRadioItem({
|
| 164 |
+
className,
|
| 165 |
+
children,
|
| 166 |
+
...props
|
| 167 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
| 168 |
+
return (
|
| 169 |
+
<ContextMenuPrimitive.RadioItem
|
| 170 |
+
data-slot="context-menu-radio-item"
|
| 171 |
+
className={cn(
|
| 172 |
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 173 |
+
className,
|
| 174 |
+
)}
|
| 175 |
+
{...props}
|
| 176 |
+
>
|
| 177 |
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
| 178 |
+
<ContextMenuPrimitive.ItemIndicator>
|
| 179 |
+
<CircleIcon className="size-2 fill-current" />
|
| 180 |
+
</ContextMenuPrimitive.ItemIndicator>
|
| 181 |
+
</span>
|
| 182 |
+
{children}
|
| 183 |
+
</ContextMenuPrimitive.RadioItem>
|
| 184 |
+
)
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
function ContextMenuLabel({
|
| 188 |
+
className,
|
| 189 |
+
inset,
|
| 190 |
+
...props
|
| 191 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
| 192 |
+
inset?: boolean
|
| 193 |
+
}) {
|
| 194 |
+
return (
|
| 195 |
+
<ContextMenuPrimitive.Label
|
| 196 |
+
data-slot="context-menu-label"
|
| 197 |
+
data-inset={inset}
|
| 198 |
+
className={cn(
|
| 199 |
+
'text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
|
| 200 |
+
className,
|
| 201 |
+
)}
|
| 202 |
+
{...props}
|
| 203 |
+
/>
|
| 204 |
+
)
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
function ContextMenuSeparator({
|
| 208 |
+
className,
|
| 209 |
+
...props
|
| 210 |
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
| 211 |
+
return (
|
| 212 |
+
<ContextMenuPrimitive.Separator
|
| 213 |
+
data-slot="context-menu-separator"
|
| 214 |
+
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
| 215 |
+
{...props}
|
| 216 |
+
/>
|
| 217 |
+
)
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
function ContextMenuShortcut({
|
| 221 |
+
className,
|
| 222 |
+
...props
|
| 223 |
+
}: React.ComponentProps<'span'>) {
|
| 224 |
+
return (
|
| 225 |
+
<span
|
| 226 |
+
data-slot="context-menu-shortcut"
|
| 227 |
+
className={cn(
|
| 228 |
+
'text-muted-foreground ml-auto text-xs tracking-widest',
|
| 229 |
+
className,
|
| 230 |
+
)}
|
| 231 |
+
{...props}
|
| 232 |
+
/>
|
| 233 |
+
)
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
export {
|
| 237 |
+
ContextMenu,
|
| 238 |
+
ContextMenuTrigger,
|
| 239 |
+
ContextMenuContent,
|
| 240 |
+
ContextMenuItem,
|
| 241 |
+
ContextMenuCheckboxItem,
|
| 242 |
+
ContextMenuRadioItem,
|
| 243 |
+
ContextMenuLabel,
|
| 244 |
+
ContextMenuSeparator,
|
| 245 |
+
ContextMenuShortcut,
|
| 246 |
+
ContextMenuGroup,
|
| 247 |
+
ContextMenuPortal,
|
| 248 |
+
ContextMenuSub,
|
| 249 |
+
ContextMenuSubContent,
|
| 250 |
+
ContextMenuSubTrigger,
|
| 251 |
+
ContextMenuRadioGroup,
|
| 252 |
+
}
|
Frontend/components/ui/dialog.tsx
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as DialogPrimitive from '@radix-ui/react-dialog'
|
| 5 |
+
import { XIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function Dialog({
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
| 12 |
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function DialogTrigger({
|
| 16 |
+
...props
|
| 17 |
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
| 18 |
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
function DialogPortal({
|
| 22 |
+
...props
|
| 23 |
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
| 24 |
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
function DialogClose({
|
| 28 |
+
...props
|
| 29 |
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
| 30 |
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
function DialogOverlay({
|
| 34 |
+
className,
|
| 35 |
+
...props
|
| 36 |
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
| 37 |
+
return (
|
| 38 |
+
<DialogPrimitive.Overlay
|
| 39 |
+
data-slot="dialog-overlay"
|
| 40 |
+
className={cn(
|
| 41 |
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
| 42 |
+
className,
|
| 43 |
+
)}
|
| 44 |
+
{...props}
|
| 45 |
+
/>
|
| 46 |
+
)
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
function DialogContent({
|
| 50 |
+
className,
|
| 51 |
+
children,
|
| 52 |
+
showCloseButton = true,
|
| 53 |
+
...props
|
| 54 |
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
| 55 |
+
showCloseButton?: boolean
|
| 56 |
+
}) {
|
| 57 |
+
return (
|
| 58 |
+
<DialogPortal data-slot="dialog-portal">
|
| 59 |
+
<DialogOverlay />
|
| 60 |
+
<DialogPrimitive.Content
|
| 61 |
+
data-slot="dialog-content"
|
| 62 |
+
className={cn(
|
| 63 |
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
|
| 64 |
+
className,
|
| 65 |
+
)}
|
| 66 |
+
{...props}
|
| 67 |
+
>
|
| 68 |
+
{children}
|
| 69 |
+
{showCloseButton && (
|
| 70 |
+
<DialogPrimitive.Close
|
| 71 |
+
data-slot="dialog-close"
|
| 72 |
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
| 73 |
+
>
|
| 74 |
+
<XIcon />
|
| 75 |
+
<span className="sr-only">Close</span>
|
| 76 |
+
</DialogPrimitive.Close>
|
| 77 |
+
)}
|
| 78 |
+
</DialogPrimitive.Content>
|
| 79 |
+
</DialogPortal>
|
| 80 |
+
)
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
| 84 |
+
return (
|
| 85 |
+
<div
|
| 86 |
+
data-slot="dialog-header"
|
| 87 |
+
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
|
| 88 |
+
{...props}
|
| 89 |
+
/>
|
| 90 |
+
)
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
| 94 |
+
return (
|
| 95 |
+
<div
|
| 96 |
+
data-slot="dialog-footer"
|
| 97 |
+
className={cn(
|
| 98 |
+
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
|
| 99 |
+
className,
|
| 100 |
+
)}
|
| 101 |
+
{...props}
|
| 102 |
+
/>
|
| 103 |
+
)
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
function DialogTitle({
|
| 107 |
+
className,
|
| 108 |
+
...props
|
| 109 |
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
| 110 |
+
return (
|
| 111 |
+
<DialogPrimitive.Title
|
| 112 |
+
data-slot="dialog-title"
|
| 113 |
+
className={cn('text-lg leading-none font-semibold', className)}
|
| 114 |
+
{...props}
|
| 115 |
+
/>
|
| 116 |
+
)
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
function DialogDescription({
|
| 120 |
+
className,
|
| 121 |
+
...props
|
| 122 |
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
| 123 |
+
return (
|
| 124 |
+
<DialogPrimitive.Description
|
| 125 |
+
data-slot="dialog-description"
|
| 126 |
+
className={cn('text-muted-foreground text-sm', className)}
|
| 127 |
+
{...props}
|
| 128 |
+
/>
|
| 129 |
+
)
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
export {
|
| 133 |
+
Dialog,
|
| 134 |
+
DialogClose,
|
| 135 |
+
DialogContent,
|
| 136 |
+
DialogDescription,
|
| 137 |
+
DialogFooter,
|
| 138 |
+
DialogHeader,
|
| 139 |
+
DialogOverlay,
|
| 140 |
+
DialogPortal,
|
| 141 |
+
DialogTitle,
|
| 142 |
+
DialogTrigger,
|
| 143 |
+
}
|
Frontend/components/ui/drawer.tsx
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import { Drawer as DrawerPrimitive } from 'vaul'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
|
| 8 |
+
function Drawer({
|
| 9 |
+
...props
|
| 10 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
| 11 |
+
return <DrawerPrimitive.Root data-slot="drawer" {...props} />
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
function DrawerTrigger({
|
| 15 |
+
...props
|
| 16 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
| 17 |
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
function DrawerPortal({
|
| 21 |
+
...props
|
| 22 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
| 23 |
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
function DrawerClose({
|
| 27 |
+
...props
|
| 28 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
| 29 |
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
function DrawerOverlay({
|
| 33 |
+
className,
|
| 34 |
+
...props
|
| 35 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
| 36 |
+
return (
|
| 37 |
+
<DrawerPrimitive.Overlay
|
| 38 |
+
data-slot="drawer-overlay"
|
| 39 |
+
className={cn(
|
| 40 |
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
| 41 |
+
className,
|
| 42 |
+
)}
|
| 43 |
+
{...props}
|
| 44 |
+
/>
|
| 45 |
+
)
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function DrawerContent({
|
| 49 |
+
className,
|
| 50 |
+
children,
|
| 51 |
+
...props
|
| 52 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
| 53 |
+
return (
|
| 54 |
+
<DrawerPortal data-slot="drawer-portal">
|
| 55 |
+
<DrawerOverlay />
|
| 56 |
+
<DrawerPrimitive.Content
|
| 57 |
+
data-slot="drawer-content"
|
| 58 |
+
className={cn(
|
| 59 |
+
'group/drawer-content bg-background fixed z-50 flex h-auto flex-col',
|
| 60 |
+
'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',
|
| 61 |
+
'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',
|
| 62 |
+
'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm',
|
| 63 |
+
'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',
|
| 64 |
+
className,
|
| 65 |
+
)}
|
| 66 |
+
{...props}
|
| 67 |
+
>
|
| 68 |
+
<div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
| 69 |
+
{children}
|
| 70 |
+
</DrawerPrimitive.Content>
|
| 71 |
+
</DrawerPortal>
|
| 72 |
+
)
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
| 76 |
+
return (
|
| 77 |
+
<div
|
| 78 |
+
data-slot="drawer-header"
|
| 79 |
+
className={cn(
|
| 80 |
+
'flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left',
|
| 81 |
+
className,
|
| 82 |
+
)}
|
| 83 |
+
{...props}
|
| 84 |
+
/>
|
| 85 |
+
)
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
| 89 |
+
return (
|
| 90 |
+
<div
|
| 91 |
+
data-slot="drawer-footer"
|
| 92 |
+
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
| 93 |
+
{...props}
|
| 94 |
+
/>
|
| 95 |
+
)
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
function DrawerTitle({
|
| 99 |
+
className,
|
| 100 |
+
...props
|
| 101 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
| 102 |
+
return (
|
| 103 |
+
<DrawerPrimitive.Title
|
| 104 |
+
data-slot="drawer-title"
|
| 105 |
+
className={cn('text-foreground font-semibold', className)}
|
| 106 |
+
{...props}
|
| 107 |
+
/>
|
| 108 |
+
)
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
function DrawerDescription({
|
| 112 |
+
className,
|
| 113 |
+
...props
|
| 114 |
+
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
| 115 |
+
return (
|
| 116 |
+
<DrawerPrimitive.Description
|
| 117 |
+
data-slot="drawer-description"
|
| 118 |
+
className={cn('text-muted-foreground text-sm', className)}
|
| 119 |
+
{...props}
|
| 120 |
+
/>
|
| 121 |
+
)
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
export {
|
| 125 |
+
Drawer,
|
| 126 |
+
DrawerPortal,
|
| 127 |
+
DrawerOverlay,
|
| 128 |
+
DrawerTrigger,
|
| 129 |
+
DrawerClose,
|
| 130 |
+
DrawerContent,
|
| 131 |
+
DrawerHeader,
|
| 132 |
+
DrawerFooter,
|
| 133 |
+
DrawerTitle,
|
| 134 |
+
DrawerDescription,
|
| 135 |
+
}
|
Frontend/components/ui/dropdown-menu.tsx
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
|
| 5 |
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function DropdownMenu({
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
| 12 |
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function DropdownMenuPortal({
|
| 16 |
+
...props
|
| 17 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
| 18 |
+
return (
|
| 19 |
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
| 20 |
+
)
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
function DropdownMenuTrigger({
|
| 24 |
+
...props
|
| 25 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
| 26 |
+
return (
|
| 27 |
+
<DropdownMenuPrimitive.Trigger
|
| 28 |
+
data-slot="dropdown-menu-trigger"
|
| 29 |
+
{...props}
|
| 30 |
+
/>
|
| 31 |
+
)
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
function DropdownMenuContent({
|
| 35 |
+
className,
|
| 36 |
+
sideOffset = 4,
|
| 37 |
+
...props
|
| 38 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
| 39 |
+
return (
|
| 40 |
+
<DropdownMenuPrimitive.Portal>
|
| 41 |
+
<DropdownMenuPrimitive.Content
|
| 42 |
+
data-slot="dropdown-menu-content"
|
| 43 |
+
sideOffset={sideOffset}
|
| 44 |
+
className={cn(
|
| 45 |
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
| 46 |
+
className,
|
| 47 |
+
)}
|
| 48 |
+
{...props}
|
| 49 |
+
/>
|
| 50 |
+
</DropdownMenuPrimitive.Portal>
|
| 51 |
+
)
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
function DropdownMenuGroup({
|
| 55 |
+
...props
|
| 56 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
| 57 |
+
return (
|
| 58 |
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
| 59 |
+
)
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
function DropdownMenuItem({
|
| 63 |
+
className,
|
| 64 |
+
inset,
|
| 65 |
+
variant = 'default',
|
| 66 |
+
...props
|
| 67 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
| 68 |
+
inset?: boolean
|
| 69 |
+
variant?: 'default' | 'destructive'
|
| 70 |
+
}) {
|
| 71 |
+
return (
|
| 72 |
+
<DropdownMenuPrimitive.Item
|
| 73 |
+
data-slot="dropdown-menu-item"
|
| 74 |
+
data-inset={inset}
|
| 75 |
+
data-variant={variant}
|
| 76 |
+
className={cn(
|
| 77 |
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 78 |
+
className,
|
| 79 |
+
)}
|
| 80 |
+
{...props}
|
| 81 |
+
/>
|
| 82 |
+
)
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
function DropdownMenuCheckboxItem({
|
| 86 |
+
className,
|
| 87 |
+
children,
|
| 88 |
+
checked,
|
| 89 |
+
...props
|
| 90 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
| 91 |
+
return (
|
| 92 |
+
<DropdownMenuPrimitive.CheckboxItem
|
| 93 |
+
data-slot="dropdown-menu-checkbox-item"
|
| 94 |
+
className={cn(
|
| 95 |
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 96 |
+
className,
|
| 97 |
+
)}
|
| 98 |
+
checked={checked}
|
| 99 |
+
{...props}
|
| 100 |
+
>
|
| 101 |
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
| 102 |
+
<DropdownMenuPrimitive.ItemIndicator>
|
| 103 |
+
<CheckIcon className="size-4" />
|
| 104 |
+
</DropdownMenuPrimitive.ItemIndicator>
|
| 105 |
+
</span>
|
| 106 |
+
{children}
|
| 107 |
+
</DropdownMenuPrimitive.CheckboxItem>
|
| 108 |
+
)
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
function DropdownMenuRadioGroup({
|
| 112 |
+
...props
|
| 113 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
| 114 |
+
return (
|
| 115 |
+
<DropdownMenuPrimitive.RadioGroup
|
| 116 |
+
data-slot="dropdown-menu-radio-group"
|
| 117 |
+
{...props}
|
| 118 |
+
/>
|
| 119 |
+
)
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
function DropdownMenuRadioItem({
|
| 123 |
+
className,
|
| 124 |
+
children,
|
| 125 |
+
...props
|
| 126 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
| 127 |
+
return (
|
| 128 |
+
<DropdownMenuPrimitive.RadioItem
|
| 129 |
+
data-slot="dropdown-menu-radio-item"
|
| 130 |
+
className={cn(
|
| 131 |
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 132 |
+
className,
|
| 133 |
+
)}
|
| 134 |
+
{...props}
|
| 135 |
+
>
|
| 136 |
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
| 137 |
+
<DropdownMenuPrimitive.ItemIndicator>
|
| 138 |
+
<CircleIcon className="size-2 fill-current" />
|
| 139 |
+
</DropdownMenuPrimitive.ItemIndicator>
|
| 140 |
+
</span>
|
| 141 |
+
{children}
|
| 142 |
+
</DropdownMenuPrimitive.RadioItem>
|
| 143 |
+
)
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function DropdownMenuLabel({
|
| 147 |
+
className,
|
| 148 |
+
inset,
|
| 149 |
+
...props
|
| 150 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
| 151 |
+
inset?: boolean
|
| 152 |
+
}) {
|
| 153 |
+
return (
|
| 154 |
+
<DropdownMenuPrimitive.Label
|
| 155 |
+
data-slot="dropdown-menu-label"
|
| 156 |
+
data-inset={inset}
|
| 157 |
+
className={cn(
|
| 158 |
+
'px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
|
| 159 |
+
className,
|
| 160 |
+
)}
|
| 161 |
+
{...props}
|
| 162 |
+
/>
|
| 163 |
+
)
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
function DropdownMenuSeparator({
|
| 167 |
+
className,
|
| 168 |
+
...props
|
| 169 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
| 170 |
+
return (
|
| 171 |
+
<DropdownMenuPrimitive.Separator
|
| 172 |
+
data-slot="dropdown-menu-separator"
|
| 173 |
+
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
| 174 |
+
{...props}
|
| 175 |
+
/>
|
| 176 |
+
)
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
function DropdownMenuShortcut({
|
| 180 |
+
className,
|
| 181 |
+
...props
|
| 182 |
+
}: React.ComponentProps<'span'>) {
|
| 183 |
+
return (
|
| 184 |
+
<span
|
| 185 |
+
data-slot="dropdown-menu-shortcut"
|
| 186 |
+
className={cn(
|
| 187 |
+
'text-muted-foreground ml-auto text-xs tracking-widest',
|
| 188 |
+
className,
|
| 189 |
+
)}
|
| 190 |
+
{...props}
|
| 191 |
+
/>
|
| 192 |
+
)
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
function DropdownMenuSub({
|
| 196 |
+
...props
|
| 197 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
| 198 |
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
function DropdownMenuSubTrigger({
|
| 202 |
+
className,
|
| 203 |
+
inset,
|
| 204 |
+
children,
|
| 205 |
+
...props
|
| 206 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
| 207 |
+
inset?: boolean
|
| 208 |
+
}) {
|
| 209 |
+
return (
|
| 210 |
+
<DropdownMenuPrimitive.SubTrigger
|
| 211 |
+
data-slot="dropdown-menu-sub-trigger"
|
| 212 |
+
data-inset={inset}
|
| 213 |
+
className={cn(
|
| 214 |
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 215 |
+
className,
|
| 216 |
+
)}
|
| 217 |
+
{...props}
|
| 218 |
+
>
|
| 219 |
+
{children}
|
| 220 |
+
<ChevronRightIcon className="ml-auto size-4" />
|
| 221 |
+
</DropdownMenuPrimitive.SubTrigger>
|
| 222 |
+
)
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
function DropdownMenuSubContent({
|
| 226 |
+
className,
|
| 227 |
+
...props
|
| 228 |
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
| 229 |
+
return (
|
| 230 |
+
<DropdownMenuPrimitive.SubContent
|
| 231 |
+
data-slot="dropdown-menu-sub-content"
|
| 232 |
+
className={cn(
|
| 233 |
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
| 234 |
+
className,
|
| 235 |
+
)}
|
| 236 |
+
{...props}
|
| 237 |
+
/>
|
| 238 |
+
)
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
export {
|
| 242 |
+
DropdownMenu,
|
| 243 |
+
DropdownMenuPortal,
|
| 244 |
+
DropdownMenuTrigger,
|
| 245 |
+
DropdownMenuContent,
|
| 246 |
+
DropdownMenuGroup,
|
| 247 |
+
DropdownMenuLabel,
|
| 248 |
+
DropdownMenuItem,
|
| 249 |
+
DropdownMenuCheckboxItem,
|
| 250 |
+
DropdownMenuRadioGroup,
|
| 251 |
+
DropdownMenuRadioItem,
|
| 252 |
+
DropdownMenuSeparator,
|
| 253 |
+
DropdownMenuShortcut,
|
| 254 |
+
DropdownMenuSub,
|
| 255 |
+
DropdownMenuSubTrigger,
|
| 256 |
+
DropdownMenuSubContent,
|
| 257 |
+
}
|
Frontend/components/ui/empty.tsx
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 2 |
+
|
| 3 |
+
import { cn } from '@/lib/utils'
|
| 4 |
+
|
| 5 |
+
function Empty({ className, ...props }: React.ComponentProps<'div'>) {
|
| 6 |
+
return (
|
| 7 |
+
<div
|
| 8 |
+
data-slot="empty"
|
| 9 |
+
className={cn(
|
| 10 |
+
'flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12',
|
| 11 |
+
className,
|
| 12 |
+
)}
|
| 13 |
+
{...props}
|
| 14 |
+
/>
|
| 15 |
+
)
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
| 19 |
+
return (
|
| 20 |
+
<div
|
| 21 |
+
data-slot="empty-header"
|
| 22 |
+
className={cn(
|
| 23 |
+
'flex max-w-sm flex-col items-center gap-2 text-center',
|
| 24 |
+
className,
|
| 25 |
+
)}
|
| 26 |
+
{...props}
|
| 27 |
+
/>
|
| 28 |
+
)
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
const emptyMediaVariants = cva(
|
| 32 |
+
'flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
| 33 |
+
{
|
| 34 |
+
variants: {
|
| 35 |
+
variant: {
|
| 36 |
+
default: 'bg-transparent',
|
| 37 |
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
| 38 |
+
},
|
| 39 |
+
},
|
| 40 |
+
defaultVariants: {
|
| 41 |
+
variant: 'default',
|
| 42 |
+
},
|
| 43 |
+
},
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
function EmptyMedia({
|
| 47 |
+
className,
|
| 48 |
+
variant = 'default',
|
| 49 |
+
...props
|
| 50 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>) {
|
| 51 |
+
return (
|
| 52 |
+
<div
|
| 53 |
+
data-slot="empty-icon"
|
| 54 |
+
data-variant={variant}
|
| 55 |
+
className={cn(emptyMediaVariants({ variant, className }))}
|
| 56 |
+
{...props}
|
| 57 |
+
/>
|
| 58 |
+
)
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
| 62 |
+
return (
|
| 63 |
+
<div
|
| 64 |
+
data-slot="empty-title"
|
| 65 |
+
className={cn('text-lg font-medium tracking-tight', className)}
|
| 66 |
+
{...props}
|
| 67 |
+
/>
|
| 68 |
+
)
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
| 72 |
+
return (
|
| 73 |
+
<div
|
| 74 |
+
data-slot="empty-description"
|
| 75 |
+
className={cn(
|
| 76 |
+
'text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4',
|
| 77 |
+
className,
|
| 78 |
+
)}
|
| 79 |
+
{...props}
|
| 80 |
+
/>
|
| 81 |
+
)
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
function EmptyContent({ className, ...props }: React.ComponentProps<'div'>) {
|
| 85 |
+
return (
|
| 86 |
+
<div
|
| 87 |
+
data-slot="empty-content"
|
| 88 |
+
className={cn(
|
| 89 |
+
'flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance',
|
| 90 |
+
className,
|
| 91 |
+
)}
|
| 92 |
+
{...props}
|
| 93 |
+
/>
|
| 94 |
+
)
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
export {
|
| 98 |
+
Empty,
|
| 99 |
+
EmptyHeader,
|
| 100 |
+
EmptyTitle,
|
| 101 |
+
EmptyDescription,
|
| 102 |
+
EmptyContent,
|
| 103 |
+
EmptyMedia,
|
| 104 |
+
}
|
Frontend/components/ui/field.tsx
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { useMemo } from 'react'
|
| 4 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
import { Label } from '@/components/ui/label'
|
| 8 |
+
import { Separator } from '@/components/ui/separator'
|
| 9 |
+
|
| 10 |
+
function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
| 11 |
+
return (
|
| 12 |
+
<fieldset
|
| 13 |
+
data-slot="field-set"
|
| 14 |
+
className={cn(
|
| 15 |
+
'flex flex-col gap-6',
|
| 16 |
+
'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
|
| 17 |
+
className,
|
| 18 |
+
)}
|
| 19 |
+
{...props}
|
| 20 |
+
/>
|
| 21 |
+
)
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
function FieldLegend({
|
| 25 |
+
className,
|
| 26 |
+
variant = 'legend',
|
| 27 |
+
...props
|
| 28 |
+
}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
|
| 29 |
+
return (
|
| 30 |
+
<legend
|
| 31 |
+
data-slot="field-legend"
|
| 32 |
+
data-variant={variant}
|
| 33 |
+
className={cn(
|
| 34 |
+
'mb-3 font-medium',
|
| 35 |
+
'data-[variant=legend]:text-base',
|
| 36 |
+
'data-[variant=label]:text-sm',
|
| 37 |
+
className,
|
| 38 |
+
)}
|
| 39 |
+
{...props}
|
| 40 |
+
/>
|
| 41 |
+
)
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
| 45 |
+
return (
|
| 46 |
+
<div
|
| 47 |
+
data-slot="field-group"
|
| 48 |
+
className={cn(
|
| 49 |
+
'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',
|
| 50 |
+
className,
|
| 51 |
+
)}
|
| 52 |
+
{...props}
|
| 53 |
+
/>
|
| 54 |
+
)
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
const fieldVariants = cva(
|
| 58 |
+
'group/field flex w-full gap-3 data-[invalid=true]:text-destructive',
|
| 59 |
+
{
|
| 60 |
+
variants: {
|
| 61 |
+
orientation: {
|
| 62 |
+
vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
|
| 63 |
+
horizontal: [
|
| 64 |
+
'flex-row items-center',
|
| 65 |
+
'[&>[data-slot=field-label]]:flex-auto',
|
| 66 |
+
'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
| 67 |
+
],
|
| 68 |
+
responsive: [
|
| 69 |
+
'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto',
|
| 70 |
+
'@md/field-group:[&>[data-slot=field-label]]:flex-auto',
|
| 71 |
+
'@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
| 72 |
+
],
|
| 73 |
+
},
|
| 74 |
+
},
|
| 75 |
+
defaultVariants: {
|
| 76 |
+
orientation: 'vertical',
|
| 77 |
+
},
|
| 78 |
+
},
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
function Field({
|
| 82 |
+
className,
|
| 83 |
+
orientation = 'vertical',
|
| 84 |
+
...props
|
| 85 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
| 86 |
+
return (
|
| 87 |
+
<div
|
| 88 |
+
role="group"
|
| 89 |
+
data-slot="field"
|
| 90 |
+
data-orientation={orientation}
|
| 91 |
+
className={cn(fieldVariants({ orientation }), className)}
|
| 92 |
+
{...props}
|
| 93 |
+
/>
|
| 94 |
+
)
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
| 98 |
+
return (
|
| 99 |
+
<div
|
| 100 |
+
data-slot="field-content"
|
| 101 |
+
className={cn(
|
| 102 |
+
'group/field-content flex flex-1 flex-col gap-1.5 leading-snug',
|
| 103 |
+
className,
|
| 104 |
+
)}
|
| 105 |
+
{...props}
|
| 106 |
+
/>
|
| 107 |
+
)
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
function FieldLabel({
|
| 111 |
+
className,
|
| 112 |
+
...props
|
| 113 |
+
}: React.ComponentProps<typeof Label>) {
|
| 114 |
+
return (
|
| 115 |
+
<Label
|
| 116 |
+
data-slot="field-label"
|
| 117 |
+
className={cn(
|
| 118 |
+
'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
|
| 119 |
+
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',
|
| 120 |
+
'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',
|
| 121 |
+
className,
|
| 122 |
+
)}
|
| 123 |
+
{...props}
|
| 124 |
+
/>
|
| 125 |
+
)
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
| 129 |
+
return (
|
| 130 |
+
<div
|
| 131 |
+
data-slot="field-label"
|
| 132 |
+
className={cn(
|
| 133 |
+
'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
|
| 134 |
+
className,
|
| 135 |
+
)}
|
| 136 |
+
{...props}
|
| 137 |
+
/>
|
| 138 |
+
)
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
| 142 |
+
return (
|
| 143 |
+
<p
|
| 144 |
+
data-slot="field-description"
|
| 145 |
+
className={cn(
|
| 146 |
+
'text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',
|
| 147 |
+
'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',
|
| 148 |
+
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
| 149 |
+
className,
|
| 150 |
+
)}
|
| 151 |
+
{...props}
|
| 152 |
+
/>
|
| 153 |
+
)
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
function FieldSeparator({
|
| 157 |
+
children,
|
| 158 |
+
className,
|
| 159 |
+
...props
|
| 160 |
+
}: React.ComponentProps<'div'> & {
|
| 161 |
+
children?: React.ReactNode
|
| 162 |
+
}) {
|
| 163 |
+
return (
|
| 164 |
+
<div
|
| 165 |
+
data-slot="field-separator"
|
| 166 |
+
data-content={!!children}
|
| 167 |
+
className={cn(
|
| 168 |
+
'relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2',
|
| 169 |
+
className,
|
| 170 |
+
)}
|
| 171 |
+
{...props}
|
| 172 |
+
>
|
| 173 |
+
<Separator className="absolute inset-0 top-1/2" />
|
| 174 |
+
{children && (
|
| 175 |
+
<span
|
| 176 |
+
className="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
|
| 177 |
+
data-slot="field-separator-content"
|
| 178 |
+
>
|
| 179 |
+
{children}
|
| 180 |
+
</span>
|
| 181 |
+
)}
|
| 182 |
+
</div>
|
| 183 |
+
)
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
function FieldError({
|
| 187 |
+
className,
|
| 188 |
+
children,
|
| 189 |
+
errors,
|
| 190 |
+
...props
|
| 191 |
+
}: React.ComponentProps<'div'> & {
|
| 192 |
+
errors?: Array<{ message?: string } | undefined>
|
| 193 |
+
}) {
|
| 194 |
+
const content = useMemo(() => {
|
| 195 |
+
if (children) {
|
| 196 |
+
return children
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
if (!errors) {
|
| 200 |
+
return null
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
if (errors.length === 1 && errors[0]?.message) {
|
| 204 |
+
return errors[0].message
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
return (
|
| 208 |
+
<ul className="ml-4 flex list-disc flex-col gap-1">
|
| 209 |
+
{errors.map(
|
| 210 |
+
(error, index) =>
|
| 211 |
+
error?.message && <li key={index}>{error.message}</li>,
|
| 212 |
+
)}
|
| 213 |
+
</ul>
|
| 214 |
+
)
|
| 215 |
+
}, [children, errors])
|
| 216 |
+
|
| 217 |
+
if (!content) {
|
| 218 |
+
return null
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
return (
|
| 222 |
+
<div
|
| 223 |
+
role="alert"
|
| 224 |
+
data-slot="field-error"
|
| 225 |
+
className={cn('text-destructive text-sm font-normal', className)}
|
| 226 |
+
{...props}
|
| 227 |
+
>
|
| 228 |
+
{content}
|
| 229 |
+
</div>
|
| 230 |
+
)
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
export {
|
| 234 |
+
Field,
|
| 235 |
+
FieldLabel,
|
| 236 |
+
FieldDescription,
|
| 237 |
+
FieldError,
|
| 238 |
+
FieldGroup,
|
| 239 |
+
FieldLegend,
|
| 240 |
+
FieldSeparator,
|
| 241 |
+
FieldSet,
|
| 242 |
+
FieldContent,
|
| 243 |
+
FieldTitle,
|
| 244 |
+
}
|
Frontend/components/ui/form.tsx
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as LabelPrimitive from '@radix-ui/react-label'
|
| 5 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 6 |
+
import {
|
| 7 |
+
Controller,
|
| 8 |
+
FormProvider,
|
| 9 |
+
useFormContext,
|
| 10 |
+
useFormState,
|
| 11 |
+
type ControllerProps,
|
| 12 |
+
type FieldPath,
|
| 13 |
+
type FieldValues,
|
| 14 |
+
} from 'react-hook-form'
|
| 15 |
+
|
| 16 |
+
import { cn } from '@/lib/utils'
|
| 17 |
+
import { Label } from '@/components/ui/label'
|
| 18 |
+
|
| 19 |
+
const Form = FormProvider
|
| 20 |
+
|
| 21 |
+
type FormFieldContextValue<
|
| 22 |
+
TFieldValues extends FieldValues = FieldValues,
|
| 23 |
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
| 24 |
+
> = {
|
| 25 |
+
name: TName
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
| 29 |
+
{} as FormFieldContextValue,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
const FormField = <
|
| 33 |
+
TFieldValues extends FieldValues = FieldValues,
|
| 34 |
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
| 35 |
+
>({
|
| 36 |
+
...props
|
| 37 |
+
}: ControllerProps<TFieldValues, TName>) => {
|
| 38 |
+
return (
|
| 39 |
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
| 40 |
+
<Controller {...props} />
|
| 41 |
+
</FormFieldContext.Provider>
|
| 42 |
+
)
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
const useFormField = () => {
|
| 46 |
+
const fieldContext = React.useContext(FormFieldContext)
|
| 47 |
+
const itemContext = React.useContext(FormItemContext)
|
| 48 |
+
const { getFieldState } = useFormContext()
|
| 49 |
+
const formState = useFormState({ name: fieldContext.name })
|
| 50 |
+
const fieldState = getFieldState(fieldContext.name, formState)
|
| 51 |
+
|
| 52 |
+
if (!fieldContext) {
|
| 53 |
+
throw new Error('useFormField should be used within <FormField>')
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
const { id } = itemContext
|
| 57 |
+
|
| 58 |
+
return {
|
| 59 |
+
id,
|
| 60 |
+
name: fieldContext.name,
|
| 61 |
+
formItemId: `${id}-form-item`,
|
| 62 |
+
formDescriptionId: `${id}-form-item-description`,
|
| 63 |
+
formMessageId: `${id}-form-item-message`,
|
| 64 |
+
...fieldState,
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
type FormItemContextValue = {
|
| 69 |
+
id: string
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
const FormItemContext = React.createContext<FormItemContextValue>(
|
| 73 |
+
{} as FormItemContextValue,
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
|
| 77 |
+
const id = React.useId()
|
| 78 |
+
|
| 79 |
+
return (
|
| 80 |
+
<FormItemContext.Provider value={{ id }}>
|
| 81 |
+
<div
|
| 82 |
+
data-slot="form-item"
|
| 83 |
+
className={cn('grid gap-2', className)}
|
| 84 |
+
{...props}
|
| 85 |
+
/>
|
| 86 |
+
</FormItemContext.Provider>
|
| 87 |
+
)
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
function FormLabel({
|
| 91 |
+
className,
|
| 92 |
+
...props
|
| 93 |
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
| 94 |
+
const { error, formItemId } = useFormField()
|
| 95 |
+
|
| 96 |
+
return (
|
| 97 |
+
<Label
|
| 98 |
+
data-slot="form-label"
|
| 99 |
+
data-error={!!error}
|
| 100 |
+
className={cn('data-[error=true]:text-destructive', className)}
|
| 101 |
+
htmlFor={formItemId}
|
| 102 |
+
{...props}
|
| 103 |
+
/>
|
| 104 |
+
)
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
|
| 108 |
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
| 109 |
+
|
| 110 |
+
return (
|
| 111 |
+
<Slot
|
| 112 |
+
data-slot="form-control"
|
| 113 |
+
id={formItemId}
|
| 114 |
+
aria-describedby={
|
| 115 |
+
!error
|
| 116 |
+
? `${formDescriptionId}`
|
| 117 |
+
: `${formDescriptionId} ${formMessageId}`
|
| 118 |
+
}
|
| 119 |
+
aria-invalid={!!error}
|
| 120 |
+
{...props}
|
| 121 |
+
/>
|
| 122 |
+
)
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
| 126 |
+
const { formDescriptionId } = useFormField()
|
| 127 |
+
|
| 128 |
+
return (
|
| 129 |
+
<p
|
| 130 |
+
data-slot="form-description"
|
| 131 |
+
id={formDescriptionId}
|
| 132 |
+
className={cn('text-muted-foreground text-sm', className)}
|
| 133 |
+
{...props}
|
| 134 |
+
/>
|
| 135 |
+
)
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
function FormMessage({ className, ...props }: React.ComponentProps<'p'>) {
|
| 139 |
+
const { error, formMessageId } = useFormField()
|
| 140 |
+
const body = error ? String(error?.message ?? '') : props.children
|
| 141 |
+
|
| 142 |
+
if (!body) {
|
| 143 |
+
return null
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
return (
|
| 147 |
+
<p
|
| 148 |
+
data-slot="form-message"
|
| 149 |
+
id={formMessageId}
|
| 150 |
+
className={cn('text-destructive text-sm', className)}
|
| 151 |
+
{...props}
|
| 152 |
+
>
|
| 153 |
+
{body}
|
| 154 |
+
</p>
|
| 155 |
+
)
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
export {
|
| 159 |
+
useFormField,
|
| 160 |
+
Form,
|
| 161 |
+
FormItem,
|
| 162 |
+
FormLabel,
|
| 163 |
+
FormControl,
|
| 164 |
+
FormDescription,
|
| 165 |
+
FormMessage,
|
| 166 |
+
FormField,
|
| 167 |
+
}
|
Frontend/components/ui/hover-card.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card'
|
| 5 |
+
|
| 6 |
+
import { cn } from '@/lib/utils'
|
| 7 |
+
|
| 8 |
+
function HoverCard({
|
| 9 |
+
...props
|
| 10 |
+
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
| 11 |
+
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
function HoverCardTrigger({
|
| 15 |
+
...props
|
| 16 |
+
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
| 17 |
+
return (
|
| 18 |
+
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
| 19 |
+
)
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
function HoverCardContent({
|
| 23 |
+
className,
|
| 24 |
+
align = 'center',
|
| 25 |
+
sideOffset = 4,
|
| 26 |
+
...props
|
| 27 |
+
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
|
| 28 |
+
return (
|
| 29 |
+
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
| 30 |
+
<HoverCardPrimitive.Content
|
| 31 |
+
data-slot="hover-card-content"
|
| 32 |
+
align={align}
|
| 33 |
+
sideOffset={sideOffset}
|
| 34 |
+
className={cn(
|
| 35 |
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
|
| 36 |
+
className,
|
| 37 |
+
)}
|
| 38 |
+
{...props}
|
| 39 |
+
/>
|
| 40 |
+
</HoverCardPrimitive.Portal>
|
| 41 |
+
)
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
export { HoverCard, HoverCardTrigger, HoverCardContent }
|
Frontend/components/ui/input-group.tsx
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 4 |
+
|
| 5 |
+
import { cn } from '@/lib/utils'
|
| 6 |
+
import { Button } from '@/components/ui/button'
|
| 7 |
+
import { Input } from '@/components/ui/input'
|
| 8 |
+
import { Textarea } from '@/components/ui/textarea'
|
| 9 |
+
|
| 10 |
+
function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
| 11 |
+
return (
|
| 12 |
+
<div
|
| 13 |
+
data-slot="input-group"
|
| 14 |
+
role="group"
|
| 15 |
+
className={cn(
|
| 16 |
+
'group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none',
|
| 17 |
+
'h-9 has-[>textarea]:h-auto',
|
| 18 |
+
|
| 19 |
+
// Variants based on alignment.
|
| 20 |
+
'has-[>[data-align=inline-start]]:[&>input]:pl-2',
|
| 21 |
+
'has-[>[data-align=inline-end]]:[&>input]:pr-2',
|
| 22 |
+
'has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3',
|
| 23 |
+
'has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3',
|
| 24 |
+
|
| 25 |
+
// Focus state.
|
| 26 |
+
'has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]',
|
| 27 |
+
|
| 28 |
+
// Error state.
|
| 29 |
+
'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40',
|
| 30 |
+
|
| 31 |
+
className,
|
| 32 |
+
)}
|
| 33 |
+
{...props}
|
| 34 |
+
/>
|
| 35 |
+
)
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
const inputGroupAddonVariants = cva(
|
| 39 |
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
| 40 |
+
{
|
| 41 |
+
variants: {
|
| 42 |
+
align: {
|
| 43 |
+
'inline-start':
|
| 44 |
+
'order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]',
|
| 45 |
+
'inline-end':
|
| 46 |
+
'order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]',
|
| 47 |
+
'block-start':
|
| 48 |
+
'order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5',
|
| 49 |
+
'block-end':
|
| 50 |
+
'order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5',
|
| 51 |
+
},
|
| 52 |
+
},
|
| 53 |
+
defaultVariants: {
|
| 54 |
+
align: 'inline-start',
|
| 55 |
+
},
|
| 56 |
+
},
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
function InputGroupAddon({
|
| 60 |
+
className,
|
| 61 |
+
align = 'inline-start',
|
| 62 |
+
...props
|
| 63 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {
|
| 64 |
+
return (
|
| 65 |
+
<div
|
| 66 |
+
role="group"
|
| 67 |
+
data-slot="input-group-addon"
|
| 68 |
+
data-align={align}
|
| 69 |
+
className={cn(inputGroupAddonVariants({ align }), className)}
|
| 70 |
+
onClick={(e) => {
|
| 71 |
+
if ((e.target as HTMLElement).closest('button')) {
|
| 72 |
+
return
|
| 73 |
+
}
|
| 74 |
+
e.currentTarget.parentElement?.querySelector('input')?.focus()
|
| 75 |
+
}}
|
| 76 |
+
{...props}
|
| 77 |
+
/>
|
| 78 |
+
)
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
const inputGroupButtonVariants = cva(
|
| 82 |
+
'text-sm shadow-none flex gap-2 items-center',
|
| 83 |
+
{
|
| 84 |
+
variants: {
|
| 85 |
+
size: {
|
| 86 |
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
| 87 |
+
sm: 'h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5',
|
| 88 |
+
'icon-xs':
|
| 89 |
+
'size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0',
|
| 90 |
+
'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
|
| 91 |
+
},
|
| 92 |
+
},
|
| 93 |
+
defaultVariants: {
|
| 94 |
+
size: 'xs',
|
| 95 |
+
},
|
| 96 |
+
},
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
function InputGroupButton({
|
| 100 |
+
className,
|
| 101 |
+
type = 'button',
|
| 102 |
+
variant = 'ghost',
|
| 103 |
+
size = 'xs',
|
| 104 |
+
...props
|
| 105 |
+
}: Omit<React.ComponentProps<typeof Button>, 'size'> &
|
| 106 |
+
VariantProps<typeof inputGroupButtonVariants>) {
|
| 107 |
+
return (
|
| 108 |
+
<Button
|
| 109 |
+
type={type}
|
| 110 |
+
data-size={size}
|
| 111 |
+
variant={variant}
|
| 112 |
+
className={cn(inputGroupButtonVariants({ size }), className)}
|
| 113 |
+
{...props}
|
| 114 |
+
/>
|
| 115 |
+
)
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
|
| 119 |
+
return (
|
| 120 |
+
<span
|
| 121 |
+
className={cn(
|
| 122 |
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
| 123 |
+
className,
|
| 124 |
+
)}
|
| 125 |
+
{...props}
|
| 126 |
+
/>
|
| 127 |
+
)
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
function InputGroupInput({
|
| 131 |
+
className,
|
| 132 |
+
...props
|
| 133 |
+
}: React.ComponentProps<'input'>) {
|
| 134 |
+
return (
|
| 135 |
+
<Input
|
| 136 |
+
data-slot="input-group-control"
|
| 137 |
+
className={cn(
|
| 138 |
+
'flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent',
|
| 139 |
+
className,
|
| 140 |
+
)}
|
| 141 |
+
{...props}
|
| 142 |
+
/>
|
| 143 |
+
)
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function InputGroupTextarea({
|
| 147 |
+
className,
|
| 148 |
+
...props
|
| 149 |
+
}: React.ComponentProps<'textarea'>) {
|
| 150 |
+
return (
|
| 151 |
+
<Textarea
|
| 152 |
+
data-slot="input-group-control"
|
| 153 |
+
className={cn(
|
| 154 |
+
'flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent',
|
| 155 |
+
className,
|
| 156 |
+
)}
|
| 157 |
+
{...props}
|
| 158 |
+
/>
|
| 159 |
+
)
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
export {
|
| 163 |
+
InputGroup,
|
| 164 |
+
InputGroupAddon,
|
| 165 |
+
InputGroupButton,
|
| 166 |
+
InputGroupText,
|
| 167 |
+
InputGroupInput,
|
| 168 |
+
InputGroupTextarea,
|
| 169 |
+
}
|
Frontend/components/ui/input-otp.tsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
|
| 3 |
+
import * as React from 'react'
|
| 4 |
+
import { OTPInput, OTPInputContext } from 'input-otp'
|
| 5 |
+
import { MinusIcon } from 'lucide-react'
|
| 6 |
+
|
| 7 |
+
import { cn } from '@/lib/utils'
|
| 8 |
+
|
| 9 |
+
function InputOTP({
|
| 10 |
+
className,
|
| 11 |
+
containerClassName,
|
| 12 |
+
...props
|
| 13 |
+
}: React.ComponentProps<typeof OTPInput> & {
|
| 14 |
+
containerClassName?: string
|
| 15 |
+
}) {
|
| 16 |
+
return (
|
| 17 |
+
<OTPInput
|
| 18 |
+
data-slot="input-otp"
|
| 19 |
+
containerClassName={cn(
|
| 20 |
+
'flex items-center gap-2 has-disabled:opacity-50',
|
| 21 |
+
containerClassName,
|
| 22 |
+
)}
|
| 23 |
+
className={cn('disabled:cursor-not-allowed', className)}
|
| 24 |
+
{...props}
|
| 25 |
+
/>
|
| 26 |
+
)
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
| 30 |
+
return (
|
| 31 |
+
<div
|
| 32 |
+
data-slot="input-otp-group"
|
| 33 |
+
className={cn('flex items-center', className)}
|
| 34 |
+
{...props}
|
| 35 |
+
/>
|
| 36 |
+
)
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
function InputOTPSlot({
|
| 40 |
+
index,
|
| 41 |
+
className,
|
| 42 |
+
...props
|
| 43 |
+
}: React.ComponentProps<'div'> & {
|
| 44 |
+
index: number
|
| 45 |
+
}) {
|
| 46 |
+
const inputOTPContext = React.useContext(OTPInputContext)
|
| 47 |
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
| 48 |
+
|
| 49 |
+
return (
|
| 50 |
+
<div
|
| 51 |
+
data-slot="input-otp-slot"
|
| 52 |
+
data-active={isActive}
|
| 53 |
+
className={cn(
|
| 54 |
+
'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]',
|
| 55 |
+
className,
|
| 56 |
+
)}
|
| 57 |
+
{...props}
|
| 58 |
+
>
|
| 59 |
+
{char}
|
| 60 |
+
{hasFakeCaret && (
|
| 61 |
+
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
| 62 |
+
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
| 63 |
+
</div>
|
| 64 |
+
)}
|
| 65 |
+
</div>
|
| 66 |
+
)
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
|
| 70 |
+
return (
|
| 71 |
+
<div data-slot="input-otp-separator" role="separator" {...props}>
|
| 72 |
+
<MinusIcon />
|
| 73 |
+
</div>
|
| 74 |
+
)
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
Frontend/components/ui/input.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
|
| 3 |
+
import { cn } from '@/lib/utils'
|
| 4 |
+
|
| 5 |
+
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
| 6 |
+
return (
|
| 7 |
+
<input
|
| 8 |
+
type={type}
|
| 9 |
+
data-slot="input"
|
| 10 |
+
className={cn(
|
| 11 |
+
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
| 12 |
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
| 13 |
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
| 14 |
+
className,
|
| 15 |
+
)}
|
| 16 |
+
{...props}
|
| 17 |
+
/>
|
| 18 |
+
)
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
export { Input }
|
Frontend/components/ui/item.tsx
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react'
|
| 2 |
+
import { Slot } from '@radix-ui/react-slot'
|
| 3 |
+
import { cva, type VariantProps } from 'class-variance-authority'
|
| 4 |
+
|
| 5 |
+
import { cn } from '@/lib/utils'
|
| 6 |
+
import { Separator } from '@/components/ui/separator'
|
| 7 |
+
|
| 8 |
+
function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
| 9 |
+
return (
|
| 10 |
+
<div
|
| 11 |
+
role="list"
|
| 12 |
+
data-slot="item-group"
|
| 13 |
+
className={cn('group/item-group flex flex-col', className)}
|
| 14 |
+
{...props}
|
| 15 |
+
/>
|
| 16 |
+
)
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
function ItemSeparator({
|
| 20 |
+
className,
|
| 21 |
+
...props
|
| 22 |
+
}: React.ComponentProps<typeof Separator>) {
|
| 23 |
+
return (
|
| 24 |
+
<Separator
|
| 25 |
+
data-slot="item-separator"
|
| 26 |
+
orientation="horizontal"
|
| 27 |
+
className={cn('my-0', className)}
|
| 28 |
+
{...props}
|
| 29 |
+
/>
|
| 30 |
+
)
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
const itemVariants = cva(
|
| 34 |
+
'group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a&]:hover:bg-accent/50 [a&]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
| 35 |
+
{
|
| 36 |
+
variants: {
|
| 37 |
+
variant: {
|
| 38 |
+
default: 'bg-transparent',
|
| 39 |
+
outline: 'border-border',
|
| 40 |
+
muted: 'bg-muted/50',
|
| 41 |
+
},
|
| 42 |
+
size: {
|
| 43 |
+
default: 'p-4 gap-4 ',
|
| 44 |
+
sm: 'py-3 px-4 gap-2.5',
|
| 45 |
+
},
|
| 46 |
+
},
|
| 47 |
+
defaultVariants: {
|
| 48 |
+
variant: 'default',
|
| 49 |
+
size: 'default',
|
| 50 |
+
},
|
| 51 |
+
},
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
function Item({
|
| 55 |
+
className,
|
| 56 |
+
variant = 'default',
|
| 57 |
+
size = 'default',
|
| 58 |
+
asChild = false,
|
| 59 |
+
...props
|
| 60 |
+
}: React.ComponentProps<'div'> &
|
| 61 |
+
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
| 62 |
+
const Comp = asChild ? Slot : 'div'
|
| 63 |
+
return (
|
| 64 |
+
<Comp
|
| 65 |
+
data-slot="item"
|
| 66 |
+
data-variant={variant}
|
| 67 |
+
data-size={size}
|
| 68 |
+
className={cn(itemVariants({ variant, size, className }))}
|
| 69 |
+
{...props}
|
| 70 |
+
/>
|
| 71 |
+
)
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
const itemMediaVariants = cva(
|
| 75 |
+
'flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5',
|
| 76 |
+
{
|
| 77 |
+
variants: {
|
| 78 |
+
variant: {
|
| 79 |
+
default: 'bg-transparent',
|
| 80 |
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
| 81 |
+
image:
|
| 82 |
+
'size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover',
|
| 83 |
+
},
|
| 84 |
+
},
|
| 85 |
+
defaultVariants: {
|
| 86 |
+
variant: 'default',
|
| 87 |
+
},
|
| 88 |
+
},
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
function ItemMedia({
|
| 92 |
+
className,
|
| 93 |
+
variant = 'default',
|
| 94 |
+
...props
|
| 95 |
+
}: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>) {
|
| 96 |
+
return (
|
| 97 |
+
<div
|
| 98 |
+
data-slot="item-media"
|
| 99 |
+
data-variant={variant}
|
| 100 |
+
className={cn(itemMediaVariants({ variant, className }))}
|
| 101 |
+
{...props}
|
| 102 |
+
/>
|
| 103 |
+
)
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
function ItemContent({ className, ...props }: React.ComponentProps<'div'>) {
|
| 107 |
+
return (
|
| 108 |
+
<div
|
| 109 |
+
data-slot="item-content"
|
| 110 |
+
className={cn(
|
| 111 |
+
'flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none',
|
| 112 |
+
className,
|
| 113 |
+
)}
|
| 114 |
+
{...props}
|
| 115 |
+
/>
|
| 116 |
+
)
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
function ItemTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
| 120 |
+
return (
|
| 121 |
+
<div
|
| 122 |
+
data-slot="item-title"
|
| 123 |
+
className={cn(
|
| 124 |
+
'flex w-fit items-center gap-2 text-sm leading-snug font-medium',
|
| 125 |
+
className,
|
| 126 |
+
)}
|
| 127 |
+
{...props}
|
| 128 |
+
/>
|
| 129 |
+
)
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
function ItemDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
| 133 |
+
return (
|
| 134 |
+
<p
|
| 135 |
+
data-slot="item-description"
|
| 136 |
+
className={cn(
|
| 137 |
+
'text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance',
|
| 138 |
+
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
| 139 |
+
className,
|
| 140 |
+
)}
|
| 141 |
+
{...props}
|
| 142 |
+
/>
|
| 143 |
+
)
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function ItemActions({ className, ...props }: React.ComponentProps<'div'>) {
|
| 147 |
+
return (
|
| 148 |
+
<div
|
| 149 |
+
data-slot="item-actions"
|
| 150 |
+
className={cn('flex items-center gap-2', className)}
|
| 151 |
+
{...props}
|
| 152 |
+
/>
|
| 153 |
+
)
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
function ItemHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
| 157 |
+
return (
|
| 158 |
+
<div
|
| 159 |
+
data-slot="item-header"
|
| 160 |
+
className={cn(
|
| 161 |
+
'flex basis-full items-center justify-between gap-2',
|
| 162 |
+
className,
|
| 163 |
+
)}
|
| 164 |
+
{...props}
|
| 165 |
+
/>
|
| 166 |
+
)
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
function ItemFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
| 170 |
+
return (
|
| 171 |
+
<div
|
| 172 |
+
data-slot="item-footer"
|
| 173 |
+
className={cn(
|
| 174 |
+
'flex basis-full items-center justify-between gap-2',
|
| 175 |
+
className,
|
| 176 |
+
)}
|
| 177 |
+
{...props}
|
| 178 |
+
/>
|
| 179 |
+
)
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
export {
|
| 183 |
+
Item,
|
| 184 |
+
ItemMedia,
|
| 185 |
+
ItemContent,
|
| 186 |
+
ItemActions,
|
| 187 |
+
ItemGroup,
|
| 188 |
+
ItemSeparator,
|
| 189 |
+
ItemTitle,
|
| 190 |
+
ItemDescription,
|
| 191 |
+
ItemHeader,
|
| 192 |
+
ItemFooter,
|
| 193 |
+
}
|
Frontend/components/ui/kbd.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { cn } from '@/lib/utils'
|
| 2 |
+
|
| 3 |
+
function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
|
| 4 |
+
return (
|
| 5 |
+
<kbd
|
| 6 |
+
data-slot="kbd"
|
| 7 |
+
className={cn(
|
| 8 |
+
'bg-muted w-fit text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none',
|
| 9 |
+
"[&_svg:not([class*='size-'])]:size-3",
|
| 10 |
+
'[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10',
|
| 11 |
+
className,
|
| 12 |
+
)}
|
| 13 |
+
{...props}
|
| 14 |
+
/>
|
| 15 |
+
)
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
function KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
| 19 |
+
return (
|
| 20 |
+
<kbd
|
| 21 |
+
data-slot="kbd-group"
|
| 22 |
+
className={cn('inline-flex items-center gap-1', className)}
|
| 23 |
+
{...props}
|
| 24 |
+
/>
|
| 25 |
+
)
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
export { Kbd, KbdGroup }
|