"use client"; import React, { useState } from "react"; interface UIControlsShowcaseProps { accentColor: string; secondaryColor: string; borderRadius: string; boxShadow: string; backdropFilter?: string; fontFamily?: string; fontWeight?: string; border?: string; textShadow?: string; letterSpacing?: string; isDark: boolean; } export function UIControlsShowcase({ accentColor, secondaryColor, borderRadius, boxShadow, backdropFilter, fontFamily, fontWeight, border, textShadow, letterSpacing, isDark, }: UIControlsShowcaseProps) { const [toggle1, setToggle1] = useState(true); const [toggle2, setToggle2] = useState(false); const [check1, setCheck1] = useState(true); const [check2, setCheck2] = useState(false); const [radio, setRadio] = useState<"a" | "b">("a"); const [slider, setSlider] = useState(65); const bg = isDark ? "#1a1a2e" : "#ffffff"; const textPrimary = isDark ? "#f1f5f9" : "#1e293b"; const textSecondary = isDark ? "#94a3b8" : "#64748b"; const surfaceBg = isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.03)"; const borderColor = isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.08)"; const halfRadius = `calc(${borderRadius} / 2)`; const baseFont: React.CSSProperties = { fontFamily, fontWeight, textShadow, letterSpacing, }; return (
{/* 1. Buttons */}
{/* 2. Text Input */}
{/* 3. Toggle Switch */}
setToggle1(!toggle1)} accentColor={accentColor} borderRadius={borderRadius} /> setToggle2(!toggle2)} accentColor={accentColor} borderRadius={borderRadius} />
{/* 4. Checkbox */}
setCheck1(!check1)} label="Checked option" accentColor={accentColor} halfRadius={halfRadius} textPrimary={textPrimary} baseFont={baseFont} /> setCheck2(!check2)} label="Unchecked option" accentColor={accentColor} halfRadius={halfRadius} textPrimary={textPrimary} baseFont={baseFont} />
{/* 5. Radio Button */}
setRadio("a")} label="Option A" accentColor={accentColor} textPrimary={textPrimary} baseFont={baseFont} /> setRadio("b")} label="Option B" accentColor={accentColor} textPrimary={textPrimary} baseFont={baseFont} />
{/* 6. Card */}
Card Title
A short description of this card with some preview text.
{/* 7. Badge / Tag */}
{["Design", "UI/UX", "Style", "Modern"].map((tag) => ( {tag} ))}
{/* 8. Slider */}
0 {slider} 100
setSlider(Number(e.target.value))} style={{ width: "100%", accentColor, cursor: "pointer", }} />
{/* 9. Navigation Bar */}
); } /* --- Sub-components --- */ function Section({ label, textSecondary, children, }: { label: string; textSecondary: string; children: React.ReactNode; }) { return (
{label}
{children}
); } function ToggleSwitch({ on, onToggle, accentColor, borderRadius, }: { on: boolean; onToggle: () => void; accentColor: string; borderRadius: string; }) { const trackRadius = borderRadius && parseInt(borderRadius) > 20 ? "999px" : "12px"; return ( ); } function CheckboxItem({ checked, onToggle, label, accentColor, halfRadius, textPrimary, baseFont, }: { checked: boolean; onToggle: () => void; label: string; accentColor: string; halfRadius: string; textPrimary: string; baseFont: React.CSSProperties; }) { return ( ); } function RadioItem({ selected, onSelect, label, accentColor, textPrimary, baseFont, }: { selected: boolean; onSelect: () => void; label: string; accentColor: string; textPrimary: string; baseFont: React.CSSProperties; }) { return (