diff --git a/components/design-scaffolds.tsx b/components/design-scaffolds.tsx index 1d91726..3568419 100644 --- a/components/design-scaffolds.tsx +++ b/components/design-scaffolds.tsx @@ -22,13 +22,87 @@ const TABLE_ROWS = [ ]; type Page = "Dashboard" | "Users" | "Settings"; -const PAGES: Page[] = ["Dashboard", "Users", "Settings"]; + +// --------------------------------------------------------------------------- +// Theme color definitions +// --------------------------------------------------------------------------- + +export interface ThemeColor { + id: string; + label: string; + primary: string; // button bg, active dot, toggle on + primaryFg: string; // text on primary bg + activeBg: string; // sidebar active item bg + activeFg: string; // sidebar active item text + ring: string; // focus ring / subtle tint +} + +export const SHADCN_THEMES: ThemeColor[] = [ + { id: "neutral", label: "Neutral", primary: "#18181b", primaryFg: "#fff", activeBg: "#f4f4f5", activeFg: "#18181b", ring: "#e4e4e7" }, + { id: "blue", label: "Blue", primary: "#3b82f6", primaryFg: "#fff", activeBg: "#eff6ff", activeFg: "#1d4ed8", ring: "#bfdbfe" }, + { id: "green", label: "Green", primary: "#22c55e", primaryFg: "#fff", activeBg: "#f0fdf4", activeFg: "#15803d", ring: "#bbf7d0" }, + { id: "orange", label: "Orange", primary: "#f97316", primaryFg: "#fff", activeBg: "#fff7ed", activeFg: "#c2410c", ring: "#fed7aa" }, + { id: "red", label: "Red", primary: "#ef4444", primaryFg: "#fff", activeBg: "#fef2f2", activeFg: "#b91c1c", ring: "#fecaca" }, + { id: "rose", label: "Rose", primary: "#f43f5e", primaryFg: "#fff", activeBg: "#fff1f2", activeFg: "#be123c", ring: "#fecdd3" }, + { id: "violet", label: "Violet", primary: "#8b5cf6", primaryFg: "#fff", activeBg: "#f5f3ff", activeFg: "#6d28d9", ring: "#ddd6fe" }, + { id: "yellow", label: "Yellow", primary: "#eab308", primaryFg: "#000", activeBg: "#fefce8", activeFg: "#a16207", ring: "#fef08a" }, +]; + +export const MANTINE_THEMES: ThemeColor[] = [ + { id: "blue", label: "Blue", primary: "#228be6", primaryFg: "#fff", activeBg: "#e7f5ff", activeFg: "#1971c2", ring: "#a5d8ff" }, + { id: "teal", label: "Teal", primary: "#12b886", primaryFg: "#fff", activeBg: "#e6fcf5", activeFg: "#087f5b", ring: "#96f2d7" }, + { id: "violet", label: "Violet", primary: "#7950f2", primaryFg: "#fff", activeBg: "#f3f0ff", activeFg: "#5f3dc4", ring: "#d0bfff" }, + { id: "red", label: "Red", primary: "#fa5252", primaryFg: "#fff", activeBg: "#fff5f5", activeFg: "#c92a2a", ring: "#ffc9c9" }, + { id: "orange", label: "Orange", primary: "#fd7e14", primaryFg: "#fff", activeBg: "#fff4e6", activeFg: "#d9480f", ring: "#ffd8a8" }, + { id: "green", label: "Green", primary: "#40c057", primaryFg: "#fff", activeBg: "#ebfbee", activeFg: "#2f9e44", ring: "#b2f2bb" }, +]; + +export const HEROUI_THEMES: ThemeColor[] = [ + { id: "violet", label: "Violet", primary: "#7c3aed", primaryFg: "#fff", activeBg: "rgba(124,58,237,0.3)", activeFg: "#c084fc", ring: "rgba(168,85,247,0.3)" }, + { id: "blue", label: "Blue", primary: "#2563eb", primaryFg: "#fff", activeBg: "rgba(37,99,235,0.3)", activeFg: "#93c5fd", ring: "rgba(59,130,246,0.3)" }, + { id: "rose", label: "Rose", primary: "#e11d48", primaryFg: "#fff", activeBg: "rgba(225,29,72,0.3)", activeFg: "#fda4af", ring: "rgba(244,63,94,0.3)" }, + { id: "green", label: "Green", primary: "#16a34a", primaryFg: "#fff", activeBg: "rgba(22,163,74,0.3)", activeFg: "#86efac", ring: "rgba(34,197,94,0.3)" }, + { id: "orange", label: "Orange", primary: "#ea580c", primaryFg: "#fff", activeBg: "rgba(234,88,12,0.3)", activeFg: "#fdba74", ring: "rgba(249,115,22,0.3)" }, +]; + +export const TREMOR_THEMES: ThemeColor[] = [ + { id: "blue", label: "Blue", primary: "#2563eb", primaryFg: "#fff", activeBg: "#eff6ff", activeFg: "#1d4ed8", ring: "#bfdbfe" }, + { id: "indigo", label: "Indigo", primary: "#4f46e5", primaryFg: "#fff", activeBg: "#eef2ff", activeFg: "#3730a3", ring: "#c7d2fe" }, + { id: "teal", label: "Teal", primary: "#0d9488", primaryFg: "#fff", activeBg: "#f0fdfa", activeFg: "#0f766e", ring: "#99f6e4" }, + { id: "rose", label: "Rose", primary: "#e11d48", primaryFg: "#fff", activeBg: "#fff1f2", activeFg: "#be123c", ring: "#fecdd3" }, + { id: "amber", label: "Amber", primary: "#d97706", primaryFg: "#fff", activeBg: "#fffbeb", activeFg: "#92400e", ring: "#fde68a" }, +]; + +// Small swatch strip rendered inside each scaffold's header +function ThemeSwatches({ themes, selected, onSelect }: { + themes: ThemeColor[]; + selected: ThemeColor; + onSelect: (t: ThemeColor) => void; +}) { + return ( +
+ {themes.map(t => ( +
+ ); +} // --------------------------------------------------------------------------- // WEB APP — shadcn // --------------------------------------------------------------------------- -function ShadcnDashboard() { +function ShadcnDashboard({ t }: { t: ThemeColor }) { return (
@@ -41,12 +115,10 @@ function ShadcnDashboard() { ))}
-
- Revenue -
+
Revenue
{[40,60,45,75,65,85,70,90,55,80,75,95].map((h,i)=>( -
+
))}
@@ -56,7 +128,7 @@ function ShadcnDashboard() {

{r.name}

{r.email}

- {r.status} + {r.status}
))}
@@ -64,7 +136,7 @@ function ShadcnDashboard() { ); } -function ShadcnUsers() { +function ShadcnUsers({ t }: { t: ThemeColor }) { return (
@@ -72,7 +144,7 @@ function ShadcnUsers() { Team members
-
Invite
+
Invite
@@ -83,7 +155,7 @@ function ShadcnUsers() {

{r.name}

{r.email}

- + @@ -94,7 +166,7 @@ function ShadcnUsers() { ); } -function ShadcnSettings() { +function ShadcnSettings({ t }: { t: ThemeColor }) { return (
@@ -103,10 +175,10 @@ function ShadcnSettings() { {[{l:"Workspace name",v:"Acme Inc"},{l:"Slug",v:"acme-inc"},{l:"Email",v:"admin@acme.com"}].map(f=>(
- +
))} -
Save changes
+
Save changes
@@ -115,8 +187,8 @@ function ShadcnSettings() { {["Email digests","Push notifications","Security alerts","Product updates"].map((label,i)=>(

{label}

Receive {label.toLowerCase()}

-
-
+
+
))} @@ -128,6 +200,7 @@ function ShadcnSettings() { export function WebAppShadcn() { const [page, setPage] = useState("Dashboard"); + const [theme, setTheme] = useState(SHADCN_THEMES[0]); const NAV_ITEMS: { label: Page; icon: string }[] = [ { label: "Dashboard", icon: "▦" }, { label: "Users", icon: "◎" }, @@ -135,35 +208,39 @@ export function WebAppShadcn() { ]; return (
+ {/* Sidebar */}
-
+
Acme Inc
{NAV_ITEMS.map(({ label, icon }) => ( ))}
+ {/* Main */}
{page} -
+
+
Export
-
+ New
+
+ New
- {page === "Dashboard" && } - {page === "Users" && } - {page === "Settings" && } + {page === "Dashboard" && } + {page === "Users" && } + {page === "Settings" && }
); } -function MantineDashboard() { +function MantineDashboard({ t }: { t: ThemeColor }) { return (
@@ -197,7 +274,7 @@ function MantineDashboard() { ); } -function MantineUsers() { +function MantineUsers({ t }: { t: ThemeColor }) { return (
@@ -205,15 +282,15 @@ function MantineUsers() { Team members
- +
{r.role}{r.status}{r.status} {r.date}
···
{["Member","Role","Status","Joined","Actions"].map(h=>)}{TABLE_ROWS.map(r=>( - - + + @@ -225,7 +302,7 @@ function MantineUsers() { ); } -function MantineSettings() { +function MantineSettings({ t }: { t: ThemeColor }) { return (
@@ -237,7 +314,7 @@ function MantineSettings() {
))} - +
@@ -246,8 +323,8 @@ function MantineSettings() { {["Email digests","Push notifications","Security alerts","Product updates"].map((label,i)=>(

{label}

Get notified via {label.split(" ")[0].toLowerCase()}

-
-
+
+
))} @@ -259,6 +336,7 @@ function MantineSettings() { export function WebAppMantine() { const [page, setPage] = useState("Dashboard"); + const [theme, setTheme] = useState(MANTINE_THEMES[0]); const NAV: { label: Page; icon: string }[] = [ { label: "Dashboard", icon: "▦" }, { label: "Users", icon: "◎" }, @@ -268,13 +346,13 @@ export function WebAppMantine() {
-
- Acme Inc +
+ Acme Inc
{NAV.map(({ label, icon }) => ( ))} @@ -282,14 +360,15 @@ export function WebAppMantine() {
{page} -
+
+ - +
- {page === "Dashboard" && } - {page === "Users" && } - {page === "Settings" && } + {page === "Dashboard" && } + {page === "Users" && } + {page === "Settings" && }
); @@ -391,6 +470,7 @@ function HeroUISettings() { export function WebAppHeroUI() { const [page, setPage] = useState("Dashboard"); + const [theme, setTheme] = useState(HEROUI_THEMES[0]); const NAV: { label: Page; icon: string }[] = [ { label: "Dashboard", icon: "▦" }, { label: "Users", icon: "◎" }, @@ -400,23 +480,24 @@ export function WebAppHeroUI() {
-
+
Acme Inc
{NAV.map(({ label, icon }) => ( ))}
- {page} -
+ {page} +
+ - +
{page === "Dashboard" && } @@ -530,6 +611,7 @@ function TremorSettings() { export function WebAppTremor() { const [page, setPage] = useState("Dashboard"); + const [theme, setTheme] = useState(TREMOR_THEMES[0]); const NAV: { label: Page; icon: string }[] = [ { label: "Dashboard", icon: "▦" }, { label: "Users", icon: "◎" }, @@ -539,13 +621,13 @@ export function WebAppTremor() {
-
- Acme Inc +
+ Acme Inc
{NAV.map(({ label, icon }) => ( ))} @@ -553,7 +635,10 @@ export function WebAppTremor() {
{page} - +
+ + +
{page === "Dashboard" && } {page === "Users" && }
{h}

{r.name}

{r.email}

{r.role}

{r.name}

{r.email}

{r.role} {r.status} {r.date}