import { define } from '../src' import { Layout, ExampleSection } from './helpers' const UserProfile = define('UserProfile', { base: 'div', padding: 24, maxWidth: 600, margin: "0 auto", background: "white", borderRadius: 12, boxShadow: "0 2px 8px rgba(0,0,0,0.1)", parts: { Header: { display: "flex", alignItems: "center", gap: 16, marginBottom: 16, }, Avatar: { base: 'img', width: 64, height: 64, borderRadius: "50%", objectFit: "cover", border: "3px solid #e5e7eb", }, Info: { flex: 1, }, Name: { marginBottom: 4, fontSize: 20, fontWeight: 600, color: "#111827", }, Handle: { fontSize: 14, color: "#6b7280", }, Bio: { marginBottom: 16, width: "100%", fontSize: 14, lineHeight: 1.6, color: "#374151", wordWrap: "break-word", }, Stats: { display: "flex", gap: 24, paddingTop: 16, borderTop: "1px solid #e5e7eb", }, Stat: { display: "flex", flexDirection: "column", gap: 4, }, StatValue: { fontSize: 18, fontWeight: 600, color: "#111827", }, StatLabel: { fontSize: 12, color: "#6b7280", textTransform: "uppercase", }, }, variants: { size: { compact: { padding: 16, maxWidth: 300, parts: { Avatar: { width: 48, height: 48 }, Name: { fontSize: 16 }, Bio: { fontSize: 13 }, }, }, skinny: { padding: 20, maxWidth: 125, parts: { Header: { flexDirection: "column", alignItems: "center", gap: 12, }, Avatar: { width: 80, height: 80 }, Info: { flex: 0, width: "100%" }, Name: { textAlign: "center", fontSize: 18 }, Handle: { textAlign: "center" }, Bio: { textAlign: "center", fontSize: 13 }, Stats: { flexDirection: "column", gap: 16, }, Stat: { alignItems: "center" }, }, }, large: { padding: 32, maxWidth: 800, parts: { Avatar: { width: 96, height: 96 }, Name: { fontSize: 24 }, }, }, }, verified: { parts: { Avatar: { border: "3px solid #3b82f6", }, }, }, theme: { dark: { background: "#1f2937", parts: { Name: { color: "#f9fafb" }, Handle: { color: "#9ca3af" }, Bio: { color: "#d1d5db" }, Stats: { borderTop: "1px solid #374151" }, StatValue: { color: "#f9fafb" }, }, }, }, }, render({ props, parts: { Root, Header, Avatar, Info, Name, Handle, Bio, Stats, Stat, StatValue, StatLabel } }) { return (
{props.name} {props.verified && " ✓"} @{props.username}
{props.bio} {props.followers?.toLocaleString() || 0} Followers {props.following?.toLocaleString() || 0} Following {props.posts?.toLocaleString() || 0} Posts
) }, }) // Export the full example page export const ProfileExamplesPage = () => ( )