Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(sandbox): theme picker polish, Card 4 drawer improvements, and publish button fix (#1364)

rubyycheungf5e758f9c242
diff --git a/apps/sandbox/public/templates/card4-preview.png b/apps/sandbox/public/templates/card4-preview.png
new file mode 100644
index 0000000000..fe0a22f856
Binary files /dev/null and b/apps/sandbox/public/templates/card4-preview.png differ
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/InlinePublishPanel.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/InlinePublishPanel.tsx
index f30661e142..e33fc80138 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/InlinePublishPanel.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/InlinePublishPanel.tsx
@@ -18,10 +18,12 @@ export function InlinePublishPanel({
templateName,
isVisible: _isVisible,
onBack,
+ onPublish,
}: {
templateName: string;
isVisible: boolean;
onBack: () => void;
+ onPublish?: () => void;
}) {
const [name, setName] = useState(templateName);
const [description, setDescription] = useState('');
@@ -88,6 +90,7 @@ export function InlinePublishPanel({
variant="primary"
label="Publish template"
size="lg"
+ onClick={onPublish}
style={{width: '100%'}}
/>
<XDSButton
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/LogoNav.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/LogoNav.tsx
index aa94049943..34cfee9275 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/LogoNav.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/LogoNav.tsx
@@ -25,9 +25,8 @@ export const XDS_LOGO_PLAIN = (
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round">
- <line x1="4" y1="6" x2="20" y2="6" />
- <line x1="4" y1="12" x2="20" y2="12" />
- <line x1="4" y1="18" x2="20" y2="18" />
+ <line x1="4" y1="9" x2="20" y2="9" />
+ <line x1="4" y1="15" x2="20" y2="15" />
</svg>
<svg
width="46"
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
index c097d3cc29..2cdc824c91 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
@@ -83,6 +83,7 @@ export function TemplateCard({
width: '100%',
height: 400,
objectFit: 'cover' as const,
+ objectPosition: 'top',
opacity: isGenerating ? 0 : 1,
transition: 'opacity 600ms ease',
}}
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateFullPreview.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateFullPreview.tsx
index 8eff18cc1f..de2a1d9be4 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateFullPreview.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateFullPreview.tsx
@@ -13,6 +13,8 @@ import {
import {XDSToken} from '@xds/core/Token';
import {XDSToolbar} from '@xds/core/Toolbar';
import {XDSTooltip} from '@xds/core/Tooltip';
+import {XDSDialog, XDSDialogHeader} from '@xds/core/Dialog';
+import {XDSTextInput} from '@xds/core/TextInput';
import {
ArrowLeftIcon,
@@ -30,18 +32,42 @@ import {
CheckIcon,
HeartIcon,
BookmarkIcon,
+ BookmarkFilledIcon,
+ StarIcon,
+ StarFilledIcon,
+ SearchIcon,
+ MetaLogo,
+ WhatsAppLogo,
+ ThreadsLogo,
+ FacebookLogo,
+ DefaultThemeIcon,
+ ForestThemeIcon,
+ SunsetThemeIcon,
+ MidnightThemeIcon,
} from './docsite-icons';
import {
XDS_THEMES,
MOCK_CODE,
TEMPLATES,
- PREVIEW_THEMES,
+ THEME_PICKER_ENTRIES,
PREVIEW_FONT_PACKS,
AVATAR_IMAGE,
} from './constants';
+
import {InlinePublishPanel} from './InlinePublishPanel';
import {SharePopover} from './SharePopover';
+const BRAND_LOGOS: Record<string, React.ComponentType<React.SVGProps<SVGSVGElement>>> = {
+ default: DefaultThemeIcon,
+ meta: MetaLogo,
+ whatsapp: WhatsAppLogo,
+ threads: ThreadsLogo,
+ facebook: FacebookLogo,
+ forest: ForestThemeIcon,
+ sunset: SunsetThemeIcon,
+ midnight: MidnightThemeIcon,
+};
+
export function TemplateFullPreview({
templateName,
imageSrc,
@@ -68,7 +94,20 @@ export function TemplateFullPreview({
'preview' as 'preview' | 'code',
);
const [isVisible, setIsVisible] = useState(false);
- const [selectedTheme, setSelectedTheme] = useState('default' as string | null);
+ const [selectedTheme, setSelectedTheme] = useState('default');
+ const [showThemeBrowse, setShowThemeBrowse] = useState(false);
+ const [themeSearch, setThemeSearch] = useState('');
+ const [pinnedThemes, setPinnedThemes] = useState(
+ () => new Set(THEME_PICKER_ENTRIES.filter(t => t.isPinnedByDefault).map(t => t.key)),
+ );
+ const togglePin = useCallback((key: string) => {
+ setPinnedThemes(prev => {
+ const next = new Set(prev);
+ if (next.has(key)) next.delete(key);
+ else next.add(key);
+ return next;
+ });
+ }, []);
const [selectedFontPack, setSelectedFontPack] = useState(
PREVIEW_FONT_PACKS[0].heading as string | null,
);
@@ -93,37 +132,14 @@ export function TemplateFullPreview({
const [likeCount, setLikeCount] = useState(1645);
const [bookmarked, setBookmarked] = useState(false);
const [bookmarkCount, setBookmarkCount] = useState(892);
- const [panelWidth, setPanelWidth] = useState(380);
- const [isResizing, setIsResizing] = useState(false);
+ const [showAddPopover, setShowAddPopover] = useState(false);
+ const [addPopoverPos, setAddPopoverPos] = useState(null as {top: number; left: number} | null);
+ const addButtonRef = useRef(null as HTMLButtonElement | null);
+ const addPopoverRef = useRef(null as HTMLDivElement | null);
const sharePopoverRef = useRef(null as HTMLDivElement | null);
const shareButtonRef = useRef(null as HTMLButtonElement | null);
const sendPopoverRef = useRef(null as HTMLDivElement | null);
- const handleResizeStart = useCallback((e: React.MouseEvent) => {
- e.preventDefault();
- setIsResizing(true);
- const startX = e.clientX;
- const startWidth = panelWidth;
-
- const onMouseMove = (ev: MouseEvent) => {
- const maxWidth = Math.floor(window.innerWidth / 2);
- const newWidth = Math.min(Math.max(startWidth + (ev.clientX - startX), 280), maxWidth);
- setPanelWidth(newWidth);
- };
- const onMouseUp = () => {
- setIsResizing(false);
- document.removeEventListener('mousemove', onMouseMove);
- document.removeEventListener('mouseup', onMouseUp);
- document.body.style.cursor = '';
- document.body.style.userSelect = '';
- };
-
- document.body.style.cursor = 'col-resize';
- document.body.style.userSelect = 'none';
- document.addEventListener('mousemove', onMouseMove);
- document.addEventListener('mouseup', onMouseUp);
- }, [panelWidth]);
-
const shareCliCommand = `npx xds template ${templateName.toLowerCase().replace(/\s+/g, '-')} ./my-project`;
useEffect(() => {
@@ -160,6 +176,20 @@ export function TemplateFullPreview({
return () => document.removeEventListener('mousedown', handleClickOutside);
}, [showSendPopover]);
+ useEffect(() => {
+ if (!showAddPopover) return;
+ const handleClickOutside = (e: MouseEvent) => {
+ if (
+ addPopoverRef.current &&
+ !addPopoverRef.current.contains(e.target as Node)
+ ) {
+ setShowAddPopover(false);
+ }
+ };
+ document.addEventListener('mousedown', handleClickOutside);
+ return () => document.removeEventListener('mousedown', handleClickOutside);
+ }, [showAddPopover]);
+
return (
<div
style={{
@@ -171,18 +201,14 @@ export function TemplateFullPreview({
{/* LEFT PANEL — details sidebar */}
<div
style={{
- width: panelWidth,
- minWidth: 280,
- maxWidth: '50vw',
+ width: 380,
flexShrink: 0,
padding: '16px 0 16px 16px',
display: 'flex',
backgroundColor: 'transparent',
opacity: isVisible ? 1 : 0,
transform: isVisible ? 'none' : 'translateX(-60px)',
- transition: isResizing
- ? 'opacity 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms, transform 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms'
- : 'opacity 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms, transform 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms, width 150ms ease',
+ transition: 'opacity 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms, transform 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms',
}}>
<div
style={{
@@ -406,47 +432,6 @@ export function TemplateFullPreview({
}}
/>
</XDSTooltip>
- <div
- ref={sendPopoverRef}
- style={{position: 'relative' as const}}>
- <XDSTooltip content="Share">
- <XDSButton
- label="Share"
- variant="ghost"
- size="sm"
- isIconOnly
- icon={<ShareIcon />}
- onClick={() => {
- setShowSendPopover(prev => {
- if (!prev && sendPopoverRef.current) {
- const rect =
- sendPopoverRef.current.getBoundingClientRect();
- const popoverWidth = 340;
- const popoverHeight = 400;
- const left = Math.min(
- Math.max(8, rect.left),
- window.innerWidth - popoverWidth - 16,
- );
- const top =
- rect.bottom + 4 + popoverHeight + 16 >
- window.innerHeight
- ? rect.top - popoverHeight - 4
- : rect.bottom + 4;
- setSendPopoverPos({top, left});
- }
- return !prev;
- });
- }}
- />
- </XDSTooltip>
- {showSendPopover && sendPopoverPos && (
- <SharePopover
- cliCommand={shareCliCommand}
- position={sendPopoverPos}
- onClose={() => setShowSendPopover(false)}
- />
- )}
- </div>
</div>
<div style={{display: 'flex', alignItems: 'center', gap: 4}}>
<XDSTooltip content="Like">
@@ -497,9 +482,9 @@ export function TemplateFullPreview({
</div>
</div>
- {/* CTA button */}
+ {/* CTA buttons */}
{!showEditor && (
- <div style={{marginTop: 16}}>
+ <div style={{marginTop: 16, display: 'flex', flexDirection: 'column', gap: 8, position: 'relative'}}>
<XDSButton
variant="primary"
label="Start crafting"
@@ -507,155 +492,335 @@ export function TemplateFullPreview({
size="lg"
style={{width: '100%'}}
/>
+ <div ref={addPopoverRef}>
+ <XDSButton
+ ref={addButtonRef}
+ variant="secondary"
+ label="Add to your project"
+ size="lg"
+ style={{width: '100%'}}
+ onClick={() => {
+ if (addButtonRef.current) {
+ const rect = addButtonRef.current.getBoundingClientRect();
+ setAddPopoverPos({top: rect.bottom + 8, left: rect.left});
+ }
+ setShowAddPopover(prev => !prev);
+ }}
+ />
+ {showAddPopover && addPopoverPos && (
+ <SharePopover
+ cliCommand={shareCliCommand}
+ position={addPopoverPos}
+ onClose={() => setShowAddPopover(false)}
+ />
+ )}
+ </div>
</div>
)}
- {/* Themes */}
+ {/* Themes — pinned grid */}
<div style={{marginTop: 32}}>
- <XDSHeading level={4}>Themes</XDSHeading>
- {(['pinned', 'official', 'community'] as const).map(
- category => {
- const themes = PREVIEW_THEMES.filter(
- t => t.category === category,
- );
- if (themes.length === 0) return null;
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ }}>
+ <XDSHeading level={4}>Apply your themes</XDSHeading>
+ <XDSButton
+ variant="ghost"
+ size="sm"
+ label="Browse"
+ onClick={() => setShowThemeBrowse(true)}
+ />
+ </div>
+ <div
+ style={{
+ display: 'grid',
+ gridTemplateColumns: 'repeat(auto-fill, 44px)',
+ gap: 8,
+ marginTop: 12,
+ }}>
+ {THEME_PICKER_ENTRIES.filter(
+ t => pinnedThemes.has(t.key),
+ ).map(entry => {
+ const isSelected = selectedTheme === entry.key;
+ const BrandLogo = BRAND_LOGOS[entry.key];
return (
- <div key={category} style={{marginTop: 12}}>
- <XDSText
- type="supporting"
- color="secondary"
- style={{
- textTransform: 'uppercase',
- letterSpacing: '0.05em',
- }}>
- {category}
- </XDSText>
+ <XDSTooltip key={entry.key} content={entry.name}>
<div
+ onClick={() => setSelectedTheme(entry.key)}
style={{
- display: 'grid',
- gridTemplateColumns: '1fr 1fr',
- gap: 10,
- marginTop: 6,
+ width: 44,
+ height: 44,
+ borderRadius: 10,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ cursor: 'pointer',
+ border: isSelected
+ ? '2px solid var(--color-text-primary, #111)'
+ : '2px solid var(--color-border, #E0E0E0)',
+ backgroundColor: '#fff',
+ transition: 'border-color 0.15s ease',
}}>
- {themes.map(theme => {
- const isSelected =
- selectedTheme === theme.key;
- return (
- <div
- key={`${category}-${theme.key}`}
- onClick={() =>
- setSelectedTheme(theme.key)
- }
- style={{
- cursor: 'pointer',
- border: `2px solid ${isSelected ? 'var(--color-accent, #0066FF)' : 'transparent'}`,
- borderRadius: 14,
- overflow: 'hidden',
- transition: 'border-color 0.15s ease',
- }}>
- <XDSCard padding={0}>
+ {BrandLogo ? (
+ <BrandLogo width={28} height={28} />
+ ) : (
+ <div
+ style={{
+ width: 24,
+ height: 24,
+ borderRadius: '50%',
+ backgroundColor: entry.accent,
+ }}
+ />
+ )}
+ </div>
+ </XDSTooltip>
+ );
+ })}
+ </div>
+ </div>
+
+ {/* All themes browse dialog */}
+ <XDSDialog
+ isOpen={showThemeBrowse}
+ onOpenChange={open => {
+ setShowThemeBrowse(open);
+ if (!open) setThemeSearch('');
+ }}
+ width={720}>
+ <XDSDialogHeader
+ title="All Themes"
+ onOpenChange={open => {
+ setShowThemeBrowse(open);
+ if (!open) setThemeSearch('');
+ }}
+ />
+ <div
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 16,
+ padding: 16,
+ }}>
+ <XDSTextInput
+ label="Search"
+ isLabelHidden
+ placeholder="Search themes..."
+ value={themeSearch}
+ onChange={setThemeSearch}
+ size="lg"
+ startIcon={SearchIcon}
+ />
+ <div
+ style={{
+ maxHeight: 560,
+ overflowY: 'auto',
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 8,
+ }}>
+ {(['official', 'community'] as const).map(
+ category => {
+ const entries = THEME_PICKER_ENTRIES.filter(
+ t =>
+ t.category === category &&
+ t.name
+ .toLowerCase()
+ .includes(themeSearch.toLowerCase()),
+ );
+ if (entries.length === 0) return null;
+ return (
+ <div key={category}>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ style={{
+ textTransform: 'uppercase',
+ letterSpacing: '0.05em',
+ marginBottom: 8,
+ }}>
+ {category}
+ </XDSText>
+ <div
+ style={{
+ display: 'grid',
+ gridTemplateColumns: '1fr 1fr 1fr',
+ gap: 8,
+ }}>
+ {entries.map(entry => {
+ const isSelected =
+ selectedTheme === entry.key;
+ const isPinned = pinnedThemes.has(
+ entry.key,
+ );
+ const p = entry.preview;
+ return (
<div
+ key={entry.key}
style={{
- height: 56,
- backgroundColor:
- theme.colors.background,
- display: 'flex',
- flexDirection: 'column',
+ borderRadius: 12,
overflow: 'hidden',
+ border: isSelected
+ ? '2px solid var(--color-text-primary, #111)'
+ : '2px solid var(--color-border, #E0E0E0)',
+ cursor: 'pointer',
+ transition:
+ 'border-color 0.15s ease',
}}>
- {/* Mini nav bar */}
+ {/* Mini UI mockup */}
<div
+ onClick={() => {
+ setSelectedTheme(entry.key);
+ setShowThemeBrowse(false);
+ setThemeSearch('');
+ }}
style={{
- height: 12,
- backgroundColor:
- theme.colors.surface,
- borderBottom: `1px solid ${theme.colors.border}`,
+ height: 100,
+ backgroundColor: p.bg,
display: 'flex',
- alignItems: 'center',
- paddingInline: 6,
- gap: 3,
+ flexDirection: 'column',
+ overflow: 'hidden',
}}>
<div
style={{
- width: 4,
- height: 4,
- borderRadius: '50%',
- backgroundColor:
- theme.colors.accent,
- }}
- />
+ height: 14,
+ backgroundColor: p.surface,
+ borderBottom: `1px solid ${p.text}1A`,
+ display: 'flex',
+ alignItems: 'center',
+ paddingInline: 8,
+ gap: 4,
+ }}>
+ <div
+ style={{
+ width: 5,
+ height: 5,
+ borderRadius: '50%',
+ backgroundColor:
+ p.accent,
+ }}
+ />
+ <div
+ style={{
+ width: 16,
+ height: 2,
+ borderRadius: 1,
+ backgroundColor: p.text,
+ opacity: 0.3,
+ }}
+ />
+ </div>
<div
style={{
- width: 12,
- height: 2,
- borderRadius: 1,
- backgroundColor:
- theme.colors.text,
- opacity: 0.4,
- }}
- />
+ flex: 1,
+ padding: 8,
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 5,
+ }}>
+ <div
+ style={{
+ width: '65%',
+ height: 4,
+ borderRadius: 2,
+ backgroundColor: p.text,
+ opacity: 0.6,
+ }}
+ />
+ <div
+ style={{
+ width: '45%',
+ height: 3,
+ borderRadius: 1.5,
+ backgroundColor: p.text,
+ opacity: 0.25,
+ }}
+ />
+ <div
+ style={{
+ width: 28,
+ height: 10,
+ borderRadius: 4,
+ backgroundColor:
+ p.accent,
+ marginTop: 'auto',
+ }}
+ />
+ </div>
</div>
- {/* Content area */}
+ {/* Name + logo + pin */}
<div
style={{
- flex: 1,
- padding: 6,
display: 'flex',
- flexDirection: 'column',
- gap: 4,
+ alignItems: 'center',
+ justifyContent:
+ 'space-between',
+ padding: '6px 8px',
+ backgroundColor:
+ 'var(--color-surface, #f5f5f5)',
}}>
+ <div style={{display: 'flex', alignItems: 'center', gap: 6}}>
+ {(() => {
+ const Logo = BRAND_LOGOS[entry.key];
+ return Logo ? <Logo width={14} height={14} /> : (
+ <div style={{width: 14, height: 14, borderRadius: '50%', backgroundColor: entry.accent}} />
+ );
+ })()}
+ <XDSText
+ type="supporting"
+ style={{
+ fontWeight: isSelected
+ ? 600
+ : 400,
+ }}>
+ {entry.name}
+ </XDSText>
+ </div>
<div
- style={{
- width: '70%',
- height: 3,
- borderRadius: 1,
- backgroundColor:
- theme.colors.text,
- opacity: 0.7,
- }}
- />
- <div
- style={{
- width: '50%',
- height: 2,
- borderRadius: 1,
- backgroundColor:
- theme.colors.text,
- opacity: 0.3,
+ onClick={e => {
+ e.stopPropagation();
+ togglePin(entry.key);
}}
- />
- <div
style={{
- width: 24,
- height: 8,
- borderRadius: 3,
- backgroundColor:
- theme.colors.accent,
- marginTop: 'auto',
- }}
- />
+ cursor: 'pointer',
+ display: 'flex',
+ padding: 2,
+ }}>
+ {isPinned ? (
+ <StarFilledIcon
+ width={14}
+ height={14}
+ style={{
+ color:
+ 'var(--color-text-primary, #111)',
+ }}
+ />
+ ) : (
+ <StarIcon
+ width={14}
+ height={14}
+ style={{
+ color:
+ 'var(--color-secondary, #999)',
+ }}
+ />
+ )}
+ </div>
</div>
</div>
- </XDSCard>
- <div
- style={{
- padding: '4px 6px',
- backgroundColor:
- theme.colors.surface,
- }}>
- <XDSText type="supporting" color="secondary">
- {theme.name}
- </XDSText>
- </div>
- </div>
- );
- })}
- </div>
- </div>
- );
- },
- )}
- </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+ },
+ )}
+ </div>
+ </div>
+ </XDSDialog>
{/* Font packs — removed */}
<div style={{marginTop: 32, display: 'none'}}>
@@ -673,7 +838,7 @@ export function TemplateFullPreview({
onClick={() => setSelectedFontPack(pack.heading)}
style={{
cursor: 'pointer',
- border: `2px solid ${selectedFontPack === pack.heading ? 'var(--color-accent, #0066FF)' : 'transparent'}`,
+ border: `2px solid ${selectedFontPack === pack.heading ? 'var(--color-text-primary, #111)' : 'transparent'}`,
borderRadius: 14,
overflow: 'hidden',
transition: 'border-color 0.15s ease',
@@ -751,43 +916,12 @@ export function TemplateFullPreview({
templateName={templateName}
isVisible={showPublishModal}
onBack={() => setShowPublishModal(false)}
+ onPublish={onBack}
/>
</div>
</div>
</div>
- {/* Resize handle */}
- <style>{`
- .xds-resize-handle { opacity: 0; transition: opacity 150ms ease, background-color 150ms ease; }
- .xds-resize-grip:hover .xds-resize-handle { opacity: 0.6; }
- .xds-resize-grip[data-resizing="true"] .xds-resize-handle { opacity: 1; }
- `}</style>
- <div
- onMouseDown={handleResizeStart}
- data-resizing={isResizing}
- className="xds-resize-grip"
- style={{
- width: 8,
- flexShrink: 0,
- cursor: 'col-resize',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- zIndex: 10,
- }}>
- <div
- className="xds-resize-handle"
- style={{
- width: 3,
- height: 32,
- borderRadius: 2,
- backgroundColor: isResizing
- ? 'var(--color-icon-primary, #111)'
- : 'var(--color-border-strong, #ccc)',
- }}
- />
- </div>
-
{/* RIGHT PANEL — preview area */}
<div
style={{
@@ -986,7 +1120,7 @@ export function TemplateFullPreview({
padding: '22px 22px 22px',
display: !showEditor || editorView === 'preview' ? 'flex' : 'none',
justifyContent: 'center',
- alignItems: 'flex-start',
+ alignItems: 'center',
flex: 1,
overflow: 'auto',
}}>
@@ -1126,53 +1260,35 @@ export function TemplateFullPreview({
</div>
</div>
- {/* Similar templates — only visible in preview mode */}
+ {/* More like this + Explore more — only visible in preview mode */}
{(!showEditor || editorView === 'preview') && (
- <div
- style={{
- width: '100%',
- padding: '24px 32px 32px',
- boxSizing: 'border-box' as const,
- marginTop: 'auto',
- textAlign: 'center' as const,
- }}>
- <XDSHeading level={3}>Similar templates</XDSHeading>
- <div
- style={{
- display: 'flex',
- gap: 12,
- marginTop: 12,
- overflowX: 'auto' as const,
- justifyContent: 'center',
- }}>
- {TEMPLATES.slice(0, 4).map((t, i) => (
- <div
- key={i}
- onClick={() => onSelectTemplate?.(i)}
- style={{
- flex: '0 0 280px',
- aspectRatio: '1920 / 1200',
- border: '1px solid var(--color-divider, rgba(0,0,0,0.1))',
- backgroundColor: 'var(--color-background-card, #fff)',
- borderRadius: 8,
- boxShadow: hideShadows ? 'none' : '0 4px 20px rgba(0,0,0,0.08)',
- overflow: 'hidden',
- cursor: 'pointer',
- }}>
- <img
- src={t.src}
- alt={t.name}
- style={{
- display: 'block',
- width: '100%',
- height: '100%',
- objectFit: 'cover',
+ <>
+ <div style={{padding: '16px 32px 0'}}>
+ <XDSHeading level={2}>More like this</XDSHeading>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 12, marginTop: 16}}>
+ {TEMPLATES.filter((_, i) => i !== TEMPLATES.findIndex(tt => tt.name === templateName)).slice(0, 10).map((t, i) => (
+ <XDSCard
+ key={i}
+ padding={0}
+ onClick={() => {
+ const idx = TEMPLATES.indexOf(t);
+ onSelectTemplate?.(idx !== -1 ? idx : i);
}}
- />
- </div>
- ))}
+ style={{cursor: 'pointer', aspectRatio: '16/10', overflow: 'hidden'}}>
+ <img src={t.src} alt={t.name} style={{width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'top', display: 'block'}} />
+ </XDSCard>
+ ))}
+ </div>
</div>
- </div>
+ <div style={{padding: '32px 32px 40px'}}>
+ <XDSHeading level={2}>Explore more</XDSHeading>
+ <div style={{display: 'flex', flexWrap: 'wrap' as const, gap: 8, marginTop: 16}}>
+ {['website', 'dashboard', 'admin panel', 'settings', 'form layout', 'data table', 'sidebar nav', 'landing page', 'e-commerce', 'documentation', 'profile page'].map(tag => (
+ <XDSToken key={tag} label={tag} />
+ ))}
+ </div>
+ </div>
+ </>
)}
</div>
</div>
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
index 155750623c..5d9b4ddf40 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
@@ -260,7 +260,7 @@ export function TemplatePreview({
overflow: 'auto',
display: 'flex',
justifyContent: 'center',
- alignItems: viewportSize === 'phone' ? 'flex-start' : 'stretch',
+ alignItems: 'flex-start',
backgroundColor: 'var(--color-background-body, #f5f5f5)',
padding: viewportSize === 'phone' ? 24 : 16,
cursor: isPointing ? 'crosshair' : undefined,
@@ -282,9 +282,8 @@ export function TemplatePreview({
style={{
display: 'block',
width: viewportSize === 'phone' ? 375 : '100%',
- minHeight: viewportSize === 'phone' ? undefined : '100%',
aspectRatio: viewportSize === 'phone' ? '9 / 19.5' : undefined,
- objectFit: 'cover',
+ objectFit: viewportSize === 'phone' ? 'cover' : undefined,
borderRadius: viewportSize === 'phone' ? 36 : 12,
boxShadow: viewportSize === 'phone'
? '0 8px 40px rgba(0,0,0,0.15)'
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts b/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
index cf1b9fe4fe..f1e4836896 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
@@ -184,7 +184,7 @@ export const TEMPLATES: {
{name: 'Contact Form', src: FIRST_CARD_IMAGE, size: 'large'},
{name: 'Shopping Details', src: SHOPPING_DETAILS_IMAGE, size: 'small'},
{name: 'Button Component', src: SCREENSHOT_3_IMAGE, size: 'small'},
- {name: 'Settings Page', src: DUMMY_IMAGE, size: 'small'},
+ {name: 'Settings Page', src: '/templates/card4-preview.png', size: 'small'},
{name: 'Login Form', src: DUMMY_IMAGE, size: 'xlarge'},
{name: 'Dashboard', src: DUMMY_IMAGE, size: 'large'},
{name: 'Data Table', src: DUMMY_IMAGE, size: 'small'},
@@ -238,100 +238,30 @@ export const PUBLISH_TAGS = [
];
// ---------------------------------------------------------------------------
-// Preview palettes and font packs
+// Theme picker entries (used in TemplateFullPreview)
// ---------------------------------------------------------------------------
-export const PREVIEW_COLOR_PALETTES = [
- {name: 'Warm', colors: ['#2D2926', '#D4A574', '#F5E6D3', '#FFFFFF']},
- {name: 'Cool', colors: ['#1B2838', '#4A90D9', '#B8D4E3', '#F0F4F8']},
- {name: 'Earth', colors: ['#3D2B1F', '#8B6914', '#C4A35A', '#F5F0E1']},
- {name: 'Mono', colors: ['#111111', '#555555', '#AAAAAA', '#F5F5F5']},
-];
-
-export const PREVIEW_THEMES: Array<{
+export type ThemePickerEntry = {
key: string;
name: string;
- category: 'pinned' | 'official' | 'community';
- colors: {
- background: string;
- surface: string;
- border: string;
- accent: string;
- text: string;
- };
-}> = [
- {
- key: 'default',
- name: 'Default',
- category: 'pinned',
- colors: {
- background: '#FFFFFF',
- surface: '#F5F5F5',
- border: '#E0E0E0',
- accent: '#0066FF',
- text: '#1A1A1A',
- },
- },
- {
- key: 'dark',
- name: 'Dark',
- category: 'pinned',
- colors: {
- background: '#1A1A1A',
- surface: '#2A2A2A',
- border: '#3A3A3A',
- accent: '#4D9EFF',
- text: '#F0F0F0',
- },
- },
- {
- key: 'warm',
- name: 'Warm Sand',
- category: 'official',
- colors: {
- background: '#FDF8F3',
- surface: '#F5EDE3',
- border: '#E8DDD0',
- accent: '#C87941',
- text: '#2D2926',
- },
- },
- {
- key: 'cool',
- name: 'Cool Slate',
- category: 'official',
- colors: {
- background: '#F0F4F8',
- surface: '#E2EAF2',
- border: '#CBD5E1',
- accent: '#3B82F6',
- text: '#1E293B',
- },
- },
- {
- key: 'forest',
- name: 'Forest',
- category: 'community',
- colors: {
- background: '#F0F5F1',
- surface: '#E0EBE2',
- border: '#C1D6C5',
- accent: '#2D8A4E',
- text: '#1A2E1F',
- },
- },
- {
- key: 'lavender',
- name: 'Lavender',
- category: 'community',
- colors: {
- background: '#F5F0FA',
- surface: '#EBE0F5',
- border: '#D4C4E8',
- accent: '#7C3AED',
- text: '#2E1A47',
- },
- },
+ category: 'official' | 'community';
+ accent: string;
+ description?: string;
+ isPinnedByDefault?: boolean;
+ preview: {bg: string; surface: string; accent: string; text: string};
+};
+
+export const THEME_PICKER_ENTRIES: ThemePickerEntry[] = [
+ // Official — shipped theme packages
+ {key: 'default', name: 'Default', category: 'official', accent: '#0066FF', isPinnedByDefault: true, description: 'Clean blue accent with neutral grays', preview: {bg: '#FFFFFF', surface: '#F5F5F5', accent: '#0066FF', text: '#111111'}},
+ {key: 'meta', name: 'Meta', category: 'official', accent: '#0064E0', description: 'Meta brand with Figtree typography', preview: {bg: '#FFFFFF', surface: '#F2F4F6', accent: '#0064E0', text: '#111112'}},
+ {key: 'whatsapp', name: 'WhatsApp', category: 'official', accent: '#1DAA61', description: 'WhatsApp brand greens and warm grays', preview: {bg: '#FFFFFF', surface: '#F7F5F3', accent: '#1DAA61', text: '#111B21'}},
+ {key: 'threads', name: 'Threads', category: 'official', accent: '#000000', description: 'Threads brand with clean monochrome palette', preview: {bg: '#FFFFFF', surface: '#F5F5F5', accent: '#000000', text: '#111111'}},
+ {key: 'facebook', name: 'Facebook', category: 'official', accent: '#1877F2', description: 'Classic Facebook blue brand colors', preview: {bg: '#FFFFFF', surface: '#F0F2F5', accent: '#1877F2', text: '#1C1E21'}},
+ // Community — future user-contributed themes
+ {key: 'forest', name: 'Forest', category: 'community', accent: '#2D8A4E', description: 'Earthy greens and warm browns', preview: {bg: '#F4F7F4', surface: '#E8EDE8', accent: '#2D8A4E', text: '#1A2E1A'}},
+ {key: 'sunset', name: 'Sunset', category: 'community', accent: '#E5484D', description: 'Warm reds and golden highlights', preview: {bg: '#FFF5F5', surface: '#FDE8E8', accent: '#E5484D', text: '#2D1515'}},
+ {key: 'midnight', name: 'Midnight', category: 'community', accent: '#818CF8', description: 'Deep blues with soft violet accents', preview: {bg: '#0F172A', surface: '#1E293B', accent: '#818CF8', text: '#E2E8F0'}},
];
export const PREVIEW_FONT_PACKS = [
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx
index afc3894e4e..7b8b9a1a99 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx
@@ -32,8 +32,124 @@ export {
Squares2X2Icon as GridIcon,
SparklesIcon,
StopIcon,
+ StarIcon,
} from '@heroicons/react/24/outline';
+export {BookmarkIcon as BookmarkFilledIcon, StarIcon as StarFilledIcon} from '@heroicons/react/24/solid';
+
+// Brand logos for theme picker
+
+export const MetaLogo = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 287.56 191" fill="none" {...props}>
+ <defs>
+ <linearGradient id="meta-g1" x1="61" y1="117" x2="259" y2="127" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stopColor="#0064e1" /><stop offset="0.4" stopColor="#0064e1" /><stop offset="0.83" stopColor="#0073ee" /><stop offset="1" stopColor="#0082fb" />
+ </linearGradient>
+ <linearGradient id="meta-g2" x1="45" y1="139" x2="45" y2="66" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stopColor="#0082fb" /><stop offset="1" stopColor="#0064e0" />
+ </linearGradient>
+ </defs>
+ <path fill="#0081fb" d="m31.06,125.96c0,10.98 2.41,19.41 5.56,24.51 4.13,6.68 10.29,9.51 16.57,9.51 8.1,0 15.51-2.01 29.79-21.76 11.44-15.83 24.92-38.05 33.99-51.98l15.36-23.6c10.67-16.39 23.02-34.61 37.18-46.96 11.56-10.08 24.03-15.68 36.58-15.68 21.07,0 41.14,12.21 56.5,35.11 16.81,25.08 24.97,56.67 24.97,89.27 0,19.38-3.82,33.62-10.32,44.87-6.28,10.88-18.52,21.75-39.11,21.75l0-31.02c17.63,0 22.03-16.2 22.03-34.74 0-26.42-6.16-55.74-19.73-76.69-9.63-14.86-22.11-23.94-35.84-23.94-14.85,0-26.8,11.2-40.23,31.17-7.14,10.61-14.47,23.54-22.7,38.13l-9.06,16.05c-18.2,32.27-22.81,39.62-31.91,51.75-15.95,21.24-29.57,29.29-47.5,29.29-21.27,0-34.72-9.21-43.05-23.09-6.8-11.31-10.14-26.15-10.14-43.06z" />
+ <path fill="url(#meta-g1)" d="m24.49,37.3c14.24-21.95 34.79-37.3 58.36-37.3 13.65,0 27.22,4.04 41.39,15.61 15.5,12.65 32.02,33.48 52.63,67.81l7.39,12.32c17.84,29.72 27.99,45.01 33.93,52.22 7.64,9.26 12.99,12.02 19.94,12.02 17.63,0 22.03-16.2 22.03-34.74l27.4-.86c0,19.38-3.82,33.62-10.32,44.87-6.28,10.88-18.52,21.75-39.11,21.75-12.8,0-24.14-2.78-36.68-14.61-9.64-9.08-20.91-25.21-29.58-39.71l-25.79-43.08c-12.94-21.62-24.81-37.74-31.68-45.04-7.39-7.85-16.89-17.33-32.05-17.33-12.27,0-22.69,8.61-31.41,21.78z" />
+ <path fill="url(#meta-g2)" d="m82.35,31.23c-12.27,0-22.69,8.61-31.41,21.78-12.33,18.61-19.88,46.33-19.88,72.95 0,10.98 2.41,19.41 5.56,24.51l-26.48,17.44c-6.8-11.31-10.14-26.15-10.14-43.06 0-30.75 8.44-62.8 24.49-87.55 14.24-21.95 34.79-37.3 58.36-37.3z" />
+ </svg>
+);
+
+export const WhatsAppLogo = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 175.216 175.552" fill="none" {...props}>
+ <defs>
+ <linearGradient id="wa-g" x1="85.915" y1="32.567" x2="86.535" y2="137.092" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stopColor="#57d163" /><stop offset="1" stopColor="#23b33a" />
+ </linearGradient>
+ </defs>
+ <path fill="url(#wa-g)" d="M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 009.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 00-17.895-43.251 60.75 60.75 0 00-43.235-17.928z" />
+ <path fill="#fff" fillRule="evenodd" d="M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647" />
+ </svg>
+);
+
+export const PinIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" {...props}>
+ <path d="M12 17v5" />
+ <path d="M9 2h6l-1 7h4l-2 4H8L6 9h4z" />
+ </svg>
+);
+
+export const PinFilledIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 24 24" fill="currentColor" stroke="none" {...props}>
+ <path d="M9 2h6l-1 7h4l-2 4H8L6 9h4z" />
+ <rect x="11" y="17" width="2" height="5" rx="1" />
+ </svg>
+);
+
+export const ThreadsLogo = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg aria-label="Threads" viewBox="0 0 192 192" {...props}>
+ <path d="M141.537 88.9883C140.71 88.5919 139.87 88.2104 139.019 87.8451C137.537 60.5382 122.616 44.905 97.5619 44.745C97.4484 44.7443 97.3355 44.7443 97.222 44.7443C82.2364 44.7443 69.7731 51.1409 62.102 62.7807L75.881 72.2328C81.6116 63.5383 90.6052 61.6848 97.2286 61.6848C97.3051 61.6848 97.3819 61.6848 97.4576 61.6855C105.707 61.7381 111.932 64.1366 115.961 68.814C118.893 72.2193 120.854 76.925 121.825 82.8638C114.511 81.6207 106.601 81.2385 98.145 81.7233C74.3247 83.0954 59.0111 96.9879 60.0396 116.292C60.5615 126.084 65.4397 134.508 73.775 140.011C80.8224 144.663 89.899 146.938 99.3323 146.423C111.79 145.74 121.563 140.987 128.381 132.296C133.559 125.696 136.834 117.143 138.28 106.366C144.217 109.949 148.617 114.664 151.047 120.332C155.179 129.967 155.42 145.8 142.501 158.708C131.182 170.016 117.576 174.908 97.0135 175.059C74.2042 174.89 56.9538 167.575 45.7381 153.317C35.2355 139.966 29.8077 120.682 29.6052 96C29.8077 71.3178 35.2355 52.0336 45.7381 38.6827C56.9538 24.4249 74.2039 17.11 97.0132 16.9405C119.988 17.1113 137.539 24.4614 149.184 38.788C154.894 45.8136 159.199 54.6488 162.037 64.9503L178.184 60.6422C174.744 47.9622 169.331 37.0357 161.965 27.974C147.036 9.60668 125.202 0.195148 97.0695 0H96.9569C68.8816 0.19447 47.2921 9.6418 32.7883 28.0793C19.8819 44.4864 13.2244 67.3157 13.0007 95.9325L13 96L13.0007 96.0675C13.2244 124.684 19.8819 147.514 32.7883 163.921C47.2921 182.358 68.8816 191.806 96.9569 192H97.0695C122.03 191.827 139.624 185.292 154.118 170.811C173.081 151.866 172.51 128.119 166.26 113.541C161.776 103.087 153.227 94.5962 141.537 88.9883ZM98.4405 129.507C88.0005 130.095 77.1544 125.409 76.6196 115.372C76.2232 107.93 81.9158 99.626 99.0812 98.6368C101.047 98.5234 102.976 98.468 104.871 98.468C111.106 98.468 116.939 99.0737 122.242 100.233C120.264 124.935 108.662 128.946 98.4405 129.507Z" fill="#000" />
+ </svg>
+);
+
+export const FacebookLogo = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 24 24" fill="none" {...props}>
+ <path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" fill="#1877F2" />
+ </svg>
+);
+
+// Theme icons — distinctive identifiers for each theme
+
+export const DefaultThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 46 24" fill="currentColor" {...props}>
+ <path d="M2.4239 15.8011C2.03945 16.3796 1.66972 16.9538 1.3147 17.524C0.707427 18.4992 1.42354 19.7348 2.57241 19.7348C3.13302 19.7348 3.64463 19.4209 3.91525 18.93C4.29391 18.243 4.71274 17.5352 5.17173 16.8066C5.38894 16.4618 5.60743 16.12 5.82721 15.7812C6.25251 15.1254 6.46516 14.7976 6.76252 14.68C6.99255 14.5891 7.27368 14.5899 7.50317 14.6822C7.79984 14.8014 8.00881 15.1278 8.42675 15.7804C8.64287 16.1179 8.85732 16.46 9.07008 16.8066C9.52175 17.534 9.93823 18.2339 10.3195 18.9063C10.6075 19.4141 11.1428 19.7348 11.7266 19.7348C12.9476 19.7348 13.7063 18.4203 13.0547 17.3877C12.7332 16.8781 12.3991 16.3639 12.0525 15.8453C11.3983 14.8527 10.7379 13.8906 10.0714 12.9592C9.81687 12.6036 9.68962 12.4258 9.64377 12.2384C9.60589 12.0836 9.60492 11.9307 9.64085 11.7754C9.68435 11.5874 9.80856 11.4091 10.057 11.0526C10.7093 10.1164 11.3596 9.15781 12.0078 8.1768C12.3869 7.60474 12.7521 7.03681 13.1035 6.47298C13.71 5.49987 12.9962 4.26519 11.8496 4.26519C11.2943 4.26519 10.7868 4.57405 10.5169 5.05923C10.1399 5.73688 9.72461 6.43721 9.27114 7.16022C9.06143 7.49458 8.8505 7.82569 8.63835 8.15358C8.21478 8.80819 8.003 9.1355 7.70554 9.25334C7.47561 9.34442 7.19397 9.34375 6.96448 9.25156C6.66759 9.13229 6.45853 8.80578 6.04043 8.15276C5.83116 7.82591 5.62351 7.49506 5.41747 7.16022C4.97918 6.44793 4.5738 5.76096 4.20132 5.0993C3.9136 4.58821 3.37617 4.26519 2.78967 4.26519C1.56624 4.26519 0.805692 5.58299 1.45419 6.62041C1.76588 7.11903 2.08912 7.6231 2.4239 8.1326C3.0752 9.10994 3.73263 10.059 4.3962 10.9796C4.65373 11.337 4.7825 11.5156 4.82882 11.7042C4.86709 11.86 4.86797 12.0139 4.83149 12.1702C4.78732 12.3593 4.66122 12.5385 4.40903 12.897C3.74526 13.8406 3.08355 14.8086 2.4239 15.8011Z" />
+ <path fillRule="evenodd" clipRule="evenodd" d="M22.4734 4.26519C20.4471 4.26519 19.434 4.26519 18.6657 4.67201C18.0456 5.00031 17.5385 5.50739 17.2102 6.12744C16.8034 6.89579 16.8034 7.90892 16.8034 9.9352V14.0648C16.8034 16.0911 16.8034 17.1042 17.2102 17.8726C17.5385 18.4926 18.0456 18.9997 18.6657 19.328C19.434 19.7348 20.4471 19.7348 22.4734 19.7348H23.2039C24.8496 19.7348 26.2644 19.4033 27.4485 18.7403C28.6399 18.07 29.5559 17.1529 30.1963 15.989C30.8367 14.825 31.1569 13.4954 31.1569 12C31.1569 10.5046 30.8367 9.17495 30.1963 8.01105C29.5559 6.84714 28.6399 5.9337 27.4485 5.27072C26.2644 4.60037 24.8496 4.26519 23.2039 4.26519H22.4734ZM20.0092 8.74707C20.0092 8.16814 20.0092 7.87867 20.1255 7.65914C20.2193 7.48198 20.3641 7.33711 20.5413 7.24331C20.7608 7.12707 21.0503 7.12707 21.6292 7.12707H23.1927C24.6522 7.12707 25.7916 7.57274 26.6107 8.46409C27.4299 9.34807 27.8394 10.5267 27.8394 12C27.8394 13.4659 27.4299 14.6446 26.6107 15.5359C25.7916 16.4273 24.6522 16.8729 23.1927 16.8729H21.6292C21.0503 16.8729 20.7608 16.8729 20.5413 16.7567C20.3641 16.6629 20.2193 16.518 20.1255 16.3409C20.0092 16.1213 20.0092 15.8319 20.0092 15.2529V8.74707Z" />
+ <path d="M35.4666 19.2376C36.6134 19.7459 37.9501 20 39.4767 20H39.8006C41.7144 20 43.2261 19.5801 44.3357 18.7403C45.4452 17.9006 46 16.7403 46 15.2597C46 14.3757 45.8213 13.6501 45.4638 13.0829C45.1064 12.5083 44.6559 12.0589 44.1123 11.7348C43.5761 11.4033 43.0325 11.1565 42.4814 10.9945C41.9304 10.8324 41.4575 10.7145 41.0628 10.6409L38.706 10.1878C38.0283 10.0552 37.4698 9.87477 37.0305 9.64641C36.5985 9.41068 36.3826 9.02762 36.3826 8.49724C36.3826 7.96685 36.6395 7.55064 37.1533 7.24862C37.6671 6.93923 38.3857 6.78453 39.3091 6.78453H39.6219C40.3964 6.78453 41.1224 6.93186 41.8001 7.22652C42.0982 7.35474 42.3899 7.5234 42.6754 7.73251C43.326 8.20923 44.2444 8.27802 44.8243 7.71734C45.34 7.21868 45.4053 6.39786 44.8761 5.91349C44.3498 5.43171 43.7638 5.03698 43.1181 4.72928C42.1054 4.24309 40.9511 4 39.6554 4H39.3315C38.0953 4 37.0156 4.19521 36.0922 4.58564C35.1762 4.97606 34.4613 5.52486 33.9475 6.23204C33.4411 6.93186 33.188 7.76059 33.188 8.71823C33.188 9.49171 33.3406 10.1436 33.6459 10.674C33.9587 11.2044 34.3571 11.6354 34.8411 11.9669C35.3326 12.2983 35.8539 12.5599 36.4049 12.7514C36.956 12.9355 37.4698 13.0718 37.9464 13.1602L40.3033 13.6243C40.6905 13.698 41.074 13.8011 41.4538 13.9337C41.841 14.0589 42.1612 14.2431 42.4144 14.4862C42.6676 14.7293 42.7942 15.0608 42.7942 15.4807C42.7942 16.6151 41.7814 17.1823 39.7559 17.1823H39.4432C38.49 17.1823 37.615 17.0055 36.8182 16.6519C36.4847 16.4994 36.1665 16.3134 35.8635 16.0938C35.17 15.5911 34.1857 15.5241 33.5784 16.1282C33.0651 16.6388 32.9912 17.4631 33.5198 17.9578C34.0797 18.4818 34.7287 18.9083 35.4666 19.2376Z" />
+ </svg>
+);
+
+export const NeutralThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <circle cx="10" cy="10" r="8" stroke="#525252" strokeWidth="2" />
+ <path d="M10 2a8 8 0 010 16V2z" fill="#525252" />
+ </svg>
+);
+
+export const BrutalistThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <path d="M10 1L19 10L10 19L1 10Z" fill="#FF1493" />
+ <path d="M10 5L15 10L10 15L5 10Z" fill="#fff" />
+ </svg>
+);
+
+export const DailyThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <circle cx="10" cy="10" r="4" fill="#0064E0" />
+ {[0, 45, 90, 135, 180, 225, 270, 315].map(deg => (
+ <line key={deg} x1="10" y1="2" x2="10" y2="4.5" stroke="#0064E0" strokeWidth="1.8" strokeLinecap="round" transform={`rotate(${deg} 10 10)`} />
+ ))}
+ </svg>
+);
+
+export const ForestThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <path d="M10 2C10 2 4 8 4 12.5C4 15.5 6.7 18 10 18C13.3 18 16 15.5 16 12.5C16 8 10 2 10 2Z" fill="#2D8A4E" />
+ <path d="M10 10V17" stroke="#1A5C33" strokeWidth="1.5" strokeLinecap="round" />
+ <path d="M10 13C8.5 11.5 7 12 7 12" stroke="#1A5C33" strokeWidth="1.2" strokeLinecap="round" />
+ </svg>
+);
+
+export const SunsetThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <path d="M3 14h14" stroke="#E5484D" strokeWidth="1.5" strokeLinecap="round" />
+ <path d="M5 14a5 5 0 0110 0" fill="#E5484D" />
+ <path d="M10 3v2M15.5 8.5l-1.4 1.4M4.5 8.5l1.4 1.4M17 14h0M3 14h0" stroke="#F59E0B" strokeWidth="1.5" strokeLinecap="round" />
+ </svg>
+);
+
+export const MidnightThemeIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg viewBox="0 0 20 20" fill="none" {...props}>
+ <path d="M15.5 11.5A6.5 6.5 0 018.5 4.5 6.5 6.5 0 1015.5 11.5z" fill="#818CF8" />
+ <circle cx="14" cy="5" r="1" fill="#818CF8" opacity={0.6} />
+ <circle cx="16.5" cy="8" r="0.6" fill="#818CF8" opacity={0.4} />
+ </svg>
+);
+
// Brand icons — no Heroicons equivalent
export const ClaudeIcon = (props: React.SVGProps<SVGSVGElement>) => (
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
index 4280e83525..4792d29f30 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
@@ -5,7 +5,7 @@ import {useSearchParams, useRouter} from 'next/navigation';
import {createSimulation} from './BoidsCanvas';
import type {BoidsSimulation} from './BoidsCanvas';
-import {TEMPLATES, XDS_THEMES} from './constants';
+import {TEMPLATES, XDS_THEMES, AVATAR_IMAGE, THEME_PICKER_ENTRIES} from './constants';
import {TemplateCard} from './TemplateCard';
import {AIComposer} from './AIComposer';
import {ChatPanel} from './ChatPanel';
@@ -17,13 +17,18 @@ import {TemplateFullPreview} from './TemplateFullPreview';
import {AppTopNav} from './AppTopNav';
import {DocsView} from './DocsView';
import {ProfileView} from './ProfileView';
+import {XDSAvatar} from '@xds/core/Avatar';
import {XDSButton} from '@xds/core/Button';
+import {XDSCard} from '@xds/core/Card';
import {XDSText} from '@xds/core/Text';
+import {XDSToken} from '@xds/core/Token';
import {XDSDropdownMenu} from '@xds/core/DropdownMenu';
import {
XDSSegmentedControl,
XDSSegmentedControlItem,
} from '@xds/core/SegmentedControl';
+import {XDSDialog, XDSDialogHeader} from '@xds/core/Dialog';
+import {XDSTextInput} from '@xds/core/TextInput';
import {XDSToolbar} from '@xds/core/Toolbar';
import {XDSTooltip} from '@xds/core/Tooltip';
import {
@@ -35,8 +40,34 @@ import {
ContrastIcon,
SaveIcon,
ShareIcon,
+ BookmarkIcon,
+ BookmarkFilledIcon,
+ StarIcon,
+ StarFilledIcon,
+ SearchIcon,
+ LinkIcon,
+ HeartIcon,
+ MetaLogo,
+ WhatsAppLogo,
+ ThreadsLogo,
+ FacebookLogo,
+ DefaultThemeIcon,
+ ForestThemeIcon,
+ SunsetThemeIcon,
+ MidnightThemeIcon,
} from './docsite-icons';
+const BRAND_LOGOS: Record<string, React.ComponentType<React.SVGProps<SVGSVGElement>>> = {
+ default: DefaultThemeIcon,
+ meta: MetaLogo,
+ whatsapp: WhatsAppLogo,
+ threads: ThreadsLogo,
+ facebook: FacebookLogo,
+ forest: ForestThemeIcon,
+ sunset: SunsetThemeIcon,
+ midnight: MidnightThemeIcon,
+};
+
// ---------------------------------------------------------------------------
// Page
// ---------------------------------------------------------------------------
@@ -87,6 +118,21 @@ function DocsiteLandingTemplate() {
const [sharePopoverPos, setSharePopoverPos] = useState(null as {top: number; left: number} | null);
const shareButtonRef = useRef<HTMLButtonElement>(null);
const scrollContainerRef = useRef(null);
+ const [card4SelectedThumb, setCard4SelectedThumb] = useState(0);
+ const [card4SelectedOption, setCard4SelectedOption] = useState('default');
+ const [card4ThemeBrowse, setCard4ThemeBrowse] = useState(false);
+ const [card4ThemeSearch, setCard4ThemeSearch] = useState('');
+ const [card4PinnedThemes, setCard4PinnedThemes] = useState(
+ () => new Set(THEME_PICKER_ENTRIES.filter(t => t.isPinnedByDefault).map(t => t.key)),
+ );
+ const toggleCard4Pin = useCallback((key: string) => {
+ setCard4PinnedThemes(prev => {
+ const next = new Set(prev);
+ if (next.has(key)) next.delete(key);
+ else next.add(key);
+ return next;
+ });
+ }, []);
const handleEditorResizeStart = useCallback((e: React.MouseEvent) => {
e.preventDefault();
@@ -202,6 +248,7 @@ function DocsiteLandingTemplate() {
const handleUse = useCallback((index: number) => {
setPreviewTarget(null);
setUseTarget(index);
+ setPanelTab('configure');
setChatOpen(true);
}, []);
@@ -515,6 +562,7 @@ function DocsiteLandingTemplate() {
templateName={t.name}
isVisible={showPublishCard1}
onBack={() => setShowPublishCard1(false)}
+ onPublish={handleBackFromUse}
/>
) : (
<ChatPanel
@@ -713,6 +761,7 @@ function DocsiteLandingTemplate() {
templateName={t.name}
isVisible={showPublishCard1}
onBack={() => setShowPublishCard1(false)}
+ onPublish={handleBackFromUse}
/>
) : (
<ChatPanel
@@ -780,7 +829,8 @@ function DocsiteLandingTemplate() {
}
// Preview page for all other cards (two-step: preview → editor)
- if (previewTarget !== null && useTarget === null && activeView === 'craft') {
+ // Card 4 (previewTarget === 3) is handled as a bottom drawer overlay on the craft grid below.
+ if (previewTarget !== null && previewTarget !== 3 && useTarget === null && activeView === 'craft') {
const t = TEMPLATES[previewTarget % TEMPLATES.length];
return (
<TemplateFullPreview
@@ -792,6 +842,7 @@ function DocsiteLandingTemplate() {
onUse={() => {
setUseTarget(previewTarget);
setPreviewTarget(null);
+ setPanelTab('configure');
setChatOpen(true);
}}
onSelectTemplate={index => {
@@ -915,6 +966,297 @@ function DocsiteLandingTemplate() {
</div>
{!chatOpen && <AIComposer />}
+
+ {/* Card 4 — Bottom drawer overlay */}
+ {previewTarget === 3 && (() => {
+ const t = TEMPLATES[3];
+ const thumbnailTemplates = TEMPLATES.slice(0, 5);
+ const relatedTemplates = TEMPLATES.filter((_, i) => i !== 3).slice(0, 10);
+ const card4Options = [
+ {key: 'default', label: 'Default Theme', description: 'Clean neutral palette with blue accent. Great for internal tools.', preview: {bg: '#F5F5F5', accent: '#0066FF'}},
+ {key: 'meta', label: 'Meta Theme', description: 'Meta brand colors with Figtree typography.', preview: {bg: '#F2F4F6', accent: '#0064E0'}},
+ {key: 'dark', label: 'Dark Mode', description: 'Dark surface with high-contrast text. Reduces eye strain.', preview: {bg: '#1E293B', accent: '#818CF8'}},
+ ];
+ return (
+ <>
+ <style>{`
+ @keyframes card4DrawerSlideUp {
+ from { opacity: 0; }
+ to { opacity: 1; }
+ }
+ @keyframes card4BackdropFadeIn {
+ from { opacity: 0; }
+ to { opacity: 1; }
+ }
+ `}</style>
+ {/* Backdrop */}
+ <div
+ onClick={() => setPreviewTarget(null)}
+ style={{
+ position: 'fixed', inset: 0, zIndex: 100,
+ backgroundColor: 'rgba(0,0,0,0.4)',
+ backdropFilter: 'blur(2px)',
+ animation: 'card4BackdropFadeIn 300ms ease',
+ }}
+ />
+ {/* Drawer */}
+ <div style={{
+ position: 'fixed', inset: 0, margin: 'auto', zIndex: 101,
+ width: '90vw', maxWidth: 1200, height: 'fit-content', maxHeight: '90vh',
+ backgroundColor: 'var(--color-background-card, #fff)',
+ borderRadius: 16,
+ boxShadow: '0 8px 60px rgba(0,0,0,0.2)',
+ display: 'flex', flexDirection: 'column',
+ animation: 'card4DrawerSlideUp 400ms cubic-bezier(0.16, 1, 0.3, 1)',
+ overflow: 'visible',
+ }}>
+ {/* Floating close button — outside modal, top-right with 8px gap */}
+ <div style={{position: 'absolute', top: 0, right: -44, zIndex: 1}}>
+ <XDSButton
+ label="Close"
+ variant="secondary"
+ size="sm"
+ isIconOnly
+ icon={<span style={{fontSize: 16, lineHeight: 1}}>✕</span>}
+ onClick={() => setPreviewTarget(null)}
+ style={{borderRadius: '50%', width: 36, height: 36, backgroundColor: '#fff', color: '#111', border: 'none', boxShadow: '0 2px 12px rgba(0,0,0,0.2)'}}
+ />
+ </div>
+
+ {/* Scrollable content */}
+ <div style={{overflowY: 'auto', borderRadius: 16}}>
+ {/* Main content: image left + details right */}
+ <div style={{display: 'flex', minHeight: 0, padding: '0 24px'}}>
+ {/* Left — Preview image + thumbnails */}
+ <div style={{flex: 1, minWidth: 0, padding: '24px 24px 24px 0', display: 'flex', flexDirection: 'column', gap: 12}}>
+ <div style={{flex: 1, aspectRatio: '16 / 10', backgroundColor: 'var(--color-background-muted, #f9f9f9)', borderRadius: 12, overflow: 'hidden', border: '1px solid var(--color-border, #e0e0e0)'}}>
+ <img
+ src={card4SelectedThumb === 0 ? t.src : thumbnailTemplates[card4SelectedThumb]?.src || t.src}
+ alt={t.name}
+ style={{width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'top'}}
+ />
+ </div>
+ </div>
+
+ {/* Right — Details panel */}
+ <div style={{width: 360, flexShrink: 0, padding: '24px 0', display: 'flex', flexDirection: 'column'}}>
+ {/* Title */}
+ <XDSText type="display-2">{t.name}</XDSText>
+
+ {/* Description */}
+ <div style={{marginTop: 8}}>
+ <XDSText type="body" color="secondary">
+ Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.
+ </XDSText>
+ </div>
+
+ {/* Author */}
+ <div style={{marginTop: 16, display: 'flex', alignItems: 'center', gap: 12}}>
+ <XDSAvatar name="Andrea Anderson" size={36} src={AVATAR_IMAGE} />
+ <div style={{display: 'flex', flexDirection: 'column'}}>
+ <XDSText type="supporting" color="secondary">Crafted by</XDSText>
+ <XDSText type="body" style={{fontWeight: 600, fontSize: 16}}>Andrea Anderson</XDSText>
+ </div>
+ </div>
+
+ {/* Stats buttons */}
+ <div style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginTop: 16, marginLeft: -8, marginRight: -8}}>
+ <div style={{display: 'flex', alignItems: 'center', gap: 4}}>
+ <XDSTooltip content="Copy link">
+ <XDSButton label="Link" variant="ghost" size="sm" isIconOnly icon={<LinkIcon />} />
+ </XDSTooltip>
+ <XDSTooltip content="Share">
+ <XDSButton label="Share" variant="ghost" size="sm" isIconOnly icon={<ShareIcon />} />
+ </XDSTooltip>
+ </div>
+ <div style={{display: 'flex', alignItems: 'center', gap: 4}}>
+ <XDSButton label="1,645" variant="ghost" size="sm" style={{color: 'var(--color-text-secondary, #65676B)'}} icon={<HeartIcon />} />
+ <XDSButton label="892" variant="ghost" size="sm" style={{color: 'var(--color-text-secondary, #65676B)'}} icon={<BookmarkIcon />} />
+ </div>
+ </div>
+
+ {/* CTA */}
+ <div style={{marginTop: 16}}>
+ <XDSButton
+ label="Start crafting"
+ variant="primary"
+ size="lg"
+ style={{width: '100%'}}
+ onClick={() => {
+ setUseTarget(3);
+ setPreviewTarget(null);
+ setPanelTab('configure');
+ setChatOpen(true);
+ }}
+ />
+ </div>
+
+ {/* Themes — pinned grid */}
+ <div style={{marginTop: 32}}>
+ <div style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between'}}>
+ <XDSText type="body" style={{fontWeight: 600}}>Apply your themes</XDSText>
+ <XDSButton variant="ghost" size="sm" label="Browse" onClick={() => setCard4ThemeBrowse(true)} />
+ </div>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(auto-fill, 44px)', gap: 8, marginTop: 12}}>
+ {THEME_PICKER_ENTRIES.filter(e => card4PinnedThemes.has(e.key)).map(entry => {
+ const isSelected = card4SelectedOption === entry.key;
+ const BrandLogo = BRAND_LOGOS[entry.key];
+ return (
+ <XDSTooltip key={entry.key} content={entry.name}>
+ <div
+ onClick={() => setCard4SelectedOption(entry.key)}
+ style={{
+ width: 44, height: 44, borderRadius: 10,
+ display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer',
+ border: isSelected ? '2px solid var(--color-text-primary, #111)' : '2px solid var(--color-border, #E0E0E0)',
+ backgroundColor: '#fff',
+ transition: 'border-color 0.15s ease',
+ }}>
+ {BrandLogo ? (
+ <BrandLogo width={28} height={28} />
+ ) : (
+ <div style={{width: 24, height: 24, borderRadius: '50%', backgroundColor: entry.accent}} />
+ )}
+ </div>
+ </XDSTooltip>
+ );
+ })}
+ </div>
+
+ {/* Theme browse dialog */}
+ <XDSDialog
+ isOpen={card4ThemeBrowse}
+ onOpenChange={open => { setCard4ThemeBrowse(open); if (!open) setCard4ThemeSearch(''); }}
+ width={720}>
+ <XDSDialogHeader
+ title="All Themes"
+ onOpenChange={open => { setCard4ThemeBrowse(open); if (!open) setCard4ThemeSearch(''); }}
+ />
+ <div style={{display: 'flex', flexDirection: 'column', gap: 16, padding: 16}}>
+ <XDSTextInput
+ label="Search"
+ isLabelHidden
+ placeholder="Search themes..."
+ value={card4ThemeSearch}
+ onChange={setCard4ThemeSearch}
+ size="lg"
+ startIcon={SearchIcon}
+ />
+ <div style={{maxHeight: 560, overflowY: 'auto', display: 'flex', flexDirection: 'column', gap: 8}}>
+ {(['official', 'community'] as const).map(category => {
+ const entries = THEME_PICKER_ENTRIES.filter(
+ e => e.category === category && e.name.toLowerCase().includes(card4ThemeSearch.toLowerCase()),
+ );
+ if (entries.length === 0) return null;
+ return (
+ <div key={category}>
+ <XDSText type="supporting" color="secondary" style={{textTransform: 'uppercase', letterSpacing: '0.05em', marginBottom: 8}}>
+ {category}
+ </XDSText>
+ <div style={{display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8}}>
+ {entries.map(entry => {
+ const isSelected = card4SelectedOption === entry.key;
+ const isPinned = card4PinnedThemes.has(entry.key);
+ const p = entry.preview;
+ return (
+ <div
+ key={entry.key}
+ style={{
+ borderRadius: 12, overflow: 'hidden', cursor: 'pointer',
+ border: isSelected ? '2px solid var(--color-text-primary, #111)' : '2px solid var(--color-border, #E0E0E0)',
+ transition: 'border-color 0.15s ease',
+ }}>
+ <div
+ onClick={() => { setCard4SelectedOption(entry.key); setCard4ThemeBrowse(false); setCard4ThemeSearch(''); }}
+ style={{height: 100, backgroundColor: p.bg, display: 'flex', flexDirection: 'column', overflow: 'hidden'}}>
+ <div style={{height: 14, backgroundColor: p.surface, borderBottom: `1px solid ${p.text}1A`, display: 'flex', alignItems: 'center', paddingInline: 8, gap: 4}}>
+ <div style={{width: 5, height: 5, borderRadius: '50%', backgroundColor: p.accent}} />
+ <div style={{width: 16, height: 2, borderRadius: 1, backgroundColor: p.text, opacity: 0.3}} />
+ </div>
+ <div style={{flex: 1, padding: 8, display: 'flex', flexDirection: 'column', gap: 5}}>
+ <div style={{width: '65%', height: 4, borderRadius: 2, backgroundColor: p.text, opacity: 0.6}} />
+ <div style={{width: '45%', height: 3, borderRadius: 1.5, backgroundColor: p.text, opacity: 0.25}} />
+ <div style={{width: 28, height: 10, borderRadius: 4, backgroundColor: p.accent, marginTop: 'auto'}} />
+ </div>
+ </div>
+ <div style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '6px 8px', backgroundColor: 'var(--color-surface, #f5f5f5)'}}>
+ <div style={{display: 'flex', alignItems: 'center', gap: 6}}>
+ {(() => {
+ const Logo = BRAND_LOGOS[entry.key];
+ return Logo ? <Logo width={14} height={14} /> : (
+ <div style={{width: 14, height: 14, borderRadius: '50%', backgroundColor: entry.accent}} />
+ );
+ })()}
+ <XDSText type="supporting" style={{fontWeight: isSelected ? 600 : 400}}>{entry.name}</XDSText>
+ </div>
+ <div
+ onClick={e => { e.stopPropagation(); toggleCard4Pin(entry.key); }}
+ style={{cursor: 'pointer', display: 'flex', padding: 2}}>
+ {isPinned ? (
+ <StarFilledIcon width={14} height={14} style={{color: 'var(--color-text-primary, #111)'}} />
+ ) : (
+ <StarIcon width={14} height={14} style={{color: 'var(--color-secondary, #999)'}} />
+ )}
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ </XDSDialog>
+ </div>
+
+ {/* Component used */}
+ <div style={{marginTop: 32}}>
+ <XDSText type="body" style={{fontWeight: 600}}>Component used</XDSText>
+ <div style={{display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 16}}>
+ {['XDSAppShell', 'XDSTopNav', 'XDSVStack', 'XDSHStack', 'XDSHeading', 'XDSText', 'XDSButton', 'XDSCard', 'XDSBadge', 'XDSAvatar'].map(c => (
+ <XDSToken key={c} label={c} />
+ ))}
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ {/* More like this */}
+ <div style={{padding: '16px 32px 0'}}>
+ <XDSText type="display-3">More like this</XDSText>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 12, marginTop: 16}}>
+ {relatedTemplates.slice(0, 10).map((rt, i) => (
+ <XDSCard
+ key={i}
+ padding={0}
+ onClick={() => {
+ const idx = TEMPLATES.indexOf(rt);
+ setPreviewTarget(idx !== -1 ? idx : i);
+ }}
+ style={{cursor: 'pointer', aspectRatio: '16/10', overflow: 'hidden'}}>
+ <img src={rt.src} alt={rt.name} style={{width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'top', display: 'block'}} />
+ </XDSCard>
+ ))}
+ </div>
+ </div>
+
+ {/* Explore more */}
+ <div style={{padding: '32px 32px 40px'}}>
+ <XDSText type="display-3">Explore more</XDSText>
+ <div style={{display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 16}}>
+ {['website', 'dashboard', 'admin panel', 'settings', 'form layout', 'data table', 'sidebar nav', 'landing page', 'e-commerce', 'documentation', 'profile page'].map(tag => (
+ <XDSToken key={tag} label={tag} />
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ </>
+ );
+ })()}
</div>
);
}