-
+
+
Tab navigation is trapped within this box:
Last element (Tab goes back to first)
diff --git a/src/pages/form-submit.tsx b/src/pages/form-submit.tsx
deleted file mode 100644
index 992f7d5..0000000
--- a/src/pages/form-submit.tsx
+++ /dev/null
@@ -1,279 +0,0 @@
-import React, { useState } from "react";
-import { motion } from "framer-motion";
-import {
- CheckCircle,
- Mail,
- MessageSquare,
- RotateCcw,
- Send,
- User,
-} from "lucide-react";
-import { Layout } from "@/components/layout";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Textarea } from "@/components/ui/textarea";
-
-export default function FormSubmit() {
- const [formData, setFormData] = useState({
- firstName: "",
- lastName: "",
- email: "",
- message: "",
- });
- const [submittedData, setSubmittedData] = useState
(
- null,
- );
- const [submitCount, setSubmitCount] = useState(0);
-
- const handleSubmit = (e: React.FormEvent) => {
- e.preventDefault();
- setSubmittedData({ ...formData });
- setSubmitCount((count) => count + 1);
- };
-
- const handleReset = () => {
- setFormData({
- firstName: "",
- lastName: "",
- email: "",
- message: "",
- });
- setSubmittedData(null);
- };
-
- return (
-
-
-
-
-
- Form Submit Test
-
-
- Test form submission and validation handling
-
-
-
-
-
-
-
-
- Contact Form
-
-
- Fill out the form to test submission
-
-
-
-
-
-
-
-
-
-
-
- Form Status
-
-
- View submission results and manage data
-
-
-
-
-
-
-
Quick Actions
-
-
- setFormData({
- firstName: "John",
- lastName: "Doe",
- email: "john.doe@example.com",
- message: "This is a test message.",
- })
- }
- variant="outline"
- size="sm"
- >
- Fill Sample Data
-
- setSubmittedData(null)}
- variant="outline"
- size="sm"
- >
- Clear Results
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/pages/forms.tsx b/src/pages/forms.tsx
index 23c29db..d4f26b4 100644
--- a/src/pages/forms.tsx
+++ b/src/pages/forms.tsx
@@ -1,6 +1,16 @@
import React, { useState } from "react";
import { motion } from "framer-motion";
-import { AlertCircle, CheckCircle, FileText, Save } from "lucide-react";
+import {
+ AlertCircle,
+ CheckCircle,
+ FileText,
+ Mail,
+ MessageSquare,
+ RotateCcw,
+ Save,
+ Send,
+ User,
+} from "lucide-react";
import { Layout } from "@/components/layout";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -24,11 +34,25 @@ import {
} from "@/components/ui/select";
import { Slider } from "@/components/ui/slider";
import { Switch } from "@/components/ui/switch";
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import { toast } from "@/hooks/use-toast";
export default function Forms() {
- const [formData, setFormData] = useState({
+ // Simple form state
+ const [simpleForm, setSimpleForm] = useState({
+ firstName: "",
+ lastName: "",
+ email: "",
+ message: "",
+ });
+ const [submittedData, setSubmittedData] = useState(
+ null,
+ );
+ const [submitCount, setSubmitCount] = useState(0);
+
+ // Complex form state
+ const [complexForm, setComplexForm] = useState({
username: "",
email: "",
password: "",
@@ -41,49 +65,64 @@ export default function Forms() {
newsletter: false,
privacy: false,
});
-
const [errors, setErrors] = useState>({});
- const [submitted, setSubmitted] = useState(false);
+ const [complexSubmitted, setComplexSubmitted] = useState(false);
+
+ // Simple form handlers
+ const handleSimpleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ setSubmittedData({ ...simpleForm });
+ setSubmitCount((count) => count + 1);
+ toast({
+ title: "Simple form submitted!",
+ description: "Check the submission details below.",
+ });
+ };
- const validateForm = () => {
+ const handleSimpleReset = () => {
+ setSimpleForm({
+ firstName: "",
+ lastName: "",
+ email: "",
+ message: "",
+ });
+ setSubmittedData(null);
+ setSubmitCount(0);
+ };
+
+ // Complex form handlers
+ const validateComplexForm = () => {
const newErrors: Record = {};
- if (!formData.username) newErrors.username = "Username is required";
- if (!formData.email) newErrors.email = "Email is required";
- else if (!/\S+@\S+\.\S+/.test(formData.email))
- newErrors.email = "Email is invalid";
- if (!formData.password) newErrors.password = "Password is required";
- else if (formData.password.length < 6)
- newErrors.password = "Password must be at least 6 characters";
- if (!formData.country) newErrors.country = "Please select a country";
- if (!formData.terms) newErrors.terms = "You must accept the terms";
+ if (!complexForm.username) newErrors.username = "Username is required";
+ if (!complexForm.email) newErrors.email = "Email is required";
+ if (!complexForm.password) newErrors.password = "Password is required";
+ if (!complexForm.country) newErrors.country = "Please select a country";
+ if (!complexForm.terms) newErrors.terms = "You must accept the terms";
setErrors(newErrors);
return Object.keys(newErrors).length === 0;
};
- const handleSubmit = (e: React.FormEvent) => {
+ const handleComplexSubmit = (e: React.FormEvent) => {
e.preventDefault();
-
- if (validateForm()) {
- setSubmitted(true);
+ if (validateComplexForm()) {
+ setComplexSubmitted(true);
toast({
- title: "Form Submitted Successfully!",
- description:
- "Your form has been submitted with all validations passed.",
+ title: "Complex form submitted successfully!",
+ description: "All validations passed.",
});
- console.log("Form Data:", formData);
} else {
toast({
- title: "Validation Failed",
- description: "Please fix the errors in the form.",
+ title: "Validation failed",
+ description: "Please fix the errors and try again.",
variant: "destructive",
});
}
};
- const handleReset = () => {
- setFormData({
+ const handleComplexReset = () => {
+ setComplexForm({
username: "",
email: "",
password: "",
@@ -97,340 +136,534 @@ export default function Forms() {
privacy: false,
});
setErrors({});
- setSubmitted(false);
+ setComplexSubmitted(false);
+ };
+
+ const pageVariants = {
+ initial: { opacity: 0, y: 20 },
+ in: { opacity: 1, y: 0 },
+ out: { opacity: 0, y: -20 },
};
return (
-
-
-
+
+
+
- Form Elements Test
+ Form Examples
- Comprehensive form with all input types and validation
+ Test various form implementations from simple to complex
-
+
-
-
-
-
-
- Basic Information
-
-
- Enter your basic account information
-
-
-
-
-
Username *
-
- setFormData({ ...formData, username: e.target.value })
- }
- className={errors.username ? "border-destructive" : ""}
- />
- {errors.username && (
-
-
- {errors.username}
-
- )}
-
+
+
+ Simple Form
+ Complex Form
+
-
-
Email *
-
- setFormData({ ...formData, email: e.target.value })
- }
- className={errors.email ? "border-destructive" : ""}
- />
- {errors.email && (
-
-
- {errors.email}
-
- )}
-
+
+
+ {/* Simple Form */}
+
+
+
+
+ Contact Form
+
+
+ A simple form with basic validation and submission
+
+
+
+
+
+
+
+
+ Email
+
+
+ setSimpleForm({
+ ...simpleForm,
+ email: e.target.value,
+ })
+ }
+ placeholder="john.doe@example.com"
+ required
+ />
+
+
+
+
+ Message
+
+
+ setSimpleForm({
+ ...simpleForm,
+ message: e.target.value,
+ })
+ }
+ placeholder="Enter your message here..."
+ rows={4}
+ required
+ />
+
+
+
+
+ Submit Form
+
+
+
+ Reset
+
+
+
+
+
-
-
Password *
-
- setFormData({ ...formData, password: e.target.value })
- }
- className={errors.password ? "border-destructive" : ""}
- />
- {errors.password && (
-
-
- {errors.password}
-
- )}
-
+ {/* Submission Details */}
+
+
+
+
+
+ Submission Details
+
+
+ Form data after submission
+
+
+
+ {submittedData ? (
+
+ {Object.entries(submittedData).map(([key, value]) => (
+
+
+ {key.replace(/([A-Z])/g, " $1").trim()}:
+
+
+ {value || "N/A"}
+
+
+ ))}
+
+ ) : (
+
+ No data submitted yet
+
+ )}
+
+
-
-
Bio
-
- setFormData({ ...formData, bio: e.target.value })
- }
- className="min-h-[100px]"
- />
+
+
+ Form Statistics
+
+
+
+ Submit Count:
+
+ {submitCount}
+
+
+
+
-
-
+
+
-
-
- Preferences
- Customize your experience
-
-
-
-
Country *
-
- setFormData({ ...formData, country: value })
- }
- >
-
+
+ {/* Complex Form */}
+
+
+
+
+ Advanced Form
+
+
+ Complex form with various input types and validation
+
+
+
+
-
-
-
- United States
- United Kingdom
- Canada
- Australia
- Germany
- France
- Japan
-
-
- {errors.country && (
-
-
- {errors.country}
-
- )}
-
+ {/* Text Inputs */}
+
+
+
Username
+
+ setComplexForm({
+ ...complexForm,
+ username: e.target.value,
+ })
+ }
+ className={errors.username ? "border-red-500" : ""}
+ />
+ {errors.username && (
+
+ {errors.username}
+
+ )}
+
-
-
-
Email Notifications
-
- Receive emails about your account activity
-
-
-
- setFormData({ ...formData, notifications: checked })
- }
- />
-
+
+
Email
+
+ setComplexForm({
+ ...complexForm,
+ email: e.target.value,
+ })
+ }
+ className={errors.email ? "border-red-500" : ""}
+ />
+ {errors.email && (
+
+ {errors.email}
+
+ )}
+
-
-
Theme Preference
-
- setFormData({ ...formData, theme: value })
- }
- >
-
-
- Light
-
-
-
- Dark
-
-
-
- System
-
-
-
+
+
Password
+
+ setComplexForm({
+ ...complexForm,
+ password: e.target.value,
+ })
+ }
+ className={errors.password ? "border-red-500" : ""}
+ />
+ {errors.password && (
+
+ {errors.password}
+
+ )}
+
+
-
-
- Volume Level: {formData.volume[0]}%
-
-
- setFormData({ ...formData, volume: value })
- }
- className="w-full"
- />
-
-
-
+ {/* Textarea */}
+
+ Bio
+
+ setComplexForm({
+ ...complexForm,
+ bio: e.target.value,
+ })
+ }
+ placeholder="Tell us about yourself..."
+ rows={3}
+ />
+
-
-
- Legal Agreements
-
- Please review and accept our terms
-
-
-
-
-
- setFormData({ ...formData, terms: checked as boolean })
- }
- />
-
- I accept the terms and conditions *
-
-
+ {/* Select */}
+
+
Country
+
+ setComplexForm({ ...complexForm, country: value })
+ }
+ >
+
+
+
+
+ United States
+ United Kingdom
+ Canada
+ Australia
+
+
+ {errors.country && (
+
+ {errors.country}
+
+ )}
+
-
-
- setFormData({
- ...formData,
- newsletter: checked as boolean,
- })
- }
- />
-
- Subscribe to our newsletter
-
-
+ {/* Switch */}
+
+
+ Email Notifications
+
+
+ setComplexForm({
+ ...complexForm,
+ notifications: checked,
+ })
+ }
+ />
+
-
-
- setFormData({ ...formData, privacy: checked as boolean })
- }
- />
-
- I have read the privacy policy
-
-
-
-
+ {/* Radio Group */}
+
+
Theme Preference
+
+ setComplexForm({ ...complexForm, theme: value })
+ }
+ >
+
+
+ Light
+
+
+
+ Dark
+
+
+
+ System
+
+
+
-
-
-
-
-
- Submit Form
-
-
- Reset
-
-
-
-
-
+ {/* Slider */}
+
+ Volume: {complexForm.volume[0]}%
+
+ setComplexForm({ ...complexForm, volume: value })
+ }
+ max={100}
+ step={1}
+ />
+
+
+ {/* Checkboxes */}
+
+
+
+ setComplexForm({
+ ...complexForm,
+ terms: checked as boolean,
+ })
+ }
+ />
+
+ I accept the terms and conditions
+
+
+
+
+ setComplexForm({
+ ...complexForm,
+ newsletter: checked as boolean,
+ })
+ }
+ />
+
+ Subscribe to newsletter
+
+
+
+
+ setComplexForm({
+ ...complexForm,
+ privacy: checked as boolean,
+ })
+ }
+ />
+
+ I agree to the privacy policy
+
+
+
+
+ {/* Submit Buttons */}
+
+
+
+ Submit Form
+
+
+
+ Reset
+
+
+
+
+
- {submitted && (
-
-
-
-
-
- Form Submitted Successfully!
-
-
-
-
- Here's what was submitted:
-
-
-
- Username:
- {formData.username}
-
-
- Email:
- {formData.email}
-
-
- Country:
- {formData.country}
-
-
- Theme:
- {formData.theme}
-
-
- Notifications:
-
- {formData.notifications ? "Enabled" : "Disabled"}
-
-
-
- Volume:
- {formData.volume[0]}%
-
-
-
-
-
- )}
-
-
+ {/* Status Card */}
+
+
+
+ Form Status
+
+
+
+
+ Validation Errors:
+ 0
+ ? "destructive"
+ : "secondary"
+ }
+ >
+ {Object.keys(errors).length}
+
+
+
+ Form Status:
+
+ {complexSubmitted ? "Submitted" : "Not Submitted"}
+
+
+
+
+
+
+ {/* Validation Summary */}
+ {Object.keys(errors).length > 0 && (
+
+
+
+
+ Validation Errors
+
+
+
+
+ {Object.entries(errors).map(([field, error]) => (
+
+ • {error}
+
+ ))}
+
+
+
+ )}
+
+ {/* Success Message */}
+ {complexSubmitted && (
+
+
+
+
+ Success!
+
+
+
+ Form submitted successfully with all data valid.
+
+
+ )}
+
+
+
+
+
+
);
}
diff --git a/src/pages/hover.tsx b/src/pages/hover.tsx
index b8e2be9..48d273d 100644
--- a/src/pages/hover.tsx
+++ b/src/pages/hover.tsx
@@ -147,10 +147,10 @@ export default function Hover() {
onMouseMove={handleMouseMove}
onMouseEnter={() => setHoveredItem("tracker")}
onMouseLeave={() => setHoveredItem(null)}
- className="relative h-48 w-full overflow-hidden rounded-lg border-2 border-gray-300 bg-gray-100"
+ className="relative h-48 w-full overflow-hidden rounded-lg border-2 border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800"
>
-
+
Move your mouse here
@@ -248,8 +248,8 @@ export default function Hover() {
onMouseLeave={() => setCardHovered(null)}
className={`cursor-pointer rounded-xl border-2 p-6 transition-all duration-300 ${
cardHovered === num
- ? "border-green-400 bg-green-50 shadow-lg"
- : "border-gray-200 bg-white hover:shadow-md"
+ ? "border-green-400 bg-green-50 dark:bg-green-950/50 shadow-lg"
+ : "border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 hover:shadow-md"
}`}
>
Card {num}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index f101126..3515cc4 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -10,10 +10,11 @@ import {
FileText,
Focus,
Menu,
+ MessageSquare,
MousePointer,
Navigation,
+ Quote,
ScrollText,
- Search,
Settings,
Sliders,
Sparkles,
@@ -52,8 +53,8 @@ const testCategories = [
color: "bg-blue-500",
},
{
- href: "/form-submit",
- label: "Form Submit",
+ href: "/forms",
+ label: "Forms",
icon: FileInput,
color: "bg-green-500",
},
@@ -112,16 +113,16 @@ const testCategories = [
color: "bg-cyan-500",
},
{
- href: "/navigation",
- label: "Navigation",
+ href: "/navigation-search",
+ label: "Navigation & Search",
icon: Navigation,
color: "bg-emerald-500",
},
{
- href: "/search",
- label: "Search",
- icon: Search,
- color: "bg-violet-500",
+ href: "/interactive",
+ label: "Interactive",
+ icon: MessageSquare,
+ color: "bg-amber-500",
},
],
},
@@ -186,7 +187,19 @@ export default function Home() {
- Introducing Betsey (bTc) — Between the Clicks
+ Introducing Betsey (bTc) —{" "}
+
+ B
+
+ etween{" "}
+
+ T
+
+ he{" "}
+
+ C
+
+ licks
MCP Automation with Vision and Control.
@@ -259,6 +272,30 @@ export default function Home() {
))}
+
+
+
+
+
+
+
+ We created Betsey (bTc) not only to train our ehAye™ Engine
+ Vision & Control, but because Betsey needs to exist.
+
+
+ — Val Neekman @ Neekware Inc.
+
+
+
+
+
+
+
{
setLoading(true);
@@ -93,7 +95,7 @@ export default function Interactions() {
};
const handleNewTab = () => {
- window.open("https://example.com", "_blank");
+ window.open("/about", "_blank");
};
const handleFileUpload = () => {
@@ -102,10 +104,19 @@ export default function Interactions() {
input.onchange = (e: any) => {
const file = e.target.files[0];
if (file) {
+ // Simulate upload process
toast({
- title: "File Selected",
+ title: "Uploading...",
description: `${file.name} (${(file.size / 1024).toFixed(2)} KB)`,
});
+
+ // Simulate successful upload after 1.5 seconds
+ setTimeout(() => {
+ toast({
+ title: "Upload Successful! ✅",
+ description: `${file.name} has been uploaded successfully.`,
+ });
+ }, 1500);
}
};
input.click();
@@ -142,7 +153,10 @@ export default function Interactions() {
-
+
Open Basic Dialog
@@ -161,12 +175,17 @@ export default function Interactions() {
- Continue
+ setBasicDialogOpen(false)}>
+ Continue
+
-
+
Dialog with Form
@@ -216,7 +235,19 @@ export default function Interactions() {
- Save changes
+ {
+ // Here you would normally save the data
+ toast({
+ title: "Profile Updated",
+ description:
+ "Your changes have been saved successfully.",
+ });
+ setFormDialogOpen(false);
+ }}
+ >
+ Save changes
+
@@ -495,20 +526,40 @@ export default function Interactions() {
{
- const data = "Hello, World!";
+ // Create a 100KB text file
+ const lines = [];
+ const line =
+ "This is a test file created by ehAye™ Test Target App (Betsey - bTc). ";
+ const targetSize = 100 * 1024; // 100KB
+ let currentSize = 0;
+ let lineNumber = 1;
+
+ while (currentSize < targetSize) {
+ const lineContent = `Line ${lineNumber}: ${line}`;
+ lines.push(lineContent);
+ currentSize += lineContent.length + 1; // +1 for newline
+ lineNumber++;
+ }
+
+ const data = lines.join("\n");
const blob = new Blob([data], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
- a.download = "test-file.txt";
+ a.download = "test-file-100kb.txt";
a.click();
URL.revokeObjectURL(url);
+
+ toast({
+ title: "Download Started",
+ description: "Downloading test-file-100kb.txt (100KB)",
+ });
}}
className="w-full"
variant="outline"
>
- Download File
+ Download Test File (100KB)
diff --git a/src/pages/navigation-search.tsx b/src/pages/navigation-search.tsx
new file mode 100644
index 0000000..cad3590
--- /dev/null
+++ b/src/pages/navigation-search.tsx
@@ -0,0 +1,513 @@
+import React, { useState } from "react";
+import Link from "next/link";
+import { useRouter } from "next/router";
+import { motion } from "framer-motion";
+import {
+ ArrowLeft,
+ ArrowRight,
+ Clock,
+ ExternalLink,
+ Hash,
+ Home,
+ RotateCcw,
+ Search as SearchIcon,
+ X,
+} from "lucide-react";
+import { Layout } from "@/components/layout";
+import { Badge } from "@/components/ui/badge";
+import { Button } from "@/components/ui/button";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Input } from "@/components/ui/input";
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+
+export default function NavigationSearch() {
+ // Navigation state
+ const [visitCount, setVisitCount] = useState(1);
+ const router = useRouter();
+
+ // Search state
+ const [searchQuery, setSearchQuery] = useState("");
+ const [instantQuery, setInstantQuery] = useState("");
+ const [urlQuery, setUrlQuery] = useState("");
+ const [searchResults, setSearchResults] = useState
([]);
+ const [instantResults, setInstantResults] = useState([]);
+ const [searchHistory, setSearchHistory] = useState([]);
+
+ const mockData = [
+ "Apple iPhone 15 Pro",
+ "Samsung Galaxy S24",
+ "Google Pixel 8",
+ "MacBook Pro M3",
+ "Dell XPS 15",
+ "iPad Air",
+ "Microsoft Surface",
+ "Sony PlayStation 5",
+ "Xbox Series X",
+ "Nintendo Switch",
+ ];
+
+ const handleSearch = (e: React.FormEvent) => {
+ e.preventDefault();
+
+ const results = mockData.filter((item) =>
+ item.toLowerCase().includes(searchQuery.toLowerCase()),
+ );
+ setSearchResults(results);
+
+ if (searchQuery.trim() && !searchHistory.includes(searchQuery)) {
+ setSearchHistory((prev) => [searchQuery, ...prev.slice(0, 4)]);
+ }
+ };
+
+ const handleInstantSearch = (query: string) => {
+ setInstantQuery(query);
+ if (query.trim()) {
+ const results = mockData.filter((item) =>
+ item.toLowerCase().includes(query.toLowerCase()),
+ );
+ setInstantResults(results);
+ } else {
+ setInstantResults([]);
+ }
+ };
+
+ const handleUrlSearch = (e: React.FormEvent) => {
+ e.preventDefault();
+ if (urlQuery.trim()) {
+ window.location.href = `/navigation-search?q=${encodeURIComponent(urlQuery)}`;
+ }
+ };
+
+ const clearHistory = () => {
+ setSearchHistory([]);
+ };
+
+ return (
+
+
+
+
+
+ Navigation & Search
+
+
+ Test navigation methods and search functionality
+
+
+ Page visits: {visitCount}
+
+
+
+
+
+ Navigation
+ Search
+
+
+
+
+
+
+
+
+ Links Navigation
+
+
+ Navigation using Next.js Link components
+
+
+
+
+
+
+ Home
+
+
+ Forms
+
+
+ Interactive
+
+
+
+
+
+
+
+ Programmatic Navigation
+
+ Navigation using the Next.js router
+
+
+
+
+
router.push("/")}
+ className="flex items-center gap-2"
+ >
+
+ Go to Home
+
+
router.back()}
+ variant="outline"
+ className="flex items-center gap-2"
+ >
+
+ Go Back
+
+
router.forward()}
+ variant="outline"
+ className="flex items-center gap-2"
+ >
+
+ Go Forward
+
+
+
+
+
+
+
+
+
+ Hash Navigation
+
+
+ Navigate to sections within the page
+
+
+
+
+
+
+
+
+
+
+
+ Reload Test
+
+
+ Test page reload functionality
+
+
+
+ {
+ setVisitCount((count) => count + 1);
+ window.location.reload();
+ }}
+ variant="destructive"
+ className="flex items-center gap-2"
+ >
+
+ Reload Page
+
+
+
+
+
+
+
+
+
+ Section 1
+
+
+
+
+ This is section 1 content. You can navigate here using the
+ hash navigation buttons above.
+
+
+
+
+
+
+
+ Section 2
+
+
+
+
+ This is section 2 content. Hash navigation allows smooth
+ scrolling to specific page sections.
+
+
+
+
+
+
+
+ Section 3
+
+
+
+
+ This is section 3 content, the final section in our
+ navigation test page.
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard Search
+
+
+ Traditional form submit search
+
+
+
+
+
+ setSearchQuery(e.target.value)}
+ placeholder="Search products..."
+ className="flex-1"
+ />
+
+ Search
+
+
+
+ {searchResults.length > 0 && (
+
+
Results:
+
+ {searchResults.map((result, index) => (
+
+
+ {result}
+
+
+ ))}
+
+
+ )}
+
+
+
+
+
+ Instant Search
+
+ Real-time search as you type
+
+
+
+ handleInstantSearch(e.target.value)}
+ />
+ {instantResults.length > 0 && (
+
+
+ Live Results:
+
+
+ {instantResults.map((result, index) => (
+
+
+ {result}
+
+
+ ))}
+
+
+ )}
+ {instantQuery && instantResults.length === 0 && (
+
+ No results found
+
+ )}
+
+
+
+
+
+
+
+ URL Parameter Search
+
+
+ Search that updates browser URL
+
+
+
+
+
+ setUrlQuery(e.target.value)}
+ className="flex-1"
+ />
+ Search with URL
+
+
+
+
+
+
+
+
+
+ Search History
+
+ Recently searched terms
+
+
+
+ {searchHistory.length > 0 ? (
+
+ {searchHistory.map((query, index) => (
+ {
+ setSearchQuery(query);
+ handleInstantSearch(query);
+ }}
+ >
+
+ {query}
+
+ ))}
+
+
+ Clear History
+
+
+ ) : (
+
+ No search history
+
+ )}
+
+
+
+
+
+
+
+ Search Results Summary
+
+ Combined results from all search types
+
+
+
+
+ {searchQuery || instantQuery ? (
+
+ Showing results for:{" "}
+ {searchQuery || instantQuery}
+
+ ) : (
+
Enter a search query to see results
+ )}
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/pages/navigation.tsx b/src/pages/navigation.tsx
deleted file mode 100644
index ab0e00c..0000000
--- a/src/pages/navigation.tsx
+++ /dev/null
@@ -1,221 +0,0 @@
-import React, { useState } from "react";
-import Link from "next/link";
-import { useRouter } from "next/router";
-import { motion } from "framer-motion";
-import {
- ArrowLeft,
- ArrowRight,
- ExternalLink,
- Hash,
- Home,
- RotateCcw,
-} from "lucide-react";
-import { Layout } from "@/components/layout";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-
-export default function Navigation() {
- const [visitCount, setVisitCount] = useState(1);
- const router = useRouter();
-
- return (
-
-
-
-
-
- Navigation Tests
-
-
- Test various navigation methods and routing
-
-
- Page visits: {visitCount}
-
-
-
-
-
-
-
-
- Links Navigation
-
-
- Navigation using Next.js Link components
-
-
-
-
-
-
- Home
-
-
- Forms
-
-
- Interactions
-
-
-
-
-
-
-
- Programmatic Navigation
-
- Navigation using the Next.js router
-
-
-
-
-
router.push("/")}
- className="flex items-center gap-2"
- >
-
- Go to Home
-
-
router.back()}
- variant="outline"
- className="flex items-center gap-2"
- >
-
- Go Back
-
-
router.forward()}
- variant="outline"
- className="flex items-center gap-2"
- >
-
- Go Forward
-
-
-
-
-
-
-
-
-
- Hash Navigation
-
-
- Navigate to sections within the page
-
-
-
-
-
-
-
-
-
-
-
- Reload Test
-
-
- Test page reload functionality
-
-
-
- {
- setVisitCount((count) => count + 1);
- window.location.reload();
- }}
- variant="destructive"
- className="flex items-center gap-2"
- >
-
- Reload Page
-
-
-
-
-
-
-
-
- Section 1
-
-
-
- This is section 1 content. You can navigate here using the
- hash navigation buttons above.
-
-
-
-
-
-
- Section 2
-
-
-
- This is section 2 content. Hash navigation allows smooth
- scrolling to specific page sections.
-
-
-
-
-
-
- Section 3
-
-
-
- This is section 3 content, the final section in our navigation
- test page.
-
-
-
-
-
-
-
- );
-}
diff --git a/src/pages/scroll.tsx b/src/pages/scroll.tsx
index eb3572c..4300128 100644
--- a/src/pages/scroll.tsx
+++ b/src/pages/scroll.tsx
@@ -86,12 +86,12 @@ export default function Scroll() {
{/* Fixed position scroll indicator */}
-