Spaces:
Sleeping
Sleeping
Upload 67 files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- DockerfileAdded+28
- apphosting.yamlAdded+7
- components.jsonAdded+21
- next-env.d.tsAdded+5
- next.config.tsAdded+23
- package-lock.jsonAdded
- package.jsonAdded+65
- postcss.config.mjsAdded+8
- src/ai/dev.tsAdded+4
- src/ai/flows/explain-topic-flow.tsAdded+57
- src/ai/flows/structure-text-flow.tsAdded+3
- src/ai/genkit.tsAdded+7
- src/app/favicon.icoAdded
- src/app/globals.cssAdded+93
- src/app/layout.tsxAdded+32
- src/app/page.tsxAdded+27
- src/components/layout/ExamCountdown.tsxAdded+74
- src/components/layout/Footer.tsxAdded+15
- src/components/layout/Header.tsxAdded+28
- src/components/layout/ThemeToggle.tsxAdded+49
- src/components/syllabus/BookList.tsxAdded+25
- src/components/syllabus/CourseSection.tsxAdded+85
- src/components/syllabus/HierarchicalContentDisplay.tsxAdded+122
- src/components/syllabus/PracticalDetails.tsxAdded+44
- src/components/syllabus/ResourceLinks.tsxAdded+37
- src/components/syllabus/TableOfContents.tsxAdded+50
- src/components/syllabus/UnitDetails.tsxAdded+51
- src/components/ui/accordion.tsxAdded+58
- src/components/ui/alert-dialog.tsxAdded+141
- src/components/ui/alert.tsxAdded+59
- src/components/ui/avatar.tsxAdded+50
- src/components/ui/badge.tsxAdded+36
- src/components/ui/button.tsxAdded+56
- src/components/ui/calendar.tsxAdded+70
- src/components/ui/card.tsxAdded+79
- src/components/ui/chart.tsxAdded+365
- src/components/ui/checkbox.tsxAdded+30
- src/components/ui/dialog.tsxAdded+122
- src/components/ui/dropdown-menu.tsxAdded+200
- src/components/ui/form.tsxAdded+178
- src/components/ui/input.tsxAdded+22
- src/components/ui/label.tsxAdded+26
- src/components/ui/menubar.tsxAdded+256
- src/components/ui/popover.tsxAdded+31
- src/components/ui/progress.tsxAdded+28
- src/components/ui/radio-group.tsxAdded+44
- src/components/ui/scroll-area.tsxAdded+48
- src/components/ui/select.tsxAdded+160
- src/components/ui/separator.tsxAdded+31
- src/components/ui/sheet.tsxAdded+140
12345678910111213141516171819202122232425262728# for deploying a React application with Node.js in a Docker container
# Use Node 22 as the base imageFROM node:22-alpine
# Set the working directory inside the containerWORKDIR /app
# Copy package.json and package-lock.json (if you have one)COPY package*.json ./
# Install dependenciesRUN npm install
# Copy the rest of the application codeCOPY . .
# Expose the port your React app runs onEXPOSE 7860
# Change ownership of /app to the node userRUN chown -R node:node /app
# Switch to the node userUSER node
# Command to run the applicationCMD ["npm", "run", "dev"]1234567# Settings to manage and configure a Firebase App Hosting backend.# https://firebase.google.com/docs/app-hosting/configure
runConfig: # Increase this value if you'd like to automatically spin up # more instances in response to increased traffic. maxInstances: 1123456789101112131415161718192021{ "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": true, "tsx": true, "tailwind": { "config": "tailwind.config.ts", "css": "src/app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "iconLibrary": "lucide"}12345/// <reference types="next" />/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.1234567891011121314151617181920212223import type {NextConfig} from 'next';
const nextConfig: NextConfig = { /* config options here */ typescript: { ignoreBuildErrors: true, }, eslint: { ignoreDuringBuilds: true, }, images: { remotePatterns: [ { protocol: 'https', hostname: 'placehold.co', port: '', pathname: '/**', }, ], },};
export default nextConfig;1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465{ "name": "nextn", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev --turbopack -p 7860", "genkit:dev": "genkit start -- tsx src/ai/dev.ts", "genkit:watch": "genkit start -- tsx --watch src/ai/dev.ts", "build": "next build", "start": "next start", "lint": "next lint", "typecheck": "tsc --noEmit" }, "dependencies": { "@genkit-ai/googleai": "^1.8.0", "@genkit-ai/next": "^1.8.0", "@hookform/resolvers": "^4.1.3", "@radix-ui/react-accordion": "^1.2.3", "@radix-ui/react-alert-dialog": "^1.1.6", "@radix-ui/react-avatar": "^1.1.3", "@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-dropdown-menu": "^2.1.6", "@radix-ui/react-label": "^2.1.2", "@radix-ui/react-menubar": "^1.1.6", "@radix-ui/react-popover": "^1.1.6", "@radix-ui/react-progress": "^1.1.2", "@radix-ui/react-radio-group": "^1.2.3", "@radix-ui/react-scroll-area": "^1.2.3", "@radix-ui/react-select": "^2.1.6", "@radix-ui/react-separator": "^1.1.2", "@radix-ui/react-slider": "^1.2.3", "@radix-ui/react-slot": "^1.1.2", "@radix-ui/react-switch": "^1.1.3", "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-toast": "^1.2.6", "@radix-ui/react-tooltip": "^1.1.8", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^3.6.0", "dotenv": "^16.5.0", "firebase": "^11.8.1", "genkit": "^1.8.0", "lucide-react": "^0.475.0", "next": "15.3.3", "patch-package": "^8.0.0", "react": "^18.3.1", "react-day-picker": "^8.10.1", "react-dom": "^18.3.1", "react-hook-form": "^7.54.2", "recharts": "^2.15.1", "tailwind-merge": "^3.0.1", "tailwindcss-animate": "^1.0.7", "zod": "^3.24.2" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "genkit-cli": "^1.8.0", "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" }}12345678/** @type {import('postcss-load-config').Config} */const config = { plugins: { tailwindcss: {}, },};
export default config;1234
// Flows will be imported for their side effects in this file.// import './flows/structure-text-flow'; // Removed as per user requestimport './flows/explain-topic-flow';123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
'use server';/** * @fileOverview An AI flow to explain a given syllabus topic. * * - explainTopic - A function that handles the topic explanation. * - ExplainTopicInput - The input type for the explainTopic function. * - ExplainTopicOutput - The return type for the explainTopic function. */
import {ai} from '@/ai/genkit';import {z} from 'genkit';
const ExplainTopicInputSchema = z.object({ topicText: z.string().describe('The syllabus topic text to be explained.'),});export type ExplainTopicInput = z.infer<typeof ExplainTopicInputSchema>;
const ExplainTopicOutputSchema = z.object({ explanation: z.string().describe('The AI-generated explanation for the topic, formatted in simple Markdown.'),});export type ExplainTopicOutput = z.infer<typeof ExplainTopicOutputSchema>;
export async function explainTopic(input: ExplainTopicInput): Promise<ExplainTopicOutput> { return explainTopicFlow(input);}
const explainTopicPrompt = ai.definePrompt({ name: 'explainTopicPrompt', input: {schema: ExplainTopicInputSchema}, output: {schema: ExplainTopicOutputSchema}, prompt: `You are a helpful assistant. Explain the following syllabus topic concisely and clearly, in simple terms suitable for a university student.Make the explanation easy to understand and focus on the core concepts.Please use simple Markdown for formatting:- Use '#' for main headings and '##' for subheadings (e.g., # Main Title, ## Sub-section).- Use backticks (\`) for inline code snippets (e.g., \`String name = "Java"\`).- Use triple backticks (\`\`\`) for code blocks, specifying the language if known (e.g., \`\`\`java ...code... \`\`\`).- Use bullet points (-) for lists if appropriate.- Ensure paragraphs are well-separated.
Topic: {{{topicText}}}`,});
const explainTopicFlow = ai.defineFlow( { name: 'explainTopicFlow', inputSchema: ExplainTopicInputSchema, outputSchema: ExplainTopicOutputSchema, }, async (input) => { const {output} = await explainTopicPrompt(input); if (!output) { throw new Error('No explanation was generated by the AI.'); } return output; });123
// This file is intentionally left empty as it's being removed.// The build system will delete it.1234567import {genkit} from 'genkit';import {googleAI} from '@genkit-ai/googleai';
export const ai = genkit({ plugins: [googleAI()], model: 'googleai/gemini-2.0-flash',});123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293@tailwind base;@tailwind components;@tailwind utilities;
body { font-family: 'Inter', sans-serif;}
@layer base { :root { --background: 0 0% 100%; /* White */ --foreground: 220 10% 10%; /* Very dark gray/near black */ --card: 0 0% 97%; /* Very light gray, almost white */ --card-foreground: 220 10% 10%; --popover: 0 0% 97%; --popover-foreground: 220 10% 10%; --primary: 217 91% 55%; /* Vibrant Blue (slightly darker for light theme) */ --primary-foreground: 0 0% 100%; /* White */ --secondary: 258 90% 60%; /* Vibrant Purple (slightly darker for light theme) */ --secondary-foreground: 0 0% 100%; /* White */ --muted: 220 15% 94%; /* Light gray */ --muted-foreground: 220 10% 45%; /* Mid gray */ --accent: 75 80% 45%; /* Vibrant Green (slightly darker/desaturated for light theme) */ --accent-foreground: 0 0% 100%; /* White */ --destructive: 0 84.2% 60.2%; --destructive-foreground: 0 0% 98%; --border: 220 15% 88%; /* Light gray border */ --input: 220 15% 92%; /* Light gray input background */ --ring: 217 91% 55%; /* Primary blue for focus rings */ --chart-1: 12 76% 61%; --chart-2: 173 58% 39%; --chart-3: 197 37% 24%; --chart-4: 43 74% 66%; --chart-5: 27 87% 67%; --radius: 0.5rem; /* Standard radius */
/* Sidebar variables for light theme */ --sidebar-background: 0 0% 96%; /* Slightly off-white */ --sidebar-foreground: 220 10% 20%; /* Dark gray */ --sidebar-primary: 217 91% 50%; /* Primary blue, slightly darker for sidebar */ --sidebar-primary-foreground: 0 0% 100%; /* White */ --sidebar-accent: 220 15% 90%; /* Lighter gray for hover/accent */ --sidebar-accent-foreground: 220 10% 15%; /* Darker text for accent */ --sidebar-border: 220 15% 85%; /* Light border */ --sidebar-ring: 217 91% 55%; }
.dark { --background: 220 7% 8%; /* Vite's #161618 - Very dark blue/gray */ --foreground: 240 8% 94%; /* Vite's #EFEFF0 - Light gray/white */ --card: 225 6% 13%; /* Vite's #202123 - Slightly lighter dark blue/gray */ --card-foreground: 240 8% 94%; --popover: 225 6% 13%; --popover-foreground: 240 8% 94%; --primary: 217 91% 60%; /* Vite's blue #3B82F6 */ --primary-foreground: 210 100% 97%; /* Very light color for contrast */ --secondary: 258 90% 66%; /* Vite's purple #8B5CF6 */ --secondary-foreground: 260 100% 97%; /* Very light for contrast */ --muted: 240 3% 18%; /* Slightly lighter than card for muted elements */ --muted-foreground: 240 5% 65%; /* A dimmer text color */ --accent: 75 94% 57%; /* Vite's green #74C042 */ --accent-foreground: 75 100% 10%; /* Dark green for text on accent */ --destructive: 0 70% 50%; /* Adjusted red for dark theme */ --destructive-foreground: 0 0% 95%; --border: 240 3% 23%; /* Vite's #3A3A3C */ --input: 225 6% 18%; /* Slightly lighter than card, for input fields */ --ring: 217 91% 60%; /* Primary blue for focus rings */ --chart-1: 220 70% 50%; --chart-2: 160 60% 45%; --chart-3: 30 80% 55%; --chart-4: 280 65% 60%; --chart-5: 340 75% 55%;
/* Sidebar variables for dark theme */ --sidebar-background: 225 6% 13%; /* Same as card */ --sidebar-foreground: 240 8% 94%; /* Same as foreground */ --sidebar-primary: 217 91% 60%; /* Primary blue */ --sidebar-primary-foreground: 210 100% 97%; --sidebar-accent: 225 6% 18%; /* Slightly lighter than sidebar-background for hover */ --sidebar-accent-foreground: 240 8% 94%; --sidebar-border: 240 3% 23%; /* Same as border */ --sidebar-ring: 217 91% 60%; }}
@layer base { * { @apply border-border; } body { @apply bg-background text-foreground; }}1234567891011121314151617181920212223242526272829303132
import type {Metadata} from 'next';import './globals.css';import { Toaster } from "@/components/ui/toaster";import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
export const metadata: Metadata = { title: 'Syllabus', description: 'M.Sc. (CS) Third Semester Syllabus',};
export default function RootLayout({ children,}: Readonly<{ children: React.ReactNode;}>) { return ( <html lang="en" suppressHydrationWarning className={inter.variable}> <head> {/* Removed Literata font import, Inter is handled by next/font */} </head> <body className="font-body antialiased min-h-screen flex flex-col"> <div className="flex-grow"> {children} </div> <Toaster /> </body> </html> );}123456789101112131415161718192021222324252627import { Header } from '@/components/layout/Header';import { Footer } from '@/components/layout/Footer';import { TableOfContents } from '@/components/syllabus/TableOfContents';import { CourseSection } from '@/components/syllabus/CourseSection';import { syllabusData } from '@/data/syllabusData';import { Separator } from '@/components/ui/separator';
export default function HomePage() { return ( <div className="flex flex-col min-h-screen bg-background"> <Header /> <main className="flex-grow container mx-auto px-4 py-8 md:px-6 md:py-12"> <div className="grid grid-cols-1 md:grid-cols-12 gap-8"> <aside className="md:col-span-4 lg:col-span-3"> <TableOfContents courses={syllabusData} /> </aside> <section className="md:col-span-8 lg:col-span-9 space-y-10"> {syllabusData.map((course, index) => ( <CourseSection key={index} course={course} /> ))} </section> </div> </main> <Footer /> </div> );}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
'use client';
import { useState, useEffect } from 'react';import { AlarmClock } from 'lucide-react';
interface TimeLeft { days?: number; hours?: number; minutes?: number; seconds?: number;}
interface ExamCountdownProps { targetDate: Date;}
export function ExamCountdown({ targetDate }: ExamCountdownProps) { const [timeLeft, setTimeLeft] = useState<TimeLeft | null>(null);
useEffect(() => { const calculateTimeLeft = (): TimeLeft => { const difference = +targetDate - +new Date(); let newTimeLeft: TimeLeft = {};
if (difference > 0) { newTimeLeft = { days: Math.floor(difference / (1000 * 60 * 60 * 24)), hours: Math.floor((difference / (1000 * 60 * 60)) % 24), minutes: Math.floor((difference / 1000 / 60) % 60), seconds: Math.floor((difference / 1000) % 60), }; } return newTimeLeft; };
// Initial calculation right after mount, only on client setTimeLeft(calculateTimeLeft());
const timer = setInterval(() => { setTimeLeft(calculateTimeLeft()); }, 1000);
return () => clearInterval(timer); }, [targetDate]);
if (timeLeft === null) { return <p className="text-sm text-foreground/70 mt-1.5">Calculating time until exam...</p>; }
const timerComponents: string[] = []; if (typeof timeLeft.days === 'number') timerComponents.push(`${timeLeft.days}d`); if (typeof timeLeft.hours === 'number') timerComponents.push(`${timeLeft.hours}h`); if (typeof timeLeft.minutes === 'number') timerComponents.push(`${timeLeft.minutes}m`); if (typeof timeLeft.seconds === 'number') timerComponents.push(`${timeLeft.seconds}s`);
if (timerComponents.length === 0 && +targetDate <= +new Date()) { return <p className="text-sm text-primary font-medium mt-1.5">The exam period has begun. Good luck!</p>; } if (timerComponents.length === 0) { return <p className="text-sm text-foreground/70 mt-1.5">Calculating time until exam...</p>; }
return ( <div className="mt-2 flex items-center text-sm text-primary font-medium bg-primary/10 px-2.5 py-1.5 rounded-md shadow-sm"> <AlarmClock size={16} className="mr-2 shrink-0" /> <span> Exam starts in: <strong>{timerComponents.join(' : ')}</strong> </span> </div> );}123456789101112131415
export function Footer() { return ( <footer className="bg-muted text-muted-foreground py-6 mt-12"> <div className="container mx-auto px-4 text-center"> <p className="text-sm"> © {new Date().getFullYear()} sameer banchhor . All rights reserved. </p> <p className="text-xs mt-1"> Slimshadow Inc. </p> </div> </footer> );}12345678910111213141516171819202122232425262728
import { GraduationCap } from 'lucide-react';import { ExamCountdown } from './ExamCountdown';import { ThemeToggle } from './ThemeToggle';
export function Header() { // Note: getFullYear() will be based on client's current year when ExamCountdown runs. // Month is 0-indexed, so 11 is December. const examDate = new Date(new Date().getFullYear(), 11, 22, 0, 0, 0);
return ( <header className="bg-background text-foreground border-b border-border"> <div className="container mx-auto px-4 py-6 md:px-8 md:py-8"> <div className="flex items-center justify-between"> <div className="flex items-center space-x-3"> <GraduationCap size={40} className="text-primary" /> <div> <h1 className="text-3xl font-bold font-headline">Syllabus</h1> <p className="text-lg text-foreground/80">M.Sc. (CS) - THIRD SEMESTER</p> <ExamCountdown targetDate={examDate} /> </div> </div> <ThemeToggle /> </div> </div> </header> );}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
'use client';
import { useState, useEffect } from 'react';import { Moon, Sun } from 'lucide-react';import { Button } from '@/components/ui/button';
export function ThemeToggle() { const [theme, setTheme] = useState<string | undefined>(undefined);
useEffect(() => { // Set initial theme based on localStorage or system preference const storedTheme = localStorage.getItem('theme'); const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (storedTheme) { setTheme(storedTheme); } else { setTheme(systemPrefersDark ? 'dark' : 'light'); } }, []);
useEffect(() => { // Apply theme to document and save to localStorage if (theme === 'dark') { document.documentElement.classList.add('dark'); localStorage.setItem('theme', 'dark'); } else if (theme === 'light') { document.documentElement.classList.remove('dark'); localStorage.setItem('theme', 'light'); } }, [theme]);
const toggleTheme = () => { setTheme(prevTheme => (prevTheme === 'light' ? 'dark' : 'light')); };
if (theme === undefined) { // Return a placeholder to avoid rendering mismatch during initial load // and to reserve space, matching the button's size. return <Button variant="ghost" size="icon" disabled className="h-9 w-9" />; }
return ( <Button variant="ghost" size="icon" onClick={toggleTheme} aria-label="Toggle theme" className="h-9 w-9"> {theme === 'light' ? <Moon className="h-5 w-5" /> : <Sun className="h-5 w-5" />} </Button> );}12345678910111213141516171819202122232425import { BookOpenText } from 'lucide-react';
interface BookListProps { books: string[];}
export function BookList({ books }: BookListProps) { if (!books || books.length === 0) { return null; }
return ( <div className="mt-8"> <h3 className="text-xl font-semibold mb-3 flex items-center font-headline text-primary"> <BookOpenText className="mr-2 h-5 w-5" /> Recommended Books </h3> <ul className="list-disc list-inside space-y-1 text-foreground/80"> {books.map((book, index) => ( <li key={index} className="text-sm ml-2">{book}</li> ))} </ul> </div> );}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
import type { SyllabusCourse, SyllabusPaper, SyllabusPractical } from '@/types/syllabus';import { slugify } from '@/lib/utils';import { Card, CardHeader, CardTitle, CardContent, CardDescription } from '@/components/ui/card';import { Badge } from '@/components/ui/badge';import { UnitDetails } from './UnitDetails';// import { BookList } from './BookList'; // Removed// import { ResourceLinks } from './ResourceLinks'; // Removedimport { PracticalDetails } from './PracticalDetails';import { FileText, FlaskConical, Info } from 'lucide-react';
interface CourseSectionProps { course: SyllabusCourse;}
export function CourseSection({ course }: CourseSectionProps) { const sectionId = slugify(course.title); const isPaper = course.type === 'paper'; const paper = course as SyllabusPaper; const practical = course as SyllabusPractical;
const Icon = isPaper ? FileText : FlaskConical;
return ( <Card id={sectionId} className="shadow-md rounded-lg overflow-hidden"> <CardHeader className="p-6"> <CardTitle className="text-2xl font-bold font-headline flex items-center text-primary"> <Icon className="mr-3 h-7 w-7" /> {course.title} </CardTitle> {course.maxMarks && course.minMarks && ( <div className="flex space-x-4 mt-2"> <Badge variant="outline">Max Marks: {course.maxMarks}</Badge> <Badge variant="outline">Min Marks: {course.minMarks}</Badge> </div> )} </CardHeader> <CardContent className="p-6"> {course.note && ( <CardDescription className="mb-6 p-4 border-l-4 border-accent bg-accent/10 rounded-r-md text-foreground/80 flex items-start"> <Info className="h-5 w-5 mr-2 mt-0.5 shrink-0 text-accent" /> <span><strong>Note:</strong> {course.note}</span> </CardDescription> )}
{/* Removed Course Outcomes section */} {/* {isPaper && paper.courseOutcomes && paper.courseOutcomes.length > 0 && ( <div className="mb-6"> <h3 className="text-xl font-semibold mb-3 flex items-center font-headline text-primary"> <ListChecks className="mr-2 h-5 w-5" /> Course Outcomes </h3> <ul className="list-disc list-inside space-y-1 text-foreground/80"> {paper.courseOutcomes.map((outcome, index) => ( <li key={index} className="text-sm ml-2">{outcome}</li> ))} </ul> </div> )} */}
{isPaper ? ( <> <UnitDetails units={paper.units} /> {/* <BookList books={paper.recommendedBooks} /> */} {/* Removed */} {/* <ResourceLinks links={paper.digitalPlatforms} /> */} {/* Removed */} </> ) : ( <PracticalDetails practical={practical} /> )} </CardContent> {/* Removed CardFooter */} {/* {isPaper && paper.digitalPlatforms.length > 0 && ( <CardFooter className="bg-muted/30 p-4 border-t"> <p className="text-xs text-muted-foreground"> Refer to "Suggested Digital Platforms" section for online resources. </p> </CardFooter> )} */} </Card> );}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
"use client";
import type { HierarchicalContentNode } from '@/types/syllabus';import { Folder, FileText, ChevronRight, Dot, Sparkles, Loader2 } from 'lucide-react';import { cn } from '@/lib/utils';import { Button } from '@/components/ui/button';import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle,} from "@/components/ui/alert-dialog";import React, { useState } from 'react';import { explainTopic } from '@/ai/flows/explain-topic-flow';
interface HierarchicalContentDisplayProps { nodes: HierarchicalContentNode[]; level?: number;}
const NodeDisplay: React.FC<{ node: HierarchicalContentNode; level: number }> = ({ node, level }) => { const hasChildren = node.children && node.children.length > 0;
const [isAlertOpen, setIsAlertOpen] = useState(false); const [alertContent, setAlertContent] = useState(''); const [alertTitle, setAlertTitle] = useState(''); const [isLoadingExplanation, setIsLoadingExplanation] = useState(false);
let paddingLeft; switch (level) { case 0: paddingLeft = 'pl-0'; break; case 1: paddingLeft = 'pl-4'; break; case 2: paddingLeft = 'pl-8'; break; case 3: paddingLeft = 'pl-12'; break; case 4: paddingLeft = 'pl-16'; break; default: paddingLeft = 'pl-20'; }
const handleExplainClick = async (topic: string) => { setAlertTitle(`Explanation for: ${topic}`); setAlertContent(''); setIsLoadingExplanation(true); setIsAlertOpen(true); try { const result = await explainTopic({ topicText: topic }); setAlertContent(result.explanation); } catch (error) { console.error("Error generating explanation:", error); setAlertContent('Sorry, I could not generate an explanation for this topic at the moment.'); } finally { setIsLoadingExplanation(false); } };
return ( <li className={cn('mb-1 flex flex-col', paddingLeft)}> <div className="flex items-start py-1 group"> {hasChildren ? ( <Folder size={18} className="mr-2 mt-0.5 text-primary shrink-0" /> ) : ( <Dot size={20} className="mr-1.5 mt-0.5 text-accent shrink-0" /> )} {node.isCode ? ( <code className="text-sm bg-muted/80 px-1.5 py-0.5 rounded font-mono text-foreground/90">{node.text}</code> ) : ( <span className="text-sm text-foreground/80">{node.text}</span> )} <Button variant="ghost" size="icon" className="ml-2 h-6 w-6 opacity-50 group-hover:opacity-100 transition-opacity" onClick={() => handleExplainClick(node.text)} title={`Get AI explanation for "${node.text}"`} > <Sparkles size={14} className="text-primary" /> </Button> </div> {hasChildren && ( <HierarchicalContentDisplay nodes={node.children!} level={level + 1} /> )} <AlertDialog open={isAlertOpen} onOpenChange={setIsAlertOpen}> <AlertDialogContent> <AlertDialogHeader> <AlertDialogTitle>{alertTitle}</AlertDialogTitle> {isLoadingExplanation ? ( <div className="flex items-center justify-center py-4 text-sm text-muted-foreground"> <Loader2 className="mr-2 h-6 w-6 animate-spin text-primary" /> <span>Generating explanation...</span> </div> ) : ( <div className="text-sm text-muted-foreground max-h-[60vh] overflow-y-auto whitespace-pre-line py-4"> {alertContent} </div> )} </AlertDialogHeader> <AlertDialogFooter> <AlertDialogAction onClick={() => setIsAlertOpen(false)}>Close</AlertDialogAction> </AlertDialogFooter> </AlertDialogContent> </AlertDialog> </li> );};
export function HierarchicalContentDisplay({ nodes, level = 0 }: HierarchicalContentDisplayProps) { if (!nodes || nodes.length === 0) { return null; }
return ( <ul className={cn('list-none space-y-1', level > 0 ? 'mt-1' : '')}> {nodes.map((node, index) => ( <NodeDisplay key={`${level}-${index}-${node.text.slice(0,10)}`} node={node} level={level} /> ))} </ul> );}1234567891011121314151617181920212223242526272829303132333435363738394041424344import type { SyllabusPractical } from '@/types/syllabus';import { ClipboardList, TerminalSquare, Code2 } from 'lucide-react'; // Terminal for Linux, Code2 for Java
interface PracticalDetailsProps { practical: SyllabusPractical;}
export function PracticalDetails({ practical }: PracticalDetailsProps) { const ProgramIcon = practical.title.toLowerCase().includes('linux') ? TerminalSquare : Code2;
return ( <div className="mt-6"> <h3 className="text-xl font-semibold mb-3 flex items-center font-headline text-primary"> <ClipboardList className="mr-2 h-5 w-5" /> Scheme of Examination </h3> <p className="text-sm text-foreground/80 mb-2">{practical.examinationSchemeIntro}</p> <ul className="list-disc list-inside space-y-1 text-sm text-foreground/80 mb-6"> {practical.examinationSchemeMarks.map((item, index) => ( <li key={index} className="ml-2">{item}</li> ))} </ul>
{practical.note && ( <p className="text-sm italic text-muted-foreground mb-4">Note: {practical.note}</p> )}
<h3 className="text-xl font-semibold mb-4 flex items-center font-headline text-primary"> <ProgramIcon className="mr-2 h-5 w-5" /> List of Practicals </h3> <div className="space-y-3"> {practical.programs.map((program, index) => ( <div key={program.id} className="p-3 border border-dashed border-accent/30 rounded-md bg-background hover:shadow-sm transition-shadow"> <p className="text-sm font-medium text-foreground"> <span className="text-accent">{index + 1}. </span> {program.description} </p> </div> ))} </div> </div> );}12345678910111213141516171819202122232425262728293031323334353637import type { SyllabusLink } from '@/types/syllabus';import { ExternalLink } from 'lucide-react';import { Button } from '@/components/ui/button';
interface ResourceLinksProps { links: SyllabusLink[];}
export function ResourceLinks({ links }: ResourceLinksProps) { if (!links || links.length === 0) { return null; }
return ( <div className="mt-8"> <h3 className="text-xl font-semibold mb-4 flex items-center font-headline text-primary"> <ExternalLink className="mr-2 h-5 w-5" /> Suggested Digital Platforms </h3> <div className="space-y-2"> {links.map((link, index) => ( <Button key={index} variant="outline" className="w-full justify-start text-left hover:bg-accent/10 hover:border-accent group transition-colors duration-200" asChild > <a href={link.url} target="_blank" rel="noopener noreferrer" className="flex items-center"> <span className="truncate group-hover:text-accent transition-colors duration-200">{link.text}</span> <ExternalLink className="ml-auto h-4 w-4 text-muted-foreground group-hover:text-accent transition-colors duration-200" /> </a> </Button> ))} </div> </div> );}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950import type { SyllabusCourse } from '@/types/syllabus';import { slugify } from '@/lib/utils';import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';import { ScrollArea } from '@/components/ui/scroll-area';import { Button } from '@/components/ui/button';import { ChevronRight, FileText, FlaskConical, BookOpenText } from 'lucide-react';
interface TableOfContentsProps { courses: SyllabusCourse[];}
export function TableOfContents({ courses }: TableOfContentsProps) { return ( <Card className="sticky top-8 shadow-md rounded-lg"> {/* Reduced shadow and rounding */} <CardHeader> <CardTitle className="flex items-center text-xl font-headline"> <BookOpenText className="mr-2 h-6 w-6 text-primary" /> Table of Contents </CardTitle> </CardHeader> <CardContent> <ScrollArea className="h-[calc(100vh-12rem)] pr-3"> <nav> <ul className="space-y-2"> {courses.map((course) => ( <li key={slugify(course.title)}> <Button variant="ghost" className="w-full justify-start text-left h-auto py-2 px-3 transition-colors duration-200 hover:bg-muted/50 group" /* Changed hover to muted/50 */ asChild > <a href={`#${slugify(course.title)}`} className="flex items-center"> {course.type === 'paper' ? ( <FileText className="mr-2 h-5 w-5 text-primary group-hover:text-primary transition-colors duration-200" /> /* Changed hover text to primary */ ) : ( <FlaskConical className="mr-2 h-5 w-5 text-primary group-hover:text-primary transition-colors duration-200" /> /* Changed hover text to primary */ )} <span className="flex-1 group-hover:text-primary transition-colors duration-200">{course.title}</span> {/* Changed hover text to primary */} <ChevronRight className="ml-auto h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors duration-200" /> {/* Changed hover text to primary */} </a> </Button> </li> ))} </ul> </nav> </ScrollArea> </CardContent> </Card> );}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
"use client";import type { SyllabusUnit } from '@/types/syllabus';import { Accordion, AccordionContent, AccordionItem, AccordionTrigger,} from '@/components/ui/accordion';import { NotebookText } from 'lucide-react';import { HierarchicalContentDisplay } from './HierarchicalContentDisplay'; // Import the new component
interface UnitDetailsProps { units: SyllabusUnit[];}
export function UnitDetails({ units }: UnitDetailsProps) { if (!units || units.length === 0) { return null; }
return ( <div className="mt-6"> <h3 className="text-xl font-semibold mb-3 flex items-center font-headline text-primary"> <NotebookText className="mr-2 h-5 w-5" /> Units </h3> <Accordion type="single" collapsible className="w-full"> {units.map((unit, index) => ( <AccordionItem value={`unit-${index + 1}`} key={`unit-${index + 1}-${unit.title}`} className="border-accent/20"> <AccordionTrigger className="text-md font-medium hover:text-accent transition-colors duration-200 py-3 text-left"> {unit.title} </AccordionTrigger> <AccordionContent> <div className="pt-2 pb-4"> {unit.structuredContent ? ( <HierarchicalContentDisplay nodes={unit.structuredContent} /> ) : ( // Fallback for any old data that might not have structuredContent <p className="text-sm leading-relaxed text-foreground/80 whitespace-pre-line"> Content not available in structured format. </p> )} </div> </AccordionContent> </AccordionItem> ))} </Accordion> </div> );}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"use client"
import * as React from "react"import * as AccordionPrimitive from "@radix-ui/react-accordion"import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils"
const Accordion = AccordionPrimitive.Root
const AccordionItem = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Item>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>>(({ className, ...props }, ref) => ( <AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />))AccordionItem.displayName = "AccordionItem"
const AccordionTrigger = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Trigger>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>>(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Header className="flex"> <AccordionPrimitive.Trigger ref={ref} className={cn( "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className )} {...props} > {children} <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" /> </AccordionPrimitive.Trigger> </AccordionPrimitive.Header>))AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
const AccordionContent = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Content>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>>(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Content ref={ref} className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down" {...props} > <div className={cn("pb-4 pt-0", className)}>{children}</div> </AccordionPrimitive.Content>))
AccordionContent.displayName = AccordionPrimitive.Content.displayName
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141"use client"
import * as React from "react"import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
import { cn } from "@/lib/utils"import { buttonVariants } from "@/components/ui/button"
const AlertDialog = AlertDialogPrimitive.Root
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
const AlertDialogPortal = AlertDialogPrimitive.Portal
const AlertDialogOverlay = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Overlay>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Overlay className={cn( "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className )} {...props} ref={ref} />))AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
const AlertDialogContent = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Content>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>>(({ className, ...props }, ref) => ( <AlertDialogPortal> <AlertDialogOverlay /> <AlertDialogPrimitive.Content ref={ref} className={cn( "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className )} {...props} /> </AlertDialogPortal>))AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
const AlertDialogHeader = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col space-y-2 text-center sm:text-left", className )} {...props} />)AlertDialogHeader.displayName = "AlertDialogHeader"
const AlertDialogFooter = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className )} {...props} />)AlertDialogFooter.displayName = "AlertDialogFooter"
const AlertDialogTitle = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Title>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold", className)} {...props} />))AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
const AlertDialogDescription = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Description>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />))AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName
const AlertDialogAction = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Action>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />))AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
const AlertDialogCancel = React.forwardRef< React.ElementRef<typeof AlertDialogPrimitive.Cancel>, React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>>(({ className, ...props }, ref) => ( <AlertDialogPrimitive.Cancel ref={ref} className={cn( buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className )} {...props} />))AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel,}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import * as React from "react"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const alertVariants = cva( "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", { variants: { variant: { default: "bg-background text-foreground", destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", }, }, defaultVariants: { variant: "default", }, })
const Alert = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>>(({ className, variant, ...props }, ref) => ( <div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />))Alert.displayName = "Alert"
const AlertTitle = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => ( <h5 ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props} />))AlertTitle.displayName = "AlertTitle"
const AlertDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("text-sm [&_p]:leading-relaxed", className)} {...props} />))AlertDescription.displayName = "AlertDescription"
export { Alert, AlertTitle, AlertDescription }1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950"use client"
import * as React from "react"import * as AvatarPrimitive from "@radix-ui/react-avatar"
import { cn } from "@/lib/utils"
const Avatar = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Root>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Root ref={ref} className={cn( "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className )} {...props} />))Avatar.displayName = AvatarPrimitive.Root.displayName
const AvatarImage = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Image>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Image ref={ref} className={cn("aspect-square h-full w-full", className)} {...props} />))AvatarImage.displayName = AvatarPrimitive.Image.displayName
const AvatarFallback = React.forwardRef< React.ElementRef<typeof AvatarPrimitive.Fallback>, React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>>(({ className, ...props }, ref) => ( <AvatarPrimitive.Fallback ref={ref} className={cn( "flex h-full w-full items-center justify-center rounded-full bg-muted", className )} {...props} />))AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
export { Avatar, AvatarImage, AvatarFallback }123456789101112131415161718192021222324252627282930313233343536import * as React from "react"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const badgeVariants = cva( "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { variant: { default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", outline: "text-foreground", }, }, defaultVariants: { variant: "default", }, })
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) { return ( <div className={cn(badgeVariants({ variant }), className)} {...props} /> )}
export { Badge, badgeVariants }1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import * as React from "react"import { Slot } from "@radix-ui/react-slot"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", }, }, defaultVariants: { variant: "default", size: "default", }, })
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> { asChild?: boolean}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button" return ( <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} /> ) })Button.displayName = "Button"
export { Button, buttonVariants }12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970"use client"
import * as React from "react"import { ChevronLeft, ChevronRight } from "lucide-react"import { DayPicker } from "react-day-picker"
import { cn } from "@/lib/utils"import { buttonVariants } from "@/components/ui/button"
export type CalendarProps = React.ComponentProps<typeof DayPicker>
function Calendar({ className, classNames, showOutsideDays = true, ...props}: CalendarProps) { return ( <DayPicker showOutsideDays={showOutsideDays} className={cn("p-3", className)} classNames={{ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", month: "space-y-4", caption: "flex justify-center pt-1 relative items-center", caption_label: "text-sm font-medium", nav: "space-x-1 flex items-center", nav_button: cn( buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100" ), nav_button_previous: "absolute left-1", nav_button_next: "absolute right-1", table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]", row: "flex w-full mt-2", cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20", day: cn( buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100" ), day_range_end: "day-range-end", day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", day_today: "bg-accent text-accent-foreground", day_outside: "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground", day_disabled: "text-muted-foreground opacity-50", day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground", day_hidden: "invisible", ...classNames, }} components={{ IconLeft: ({ className, ...props }) => ( <ChevronLeft className={cn("h-4 w-4", className)} {...props} /> ), IconRight: ({ className, ...props }) => ( <ChevronRight className={cn("h-4 w-4", className)} {...props} /> ), }} {...props} /> )}Calendar.displayName = "Calendar"
export { Calendar }12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import * as React from "react"
import { cn } from "@/lib/utils"
const Card = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn( "rounded-lg border bg-card text-card-foreground shadow-sm", className )} {...props} />))Card.displayName = "Card"
const CardHeader = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />))CardHeader.displayName = "CardHeader"
const CardTitle = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn( "text-2xl font-semibold leading-none tracking-tight", className )} {...props} />))CardTitle.displayName = "CardTitle"
const CardDescription = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />))CardDescription.displayName = "CardDescription"
const CardContent = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />))CardContent.displayName = "CardContent"
const CardFooter = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />))CardFooter.displayName = "CardFooter"
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365"use client"
import * as React from "react"import * as RechartsPrimitive from "recharts"
import { cn } from "@/lib/utils"
// Format: { THEME_NAME: CSS_SELECTOR }const THEMES = { light: "", dark: ".dark" } as const
export type ChartConfig = { [k in string]: { label?: React.ReactNode icon?: React.ComponentType } & ( | { color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> } )}
type ChartContextProps = { config: ChartConfig}
const ChartContext = React.createContext<ChartContextProps | null>(null)
function useChart() { const context = React.useContext(ChartContext)
if (!context) { throw new Error("useChart must be used within a <ChartContainer />") }
return context}
const ChartContainer = React.forwardRef< HTMLDivElement, React.ComponentProps<"div"> & { config: ChartConfig children: React.ComponentProps< typeof RechartsPrimitive.ResponsiveContainer >["children"] }>(({ id, className, children, config, ...props }, ref) => { const uniqueId = React.useId() const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
return ( <ChartContext.Provider value={{ config }}> <div data-chart={chartId} ref={ref} className={cn( "flex aspect-video justify-center text-xs [&_.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-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.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 [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className )} {...props} > <ChartStyle id={chartId} config={config} /> <RechartsPrimitive.ResponsiveContainer> {children} </RechartsPrimitive.ResponsiveContainer> </div> </ChartContext.Provider> )})ChartContainer.displayName = "Chart"
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { const colorConfig = Object.entries(config).filter( ([, config]) => config.theme || config.color )
if (!colorConfig.length) { return null }
return ( <style dangerouslySetInnerHTML={{ __html: Object.entries(THEMES) .map( ([theme, prefix]) => `${prefix} [data-chart=${id}] {${colorConfig .map(([key, itemConfig]) => { const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color return color ? ` --color-${key}: ${color};` : null }) .join("\n")}}` ) .join("\n"), }} /> )}
const ChartTooltip = RechartsPrimitive.Tooltip
const ChartTooltipContent = React.forwardRef< HTMLDivElement, React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & { hideLabel?: boolean hideIndicator?: boolean indicator?: "line" | "dot" | "dashed" nameKey?: string labelKey?: string }>( ( { active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }, ref ) => { const { config } = useChart()
const tooltipLabel = React.useMemo(() => { if (hideLabel || !payload?.length) { return null }
const [item] = payload const key = `${labelKey || item.dataKey || item.name || "value"}` const itemConfig = getPayloadConfigFromPayload(config, item, key) const value = !labelKey && typeof label === "string" ? config[label as keyof typeof config]?.label || label : itemConfig?.label
if (labelFormatter) { return ( <div className={cn("font-medium", labelClassName)}> {labelFormatter(value, payload)} </div> ) }
if (!value) { return null }
return <div className={cn("font-medium", labelClassName)}>{value}</div> }, [ label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey, ])
if (!active || !payload?.length) { return null }
const nestLabel = payload.length === 1 && indicator !== "dot"
return ( <div ref={ref} className={cn( "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className )} > {!nestLabel ? tooltipLabel : null} <div className="grid gap-1.5"> {payload.map((item, index) => { const key = `${nameKey || item.name || item.dataKey || "value"}` const itemConfig = getPayloadConfigFromPayload(config, item, key) const indicatorColor = color || item.payload.fill || item.color
return ( <div key={item.dataKey} className={cn( "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center" )} > {formatter && item?.value !== undefined && item.name ? ( formatter(item.value, item.name, item, index, item.payload) ) : ( <> {itemConfig?.icon ? ( <itemConfig.icon /> ) : ( !hideIndicator && ( <div className={cn( "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", { "h-2.5 w-2.5": indicator === "dot", "w-1": indicator === "line", "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed", "my-0.5": nestLabel && indicator === "dashed", } )} style={ { "--color-bg": indicatorColor, "--color-border": indicatorColor, } as React.CSSProperties } /> ) )} <div className={cn( "flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center" )} > <div className="grid gap-1.5"> {nestLabel ? tooltipLabel : null} <span className="text-muted-foreground"> {itemConfig?.label || item.name} </span> </div> {item.value && ( <span className="font-mono font-medium tabular-nums text-foreground"> {item.value.toLocaleString()} </span> )} </div> </> )} </div> ) })} </div> </div> ) })ChartTooltipContent.displayName = "ChartTooltip"
const ChartLegend = RechartsPrimitive.Legend
const ChartLegendContent = React.forwardRef< HTMLDivElement, React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & { hideIcon?: boolean nameKey?: string }>( ( { className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref ) => { const { config } = useChart()
if (!payload?.length) { return null }
return ( <div ref={ref} className={cn( "flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className )} > {payload.map((item) => { const key = `${nameKey || item.dataKey || "value"}` const itemConfig = getPayloadConfigFromPayload(config, item, key)
return ( <div key={item.value} className={cn( "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground" )} > {itemConfig?.icon && !hideIcon ? ( <itemConfig.icon /> ) : ( <div className="h-2 w-2 shrink-0 rounded-[2px]" style={{ backgroundColor: item.color, }} /> )} {itemConfig?.label} </div> ) })} </div> ) })ChartLegendContent.displayName = "ChartLegend"
// Helper to extract item config from a payload.function getPayloadConfigFromPayload( config: ChartConfig, payload: unknown, key: string) { if (typeof payload !== "object" || payload === null) { return undefined }
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : undefined
let configLabelKey: string = key
if ( key in payload && typeof payload[key as keyof typeof payload] === "string" ) { configLabelKey = payload[key as keyof typeof payload] as string } else if ( payloadPayload && key in payloadPayload && typeof payloadPayload[key as keyof typeof payloadPayload] === "string" ) { configLabelKey = payloadPayload[ key as keyof typeof payloadPayload ] as string }
return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]}
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle,}123456789101112131415161718192021222324252627282930"use client"
import * as React from "react"import * as CheckboxPrimitive from "@radix-ui/react-checkbox"import { Check } from "lucide-react"
import { cn } from "@/lib/utils"
const Checkbox = React.forwardRef< React.ElementRef<typeof CheckboxPrimitive.Root>, React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>>(({ className, ...props }, ref) => ( <CheckboxPrimitive.Root ref={ref} className={cn( "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className )} {...props} > <CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")} > <Check className="h-4 w-4" /> </CheckboxPrimitive.Indicator> </CheckboxPrimitive.Root>))Checkbox.displayName = CheckboxPrimitive.Root.displayName
export { Checkbox }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122"use client"
import * as React from "react"import * as DialogPrimitive from "@radix-ui/react-dialog"import { X } from "lucide-react"
import { cn } from "@/lib/utils"
const Dialog = DialogPrimitive.Root
const DialogTrigger = DialogPrimitive.Trigger
const DialogPortal = DialogPrimitive.Portal
const DialogClose = DialogPrimitive.Close
const DialogOverlay = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Overlay>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>>(({ className, ...props }, ref) => ( <DialogPrimitive.Overlay ref={ref} className={cn( "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className )} {...props} />))DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
const DialogContent = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Content>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>>(({ className, children, ...props }, ref) => ( <DialogPortal> <DialogOverlay /> <DialogPrimitive.Content ref={ref} className={cn( "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className )} {...props} > {children} <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"> <X className="h-4 w-4" /> <span className="sr-only">Close</span> </DialogPrimitive.Close> </DialogPrimitive.Content> </DialogPortal>))DialogContent.displayName = DialogPrimitive.Content.displayName
const DialogHeader = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col space-y-1.5 text-center sm:text-left", className )} {...props} />)DialogHeader.displayName = "DialogHeader"
const DialogFooter = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className )} {...props} />)DialogFooter.displayName = "DialogFooter"
const DialogTitle = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Title>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>>(({ className, ...props }, ref) => ( <DialogPrimitive.Title ref={ref} className={cn( "text-lg font-semibold leading-none tracking-tight", className )} {...props} />))DialogTitle.displayName = DialogPrimitive.Title.displayName
const DialogDescription = React.forwardRef< React.ElementRef<typeof DialogPrimitive.Description>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>>(({ className, ...props }, ref) => ( <DialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />))DialogDescription.displayName = DialogPrimitive.Description.displayName
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription,}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200"use client"
import * as React from "react"import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"import { Check, ChevronRight, Circle } from "lucide-react"
import { cn } from "@/lib/utils"
const DropdownMenu = DropdownMenuPrimitive.Root
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
const DropdownMenuGroup = DropdownMenuPrimitive.Group
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
const DropdownMenuSub = DropdownMenuPrimitive.Sub
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
const DropdownMenuSubTrigger = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }>(({ className, inset, children, ...props }, ref) => ( <DropdownMenuPrimitive.SubTrigger ref={ref} className={cn( "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className )} {...props} > {children} <ChevronRight className="ml-auto" /> </DropdownMenuPrimitive.SubTrigger>))DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
const DropdownMenuSubContent = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.SubContent>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>>(({ className, ...props }, ref) => ( <DropdownMenuPrimitive.SubContent ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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", className )} {...props} />))DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName
const DropdownMenuContent = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.Content>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>>(({ className, sideOffset = 4, ...props }, ref) => ( <DropdownMenuPrimitive.Portal> <DropdownMenuPrimitive.Content ref={ref} sideOffset={sideOffset} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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", className )} {...props} /> </DropdownMenuPrimitive.Portal>))DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
const DropdownMenuItem = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.Item>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }>(({ className, inset, ...props }, ref) => ( <DropdownMenuPrimitive.Item ref={ref} className={cn( "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className )} {...props} />))DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
const DropdownMenuCheckboxItem = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>>(({ className, children, checked, ...props }, ref) => ( <DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className )} checked={checked} {...props} > <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <DropdownMenuPrimitive.ItemIndicator> <Check className="h-4 w-4" /> </DropdownMenuPrimitive.ItemIndicator> </span> {children} </DropdownMenuPrimitive.CheckboxItem>))DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName
const DropdownMenuRadioItem = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>>(({ className, children, ...props }, ref) => ( <DropdownMenuPrimitive.RadioItem ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className )} {...props} > <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <DropdownMenuPrimitive.ItemIndicator> <Circle className="h-2 w-2 fill-current" /> </DropdownMenuPrimitive.ItemIndicator> </span> {children} </DropdownMenuPrimitive.RadioItem>))DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
const DropdownMenuLabel = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.Label>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }>(({ className, inset, ...props }, ref) => ( <DropdownMenuPrimitive.Label ref={ref} className={cn( "px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className )} {...props} />))DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
const DropdownMenuSeparator = React.forwardRef< React.ElementRef<typeof DropdownMenuPrimitive.Separator>, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>>(({ className, ...props }, ref) => ( <DropdownMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} />))DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
const DropdownMenuShortcut = ({ className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => { return ( <span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props} /> )}DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup,}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178"use client"
import * as React from "react"import * as LabelPrimitive from "@radix-ui/react-label"import { Slot } from "@radix-ui/react-slot"import { Controller, FormProvider, useFormContext, type ControllerProps, type FieldPath, type FieldValues,} from "react-hook-form"
import { cn } from "@/lib/utils"import { Label } from "@/components/ui/label"
const Form = FormProvider
type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = { name: TName}
const FormFieldContext = React.createContext<FormFieldContextValue>( {} as FormFieldContextValue)
const FormField = < TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props}: ControllerProps<TFieldValues, TName>) => { return ( <FormFieldContext.Provider value={{ name: props.name }}> <Controller {...props} /> </FormFieldContext.Provider> )}
const useFormField = () => { const fieldContext = React.useContext(FormFieldContext) const itemContext = React.useContext(FormItemContext) const { getFieldState, formState } = useFormContext()
const fieldState = getFieldState(fieldContext.name, formState)
if (!fieldContext) { throw new Error("useFormField should be used within <FormField>") }
const { id } = itemContext
return { id, name: fieldContext.name, formItemId: `${id}-form-item`, formDescriptionId: `${id}-form-item-description`, formMessageId: `${id}-form-item-message`, ...fieldState, }}
type FormItemContextValue = { id: string}
const FormItemContext = React.createContext<FormItemContextValue>( {} as FormItemContextValue)
const FormItem = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => { const id = React.useId()
return ( <FormItemContext.Provider value={{ id }}> <div ref={ref} className={cn("space-y-2", className)} {...props} /> </FormItemContext.Provider> )})FormItem.displayName = "FormItem"
const FormLabel = React.forwardRef< React.ElementRef<typeof LabelPrimitive.Root>, React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>>(({ className, ...props }, ref) => { const { error, formItemId } = useFormField()
return ( <Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props} /> )})FormLabel.displayName = "FormLabel"
const FormControl = React.forwardRef< React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(({ ...props }, ref) => { const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
return ( <Slot ref={ref} id={formItemId} aria-describedby={ !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}` } aria-invalid={!!error} {...props} /> )})FormControl.displayName = "FormControl"
const FormDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => { const { formDescriptionId } = useFormField()
return ( <p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-foreground", className)} {...props} /> )})FormDescription.displayName = "FormDescription"
const FormMessage = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, children, ...props }, ref) => { const { error, formMessageId } = useFormField() const body = error ? String(error?.message ?? "") : children
if (!body) { return null }
return ( <p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props} > {body} </p> )})FormMessage.displayName = "FormMessage"
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField,}12345678910111213141516171819202122import * as React from "react"
import { cn } from "@/lib/utils"
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>( ({ className, type, ...props }, ref) => { return ( <input type={type} className={cn( "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className )} ref={ref} {...props} /> ) })Input.displayName = "Input"
export { Input }1234567891011121314151617181920212223242526"use client"
import * as React from "react"import * as LabelPrimitive from "@radix-ui/react-label"import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const labelVariants = cva( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70")
const Label = React.forwardRef< React.ElementRef<typeof LabelPrimitive.Root>, React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>>(({ className, ...props }, ref) => ( <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />))Label.displayName = LabelPrimitive.Root.displayName
export { Label }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256"use client"
import * as React from "react"import * as MenubarPrimitive from "@radix-ui/react-menubar"import { Check, ChevronRight, Circle } from "lucide-react"
import { cn } from "@/lib/utils"
function MenubarMenu({ ...props}: React.ComponentProps<typeof MenubarPrimitive.Menu>) { return <MenubarPrimitive.Menu {...props} />}
function MenubarGroup({ ...props}: React.ComponentProps<typeof MenubarPrimitive.Group>) { return <MenubarPrimitive.Group {...props} />}
function MenubarPortal({ ...props}: React.ComponentProps<typeof MenubarPrimitive.Portal>) { return <MenubarPrimitive.Portal {...props} />}
function MenubarRadioGroup({ ...props}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) { return <MenubarPrimitive.RadioGroup {...props} />}
function MenubarSub({ ...props}: React.ComponentProps<typeof MenubarPrimitive.Sub>) { return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />}
const Menubar = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Root>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>>(({ className, ...props }, ref) => ( <MenubarPrimitive.Root ref={ref} className={cn( "flex h-10 items-center space-x-1 rounded-md border bg-background p-1", className )} {...props} />))Menubar.displayName = MenubarPrimitive.Root.displayName
const MenubarTrigger = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Trigger>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>>(({ className, ...props }, ref) => ( <MenubarPrimitive.Trigger ref={ref} className={cn( "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className )} {...props} />))MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
const MenubarSubTrigger = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.SubTrigger>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & { inset?: boolean }>(({ className, inset, children, ...props }, ref) => ( <MenubarPrimitive.SubTrigger ref={ref} className={cn( "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className )} {...props} > {children} <ChevronRight className="ml-auto h-4 w-4" /> </MenubarPrimitive.SubTrigger>))MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
const MenubarSubContent = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.SubContent>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>>(({ className, ...props }, ref) => ( <MenubarPrimitive.SubContent ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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", className )} {...props} />))MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
const MenubarContent = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Content>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>>( ( { className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref ) => ( <MenubarPrimitive.Portal> <MenubarPrimitive.Content ref={ref} align={align} alignOffset={alignOffset} sideOffset={sideOffset} className={cn( "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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", className )} {...props} /> </MenubarPrimitive.Portal> ))MenubarContent.displayName = MenubarPrimitive.Content.displayName
const MenubarItem = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Item>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & { inset?: boolean }>(({ className, inset, ...props }, ref) => ( <MenubarPrimitive.Item ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className )} {...props} />))MenubarItem.displayName = MenubarPrimitive.Item.displayName
const MenubarCheckboxItem = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.CheckboxItem>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>>(({ className, children, checked, ...props }, ref) => ( <MenubarPrimitive.CheckboxItem ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className )} checked={checked} {...props} > <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <MenubarPrimitive.ItemIndicator> <Check className="h-4 w-4" /> </MenubarPrimitive.ItemIndicator> </span> {children} </MenubarPrimitive.CheckboxItem>))MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
const MenubarRadioItem = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.RadioItem>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>>(({ className, children, ...props }, ref) => ( <MenubarPrimitive.RadioItem ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className )} {...props} > <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <MenubarPrimitive.ItemIndicator> <Circle className="h-2 w-2 fill-current" /> </MenubarPrimitive.ItemIndicator> </span> {children} </MenubarPrimitive.RadioItem>))MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
const MenubarLabel = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Label>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & { inset?: boolean }>(({ className, inset, ...props }, ref) => ( <MenubarPrimitive.Label ref={ref} className={cn( "px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className )} {...props} />))MenubarLabel.displayName = MenubarPrimitive.Label.displayName
const MenubarSeparator = React.forwardRef< React.ElementRef<typeof MenubarPrimitive.Separator>, React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>>(({ className, ...props }, ref) => ( <MenubarPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} />))MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
const MenubarShortcut = ({ className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => { return ( <span className={cn( "ml-auto text-xs tracking-widest text-muted-foreground", className )} {...props} /> )}MenubarShortcut.displayname = "MenubarShortcut"
export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut,}12345678910111213141516171819202122232425262728293031"use client"
import * as React from "react"import * as PopoverPrimitive from "@radix-ui/react-popover"
import { cn } from "@/lib/utils"
const Popover = PopoverPrimitive.Root
const PopoverTrigger = PopoverPrimitive.Trigger
const PopoverContent = React.forwardRef< React.ElementRef<typeof PopoverPrimitive.Content>, React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( <PopoverPrimitive.Portal> <PopoverPrimitive.Content ref={ref} align={align} sideOffset={sideOffset} className={cn( "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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", className )} {...props} /> </PopoverPrimitive.Portal>))PopoverContent.displayName = PopoverPrimitive.Content.displayName
export { Popover, PopoverTrigger, PopoverContent }12345678910111213141516171819202122232425262728"use client"
import * as React from "react"import * as ProgressPrimitive from "@radix-ui/react-progress"
import { cn } from "@/lib/utils"
const Progress = React.forwardRef< React.ElementRef<typeof ProgressPrimitive.Root>, React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>>(({ className, value, ...props }, ref) => ( <ProgressPrimitive.Root ref={ref} className={cn( "relative h-4 w-full overflow-hidden rounded-full bg-secondary", className )} {...props} > <ProgressPrimitive.Indicator className="h-full w-full flex-1 bg-primary transition-all" style={{ transform: `translateX(-${100 - (value || 0)}%)` }} /> </ProgressPrimitive.Root>))Progress.displayName = ProgressPrimitive.Root.displayName
export { Progress }1234567891011121314151617181920212223242526272829303132333435363738394041424344"use client"
import * as React from "react"import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"import { Circle } from "lucide-react"
import { cn } from "@/lib/utils"
const RadioGroup = React.forwardRef< React.ElementRef<typeof RadioGroupPrimitive.Root>, React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>>(({ className, ...props }, ref) => { return ( <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} /> )})RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
const RadioGroupItem = React.forwardRef< React.ElementRef<typeof RadioGroupPrimitive.Item>, React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>>(({ className, ...props }, ref) => { return ( <RadioGroupPrimitive.Item ref={ref} className={cn( "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className )} {...props} > <RadioGroupPrimitive.Indicator className="flex items-center justify-center"> <Circle className="h-2.5 w-2.5 fill-current text-current" /> </RadioGroupPrimitive.Indicator> </RadioGroupPrimitive.Item> )})RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
export { RadioGroup, RadioGroupItem }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748"use client"
import * as React from "react"import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
import { cn } from "@/lib/utils"
const ScrollArea = React.forwardRef< React.ElementRef<typeof ScrollAreaPrimitive.Root>, React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>>(({ className, children, ...props }, ref) => ( <ScrollAreaPrimitive.Root ref={ref} className={cn("relative overflow-hidden", className)} {...props} > <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]"> {children} </ScrollAreaPrimitive.Viewport> <ScrollBar /> <ScrollAreaPrimitive.Corner /> </ScrollAreaPrimitive.Root>))ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
const ScrollBar = React.forwardRef< React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>, React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>>(({ className, orientation = "vertical", ...props }, ref) => ( <ScrollAreaPrimitive.ScrollAreaScrollbar ref={ref} orientation={orientation} className={cn( "flex touch-none select-none transition-colors", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", className )} {...props} > <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" /> </ScrollAreaPrimitive.ScrollAreaScrollbar>))ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
export { ScrollArea, ScrollBar }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160"use client"
import * as React from "react"import * as SelectPrimitive from "@radix-ui/react-select"import { Check, ChevronDown, ChevronUp } from "lucide-react"
import { cn } from "@/lib/utils"
const Select = SelectPrimitive.Root
const SelectGroup = SelectPrimitive.Group
const SelectValue = SelectPrimitive.Value
const SelectTrigger = React.forwardRef< React.ElementRef<typeof SelectPrimitive.Trigger>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>>(({ className, children, ...props }, ref) => ( <SelectPrimitive.Trigger ref={ref} className={cn( "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className )} {...props} > {children} <SelectPrimitive.Icon asChild> <ChevronDown className="h-4 w-4 opacity-50" /> </SelectPrimitive.Icon> </SelectPrimitive.Trigger>))SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
const SelectScrollUpButton = React.forwardRef< React.ElementRef<typeof SelectPrimitive.ScrollUpButton>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>>(({ className, ...props }, ref) => ( <SelectPrimitive.ScrollUpButton ref={ref} className={cn( "flex cursor-default items-center justify-center py-1", className )} {...props} > <ChevronUp className="h-4 w-4" /> </SelectPrimitive.ScrollUpButton>))SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
const SelectScrollDownButton = React.forwardRef< React.ElementRef<typeof SelectPrimitive.ScrollDownButton>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>>(({ className, ...props }, ref) => ( <SelectPrimitive.ScrollDownButton ref={ref} className={cn( "flex cursor-default items-center justify-center py-1", className )} {...props} > <ChevronDown className="h-4 w-4" /> </SelectPrimitive.ScrollDownButton>))SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName
const SelectContent = React.forwardRef< React.ElementRef<typeof SelectPrimitive.Content>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>>(({ className, children, position = "popper", ...props }, ref) => ( <SelectPrimitive.Portal> <SelectPrimitive.Content ref={ref} className={cn( "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className )} position={position} {...props} > <SelectScrollUpButton /> <SelectPrimitive.Viewport className={cn( "p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]" )} > {children} </SelectPrimitive.Viewport> <SelectScrollDownButton /> </SelectPrimitive.Content> </SelectPrimitive.Portal>))SelectContent.displayName = SelectPrimitive.Content.displayName
const SelectLabel = React.forwardRef< React.ElementRef<typeof SelectPrimitive.Label>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>>(({ className, ...props }, ref) => ( <SelectPrimitive.Label ref={ref} className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)} {...props} />))SelectLabel.displayName = SelectPrimitive.Label.displayName
const SelectItem = React.forwardRef< React.ElementRef<typeof SelectPrimitive.Item>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>>(({ className, children, ...props }, ref) => ( <SelectPrimitive.Item ref={ref} className={cn( "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className )} {...props} > <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> <SelectPrimitive.ItemIndicator> <Check className="h-4 w-4" /> </SelectPrimitive.ItemIndicator> </span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText> </SelectPrimitive.Item>))SelectItem.displayName = SelectPrimitive.Item.displayName
const SelectSeparator = React.forwardRef< React.ElementRef<typeof SelectPrimitive.Separator>, React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>>(({ className, ...props }, ref) => ( <SelectPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} />))SelectSeparator.displayName = SelectPrimitive.Separator.displayName
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton,}12345678910111213141516171819202122232425262728293031"use client"
import * as React from "react"import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from "@/lib/utils"
const Separator = React.forwardRef< React.ElementRef<typeof SeparatorPrimitive.Root>, React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>>( ( { className, orientation = "horizontal", decorative = true, ...props }, ref ) => ( <SeparatorPrimitive.Root ref={ref} decorative={decorative} orientation={orientation} className={cn( "shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className )} {...props} /> ))Separator.displayName = SeparatorPrimitive.Root.displayName
export { Separator }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140"use client"
import * as React from "react"import * as SheetPrimitive from "@radix-ui/react-dialog"import { cva, type VariantProps } from "class-variance-authority"import { X } from "lucide-react"
import { cn } from "@/lib/utils"
const Sheet = SheetPrimitive.Root
const SheetTrigger = SheetPrimitive.Trigger
const SheetClose = SheetPrimitive.Close
const SheetPortal = SheetPrimitive.Portal
const SheetOverlay = React.forwardRef< React.ElementRef<typeof SheetPrimitive.Overlay>, React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>>(({ className, ...props }, ref) => ( <SheetPrimitive.Overlay className={cn( "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className )} {...props} ref={ref} />))SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
const sheetVariants = cva( "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", { variants: { side: { top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", }, }, defaultVariants: { side: "right", }, })
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {}
const SheetContent = React.forwardRef< React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(({ side = "right", className, children, ...props }, ref) => ( <SheetPortal> <SheetOverlay /> <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props} > {children} <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"> <X className="h-4 w-4" /> <span className="sr-only">Close</span> </SheetPrimitive.Close> </SheetPrimitive.Content> </SheetPortal>))SheetContent.displayName = SheetPrimitive.Content.displayName
const SheetHeader = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col space-y-2 text-center sm:text-left", className )} {...props} />)SheetHeader.displayName = "SheetHeader"
const SheetFooter = ({ className, ...props}: React.HTMLAttributes<HTMLDivElement>) => ( <div className={cn( "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className )} {...props} />)SheetFooter.displayName = "SheetFooter"
const SheetTitle = React.forwardRef< React.ElementRef<typeof SheetPrimitive.Title>, React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>>(({ className, ...props }, ref) => ( <SheetPrimitive.Title ref={ref} className={cn("text-lg font-semibold text-foreground", className)} {...props} />))SheetTitle.displayName = SheetPrimitive.Title.displayName
const SheetDescription = React.forwardRef< React.ElementRef<typeof SheetPrimitive.Description>, React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>>(({ className, ...props }, ref) => ( <SheetPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />))SheetDescription.displayName = SheetPrimitive.Description.displayName
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription,}DockerfileAdded+28
apphosting.yamlAdded+7
components.jsonAdded+21
next-env.d.tsAdded+5
next.config.tsAdded+23
package-lock.jsonAdded
package.jsonAdded+65
postcss.config.mjsAdded+8
src/ai/dev.tsAdded+4
src/ai/flows/explain-topic-flow.tsAdded+57
src/ai/flows/structure-text-flow.tsAdded+3
src/ai/genkit.tsAdded+7
src/app/favicon.icoAdded
src/app/globals.cssAdded+93
src/app/layout.tsxAdded+32
src/app/page.tsxAdded+27
src/components/layout/ExamCountdown.tsxAdded+74
src/components/layout/Footer.tsxAdded+15
src/components/layout/Header.tsxAdded+28
src/components/layout/ThemeToggle.tsxAdded+49
src/components/syllabus/BookList.tsxAdded+25
src/components/syllabus/CourseSection.tsxAdded+85
src/components/syllabus/HierarchicalContentDisplay.tsxAdded+122
src/components/syllabus/PracticalDetails.tsxAdded+44
src/components/syllabus/ResourceLinks.tsxAdded+37
src/components/syllabus/TableOfContents.tsxAdded+50
src/components/syllabus/UnitDetails.tsxAdded+51
src/components/ui/accordion.tsxAdded+58
src/components/ui/alert-dialog.tsxAdded+141
src/components/ui/alert.tsxAdded+59
src/components/ui/avatar.tsxAdded+50
src/components/ui/badge.tsxAdded+36
src/components/ui/button.tsxAdded+56
src/components/ui/calendar.tsxAdded+70
src/components/ui/card.tsxAdded+79
src/components/ui/chart.tsxAdded+365
src/components/ui/checkbox.tsxAdded+30
src/components/ui/dialog.tsxAdded+122
src/components/ui/dropdown-menu.tsxAdded+200
src/components/ui/form.tsxAdded+178
src/components/ui/input.tsxAdded+22
src/components/ui/label.tsxAdded+26
src/components/ui/menubar.tsxAdded+256
src/components/ui/popover.tsxAdded+31
src/components/ui/progress.tsxAdded+28
src/components/ui/radio-group.tsxAdded+44
src/components/ui/scroll-area.tsxAdded+48
src/components/ui/select.tsxAdded+160
src/components/ui/separator.tsxAdded+31
src/components/ui/sheet.tsxAdded+140