Skip to content

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

TypeScript

feat(sandbox): docsite UI polish — results page, filters, transitions (#1390)

rubyycheungd337902e81ec
diff --git a/apps/sandbox/public/templates/xds-design-avatar.png b/apps/sandbox/public/templates/xds-design-avatar.png
new file mode 100644
index 0000000000..10d03b05f1
Binary files /dev/null and b/apps/sandbox/public/templates/xds-design-avatar.png differ
diff --git a/apps/sandbox/src/app/(fullscreen)/blocks/DropdownMenuCustomItemRendering/page.tsx b/apps/sandbox/src/app/(fullscreen)/blocks/DropdownMenuCustomItemRendering/page.tsx
deleted file mode 100644
index f5ea7370e9..0000000000
--- a/apps/sandbox/src/app/(fullscreen)/blocks/DropdownMenuCustomItemRendering/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * AUTO-GENERATED by scripts/sync-templates.js — do not edit.
- * Block: DropdownMenu — Custom Item Rendering
- */
-export {default} from '../../../../../../../packages/cli/templates/blocks/components/DropdownMenu/DropdownMenuCustomItemRendering';
diff --git a/apps/sandbox/src/app/(fullscreen)/blocks/MoreMenuCustomItemRendering/page.tsx b/apps/sandbox/src/app/(fullscreen)/blocks/MoreMenuCustomItemRendering/page.tsx
deleted file mode 100644
index 9bda19241c..0000000000
--- a/apps/sandbox/src/app/(fullscreen)/blocks/MoreMenuCustomItemRendering/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * AUTO-GENERATED by scripts/sync-templates.js — do not edit.
- * Block: MoreMenu — Custom Item Rendering
- */
-export {default} from '../../../../../../../packages/cli/templates/blocks/components/MoreMenu/MoreMenuCustomItemRendering';
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/AppTopNav.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/AppTopNav.tsx
index 7221a2c450..cdf8505d6f 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/AppTopNav.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/AppTopNav.tsx
@@ -6,8 +6,9 @@ import {XDSTabList, XDSTab} from '@xds/core/TabList';
import {XDSButton} from '@xds/core/Button';
import {XDSStack} from '@xds/core/Layout';
import {XDSList, XDSListItem} from '@xds/core/List';
+import {XDSDropdownMenu} from '@xds/core/DropdownMenu';
import {XDSCommandPalette} from '@xds/core/CommandPalette';
-import {SearchIcon, ProfileIcon} from './docsite-icons';
+import {SearchIcon, ProfileIcon, FilterIcon} from './docsite-icons';
import {SEARCH_COMMANDS} from './constants';
const XDS_WORDMARK = (
@@ -37,25 +38,45 @@ const XDS_WORDMARK = (
export function AppTopNav({
activeView: _activeView,
setActiveView,
- scrollContainerRef: _scrollContainerRef,
+ scrollContainerRef,
activeTab,
onActiveTabChange,
+ templateFilter,
+ onTemplateFilterChange,
+ templateAuthors,
+ activeFilters,
+ onToggleFilter,
+ onClearFilters,
+ sortOption,
+ onSortChange,
+ isFilterOpen,
+ onFilterOpenChange,
+ craftTitle,
}: {
activeView: 'craft' | 'explore' | 'docs' | 'profile';
setActiveView: (view: 'craft' | 'explore' | 'docs' | 'profile') => void;
scrollContainerRef?: React.RefObject<HTMLDivElement | null>;
activeTab: string;
onActiveTabChange: (tab: string) => void;
+ templateFilter?: 'all' | 'official' | string;
+ onTemplateFilterChange?: (filter: 'all' | 'official' | string) => void;
+ templateAuthors?: string[];
+ activeFilters?: Set<string>;
+ onToggleFilter?: (filter: string) => void;
+ onClearFilters?: () => void;
+ sortOption?: string;
+ onSortChange?: (option: string) => void;
+ isFilterOpen?: boolean;
+ onFilterOpenChange?: (open: boolean) => void;
+ craftTitle?: string | null;
}) {
const [isSearchOpen, setIsSearchOpen] = useState(false);
const [isScrolled, setIsScrolled] = useState(false);
useEffect(() => {
- const el = document.getElementById('xds-app-shell-main');
+ const el = document.getElementById('docsite-scroll');
if (!el) return;
- const handleScroll = () => {
- setIsScrolled(el.scrollTop > 170);
- };
+ const handleScroll = () => setIsScrolled(el.scrollTop > 170);
el.addEventListener('scroll', handleScroll, {passive: true});
handleScroll();
return () => el.removeEventListener('scroll', handleScroll);
@@ -72,6 +93,14 @@ export function AppTopNav({
<>
<XDSTopNav
label="XDS navigation"
+ style={{
+ paddingLeft: 16,
+ paddingRight: 24,
+ position: 'relative',
+ zIndex: 1,
+ boxShadow: isScrolled ? '0 1px 3px rgba(0,0,0,0.08)' : 'none',
+ transition: 'box-shadow 200ms ease',
+ }}
heading={
<XDSTopNavHeading
logo={XDS_WORDMARK}
@@ -80,7 +109,7 @@ export function AppTopNav({
/>
}
centerContent={
- isScrolled ? (
+ isScrolled && !craftTitle ? (
<XDSTabList
value={activeTab}
onChange={onActiveTabChange}
@@ -94,9 +123,49 @@ export function AppTopNav({
}
endContent={
<XDSStack direction="horizontal" gap={2}>
+ {isScrolled && !craftTitle && (
+ <>
+ <XDSButton
+ label="Filter"
+ variant="ghost"
+ size="sm"
+ isIconOnly
+ icon={<FilterIcon />}
+ onClick={() => onFilterOpenChange?.(!isFilterOpen)}
+ />
+ <XDSDropdownMenu
+ button={{
+ label:
+ sortOption === 'trending'
+ ? 'Trending'
+ : sortOption === 'newest'
+ ? 'Newest first'
+ : 'Oldest first',
+ variant: 'ghost',
+ size: 'sm',
+ style: {marginRight: -8},
+ }}
+ items={[
+ {
+ label: 'Trending',
+ onClick: () => onSortChange?.('trending'),
+ },
+ {
+ label: 'Newest first',
+ onClick: () => onSortChange?.('newest'),
+ },
+ {
+ label: 'Oldest first',
+ onClick: () => onSortChange?.('oldest'),
+ },
+ ]}
+ />
+ </>
+ )}
<XDSButton
label="Search"
variant="ghost"
+ size="sm"
isIconOnly
icon={<SearchIcon />}
onClick={() => setIsSearchOpen(true)}
@@ -104,6 +173,7 @@ export function AppTopNav({
<XDSButton
label="Profile"
variant="ghost"
+ size="sm"
isIconOnly
icon={<ProfileIcon />}
onClick={() => setActiveView('profile')}
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/ChatPanel.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/ChatPanel.tsx
index a589ccdd41..dae3e92d34 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/ChatPanel.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/ChatPanel.tsx
@@ -19,8 +19,8 @@ import {ShimmerText} from './ShimmerText';
import {MOCK_CODE} from './constants';
const composerStyles = stylex.create({
- noShadow: {
- boxShadow: 'none',
+ border: {
+ border: '1px solid var(--color-border)',
},
});
@@ -73,7 +73,7 @@ export function ChatPanel({
display: 'flex',
alignItems: 'center',
padding: '0 8px 0 16px',
- borderBottom: '1px solid var(--color-divider, #e0e0e0)',
+ borderBottom: 'none',
flexShrink: 0,
}}>
{onBack && (
@@ -136,8 +136,11 @@ export function ChatPanel({
<div
style={{
- padding: templateName ? 12 : 12,
- }}>
+ padding: 12,
+ // Override shadow tokens so the composer body inherits none
+ '--shadow-low': 'none',
+ '--shadow-med': 'none',
+ } as React.CSSProperties}>
<XDSChatComposer
onSubmit={() => {
onSend?.();
@@ -146,8 +149,12 @@ export function ChatPanel({
value={prompt}
onChange={setPrompt}
placeholder="Ask for changes"
- xstyle={composerStyles.noShadow}
input={<XDSChatComposerInput placeholder="Ask for changes" />}
+ xstyle={composerStyles.border}
+ style={{
+ '--shadow-low': 'none',
+ '--shadow-med': 'none',
+ } as React.CSSProperties}
/>
</div>
</>
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/DocsView.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/DocsView.tsx
index 26770e8c35..050de6f062 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/DocsView.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/DocsView.tsx
@@ -81,6 +81,7 @@ export function DocsView({
topNav={
<XDSTopNav
label="XDS navigation"
+ style={{paddingLeft: 16, paddingRight: 24}}
heading={
<XDSTopNavHeading
logo={XDS_WORDMARK}
@@ -109,7 +110,7 @@ export function DocsView({
/>
}
sideNav={
- <XDSSideNav>
+ <XDSSideNav style={{paddingLeft: 8}}>
<XDSSideNavSection title="Navigation" isHeaderHidden>
<XDSSideNavItem
label="Overview"
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/ProfileView.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/ProfileView.tsx
index 5953c0bef5..108aeb9567 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/ProfileView.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/ProfileView.tsx
@@ -1,485 +1,288 @@
'use client';
-import React, {useState} from 'react';
-import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSTopNav, XDSTopNavHeading} from '@xds/core/TopNav';
-import {XDSTabList, XDSTab} from '@xds/core/TabList';
-import {XDSHeading, XDSText} from '@xds/core/Text';
+import React, {useState, useMemo} from 'react';
+import {XDSText, XDSHeading} from '@xds/core/Text';
import {XDSButton} from '@xds/core/Button';
-import {XDSStack} from '@xds/core/Layout';
-import {XDSCard} from '@xds/core/Card';
-import {XDSAvatar} from '@xds/core/Avatar';
-import {XDSBadge} from '@xds/core/Badge';
-import {XDSList, XDSListItem} from '@xds/core/List';
import {XDSDialog, XDSDialogHeader} from '@xds/core/Dialog';
-import {XDSCommandPalette} from '@xds/core/CommandPalette';
-
-import {
- PROFILE_USED_ITEMS,
- PROFILE_LIKED_ITEMS,
- PROFILE_COLLECTIONS,
- DUMMY_IMAGE,
- AVATAR_IMAGE,
- SEARCH_COMMANDS,
-} from './constants';
-import {
- SearchIcon,
- ProfileIcon,
- PlusIcon,
- ChevronDownIcon,
- FolderIcon,
- DownloadIcon,
-} from './docsite-icons';
-
-const XDS_WORDMARK = (
- <svg
- width="46"
- height="24"
- viewBox="0 0 46 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg">
- <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"
- fill="currentColor"
- />
- <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"
- fill="currentColor"
- />
- <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"
- fill="currentColor"
- />
- </svg>
-);
-
-// ---------------------------------------------------------------------------
-// Section Label Component (for DocsView sidebar)
-// ---------------------------------------------------------------------------
-
-export function SectionLabel({label}: {label: string}) {
- return (
- <div
- style={{
- textTransform: 'uppercase' as const,
- letterSpacing: '0.05em',
- padding: '12px 8px 4px',
- margin: 0,
- }}>
- <XDSText type="supporting" weight="semibold" color="secondary">
- {label}
- </XDSText>
- </div>
- );
-}
-
-// ---------------------------------------------------------------------------
-// DialogPreview — stateful dialog preview for component previews
-// ---------------------------------------------------------------------------
+import {XDSList, XDSListItem} from '@xds/core/List';
+import {XDSDivider} from '@xds/core/Divider';
+import {XDSCard} from '@xds/core/Card';
+import {XDSPopover} from '@xds/core/Popover';
+import {XDSTextInput} from '@xds/core/TextInput';
+import {XDSToolbar} from '@xds/core/Toolbar';
+import {XDSDropdownMenu} from '@xds/core/DropdownMenu';
+import {XDSIcon} from '@xds/core/Icon';
+import {XDSToken} from '@xds/core/Token';
+import {XDSLink} from '@xds/core/Link';
+import {TEMPLATES, PROFILE_CRAFT_ITEMS, THEME_PICKER_ENTRIES, FILTER_COLUMNS} from './constants';
+import {TemplateCard} from './TemplateCard';
+import {SparklesIcon, SearchIcon, PaletteIcon, ContrastIcon, MoonIcon, VerifiedIcon} from './docsite-icons';
+import {AppTopNav} from './AppTopNav';
+import {BookmarkIcon, Cog6ToothIcon, ClockIcon} from '@heroicons/react/24/outline';
export function DialogPreview() {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
- <div style={{marginBottom: 16}}>
- <XDSHeading level={3}>Dialog</XDSHeading>
- </div>
- <XDSButton
- label="Open Dialog"
- variant="primary"
- onClick={() => setIsOpen(true)}
- />
+ <div style={{marginBottom: 16}}><XDSHeading level={3}>Dialog</XDSHeading></div>
+ <XDSButton label="Open Dialog" variant="primary" onClick={() => setIsOpen(true)} />
<XDSDialog isOpen={isOpen} onOpenChange={setIsOpen}>
<XDSDialogHeader title="Example Dialog" onOpenChange={setIsOpen} />
<div style={{padding: 16}}>
- <XDSText type="body">
- This is an example dialog. Dialogs are used to require user action
- or display important information that needs acknowledgment.
- </XDSText>
+ <XDSText type="body">This is an example dialog. Dialogs are used to require user action or display important information that needs acknowledgment.</XDSText>
</div>
</XDSDialog>
</div>
);
}
-// ---------------------------------------------------------------------------
-// ProfileView — user profile page
-// ---------------------------------------------------------------------------
-
-export function ProfileView({
- activeView: _activeView,
- setActiveView,
-}: {
- activeView: 'craft' | 'explore' | 'docs' | 'profile';
- setActiveView: (v: 'craft' | 'explore' | 'docs' | 'profile') => void;
-}) {
- const [profileTab, setProfileTab] = useState('used');
- const [expandedCollection, setExpandedCollection] = useState(
- null as string | null,
+function SearchableFilterDropdown({label, items, selectedFilters, onToggle, verifiedItems}: {label: string; items: string[]; selectedFilters: Set<string>; onToggle: (item: string) => void; verifiedItems?: Set<string>}) {
+ const [isOpen, setIsOpen] = useState(false);
+ const [search, setSearch] = useState('');
+ const filtered = items.filter(item => item.toLowerCase().includes(search.toLowerCase()));
+ return (
+ <XDSPopover label={label} placement="below" alignment="start" width={280} isOpen={isOpen} onOpenChange={open => { setIsOpen(open); if (!open) setSearch(''); }}
+ content={
+ <div style={{display: 'flex', flexDirection: 'column', gap: 4}}>
+ <div tabIndex={0} style={{position: 'absolute', opacity: 0, width: 0, height: 0, overflow: 'hidden'}} />
+ <XDSTextInput label="Search" isLabelHidden placeholder={`Search ${label.toLowerCase()}...`} value={search} onChange={setSearch} size="lg" startIcon={SearchIcon} />
+ <div style={{maxHeight: 280, overflowY: 'auto', margin: '0 -8px'}}>
+ {filtered.length === 0 ? (
+ <div style={{padding: '12px 16px'}}><XDSText type="body" color="secondary">No results</XDSText></div>
+ ) : (
+ <XDSList density="spacious">
+ {filtered.map(item => (
+ <XDSListItem key={item} label={item} isSelected={selectedFilters.has(item)} onClick={() => onToggle(item)}
+ endContent={verifiedItems?.has(item) ? <XDSIcon icon={VerifiedIcon} size="sm" color="accent" /> : undefined} />
+ ))}
+ </XDSList>
+ )}
+ </div>
+ </div>
+ }>
+ <XDSButton label={label} variant="ghost" size="sm" endContent={<XDSIcon icon="chevronDown" size="sm" color="inherit" />} />
+ </XDSPopover>
);
- const [isSearchOpen, setIsSearchOpen] = useState(false);
+}
- const headingMenu = (
- <XDSList density="spacious" style={{minWidth: 240}}>
- <XDSListItem label="Craft" onClick={() => setActiveView('craft')} />
- <XDSListItem label="Library" onClick={() => setActiveView('docs')} />
- </XDSList>
- );
+const NAV_ITEMS = [
+ {label: 'Crafted', icon: SparklesIcon},
+ {label: 'Used', icon: ClockIcon},
+ {label: 'Bookmarks', icon: BookmarkIcon},
+ {label: 'Settings', icon: Cog6ToothIcon},
+];
+const GRID_NAVS = ['Used', 'Bookmarks'] as const;
- return (
- <>
- <XDSAppShell
- variant="surface"
- height="fill"
- topNav={
- <XDSTopNav
- label="XDS navigation"
- heading={
- <XDSTopNavHeading
- logo={XDS_WORDMARK}
- headingHref="/pages/docsite/"
- menu={headingMenu}
- />
- }
- endContent={
- <XDSStack direction="horizontal" gap={2}>
- <XDSButton
- label="Search"
- variant="ghost"
- isIconOnly
- icon={<SearchIcon />}
- onClick={() => setIsSearchOpen(true)}
- />
- <XDSButton
- label="Profile"
- variant="ghost"
- isIconOnly
- icon={<ProfileIcon />}
- onClick={() => setActiveView('profile')}
- />
- </XDSStack>
- }
- />
- }>
- <div
- style={{
- padding: '40px 48px 64px',
- }}>
- <div style={{maxWidth: 800, margin: '0 auto'}}>
- {/* Profile Header */}
- <XDSStack
- direction="horizontal"
- gap={5}
- vAlign="center"
- style={{marginBottom: 24}}>
- <XDSAvatar name="Ruby Cheung" size="large" src={AVATAR_IMAGE} />
- <div>
- <XDSHeading level={1}>Ruby Cheung</XDSHeading>
- <XDSText type="supporting" color="secondary">
- Design Systems Engineer
- </XDSText>
- <XDSText type="supporting" color="secondary">
- Joined March 2026
- </XDSText>
- <div style={{marginTop: 8}}>
- <XDSText type="supporting" color="secondary">
- 12 used · 8 liked · 3 collections
- </XDSText>
- </div>
- </div>
- </XDSStack>
+export function ProfileView({activeView, setActiveView}: {activeView: 'craft' | 'explore' | 'docs' | 'profile'; setActiveView: (v: 'craft' | 'explore' | 'docs' | 'profile') => void}) {
+ const [activeNav, setActiveNav] = useState('Crafted');
+ const [craftTypeFilter, setCraftTypeFilter] = useState('all');
+ const [craftStatusFilter, setCraftStatusFilter] = useState('all');
+ const craftTypeCounts = useMemo(() => ({
+ template: PROFILE_CRAFT_ITEMS.filter(i => i.type === 'Template').length,
+ theme: PROFILE_CRAFT_ITEMS.filter(i => i.type === 'Theme').length,
+ component: PROFILE_CRAFT_ITEMS.filter(i => i.type === 'Component').length,
+ }), []);
+ const craftStatusCounts = useMemo(() => ({
+ published: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'Published').length,
+ draft: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'Draft').length,
+ review: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'In Review').length,
+ }), []);
+ const filteredCraftItems = useMemo(() => {
+ let items = PROFILE_CRAFT_ITEMS;
+ if (craftTypeFilter !== 'all') items = items.filter(i => i.type === craftTypeFilter);
+ if (craftStatusFilter !== 'all') items = items.filter(i => i.status === craftStatusFilter);
+ return items;
+ }, [craftTypeFilter, craftStatusFilter]);
- {/* Tabs */}
- <div style={{marginBottom: 24}}>
- <XDSTabList value={profileTab} onChange={setProfileTab} size="sm">
- <XDSTab value="used" label="Used" />
- <XDSTab value="liked" label="Liked" />
- <XDSTab value="bookmarks" label="Bookmarks" />
- <XDSTab value="created" label="Created" />
- </XDSTabList>
- </div>
+ const [previewMode, setPreviewMode] = useState<'light' | 'dark'>('light');
+ const [previewTheme, setPreviewTheme] = useState('default');
+ const [sortOption, setSortOption] = useState('trending');
+ const [resultFilters, setResultFilters] = useState<Set<string>>(() => new Set());
+ const handleToggleResultFilter = (filter: string) => {
+ setResultFilters(prev => { const next = new Set(prev); if (next.has(filter)) next.delete(filter); else next.add(filter); return next; });
+ };
+ const previewImageFilter = useMemo(() => {
+ const filters: string[] = [];
+ if (previewMode === 'dark') filters.push('invert(0.88)', 'hue-rotate(180deg)');
+ const tf: Record<string, string> = {neutral: 'saturate(0.3)', brutalist: 'contrast(1.2) saturate(0.5)', meta: 'sepia(0.15) saturate(1.4) hue-rotate(200deg)', whatsapp: 'sepia(0.2) saturate(1.3) hue-rotate(100deg)'};
+ if (tf[previewTheme]) filters.push(tf[previewTheme]);
+ return filters.length > 0 ? filters.join(' ') : undefined;
+ }, [previewMode, previewTheme]);
+ const templateAuthors = useMemo(() => {
+ const authors = Array.from(new Set(TEMPLATES.map(t => t.author)));
+ return authors.sort((a, b) => { if (a === 'XDS Design') return -1; if (b === 'XDS Design') return 1; return a.localeCompare(b); });
+ }, []);
+ const filteredTemplates = useMemo(() => TEMPLATES.map((t, i) => ({...t, originalIndex: i})), []);
+ const [selectedTheme, setSelectedTheme] = useState('default');
+ const [sendTo, setSendTo] = useState('clipboard');
- {/* Tab Content: Used */}
- {profileTab === 'used' && (
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 16,
- }}>
- {PROFILE_USED_ITEMS.map(item => (
- <XDSCard key={item.name}>
- <div style={{padding: 0}}>
- <div
- style={{
- width: '100%',
- aspectRatio: '4/3',
- backgroundColor:
- 'var(--color-background-body, #f1f4f7)',
- borderRadius: '8px 8px 0 0',
- }}
- />
- <div style={{padding: 12}}>
- <XDSText type="body">{item.name}</XDSText>
- <XDSText type="supporting" color="secondary">
- {item.lastUsed}
- </XDSText>
- </div>
- </div>
- </XDSCard>
+ return (
+ <div style={{display: 'flex', flexDirection: 'column' as const, height: '100vh'}}>
+ <AppTopNav activeView={activeView} setActiveView={setActiveView} activeTab="all" onActiveTabChange={() => setActiveView('craft')} />
+ <div style={{flex: 1, display: 'flex', overflow: 'hidden'}}>
+ <nav style={{width: 280, flexShrink: 0, height: '100%', overflowY: 'auto' as const, marginLeft: 8, marginRight: 8}}>
+ <div style={{display: 'flex', flexDirection: 'column' as const}}>
+ <div style={{padding: 16}}><XDSHeading level={2}>Profile</XDSHeading></div>
+ <XDSList density="spacious">
+ {NAV_ITEMS.map(item => (
+ <XDSListItem key={item.label} label={item.label} startContent={<item.icon style={{width: 20, height: 20}} />} isSelected={activeNav === item.label} onClick={() => setActiveNav(item.label)} />
+ ))}
+ </XDSList>
+ </div>
+ </nav>
+ <div style={{flex: 1, overflowY: 'auto' as const, height: '100%', padding: '16px 24px 140px'}}>
+ <style>{`
+ @keyframes craftCardFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
+ @keyframes craftTitleSlideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
+ `}</style>
+
+ {activeNav === 'Crafted' && (
+ <div style={{maxWidth: 2000, margin: '0 auto'}}>
+ <div style={{animation: 'craftTitleSlideIn 400ms cubic-bezier(0.16, 1, 0.3, 1)', marginBottom: 16}}>
+ <XDSText type="display-1">Crafted</XDSText>
+ </div>
+ <div style={{display: 'flex', gap: 6, flexWrap: 'wrap' as const, marginBottom: 8, animation: 'craftTitleSlideIn 400ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both'}}>
+ {[{value: 'all', label: `All (${PROFILE_CRAFT_ITEMS.length})`}, {value: 'Template', label: `Templates (${craftTypeCounts.template})`}, {value: 'Theme', label: `Themes (${craftTypeCounts.theme})`}, {value: 'Component', label: `Components (${craftTypeCounts.component})`}].map(tab => (
+ <XDSButton key={tab.value} label={tab.label} variant={craftTypeFilter === tab.value ? 'primary' : 'secondary'} size="sm" onClick={() => setCraftTypeFilter(tab.value)} />
+ ))}
+ <XDSDivider orientation="vertical" />
+ {[{value: 'all', label: 'All statuses'}, {value: 'Published', label: `Published (${craftStatusCounts.published})`}, {value: 'Draft', label: `Draft (${craftStatusCounts.draft})`}, {value: 'In Review', label: `In Review (${craftStatusCounts.review})`}].map(tab => (
+ <XDSButton key={tab.value} label={tab.label} variant={craftStatusFilter === tab.value ? 'primary' : 'secondary'} size="sm" onClick={() => setCraftStatusFilter(tab.value)} />
))}
</div>
- )}
-
- {/* Tab Content: Liked */}
- {profileTab === 'liked' && (
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 16,
- }}>
- {PROFILE_LIKED_ITEMS.map(item => (
- <XDSCard key={item.name}>
- <div style={{padding: 0}}>
- <div
- style={{
- width: '100%',
- aspectRatio: '4/3',
- backgroundColor:
- 'var(--color-background-body, #f1f4f7)',
- borderRadius: '8px 8px 0 0',
- }}
- />
- <div style={{padding: 12}}>
- <XDSText type="body">{item.name}</XDSText>
- <XDSText type="supporting" color="secondary">
- {item.lastUsed}
- </XDSText>
+ <div style={{marginBottom: 16}}><XDSText type="supporting" color="secondary">{filteredCraftItems.length} of {PROFILE_CRAFT_ITEMS.length} items</XDSText></div>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16}}>
+ {filteredCraftItems.map((item, i) => (
+ <XDSCard key={item.name} padding={0} style={{overflow: 'hidden', animation: `craftCardFadeIn 400ms ${i * 50}ms cubic-bezier(0.16, 1, 0.3, 1) both`}}>
+ <div style={{aspectRatio: '16 / 9', overflow: 'hidden', backgroundColor: 'var(--color-background-muted, #f0f0f0)'}}>
+ <img src={item.img} alt={item.name} style={{width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'top', display: 'block'}} />
+ </div>
+ <div style={{padding: 16}}>
+ <div style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8}}>
+ <XDSText type="body" weight="bold">{item.name}</XDSText>
+ <span style={{fontSize: 11, fontWeight: 600, padding: '2px 8px', borderRadius: 9999, whiteSpace: 'nowrap' as const, flexShrink: 0,
+ backgroundColor: item.status === 'Published' ? '#ECFDF3' : item.status === 'In Review' ? '#FFFAEB' : '#F2F4F7',
+ color: item.status === 'Published' ? '#027A48' : item.status === 'In Review' ? '#B54708' : '#667085'}}>
+ {item.status}
+ </span>
+ </div>
+ <div style={{marginTop: 4}}><XDSText type="supporting" color="secondary">{item.description}</XDSText></div>
+ <div style={{display: 'flex', alignItems: 'center', gap: 8, marginTop: 12}}>
+ <span style={{fontSize: 11, fontWeight: 500, padding: '1px 6px', borderRadius: 4, backgroundColor: 'var(--color-background-muted, #f0f0f0)', color: 'var(--color-text-secondary, #666)'}}>{item.type}</span>
+ <XDSText type="supporting" color="secondary">{item.used} uses</XDSText>
+ <XDSText type="supporting" color="secondary">{item.views} views</XDSText>
+ <div style={{marginLeft: 'auto'}}><XDSText type="supporting" color="secondary">{new Date(item.lastUpdated).toLocaleDateString('en-US', {month: 'short', day: 'numeric'})}</XDSText></div>
</div>
</div>
</XDSCard>
))}
+ {filteredCraftItems.length === 0 && <div style={{gridColumn: '1 / -1', padding: 32, textAlign: 'center' as const}}><XDSText type="body" color="secondary">No items match this filter.</XDSText></div>}
</div>
- )}
+ </div>
+ )}
- {/* Tab Content: Bookmarks */}
- {profileTab === 'bookmarks' && (
- <div>
- <div style={{marginBottom: 16}}>
- <XDSButton
- label="New collection"
- variant="secondary"
- icon={<PlusIcon />}>
- New collection
- </XDSButton>
- </div>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(3, 1fr)',
- gap: 16,
- marginBottom: 24,
- }}>
- {PROFILE_COLLECTIONS.map(collection => (
- <XDSCard key={collection.name}>
- <div style={{padding: 16}}>
- <XDSStack
- direction="horizontal"
- gap={2}
- vAlign="center"
- style={{marginBottom: 8}}>
- <FolderIcon width={20} height={20} />
- <XDSText type="body">{collection.name}</XDSText>
- </XDSStack>
- <XDSText type="supporting" color="secondary">
- {collection.count} items
- </XDSText>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: '1fr 1fr',
- gap: 4,
- marginTop: 12,
- }}>
- {[0, 1, 2, 3].map(i => (
- <div
- key={i}
- style={{
- aspectRatio: '1',
- backgroundColor:
- 'var(--color-background-body, #f1f4f7)',
- borderRadius: 4,
- }}
- />
- ))}
- </div>
- </div>
- </XDSCard>
- ))}
+ {(GRID_NAVS as readonly string[]).includes(activeNav) && (
+ <div style={{maxWidth: 2000, margin: '0 auto'}}>
+ <div style={{animation: 'craftTitleSlideIn 400ms cubic-bezier(0.16, 1, 0.3, 1)', marginBottom: 16}}><XDSText type="display-1">{activeNav}</XDSText></div>
+ <div style={{display: 'flex', flexDirection: 'column' as const, gap: 4, marginBottom: 20, animation: 'craftTitleSlideIn 400ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both'}}>
+ <div style={{display: 'flex', alignItems: 'center', gap: 4, marginLeft: -8, marginRight: -8}}>
+ {FILTER_COLUMNS.map(col => <SearchableFilterDropdown key={col.heading} label={col.heading} items={col.items} selectedFilters={resultFilters} onToggle={handleToggleResultFilter} />)}
+ <SearchableFilterDropdown label="Author" items={templateAuthors} selectedFilters={resultFilters} onToggle={handleToggleResultFilter} verifiedItems={new Set(['XDS Design'])} />
+ <div style={{marginLeft: 'auto', display: 'flex', alignItems: 'center', gap: 16}}>
+ <XDSText type="supporting" color="secondary" style={{whiteSpace: 'nowrap'}}>Showing {filteredTemplates.length} screens</XDSText>
+ <XDSToolbar label="View controls" density="compact" startContent={<>
+ <XDSButton label={previewMode === 'dark' ? 'Light mode' : 'Dark mode'} variant="ghost" size="sm" isIconOnly icon={previewMode === 'dark' ? <ContrastIcon /> : <MoonIcon />} onClick={() => setPreviewMode(previewMode === 'dark' ? 'light' : 'dark')} />
+ <XDSDropdownMenu button={{label: 'Theme', variant: 'ghost', size: 'sm', isIconOnly: true, icon: <PaletteIcon />}} hasChevron={false} menuWidth={160}
+ items={[{label: 'Default', onClick: () => setPreviewTheme('default')}, {label: 'Neutral', onClick: () => setPreviewTheme('neutral')}, {label: 'Brutalist', onClick: () => setPreviewTheme('brutalist')}, {label: 'Meta', onClick: () => setPreviewTheme('meta')}, {label: 'WhatsApp', onClick: () => setPreviewTheme('whatsapp')}]} />
+ </>} />
+ <XDSDropdownMenu button={{label: sortOption === 'trending' ? 'Trending' : sortOption === 'newest' ? 'Newest first' : 'Oldest first', variant: 'ghost', size: 'sm'}}
+ items={[{label: 'Trending', onClick: () => setSortOption('trending')}, {label: 'Newest first', onClick: () => setSortOption('newest')}, {label: 'Oldest first', onClick: () => setSortOption('oldest')}]} />
+ </div>
</div>
-
- {/* Expandable list */}
- {PROFILE_COLLECTIONS.map(collection => (
- <div key={collection.name} style={{marginBottom: 8}}>
- <XDSButton
- label={collection.name}
- variant="ghost"
- size="sm"
- icon={
- <ChevronDownIcon
- style={{
- transform:
- expandedCollection === collection.name
- ? 'rotate(180deg)'
- : 'rotate(0deg)',
- transition: 'transform 200ms',
- }}
- />
- }
- onClick={() =>
- setExpandedCollection(
- expandedCollection === collection.name
- ? null
- : collection.name,
- )
- }>
- {collection.name} ({collection.count})
- </XDSButton>
- {expandedCollection === collection.name && (
- <div style={{paddingLeft: 32, paddingTop: 8}}>
- {Array.from({length: collection.count}, (_, i) => (
- <div key={i} style={{padding: '4px 0'}}>
- <XDSText type="supporting" color="secondary">
- Item {i + 1}
- </XDSText>
- </div>
- ))}
- </div>
- )}
+ {resultFilters.size > 0 && (
+ <div style={{display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap'}}>
+ {Array.from(resultFilters).map(f => <XDSToken key={f} label={f} size="sm" onRemove={() => handleToggleResultFilter(f)} />)}
+ <XDSText type="supporting"><XDSLink label="Clear all" color="secondary" onClick={() => setResultFilters(new Set())}>Clear all</XDSLink></XDSText>
+ </div>
+ )}
+ </div>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 16, gridAutoRows: '1fr'}}>
+ {filteredTemplates.map((template, i) => (
+ <div key={`${template.name}-${template.originalIndex}`} style={{animation: `craftCardFadeIn 400ms ${i * 50}ms cubic-bezier(0.16, 1, 0.3, 1) both`, filter: previewImageFilter, transition: 'filter 300ms ease'}}>
+ <TemplateCard src={template.src} name={template.name} isGenerating={false} cardSize={template.size} onUse={() => {}} onPreview={() => {}} />
</div>
))}
</div>
- )}
+ </div>
+ )}
- {/* Tab Content: Created */}
- {profileTab === 'created' && (
+ {activeNav === 'Settings' && (
+ <div style={{maxWidth: 700, margin: '0 auto', display: 'flex', flexDirection: 'column' as const, gap: 24}}>
+ <XDSHeading level={2}>Settings</XDSHeading>
<div>
- <div
- style={{
- display: 'flex',
- justifyContent: 'flex-end',
- marginBottom: 16,
- }}>
- <XDSButton
- label="Create new"
- variant="secondary"
- size="sm"
- icon={<PlusIcon />}>
- Create new
- </XDSButton>
- </div>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 16,
- }}>
- {[
- {
- name: 'My Dashboard Theme',
- type: 'Theme',
- status: 'Published',
- downloads: '342',
- img: DUMMY_IMAGE,
- },
- {
- name: 'Custom Login Template',
- type: 'Template',
- status: 'Published',
- downloads: '128',
- img: DUMMY_IMAGE,
- },
- {
- name: 'Internal Tools Kit',
- type: 'Template',
- status: 'Draft',
- downloads: '0',
- img: DUMMY_IMAGE,
- },
- ].map((item, i) => (
- <XDSCard key={i} padding={0}>
- <img
- src={item.img}
- alt={item.name}
- style={{
- display: 'block',
- width: '100%',
- height: 140,
- objectFit: 'cover',
- }}
- />
- <div style={{padding: '12px 16px'}}>
- <XDSStack
- direction="horizontal"
- gap={2}
- vAlign="center"
- style={{marginBottom: 4}}>
- <XDSText type="body" weight="bold">
- {item.name}
- </XDSText>
- </XDSStack>
- <XDSStack
- direction="horizontal"
- gap={2}
- vAlign="center"
- style={{marginBottom: 4}}>
- <XDSBadge
- label={item.status}
- variant={
- item.status === 'Published'
- ? 'success'
- : 'neutral'
- }
- />
- <XDSText type="supporting" color="secondary">
- {item.type}
- </XDSText>
- </XDSStack>
- {item.status === 'Published' && (
- <XDSStack
- direction="horizontal"
- gap={1}
- vAlign="center"
- style={{marginTop: 4}}>
- <DownloadIcon
- width={14}
- height={14}
- style={{opacity: 0.4}}
- />
- <XDSText type="supporting" color="secondary">
- {item.downloads} downloads
- </XDSText>
- </XDSStack>
- )}
+ <XDSHeading level={3} style={{marginBottom: 16}}>Theme preference</XDSHeading>
+ {(['official', 'community'] as const).map(category => {
+ const entries = THEME_PICKER_ENTRIES.filter(e => e.category === category);
+ if (entries.length === 0) return null;
+ return (
+ <div key={category} style={{marginBottom: 20}}>
+ <div style={{marginBottom: 8}}><XDSText type="supporting" color="secondary">{category.charAt(0).toUpperCase() + category.slice(1)}</XDSText></div>
+ <div style={{display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 12}}>
+ {entries.map(entry => {
+ const isSelected = selectedTheme === entry.key;
+ const p = entry.preview;
+ return (
+ <div key={entry.key} onClick={() => setSelectedTheme(entry.key)} style={{borderRadius: 12, overflow: 'hidden', cursor: 'pointer', border: isSelected ? '2px solid var(--color-accent, #0066FF)' : '1px solid var(--color-border-emphasized, #e0e0e0)', transition: 'border-color 0.15s ease'}}>
+ <div style={{height: 80, backgroundColor: p.bg, display: 'flex', flexDirection: 'column' as const, 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' as const, 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={{padding: '8px 10px'}}>
+ <XDSText type="supporting" style={{fontWeight: isSelected ? 600 : 400}}>{entry.name}</XDSText>
+ {entry.description && <div style={{marginTop: 2}}><XDSText type="supporting" color="secondary">{entry.description}</XDSText></div>}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ <div>
+ <XDSHeading level={3} style={{marginBottom: 16}}>Send to</XDSHeading>
+ <XDSText type="supporting" color="secondary" display="block" style={{marginBottom: 12}}>Choose where templates and code are sent when you use them.</XDSText>
+ <div style={{display: 'flex', flexDirection: 'column' as const, gap: 0}}>
+ {([
+ {key: 'clipboard', label: 'Clipboard', description: 'Copy code to your clipboard'},
+ {key: 'vscode', label: 'VS Code', description: 'Open directly in VS Code'},
+ {key: 'github', label: 'GitHub', description: 'Create a new repo or gist'},
+ {key: 'download', label: 'Download', description: 'Save as a file to your device'},
+ ] as const).map((option, i, arr) => (
+ <React.Fragment key={option.key}>
+ <div onClick={() => setSendTo(option.key)} style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 0', cursor: 'pointer'}}>
+ <div>
+ <XDSText type="body" weight={sendTo === option.key ? 'semibold' : 'normal'} display="block">{option.label}</XDSText>
+ <XDSText type="supporting" color="secondary" display="block">{option.description}</XDSText>
+ </div>
+ <div style={{width: 20, height: 20, borderRadius: '50%', border: sendTo === option.key ? '6px solid var(--color-accent, #0066FF)' : '2px solid var(--color-border-emphasized, #ccc)', transition: 'border 0.15s ease', flexShrink: 0}} />
</div>
- </XDSCard>
+ {i < arr.length - 1 && <XDSDivider />}
+ </React.Fragment>
))}
</div>
</div>
- )}
- </div>
+ </div>
+ )}
</div>
- </XDSAppShell>
-
- <XDSCommandPalette
- isOpen={isSearchOpen}
- onOpenChange={setIsSearchOpen}
- searchSource={SEARCH_COMMANDS}
- label="Search templates and components"
- />
- </>
+ </div>
+ </div>
);
}
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
index 0255d0702f..3b316a4939 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplateCard.tsx
@@ -3,7 +3,7 @@
import React, {useState, useEffect} from 'react';
import {XDSCard} from '@xds/core/Card';
import {XDSButton} from '@xds/core/Button';
-import {XDSText} from '@xds/core/Text';
+import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSStack} from '@xds/core/Layout';
import {XDSPopover} from '@xds/core/Popover';
import {BookmarkIcon, BookmarkFilledIcon} from './docsite-icons';
@@ -134,9 +134,9 @@ export function TemplateCard({
}}>
{/* Template info */}
<XDSStack direction="vertical" gap={0}>
- <XDSText type="body" weight="bold" style={{color: '#fff'}}>
+ <XDSHeading level={3} style={{color: '#fff'}}>
{name}
- </XDSText>
+ </XDSHeading>
<XDSText
type="supporting"
style={{color: 'rgba(255,255,255,0.7)'}}>
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
index 89f5215711..9c7bb1bc8c 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/TemplatePreview.tsx
@@ -8,7 +8,7 @@ import {
XDSSegmentedControlItem,
} from '@xds/core/SegmentedControl';
import {XDSSpinner} from '@xds/core/Spinner';
-import {XDSToolbar} from '@xds/core/Toolbar';
+
import {XDSTooltip} from '@xds/core/Tooltip';
import {
@@ -123,7 +123,7 @@ export function TemplatePreview({
{!hideToolbar && (
<div
style={{
- background: 'none',
+ background: 'var(--color-background-card, #fff)',
position: 'absolute',
top: 0,
left: 0,
@@ -135,176 +135,169 @@ export function TemplatePreview({
}}>
<div
style={{
- backgroundColor: isScrolled
- ? 'var(--color-background-card, #fff)'
- : (previewBackground ?? 'var(--color-background-card, #fff)'),
- borderRadius: 'var(--radius-container, 12px)',
border: 'none',
- display: 'inline-flex',
- padding: '4px 0',
- boxShadow: isScrolled ? '0 2px 8px rgba(0,0,0,0.12)' : 'none',
+ display: 'flex',
+ justifyContent: 'center',
+ width: '100%',
+ padding: '4px 0 12px 0',
+ boxShadow: 'none',
transition: 'background-color 200ms ease, box-shadow 300ms ease',
}}>
- <XDSToolbar
- label="Template actions"
- padding={0}
- centerContent={
- isPublishing ? (
- <>
- <XDSSegmentedControl
- value={viewportSize}
- onChange={setViewportSize}
- label="Viewport size"
- size="sm">
- <XDSTooltip content="Desktop">
- <XDSSegmentedControlItem
- value="desktop"
- label="Desktop"
- isLabelHidden
- icon={<DesktopIcon />}
- />
- </XDSTooltip>
- <XDSTooltip content="Phone">
- <XDSSegmentedControlItem
- value="phone"
- label="Phone"
- isLabelHidden
- icon={<PhoneIcon />}
- />
- </XDSTooltip>
- </XDSSegmentedControl>
- </>
- ) : (
- <>
- <XDSTooltip content="Point">
- <XDSButton
- label="Point"
- variant={isPointing ? 'secondary' : 'ghost'}
- isIconOnly
- icon={<CursorIcon />}
- onClick={() => onPointingChange?.(!isPointing)}
- />
- </XDSTooltip>
- <XDSTooltip content="Theme">
- <XDSDropdownMenu
- button={{
- label: 'Theme',
- variant: 'ghost',
- isIconOnly: true,
- icon: <PaletteIcon />,
- }}
- hasChevron={false}
- items={XDS_THEMES.map(t => ({
- label: t.label,
- onClick: () => {},
- }))}
- />
- </XDSTooltip>
+ <div
+ role="toolbar"
+ aria-label="Template actions"
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ flex: 1,
+ padding: '0 32px 0 8px',
+ position: 'relative',
+ }}>
+ {!isPublishing && (
+ <div style={{display: 'flex', alignItems: 'center'}}>
+ <XDSTooltip content="Point">
+ <XDSButton
+ label="Point"
+ variant={isPointing ? 'secondary' : 'ghost'}
+ isIconOnly
+ icon={<CursorIcon />}
+ onClick={() => onPointingChange?.(!isPointing)}
+ />
+ </XDSTooltip>
+ <XDSTooltip content="Theme">
+ <XDSDropdownMenu
+ button={{
+ label: 'Theme',
+ variant: 'ghost',
+ isIconOnly: true,
+ icon: <PaletteIcon />,
+ }}
+ hasChevron={false}
+ items={XDS_THEMES.map(t => ({
+ label: t.label,
+ onClick: () => {},
+ }))}
+ />
+ </XDSTooltip>
+ <XDSTooltip
+ content={isDarkMode ? 'Dark mode' : 'Light mode'}>
+ <XDSButton
+ label={isDarkMode ? 'Dark mode' : 'Light mode'}
+ variant="ghost"
+ isIconOnly
+ icon={isDarkMode ? <MoonIcon /> : <ContrastIcon />}
+ onClick={() => setIsDarkMode(prev => !prev)}
+ />
+ </XDSTooltip>
+ </div>
+ )}
+ <div style={{
+ position: 'absolute',
+ left: 16,
+ right: 32,
+ display: 'flex',
+ justifyContent: 'center',
+ pointerEvents: 'none',
+ }}>
+ <XDSSegmentedControl
+ value={viewportSize}
+ onChange={setViewportSize}
+ label="Viewport size"
+ size="sm"
+ style={{pointerEvents: 'auto'}}>
+ <XDSTooltip content="Desktop">
+ <XDSSegmentedControlItem
+ value="desktop"
+ label="Desktop"
+ isLabelHidden
+ icon={<DesktopIcon />}
+ />
+ </XDSTooltip>
+ <XDSTooltip content="Phone">
+ <XDSSegmentedControlItem
+ value="phone"
+ label="Phone"
+ isLabelHidden
+ icon={<PhoneIcon />}
+ />
+ </XDSTooltip>
+ </XDSSegmentedControl>
+ </div>
+ <div style={{flex: 1}} />
+ {!isPublishing && (
+ <div style={{display: 'flex', alignItems: 'center', gap: 8}}>
+ <XDSTooltip content="Preview">
+ <XDSButton
+ label="Preview"
+ variant="ghost"
+ isIconOnly
+ icon={<FullscreenIcon />}
+ onClick={() => onFullPreviewChange?.(true)}
+ />
+ </XDSTooltip>
+ {saveState === 'saved' ? (
<XDSTooltip
- content={isDarkMode ? 'Dark mode' : 'Light mode'}>
+ content={linkCopied ? 'Copied!' : 'Copy link'}>
<XDSButton
- label={isDarkMode ? 'Dark mode' : 'Light mode'}
+ label={linkCopied ? 'Copied' : 'Copy link'}
variant="ghost"
+ icon={
+ linkCopied ? (
+ <CheckIcon color="var(--color-icon-primary, #111)" />
+ ) : (
+ <LinkIcon />
+ )
+ }
isIconOnly
- icon={isDarkMode ? <MoonIcon /> : <ContrastIcon />}
- onClick={() => setIsDarkMode(prev => !prev)}
+ onClick={handleCopyLink}
/>
</XDSTooltip>
- <XDSSegmentedControl
- value={viewportSize}
- onChange={setViewportSize}
- label="Viewport size"
- size="sm">
- <XDSTooltip content="Desktop">
- <XDSSegmentedControlItem
- value="desktop"
- label="Desktop"
- isLabelHidden
- icon={<DesktopIcon />}
- />
- </XDSTooltip>
- <XDSTooltip content="Phone">
- <XDSSegmentedControlItem
- value="phone"
- label="Phone"
- isLabelHidden
- icon={<PhoneIcon />}
- />
- </XDSTooltip>
- </XDSSegmentedControl>
- <XDSTooltip content="Preview">
+ ) : saveState === 'saving' ? (
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: 32,
+ height: 32,
+ }}>
+ <XDSSpinner size="sm" />
+ </div>
+ ) : (
+ <XDSTooltip content="Save">
<XDSButton
- label="Preview"
+ label="Save"
variant="ghost"
+ icon={<SaveIcon />}
isIconOnly
- icon={<FullscreenIcon />}
- onClick={() => onFullPreviewChange?.(true)}
+ onClick={handleSave}
/>
</XDSTooltip>
- {saveState === 'saved' ? (
- <XDSTooltip
- content={linkCopied ? 'Copied!' : 'Copy link'}>
- <XDSButton
- label={linkCopied ? 'Copied' : 'Copy link'}
- variant="ghost"
- icon={
- linkCopied ? (
- <CheckIcon color="var(--color-icon-primary, #111)" />
- ) : (
- <LinkIcon />
- )
- }
- isIconOnly
- onClick={handleCopyLink}
- />
- </XDSTooltip>
- ) : saveState === 'saving' ? (
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: 32,
- height: 32,
- }}>
- <XDSSpinner size="sm" />
- </div>
- ) : (
- <XDSTooltip content="Save">
- <XDSButton
- label="Save"
- variant="ghost"
- icon={<SaveIcon />}
- isIconOnly
- onClick={handleSave}
- />
- </XDSTooltip>
- )}
- <XDSButton
- label="Submit"
- variant="secondary"
- size="sm"
- onClick={() => onPublish?.()}
- />
- <XDSPopover
- label="Add to project"
- isOpen={showSharePopover}
- onOpenChange={setShowSharePopover}
- placement="below"
- alignment="end"
- width={340}
- content={
- <SharePopoverContent
- cliCommand={shareCliCommand}
- onClose={() => setShowSharePopover(false)}
- />
- }>
- <XDSButton label="Use" variant="primary" size="sm" />
- </XDSPopover>
- </>
- )
- }
- />
+ )}
+ <XDSButton
+ label="Submit"
+ variant="secondary"
+ size="sm"
+ onClick={() => onPublish?.()}
+ />
+ <XDSPopover
+ label="Add to project"
+ isOpen={showSharePopover}
+ onOpenChange={setShowSharePopover}
+ placement="below"
+ alignment="end"
+ width={340}
+ content={
+ <SharePopoverContent
+ cliCommand={shareCliCommand}
+ onClose={() => setShowSharePopover(false)}
+ />
+ }>
+ <XDSButton label="Use" variant="primary" size="sm" />
+ </XDSPopover>
+ </div>
+ )}
+ </div>
</div>
</div>
)}
@@ -313,7 +306,7 @@ export function TemplatePreview({
<div
style={{
flex: 1,
- overflow: previewBackground ? 'visible' : 'hidden',
+ overflow: 'visible',
padding: 0,
display: 'flex',
flexDirection: 'column' as const,
@@ -363,7 +356,7 @@ export function TemplatePreview({
? 24
: previewBackground
? '64px 16px 16px 16px'
- : '64px 16px 16px 0',
+ : '64px 32px 16px 16px',
cursor: isPointing ? 'crosshair' : undefined,
transition: 'background-color 300ms ease, padding 300ms ease',
}}
@@ -389,22 +382,17 @@ export function TemplatePreview({
<div
style={{
position: 'relative',
- width: viewportSize === 'phone' ? 375 : '100%',
+ width: viewportSize === 'phone' ? 390 : '100%',
borderRadius:
viewportSize === 'phone'
? 36
: isFullPreview
? 0
: 'var(--radius-container, 12px)',
- border: previewBackground
+ border: 'none',
+ boxShadow: isFullPreview
? 'none'
- : isFullPreview
- ? 'none'
- : '1px solid var(--color-divider, #e0e0e0)',
- boxShadow:
- previewBackground && !isFullPreview
- ? 'rgba(0, 0, 0, 0.08) 0px 1px 3px, rgba(0, 0, 0, 0.06) 0px 4px 12px'
- : 'none',
+ : 'rgba(0, 0, 0, 0.08) 0px 1px 3px, rgba(0, 0, 0, 0.06) 0px 4px 12px',
overflow: 'hidden',
flexShrink: 0,
margin: isFullPreview ? 0 : 'auto 0',
@@ -416,8 +404,8 @@ export function TemplatePreview({
style={{
display: 'block',
width: '100%',
- aspectRatio: viewportSize === 'phone' ? '9 / 19.5' : undefined,
- objectFit: viewportSize === 'phone' ? 'cover' : undefined,
+ aspectRatio: undefined,
+ objectFit: undefined,
opacity: isGenerating ? 0 : 1,
transition: 'opacity 600ms ease',
}}
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts b/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
index dbb5aad14b..0d7b7b1015 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/constants.ts
@@ -74,6 +74,7 @@ export const SIM_COUNT = 350;
export const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '';
export const DUMMY_IMAGE = `${basePath}/templates/dummy-placeholder.png`;
export const AVATAR_IMAGE = `${basePath}/templates/avatar-profile.jpg`;
+export const XDS_DESIGN_AVATAR = `${basePath}/templates/xds-design-avatar.png`;
export const FIRST_CARD_IMAGE = `${basePath}/templates/first-card.png`;
export const SHOPPING_DETAILS_IMAGE = `${basePath}/templates/shopping-details.png`;
export const SCREENSHOT_3_IMAGE = `${basePath}/templates/screenshot-3.png`;
@@ -180,48 +181,106 @@ export const TEMPLATES: {
name: string;
src: string;
size: 'xlarge' | 'large' | 'medium' | 'small';
+ author: string;
+ isOfficial: boolean;
}[] = [
- {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: `${basePath}/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'},
- {name: 'File Explorer', src: DUMMY_IMAGE, size: 'small'},
- {name: 'Contact Form', src: DUMMY_IMAGE, size: 'small'},
- {name: 'Editor', src: DUMMY_IMAGE, size: 'xlarge'},
- {name: 'Analytics', src: DUMMY_IMAGE, size: 'large'},
- {name: 'User Profile', src: DUMMY_IMAGE, size: 'small'},
- {name: 'Notifications', src: DUMMY_IMAGE, size: 'small'},
- {name: 'Calendar', src: DUMMY_IMAGE, size: 'small'},
- {name: 'Onboarding', src: DUMMY_IMAGE, size: 'xlarge'},
+ {name: 'Contact Form', src: FIRST_CARD_IMAGE, size: 'large', author: 'Andrea Anderson', isOfficial: true},
+ {name: 'Shopping Details', src: SHOPPING_DETAILS_IMAGE, size: 'small', author: 'Andrea Anderson', isOfficial: true},
+ {name: 'Button Component', src: SCREENSHOT_3_IMAGE, size: 'small', author: 'XDS Design', isOfficial: true},
+ {name: 'Settings Page', src: `${basePath}/templates/card4-preview.png`, size: 'small', author: 'XDS Design', isOfficial: true},
+ {name: 'Login Form', src: DUMMY_IMAGE, size: 'xlarge', author: 'Marcus Chen', isOfficial: false},
+ {name: 'Dashboard', src: DUMMY_IMAGE, size: 'large', author: 'Marcus Chen', isOfficial: false},
+ {name: 'Data Table', src: DUMMY_IMAGE, size: 'small', author: 'XDS Design', isOfficial: true},
+ {name: 'File Explorer', src: DUMMY_IMAGE, size: 'small', author: 'Sarah Kim', isOfficial: false},
+ {name: 'Contact Form', src: DUMMY_IMAGE, size: 'small', author: 'Sarah Kim', isOfficial: false},
+ {name: 'Editor', src: DUMMY_IMAGE, size: 'xlarge', author: 'Andrea Anderson', isOfficial: true},
+ {name: 'Analytics', src: DUMMY_IMAGE, size: 'large', author: 'Marcus Chen', isOfficial: false},
+ {name: 'User Profile', src: DUMMY_IMAGE, size: 'small', author: 'Sarah Kim', isOfficial: false},
+ {name: 'Notifications', src: DUMMY_IMAGE, size: 'small', author: 'XDS Design', isOfficial: true},
+ {name: 'Calendar', src: DUMMY_IMAGE, size: 'small', author: 'Andrea Anderson', isOfficial: false},
+ {name: 'Onboarding', src: DUMMY_IMAGE, size: 'xlarge', author: 'XDS Design', isOfficial: true},
+];
+
+// ---------------------------------------------------------------------------
+// Filter panel columns
+// ---------------------------------------------------------------------------
+
+export const FILTER_COLUMNS: {heading: string; items: string[]}[] = [
+ {
+ heading: 'Categories',
+ items: ['AI', 'Health & Fitness', 'Productivity', 'Shopping', 'Education'],
+ },
+ {
+ heading: 'Templates',
+ items: ['My Account & Profile', 'Charts', 'Login', 'Filter & Sort', 'Signup'],
+ },
+ {
+ heading: 'Components',
+ items: ['Dropdown Menu', 'Side Navigation', 'Stepper', 'Text Field', 'Navigation Menu'],
+ },
];
// ---------------------------------------------------------------------------
// Profile data
// ---------------------------------------------------------------------------
-export const PROFILE_USED_ITEMS = [
- {name: 'Dashboard Pro', lastUsed: 'Last used 2 days ago'},
- {name: 'Login Form', lastUsed: 'Last used 2 days ago'},
- {name: 'Settings Panel', lastUsed: 'Last used 2 days ago'},
- {name: 'E-commerce Kit', lastUsed: 'Last used 2 days ago'},
- {name: 'Data Table', lastUsed: 'Last used 2 days ago'},
- {name: 'Contact Form', lastUsed: 'Last used 2 days ago'},
+export const PROFILE_USED_ITEMS: {
+ name: string;
+ description: string;
+ lastUsed: string;
+ usageCount: number;
+}[] = [
+ {name: 'AppShell', description: 'Foundational page layout with header, sidebar, and content regions.', lastUsed: '2026-04-14T10:30:00Z', usageCount: 12},
+ {name: 'Avatar', description: 'Represents a person or entity with an image, initials, or icon.', lastUsed: '2026-04-13T15:45:00Z', usageCount: 8},
+ {name: 'Badge', description: 'Displays small counts or status labels on icons, buttons, or list items.', lastUsed: '2026-04-12T09:20:00Z', usageCount: 15},
+ {name: 'Banner', description: 'Shows important, non-modal messages at the top of a page or section.', lastUsed: '2026-04-10T14:00:00Z', usageCount: 3},
+ {name: 'Button', description: 'Primary action element for forms, dialogs, and toolbars.', lastUsed: '2026-04-14T16:00:00Z', usageCount: 24},
+ {name: 'Calendar', description: 'Date-picking grid for selecting single dates or date ranges.', lastUsed: '2026-04-08T11:30:00Z', usageCount: 2},
+ {name: 'Dialog', description: 'Modal overlays that require user attention or action.', lastUsed: '2026-04-11T13:15:00Z', usageCount: 6},
+ {name: 'DropdownMenu', description: 'Presents actions or options in a floating overlay.', lastUsed: '2026-04-09T16:45:00Z', usageCount: 5},
];
-export const PROFILE_LIKED_ITEMS = [
- {name: 'Meta Theme', lastUsed: 'Last used 2 days ago'},
- {name: 'Brutalist Theme', lastUsed: 'Last used 2 days ago'},
- {name: 'Admin Dashboard', lastUsed: 'Last used 2 days ago'},
- {name: 'Product Detail', lastUsed: 'Last used 2 days ago'},
+export const PROFILE_LIKED_ITEMS: {
+ name: string;
+ type: string;
+ lastUsed: string;
+}[] = [
+ {name: 'Meta Theme', type: 'Theme', lastUsed: '2026-04-13T08:00:00Z'},
+ {name: 'Brutalist Theme', type: 'Theme', lastUsed: '2026-04-11T10:30:00Z'},
+ {name: 'Admin Dashboard', type: 'Template', lastUsed: '2026-04-10T14:20:00Z'},
+ {name: 'Product Detail', type: 'Template', lastUsed: '2026-04-07T09:00:00Z'},
];
export const PROFILE_COLLECTIONS = [
{name: 'Work Projects', count: 4},
{name: 'Design Inspiration', count: 6},
{name: 'Client Templates', count: 3},
+ {name: 'Dashboard Ideas', count: 5},
+ {name: 'Landing Pages', count: 8},
+];
+
+export const PROFILE_CRAFT_ITEMS: {
+ name: string;
+ type: 'Template' | 'Theme' | 'Component';
+ status: 'Published' | 'Draft' | 'In Review';
+ used: number;
+ views: number;
+ img: string;
+ lastUpdated: string;
+ description: string;
+}[] = [
+ {name: 'My Dashboard Theme', type: 'Theme', status: 'Published', used: 342, views: 1205, img: FIRST_CARD_IMAGE, lastUpdated: '2026-03-01T10:00:00Z', description: 'Dark-mode friendly theme with custom color tokens and typography overrides.'},
+ {name: 'Custom Login Template', type: 'Template', status: 'Published', used: 128, views: 580, img: SHOPPING_DETAILS_IMAGE, lastUpdated: '2026-03-15T14:30:00Z', description: 'Branded login page with social auth buttons and form validation.'},
+ {name: 'Data Visualization Kit', type: 'Template', status: 'Published', used: 89, views: 312, img: SCREENSHOT_3_IMAGE, lastUpdated: '2026-04-02T11:00:00Z', description: 'Charts, graphs, and data table layouts for analytics dashboards.'},
+ {name: 'Settings Page', type: 'Template', status: 'Published', used: 67, views: 248, img: `${basePath}/templates/card4-preview.png`, lastUpdated: '2026-02-20T08:00:00Z', description: 'Sidebar settings layout with inline editing and expandable rows.'},
+ {name: 'Product Detail Page', type: 'Template', status: 'Published', used: 54, views: 190, img: DUMMY_IMAGE, lastUpdated: '2026-03-28T12:00:00Z', description: 'E-commerce product page with image gallery, reviews, and add-to-cart.'},
+ {name: 'Custom Notification Card', type: 'Component', status: 'Published', used: 203, views: 870, img: DUMMY_IMAGE, lastUpdated: '2026-01-15T09:00:00Z', description: 'Toast-style notification card with dismiss, action buttons, and auto-hide.'},
+ {name: 'Metric Summary Card', type: 'Component', status: 'Published', used: 156, views: 620, img: DUMMY_IMAGE, lastUpdated: '2026-02-10T14:00:00Z', description: 'KPI card with sparkline, trend indicator, and comparison period.'},
+ {name: 'Analytics Dashboard', type: 'Template', status: 'In Review', used: 0, views: 45, img: DUMMY_IMAGE, lastUpdated: '2026-04-12T09:00:00Z', description: 'Full-page analytics dashboard with filters, charts, and data tables.'},
+ {name: 'Team Directory', type: 'Template', status: 'In Review', used: 0, views: 32, img: DUMMY_IMAGE, lastUpdated: '2026-04-10T16:30:00Z', description: 'Searchable team roster with profile cards, org chart, and role filters.'},
+ {name: 'Onboarding Flow', type: 'Template', status: 'Draft', used: 0, views: 12, img: DUMMY_IMAGE, lastUpdated: '2026-04-14T16:00:00Z', description: 'Multi-step onboarding wizard with progress bar and skip logic.'},
+ {name: 'Dark Mode Palette', type: 'Theme', status: 'Draft', used: 0, views: 8, img: DUMMY_IMAGE, lastUpdated: '2026-04-13T11:30:00Z', description: 'High-contrast dark theme with WCAG AA compliant color ratios.'},
+ {name: 'File Upload Dropzone', type: 'Component', status: 'Draft', used: 0, views: 5, img: DUMMY_IMAGE, lastUpdated: '2026-04-15T10:00:00Z', description: 'Drag-and-drop file uploader with preview thumbnails and progress bars.'},
];
// ---------------------------------------------------------------------------
@@ -264,6 +323,103 @@ export const THEME_PICKER_ENTRIES: ThemePickerEntry[] = [
{key: 'midnight', name: 'Midnight', category: 'community', accent: '#818CF8', description: 'Deep blues with soft violet accents', preview: {bg: '#0F172A', surface: '#1E293B', accent: '#818CF8', text: '#E2E8F0'}},
];
+// ---------------------------------------------------------------------------
+// Preview palettes and font packs
+// ---------------------------------------------------------------------------
+
+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<{
+ 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',
+ },
+ },
+];
+
export const PREVIEW_FONT_PACKS = [
{heading: 'Georgia', paragraph: 'Helvetica Neue'},
{heading: 'Playfair Display', paragraph: 'Source Sans Pro'},
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 219b89de54..96223759fe 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/docsite-icons.tsx
@@ -31,13 +31,16 @@ export {
MagnifyingGlassIcon as SearchIcon,
UserIcon as ProfileIcon,
AdjustmentsHorizontalIcon as FilterIcon,
+ BarsArrowDownIcon as SortIcon,
Squares2X2Icon as GridIcon,
+ XMarkIcon,
SparklesIcon,
StopIcon,
StarIcon,
+ CheckBadgeIcon as VerifiedIcon,
} from '@heroicons/react/24/outline';
-export {BookmarkIcon as BookmarkFilledIcon, StarIcon as StarFilledIcon} from '@heroicons/react/24/solid';
+export {BookmarkIcon as BookmarkFilledIcon, HeartIcon as HeartFilledIcon, StarIcon as StarFilledIcon, CheckBadgeIcon as VerifiedFilledIcon} from '@heroicons/react/24/solid';
// Brand logos for theme picker
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
index 53d0505be7..e482a6ffee 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
@@ -14,7 +14,10 @@ import {useSearchParams, useRouter} from 'next/navigation';
import {
TEMPLATES,
AVATAR_IMAGE,
+ XDS_DESIGN_AVATAR,
THEME_PICKER_ENTRIES,
+ FILTER_COLUMNS,
+ PROFILE_CRAFT_ITEMS,
basePath,
} from './constants';
import {TemplateCard} from './TemplateCard';
@@ -37,9 +40,14 @@ import {XDSDivider} from '@xds/core/Divider';
import {XDSHeading, XDSText} from '@xds/core/Text';
import {XDSTabList, XDSTab} from '@xds/core/TabList';
import {XDSToken} from '@xds/core/Token';
+import {XDSIcon} from '@xds/core/Icon';
+import {XDSLink} from '@xds/core/Link';
+import {XDSList, XDSListItem} from '@xds/core/List';
import {XDSPopover} from '@xds/core/Popover';
import {XDSTextInput} from '@xds/core/TextInput';
+import {XDSToolbar} from '@xds/core/Toolbar';
import {XDSTooltip} from '@xds/core/Tooltip';
+import {XDSDropdownMenu} from '@xds/core/DropdownMenu';
import {
ArrowLeftIcon,
BookmarkIcon,
@@ -47,6 +55,10 @@ import {
StarIcon,
StarFilledIcon,
SearchIcon,
+ PaletteIcon,
+ ContrastIcon,
+ MoonIcon,
+ VerifiedIcon,
MetaLogo,
WhatsAppLogo,
ThreadsLogo,
@@ -54,6 +66,7 @@ import {
DefaultThemeIcon,
ForestThemeIcon,
SunsetThemeIcon,
+ FilterIcon,
MidnightThemeIcon,
} from './docsite-icons';
@@ -89,8 +102,99 @@ const popoverStyles = stylex.create({
themeBrowse: {
padding: 16,
},
+ filterDropdown: {
+ padding: 8,
+ },
});
+function SearchableFilterDropdown({
+ label,
+ items,
+ selectedFilters,
+ onToggle,
+ verifiedItems,
+}: {
+ label: string;
+ items: string[];
+ selectedFilters: Set<string>;
+ onToggle: (item: string) => void;
+ verifiedItems?: Set<string>;
+}) {
+ const [isOpen, setIsOpen] = useState(false);
+ const [search, setSearch] = useState('');
+ const filtered = items.filter(item =>
+ item.toLowerCase().includes(search.toLowerCase()),
+ );
+ return (
+ <XDSPopover
+ label={label}
+ placement="below"
+ alignment="start"
+ width={280}
+ isOpen={isOpen}
+ onOpenChange={open => {
+ setIsOpen(open);
+ if (!open) setSearch('');
+ }}
+ xstyle={popoverStyles.filterDropdown}
+ content={
+ <div style={{display: 'flex', flexDirection: 'column', gap: 4}}>
+ <div
+ tabIndex={0}
+ style={{
+ position: 'absolute',
+ opacity: 0,
+ width: 0,
+ height: 0,
+ overflow: 'hidden',
+ }}
+ />
+ <XDSTextInput
+ label="Search"
+ isLabelHidden
+ placeholder={`Search ${label.toLowerCase()}...`}
+ value={search}
+ onChange={setSearch}
+ size="lg"
+ startIcon={SearchIcon}
+ />
+ <div style={{maxHeight: 280, overflowY: 'auto', margin: '0 -8px'}}>
+ {filtered.length === 0 ? (
+ <div style={{padding: '12px 16px'}}>
+ <XDSText type="body" color="secondary">
+ No results
+ </XDSText>
+ </div>
+ ) : (
+ <XDSList density="spacious">
+ {filtered.map(item => (
+ <XDSListItem
+ key={item}
+ label={item}
+ isSelected={selectedFilters.has(item)}
+ onClick={() => onToggle(item)}
+ endContent={
+ verifiedItems?.has(item) ? (
+ <XDSIcon icon={VerifiedIcon} size="sm" color="accent" />
+ ) : undefined
+ }
+ />
+ ))}
+ </XDSList>
+ )}
+ </div>
+ </div>
+ }>
+ <XDSButton
+ label={label}
+ variant="ghost"
+ size="sm"
+ endContent={<XDSIcon icon="chevronDown" size="sm" color="inherit" />}
+ />
+ </XDSPopover>
+ );
+}
+
// ---------------------------------------------------------------------------
// Page
// ---------------------------------------------------------------------------
@@ -106,22 +210,98 @@ export default function DocsiteLandingPage() {
function DocsiteLandingTemplate() {
const searchParams = useSearchParams();
const router = useRouter();
+ const [previewMode, setPreviewMode] = useState<'light' | 'dark'>('light');
+ const [previewTheme, setPreviewTheme] = useState('default');
+
+ const previewImageFilter = useMemo(() => {
+ const filters: string[] = [];
+ if (previewMode === 'dark') {
+ filters.push('invert(0.88)', 'hue-rotate(180deg)');
+ }
+ const themeFilters: Record<string, string> = {
+ neutral: 'saturate(0.3)',
+ brutalist: 'contrast(1.2) saturate(0.5)',
+ meta: 'sepia(0.15) saturate(1.4) hue-rotate(200deg)',
+ whatsapp: 'sepia(0.2) saturate(1.3) hue-rotate(100deg)',
+ };
+ if (themeFilters[previewTheme]) {
+ filters.push(themeFilters[previewTheme]);
+ }
+ return filters.length > 0 ? filters.join(' ') : undefined;
+ }, [previewMode, previewTheme]);
// Read initial state from URL params
const initialView = useMemo(() => {
const v = searchParams.get('view');
const t = searchParams.get('template');
+ const q = searchParams.get('q');
const templateIdx = t !== null ? parseInt(t, 10) : null;
return {
view: v,
templateIdx: isNaN(templateIdx as number) ? null : templateIdx,
+ query: q,
};
}, [searchParams]);
const [activeView, setActiveView] = useState(
'craft' as 'craft' | 'explore' | 'docs' | 'profile',
);
+ const [craftTitle, setCraftTitle] = useState<string | null>(
+ initialView.query,
+ );
+ const [isProfileResults, setIsProfileResults] = useState(false);
+ const [isCraftResults, setIsCraftResults] = useState(false);
+ const [craftStatusFilter, setCraftStatusFilter] = useState('all');
+ const [craftLoading, setCraftLoading] = useState(false);
+ const [craftExiting, setCraftExiting] = useState(false);
+ const [resultFilters, setResultFilters] = useState<Set<string>>(
+ () => new Set(),
+ );
+ const handleToggleResultFilter = useCallback((filter: string) => {
+ setResultFilters(prev => {
+ const next = new Set(prev);
+ if (next.has(filter)) next.delete(filter);
+ else next.add(filter);
+ return next;
+ });
+ }, []);
+ const craftLoadingTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
+ const handleBackFromResults = useCallback(() => {
+ setCraftExiting(true);
+ setCraftLoading(true);
+ setResultFilters(new Set());
+ setIsProfileResults(false);
+ setIsCraftResults(false);
+ setCraftStatusFilter('all');
+ if (craftLoadingTimer.current) clearTimeout(craftLoadingTimer.current);
+ craftLoadingTimer.current = setTimeout(() => {
+ setCraftTitle(null);
+ setCraftLoading(false);
+ setCraftExiting(false);
+ craftLoadingTimer.current = null;
+ }, 600);
+ }, []);
+ const handleTokenClick = useCallback((label: string) => {
+ setPreviewTarget(null);
+ setCraftTitle(label);
+ setIsProfileResults(false);
+ setCraftLoading(true);
+ if (craftLoadingTimer.current) clearTimeout(craftLoadingTimer.current);
+ craftLoadingTimer.current = setTimeout(() => {
+ setCraftLoading(false);
+ craftLoadingTimer.current = null;
+ }, 900);
+ }, []);
const [selected, setSelected] = useState(new Set());
+ const [templateFilter, setTemplateFilter] = useState<
+ 'all' | 'official' | string
+ >('all');
+ const [activeFilters, setActiveFilters] = useState<Set<string>>(
+ () => new Set(),
+ );
+ const [sortOption, setSortOption] = useState('trending');
+ const [isFilterOpen, setIsFilterOpen] = useState(false);
+ const [isSettingsOpen, setIsSettingsOpen] = useState(false);
const [activeTab, setActiveTab] = useState('all');
const [isMobile, setIsMobile] = useState(false);
const [isTablet, setIsTablet] = useState(false);
@@ -136,6 +316,7 @@ function DocsiteLandingTemplate() {
initialView.view === 'editor' ? initialView.templateIdx : null,
);
const [previewGenerating, setPreviewGenerating] = useState(false);
+ const [previewTransitioning, setPreviewTransitioning] = useState(false);
const [showPublishCard1, setShowPublishCard1] = useState(false);
const [panelTab, setPanelTab] = useState<PanelTab>('configure');
const [isPointing, setIsPointing] = useState(false);
@@ -145,7 +326,8 @@ function DocsiteLandingTemplate() {
const [_editorViewport, _setEditorViewport] = useState('desktop');
const [fullPreview, setFullPreview] = useState(false);
- const scrollContainerRef = useRef(null);
+ const scrollContainerRef = useRef<HTMLDivElement>(null);
+ const [isHeaderCollapsed, setIsHeaderCollapsed] = useState(false);
const [card4SelectedOption, setCard4SelectedOption] = useState('default');
const [card4ThemeBrowse, setCard4ThemeBrowse] = useState(false);
const [card4Bookmarked, setCard4Bookmarked] = useState(false);
@@ -205,15 +387,21 @@ function DocsiteLandingTemplate() {
path += '?view=preview&template=' + previewTarget;
} else if (useTarget !== null) {
path += '?view=editor&template=' + useTarget;
+ } else if (craftTitle) {
+ path += '?q=' + encodeURIComponent(craftTitle);
}
router.replace(path, {scroll: false});
- }, [previewTarget, useTarget, router]);
+ }, [previewTarget, useTarget, craftTitle, router]);
- // Reset preview/editor state when switching views
+ const prevViewRef = useRef(activeView);
useEffect(() => {
+ if (prevViewRef.current === activeView) return;
+ prevViewRef.current = activeView;
setPreviewTarget(null);
setUseTarget(null);
setChatOpen(false);
+ setCraftTitle(null);
+ setResultFilters(new Set());
}, [activeView]);
const timerRef = useRef(null as ReturnType<typeof setTimeout> | null);
const previewTimerRef = useRef(null as ReturnType<typeof setTimeout> | null);
@@ -237,6 +425,14 @@ function DocsiteLandingTemplate() {
};
}, []);
+ useEffect(() => {
+ const el = document.getElementById('docsite-scroll');
+ if (!el) return;
+ const onScroll = () => setIsHeaderCollapsed(el.scrollTop > 170);
+ el.addEventListener('scroll', onScroll, {passive: true});
+ return () => el.removeEventListener('scroll', onScroll);
+ }, []);
+
const handleMoreLikeThis = useCallback(
(index: number) => {
if (generatingSource !== null) return;
@@ -280,11 +476,92 @@ function DocsiteLandingTemplate() {
return () => {
if (timerRef.current) clearTimeout(timerRef.current);
if (previewTimerRef.current) clearTimeout(previewTimerRef.current);
+ if (craftLoadingTimer.current) clearTimeout(craftLoadingTimer.current);
};
}, []);
const isGenerating = generatingSource !== null;
+ const templateAuthors = useMemo(() => {
+ const authors = Array.from(new Set(TEMPLATES.map(t => t.author)));
+ return authors.sort((a, b) => {
+ if (a === 'XDS Design') return -1;
+ if (b === 'XDS Design') return 1;
+ return a.localeCompare(b);
+ });
+ }, []);
+
+ const handleToggleFilter = useCallback((filter: string) => {
+ setActiveFilters(prev => {
+ const next = new Set(prev);
+ if (next.has(filter)) next.delete(filter);
+ else next.add(filter);
+ return next;
+ });
+ }, []);
+
+ const handleClearFilters = useCallback(() => {
+ setActiveFilters(new Set());
+ }, []);
+
+ const handleProfileAction = useCallback(
+ (action: 'craft' | 'bookmarked' | 'used' | 'settings') => {
+ if (action === 'settings') {
+ setIsSettingsOpen(true);
+ } else if (action === 'craft') {
+ setPreviewTarget(null);
+ setCraftTitle('My Craft');
+ setIsCraftResults(true);
+ setIsProfileResults(true);
+ setCraftStatusFilter('all');
+ setCraftLoading(true);
+ if (craftLoadingTimer.current) clearTimeout(craftLoadingTimer.current);
+ craftLoadingTimer.current = setTimeout(() => {
+ setCraftLoading(false);
+ craftLoadingTimer.current = null;
+ }, 900);
+ } else {
+ const label = action === 'bookmarked' ? 'Bookmarked' : 'Used';
+ setPreviewTarget(null);
+ setCraftTitle(label);
+ setIsProfileResults(true);
+ setIsCraftResults(false);
+ setCraftLoading(true);
+ if (craftLoadingTimer.current) clearTimeout(craftLoadingTimer.current);
+ craftLoadingTimer.current = setTimeout(() => {
+ setCraftLoading(false);
+ craftLoadingTimer.current = null;
+ }, 900);
+ }
+ },
+ [],
+ );
+
+ const filteredTemplates = useMemo(() => {
+ return TEMPLATES.map((t, i) => ({...t, originalIndex: i})).filter(t => {
+ if (templateFilter === 'all') return true;
+ if (templateFilter === 'official') return t.isOfficial;
+ return t.author.toLowerCase().includes(templateFilter.toLowerCase());
+ });
+ }, [templateFilter]);
+
+ const craftStatusCounts = useMemo(
+ () => ({
+ published: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'Published')
+ .length,
+ draft: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'Draft').length,
+ review: PROFILE_CRAFT_ITEMS.filter(i => i.status === 'In Review').length,
+ }),
+ [],
+ );
+
+ const filteredCraftItems = useMemo(() => {
+ if (craftStatusFilter === 'all') return PROFILE_CRAFT_ITEMS;
+ return PROFILE_CRAFT_ITEMS.filter(
+ item => item.status === craftStatusFilter,
+ );
+ }, [craftStatusFilter]);
+
// Editor flow — same layout for all cards
if (useTarget !== null && activeView === 'craft') {
const t = TEMPLATES[useTarget % TEMPLATES.length];
@@ -294,10 +571,7 @@ function DocsiteLandingTemplate() {
display: 'flex',
height: '100vh',
overflow: 'hidden',
- backgroundColor:
- useTarget !== 3
- ? 'var(--color-background-body)'
- : 'var(--color-background-surface, #fff)',
+ backgroundColor: 'var(--color-background-surface, #fff)',
}}>
<style>
{'@keyframes slideInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }' +
@@ -323,10 +597,7 @@ function DocsiteLandingTemplate() {
flex: 1,
backgroundColor: 'var(--color-background-card, #fff)',
borderRadius: 16,
- border:
- useTarget !== 3
- ? 'none'
- : '1px solid var(--color-divider, #e0e0e0)',
+ border: '1px solid var(--color-divider, #e0e0e0)',
overflow: 'hidden',
display: 'flex',
flexDirection: 'column' as const,
@@ -401,7 +672,7 @@ function DocsiteLandingTemplate() {
justifyContent: 'center',
zIndex: 10,
backgroundColor: 'transparent',
- marginRight: useTarget !== 3 ? -16 : 0,
+ marginRight: 0,
}}>
<div
className="xds-editor-resize-handle"
@@ -423,6 +694,8 @@ function DocsiteLandingTemplate() {
flexDirection: 'column' as const,
minWidth: 0,
overflow: 'visible',
+ marginLeft: -16,
+ paddingLeft: 16,
}}>
<TemplatePreview
templateName={t.name}
@@ -443,9 +716,7 @@ function DocsiteLandingTemplate() {
isFullPreview={fullPreview}
onFullPreviewChange={setFullPreview}
hideToolbar={fullPreview}
- previewBackground={
- useTarget !== 3 ? 'var(--color-background-body)' : undefined
- }
+ previewBackground={undefined}
/>
</div>
</div>
@@ -475,12 +746,23 @@ function DocsiteLandingTemplate() {
scrollContainerRef={scrollContainerRef}
activeTab={activeTab}
onActiveTabChange={setActiveTab}
+ templateFilter={templateFilter}
+ onTemplateFilterChange={setTemplateFilter}
+ templateAuthors={templateAuthors}
+ activeFilters={activeFilters}
+ onToggleFilter={handleToggleFilter}
+ onClearFilters={handleClearFilters}
+ sortOption={sortOption}
+ onSortChange={setSortOption}
+ isFilterOpen={isFilterOpen}
+ onFilterOpenChange={setIsFilterOpen}
+ craftTitle={craftTitle}
/>
}>
<div
style={{
display: 'flex',
- flex: 1,
+ height: '100%',
overflow: 'hidden',
}}>
{/* Chat panel */}
@@ -514,79 +796,694 @@ function DocsiteLandingTemplate() {
}}>
<div style={{display: 'flex', flex: 1, overflow: 'hidden'}}>
<div
+ id="docsite-scroll"
ref={scrollContainerRef}
style={{
flex: 1,
overflow: 'auto',
- padding: '16px 16px 140px',
+ padding: '0 24px 140px',
}}>
- {/* Hero heading */}
- <div
- style={{
- maxWidth: 2000,
- margin: '0 auto',
- paddingBlock: 32,
- textAlign: 'center',
- }}>
- <XDSText type="display-1">Craft what you imagine.</XDSText>
- </div>
+ <style>{`
+ @keyframes craftShimmer {
+ 0% { background-position: -400px 0; }
+ 100% { background-position: 400px 0; }
+ }
+ @keyframes craftCardFadeIn {
+ from { opacity: 0; transform: translateY(12px); }
+ to { opacity: 1; transform: translateY(0); }
+ }
+ @keyframes craftTitleSlideIn {
+ from { opacity: 0; transform: translateX(-16px); }
+ to { opacity: 1; transform: translateX(0); }
+ }
+ @keyframes previewFadeIn {
+ from { opacity: 0; transform: translateY(8px); }
+ to { opacity: 1; transform: translateY(0); }
+ }
+ `}</style>
+ {craftTitle && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto 16px',
+ paddingTop: 16,
+ display: 'flex',
+ alignItems: 'center',
+ gap: 12,
+ ...(craftExiting
+ ? {
+ opacity: 0,
+ transform: 'translateX(-16px)',
+ transition:
+ 'opacity 300ms ease, transform 300ms ease',
+ }
+ : {
+ animation:
+ 'craftTitleSlideIn 400ms cubic-bezier(0.16, 1, 0.3, 1)',
+ }),
+ }}>
+ {!isProfileResults && (
+ <XDSButton
+ label="Back"
+ variant="ghost"
+ size="lg"
+ icon={<ArrowLeftIcon />}
+ isIconOnly
+ onClick={handleBackFromResults}
+ style={{marginLeft: -8}}
+ />
+ )}
+ <XDSText type="display-1">{craftTitle}</XDSText>
+ </div>
+ )}
+ {craftTitle && !craftLoading && isCraftResults && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto 20px',
+ display: 'flex',
+ gap: 6,
+ flexWrap: 'wrap' as const,
+ animation:
+ 'craftTitleSlideIn 400ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both',
+ }}>
+ {[
+ {
+ value: 'all',
+ label: `All (${PROFILE_CRAFT_ITEMS.length})`,
+ },
+ {
+ value: 'Published',
+ label: `Published (${craftStatusCounts.published})`,
+ },
+ {
+ value: 'Draft',
+ label: `Draft (${craftStatusCounts.draft})`,
+ },
+ {
+ value: 'In Review',
+ label: `In Review (${craftStatusCounts.review})`,
+ },
+ ].map(tab => (
+ <XDSButton
+ key={tab.value}
+ label={tab.label}
+ variant={
+ craftStatusFilter === tab.value
+ ? 'primary'
+ : 'secondary'
+ }
+ size="sm"
+ onClick={() => setCraftStatusFilter(tab.value)}
+ />
+ ))}
+ </div>
+ )}
+ {craftTitle && !craftLoading && !isCraftResults && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto 20px',
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 4,
+ animation:
+ 'craftTitleSlideIn 400ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both',
+ }}>
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: 4,
+ marginLeft: -8,
+ marginRight: -8,
+ }}>
+ {FILTER_COLUMNS.map(col => (
+ <SearchableFilterDropdown
+ key={col.heading}
+ label={col.heading}
+ items={col.items}
+ selectedFilters={resultFilters}
+ onToggle={handleToggleResultFilter}
+ />
+ ))}
+ <SearchableFilterDropdown
+ label="Author"
+ items={templateAuthors}
+ selectedFilters={resultFilters}
+ onToggle={handleToggleResultFilter}
+ verifiedItems={new Set(['XDS Design'])}
+ />
+ <div
+ style={{
+ marginLeft: 'auto',
+ display: 'flex',
+ alignItems: 'center',
+ gap: 16,
+ }}>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ style={{whiteSpace: 'nowrap'}}>
+ Showing {filteredTemplates.length} screens
+ </XDSText>
+ <XDSToolbar
+ label="View controls"
+ density="compact"
+ startContent={
+ <>
+ <XDSButton
+ label={
+ previewMode === 'dark'
+ ? 'Light mode'
+ : 'Dark mode'
+ }
+ variant="ghost"
+ size="sm"
+ isIconOnly
+ icon={
+ previewMode === 'dark' ? (
+ <ContrastIcon />
+ ) : (
+ <MoonIcon />
+ )
+ }
+ onClick={() =>
+ setPreviewMode(
+ previewMode === 'dark' ? 'light' : 'dark',
+ )
+ }
+ />
+ <XDSDropdownMenu
+ button={{
+ label: 'Theme',
+ variant: 'ghost',
+ size: 'sm',
+ isIconOnly: true,
+ icon: <PaletteIcon />,
+ }}
+ hasChevron={false}
+ menuWidth={160}
+ items={[
+ {
+ label: 'Default',
+ onClick: () => setPreviewTheme('default'),
+ },
+ {
+ label: 'Neutral',
+ onClick: () => setPreviewTheme('neutral'),
+ },
+ {
+ label: 'Brutalist',
+ onClick: () => setPreviewTheme('brutalist'),
+ },
+ {
+ label: 'Meta',
+ onClick: () => setPreviewTheme('meta'),
+ },
+ {
+ label: 'WhatsApp',
+ onClick: () => setPreviewTheme('whatsapp'),
+ },
+ ]}
+ />
+ </>
+ }
+ />
+ <XDSDropdownMenu
+ button={{
+ label:
+ sortOption === 'trending'
+ ? 'Trending'
+ : sortOption === 'newest'
+ ? 'Newest first'
+ : 'Oldest first',
+ variant: 'ghost',
+ size: 'sm',
+ }}
+ items={[
+ {
+ label: 'Trending',
+ onClick: () => setSortOption('trending'),
+ },
+ {
+ label: 'Newest first',
+ onClick: () => setSortOption('newest'),
+ },
+ {
+ label: 'Oldest first',
+ onClick: () => setSortOption('oldest'),
+ },
+ ]}
+ />
+ </div>
+ </div>
+ {resultFilters.size > 0 && (
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: 8,
+ flexWrap: 'wrap',
+ }}>
+ {Array.from(resultFilters).map(f => (
+ <XDSToken
+ key={f}
+ label={f}
+ size="sm"
+ onRemove={() => handleToggleResultFilter(f)}
+ />
+ ))}
+ <XDSText type="supporting">
+ <XDSLink
+ label="Clear all"
+ color="secondary"
+ onClick={() => setResultFilters(new Set())}>
+ Clear all
+ </XDSLink>
+ </XDSText>
+ </div>
+ )}
+ </div>
+ )}
- {/* Tab filters */}
- <div
- style={{
- maxWidth: 2000,
- margin: '0 auto 24px',
- display: 'flex',
- justifyContent: 'center',
- }}>
- <XDSTabList value={activeTab} onChange={setActiveTab} size="sm">
- <XDSTab value="all" label="All" />
- <XDSTab value="templates" label="Templates" />
- <XDSTab value="theme" label="Theme" />
- <XDSTab value="components" label="Components" />
- </XDSTabList>
- </div>
+ {/* Hero heading */}
+ {!craftTitle && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ paddingTop: 48,
+ paddingBottom: 32,
+ textAlign: 'center',
+ }}>
+ <XDSText type="display-1">Craft what you imagine.</XDSText>
+ </div>
+ )}
- {/* Template grid */}
- <div
- style={{
- maxWidth: 2000,
- margin: '0 auto',
- display: 'grid',
- gridTemplateColumns: isMobile
- ? '1fr'
- : isTablet
- ? 'repeat(2, 1fr)'
- : 'repeat(3, 1fr)',
- gap: 16,
- gridAutoRows: '1fr',
- }}>
- {TEMPLATES.map((template, i) => (
- <div key={`${template.name}-${i}`}>
- <TemplateCard
- src={template.src}
- name={template.name}
- isSelected={selected.has(i)}
- isGenerating={isGenerating && generatingSource !== i}
- cardSize={template.size}
- onSelect={() =>
- setSelected(prev => {
- const next = new Set(prev);
- if (next.has(i)) {
- next.delete(i);
- } else {
- next.add(i);
- }
- return next;
- })
- }
- onMoreLikeThis={() => handleMoreLikeThis(i)}
- onUse={() => handleUse(i)}
- onPreview={() => handlePreview(i)}
+ {/* Tab row — scrolls away, AppTopNav takes over */}
+ {!craftTitle && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ paddingBottom: 24,
+ display: 'grid',
+ gridTemplateColumns: '1fr auto 1fr',
+ alignItems: 'center',
+ }}>
+ <div />
+ <XDSTabList
+ value={activeTab}
+ onChange={setActiveTab}
+ size="sm">
+ <XDSTab value="all" label="All" />
+ <XDSTab value="templates" label="Templates" />
+ <XDSTab value="theme" label="Theme" />
+ <XDSTab value="components" label="Components" />
+ </XDSTabList>
+ <div style={{justifySelf: 'end', display: 'flex', gap: 4}}>
+ <XDSButton
+ label="Filter"
+ variant="ghost"
+ size="sm"
+ isIconOnly
+ icon={<FilterIcon />}
+ onClick={() => setIsFilterOpen(!isFilterOpen)}
+ />
+ <XDSDropdownMenu
+ button={{
+ label:
+ sortOption === 'trending'
+ ? 'Trending'
+ : sortOption === 'newest'
+ ? 'Newest first'
+ : 'Oldest first',
+ variant: 'ghost',
+ size: 'sm',
+ }}
+ items={[
+ {
+ label: 'Trending',
+ onClick: () => setSortOption('trending'),
+ },
+ {
+ label: 'Newest first',
+ onClick: () => setSortOption('newest'),
+ },
+ {
+ label: 'Oldest first',
+ onClick: () => setSortOption('oldest'),
+ },
+ ]}
/>
</div>
- ))}
- </div>
+ </div>
+ )}
+
+ {/* Filter panel — sticky, independent of tab row */}
+ {!craftTitle && isFilterOpen && (
+ <div
+ style={{
+ position: 'sticky',
+ top: 0,
+ zIndex: 9,
+ backgroundColor: 'var(--color-background-surface, #fff)',
+ marginInline: -24,
+ paddingInline: 24,
+ boxShadow: isHeaderCollapsed
+ ? '0 1px 3px rgba(0,0,0,0.08)'
+ : 'none',
+ transition: 'box-shadow 200ms ease',
+ }}>
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ display: 'grid',
+ gridTemplateColumns: 'repeat(4, 1fr)',
+ gap: 24,
+ padding: '24px 8px',
+ }}>
+ <div>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ style={{marginBottom: 12, display: 'block'}}>
+ Author
+ </XDSText>
+ <div style={{marginLeft: -8, marginRight: -8}}>
+ <XDSList density="compact">
+ <XDSListItem
+ label="All"
+ isSelected={templateFilter === 'all'}
+ onClick={() => setTemplateFilter('all')}
+ />
+ <XDSListItem
+ label="XDS Official"
+ isSelected={templateFilter === 'official'}
+ onClick={() => setTemplateFilter('official')}
+ />
+ </XDSList>
+ </div>
+ </div>
+ {FILTER_COLUMNS.map(col => (
+ <div key={col.heading}>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ style={{marginBottom: 12, display: 'block'}}>
+ {col.heading}
+ </XDSText>
+ <div style={{marginLeft: -8, marginRight: -8}}>
+ <XDSList density="compact">
+ {col.items.map(item => (
+ <XDSListItem
+ key={item}
+ label={item}
+ isSelected={activeFilters.has(item)}
+ onClick={() => handleToggleFilter(item)}
+ />
+ ))}
+ </XDSList>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
+ {/* Active filter chips */}
+ {!craftTitle && activeFilters.size > 0 && (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto 16px',
+ display: 'flex',
+ alignItems: 'center',
+ gap: 8,
+ flexWrap: 'wrap',
+ }}>
+ {Array.from(activeFilters).map(filter => (
+ <XDSToken
+ key={filter}
+ label={filter}
+ onRemove={() => handleToggleFilter(filter)}
+ />
+ ))}
+ <XDSText type="supporting">
+ <XDSLink
+ label="Clear all"
+ color="secondary"
+ onClick={handleClearFilters}>
+ Clear all
+ </XDSLink>
+ </XDSText>
+ </div>
+ )}
+
+ {/* Template grid */}
+ {craftLoading ? (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ display: 'grid',
+ gridTemplateColumns: isMobile
+ ? '1fr'
+ : isTablet
+ ? 'repeat(2, 1fr)'
+ : 'repeat(3, 1fr)',
+ gap: 16,
+ }}>
+ {Array.from({length: 8}).map((_, i) => (
+ <div
+ key={i}
+ style={{
+ borderRadius: 16,
+ overflow: 'hidden',
+ animation: `craftCardFadeIn 400ms ${i * 60}ms cubic-bezier(0.16, 1, 0.3, 1) both`,
+ }}>
+ <div
+ style={{
+ aspectRatio: '4 / 3',
+ background:
+ 'linear-gradient(90deg, var(--color-background-muted, #f0f0f0) 0%, var(--color-background-surface, #fafafa) 50%, var(--color-background-muted, #f0f0f0) 100%)',
+ backgroundSize: '800px 100%',
+ animation: 'craftShimmer 1.6s ease-in-out infinite',
+ borderRadius: '16px 16px 0 0',
+ }}
+ />
+ <div
+ style={{
+ padding: 16,
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 10,
+ }}>
+ <div
+ style={{
+ height: 14,
+ width: '60%',
+ borderRadius: 6,
+ background:
+ 'linear-gradient(90deg, var(--color-background-muted, #f0f0f0) 0%, var(--color-background-surface, #fafafa) 50%, var(--color-background-muted, #f0f0f0) 100%)',
+ backgroundSize: '800px 100%',
+ animation: 'craftShimmer 1.6s ease-in-out infinite',
+ }}
+ />
+ <div
+ style={{
+ height: 10,
+ width: '40%',
+ borderRadius: 6,
+ background:
+ 'linear-gradient(90deg, var(--color-background-muted, #f0f0f0) 0%, var(--color-background-surface, #fafafa) 50%, var(--color-background-muted, #f0f0f0) 100%)',
+ backgroundSize: '800px 100%',
+ animation: 'craftShimmer 1.6s ease-in-out infinite',
+ }}
+ />
+ </div>
+ </div>
+ ))}
+ </div>
+ ) : isCraftResults ? (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ display: 'grid',
+ gridTemplateColumns: isMobile
+ ? '1fr'
+ : isTablet
+ ? 'repeat(2, 1fr)'
+ : 'repeat(3, 1fr)',
+ gap: 16,
+ }}>
+ {filteredCraftItems.map((item, i) => (
+ <XDSCard
+ key={item.name}
+ padding={0}
+ style={{
+ overflow: 'hidden',
+ animation: `craftCardFadeIn 400ms ${i * 60}ms cubic-bezier(0.16, 1, 0.3, 1) both`,
+ }}>
+ <div
+ style={{
+ aspectRatio: '16 / 9',
+ overflow: 'hidden',
+ backgroundColor:
+ 'var(--color-background-muted, #f0f0f0)',
+ }}>
+ <img
+ src={item.img}
+ alt={item.name}
+ style={{
+ width: '100%',
+ height: '100%',
+ objectFit: 'cover',
+ objectPosition: 'top',
+ display: 'block',
+ }}
+ />
+ </div>
+ <div style={{padding: 16}}>
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ gap: 8,
+ }}>
+ <XDSText type="body" weight="bold">
+ {item.name}
+ </XDSText>
+ <span
+ style={{
+ fontSize: 11,
+ fontWeight: 600,
+ padding: '2px 8px',
+ borderRadius: 9999,
+ whiteSpace: 'nowrap' as const,
+ flexShrink: 0,
+ backgroundColor:
+ item.status === 'Published'
+ ? '#ECFDF3'
+ : item.status === 'In Review'
+ ? '#FFFAEB'
+ : '#F2F4F7',
+ color:
+ item.status === 'Published'
+ ? '#027A48'
+ : item.status === 'In Review'
+ ? '#B54708'
+ : '#667085',
+ }}>
+ {item.status}
+ </span>
+ </div>
+ <div style={{marginTop: 4}}>
+ <XDSText type="supporting" color="secondary">
+ {item.type}
+ </XDSText>
+ </div>
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: 16,
+ marginTop: 12,
+ }}>
+ <div>
+ <XDSText type="supporting" color="secondary">
+ {item.used} uses
+ </XDSText>
+ </div>
+ <div>
+ <XDSText type="supporting" color="secondary">
+ {item.views} views
+ </XDSText>
+ </div>
+ <div style={{marginLeft: 'auto'}}>
+ <XDSText type="supporting" color="secondary">
+ {new Date(item.lastUpdated).toLocaleDateString(
+ 'en-US',
+ {month: 'short', day: 'numeric'},
+ )}
+ </XDSText>
+ </div>
+ </div>
+ </div>
+ </XDSCard>
+ ))}
+ {filteredCraftItems.length === 0 && (
+ <div
+ style={{
+ gridColumn: '1 / -1',
+ padding: 32,
+ textAlign: 'center' as const,
+ }}>
+ <XDSText type="body" color="secondary">
+ No items match this filter.
+ </XDSText>
+ </div>
+ )}
+ </div>
+ ) : (
+ <div
+ style={{
+ maxWidth: 2000,
+ margin: '0 auto',
+ display: 'grid',
+ gridTemplateColumns: isMobile
+ ? '1fr'
+ : isTablet
+ ? 'repeat(2, 1fr)'
+ : 'repeat(3, 1fr)',
+ gap: 16,
+ }}>
+ {filteredTemplates.map((template, i) => (
+ <div
+ key={`${template.name}-${template.originalIndex}`}
+ style={{
+ ...(craftTitle
+ ? {
+ animation: `craftCardFadeIn 400ms ${i * 50}ms cubic-bezier(0.16, 1, 0.3, 1) both`,
+ }
+ : undefined),
+ filter: previewImageFilter,
+ transition: 'filter 300ms ease',
+ }}>
+ <TemplateCard
+ src={template.src}
+ name={template.name}
+ isSelected={selected.has(template.originalIndex)}
+ isGenerating={
+ isGenerating &&
+ generatingSource !== template.originalIndex
+ }
+ cardSize={template.size}
+ onSelect={() =>
+ setSelected(prev => {
+ const next = new Set(prev);
+ if (next.has(template.originalIndex)) {
+ next.delete(template.originalIndex);
+ } else {
+ next.add(template.originalIndex);
+ }
+ return next;
+ })
+ }
+ onMoreLikeThis={() =>
+ handleMoreLikeThis(template.originalIndex)
+ }
+ onUse={() => handleUse(template.originalIndex)}
+ onPreview={() => handlePreview(template.originalIndex)}
+ />
+ </div>
+ ))}
+ </div>
+ )}
</div>
</div>
</div>
@@ -616,7 +1513,14 @@ function DocsiteLandingTemplate() {
width="90vw"
maxHeight="90vh"
purpose="info"
- style={{padding: 0, overflow: 'visible', maxWidth: 1200}}>
+ style={
+ {
+ padding: 0,
+ overflow: 'visible',
+ maxWidth: 1600,
+ '--xds-dialog-padding': '0px',
+ } as React.CSSProperties
+ }>
<div
style={{position: 'absolute', top: 0, right: -40, zIndex: 1}}>
<XDSCard padding={0} style={{borderRadius: '50%'}}>
@@ -632,16 +1536,16 @@ function DocsiteLandingTemplate() {
</div>
<div ref={card4ScrollRef} style={{overflowY: 'auto'}}>
{/* Main content: image left + details right */}
- <div style={{display: 'flex', minHeight: 0, padding: '0 24px'}}>
+ <div style={{display: 'flex', minHeight: 0, padding: '0 32px'}}>
{/* Left — Preview image + thumbnails */}
<XDSStack
direction="vertical"
gap={3}
- style={{flex: 1, minWidth: 0, padding: '24px 24px 24px 0'}}>
+ style={{flex: 1, minWidth: 0, padding: '32px 32px 32px 0'}}>
<div
style={{
flex: 1,
- height: 'clamp(300px, 50vh, 600px)',
+ aspectRatio: '16 / 10',
backgroundColor:
'var(--color-background-muted, #f9f9f9)',
borderRadius: 12,
@@ -656,7 +1560,15 @@ function DocsiteLandingTemplate() {
: t.src
}
alt={t.name}
- style={{width: '100%', display: 'block'}}
+ style={{
+ width: '100%',
+ display: 'block',
+ opacity: previewTransitioning ? 0 : 1,
+ transition: 'opacity 250ms ease',
+ animation: previewTransitioning
+ ? 'none'
+ : 'previewFadeIn 300ms ease',
+ }}
/>
</div>
</XDSStack>
@@ -664,47 +1576,60 @@ function DocsiteLandingTemplate() {
{/* Right — Details panel */}
<XDSStack
direction="vertical"
- style={{width: 360, flexShrink: 0, padding: '24px 0'}}>
- {/* Title */}
- <XDSText type="display-2">{t.name}</XDSText>
-
- {/* Description */}
- <div style={{marginTop: 8}}>
- <XDSText type="body" color="secondary">
- A ready-to-use {t.name.toLowerCase()} template built
- with XDS components. Customize it with your own content
- and theme to match your brand.
- </XDSText>
- </div>
+ style={{width: 360, flexShrink: 0, padding: '32px 0'}}>
+ <div
+ style={{
+ opacity: previewTransitioning ? 0 : 1,
+ transition: 'opacity 250ms ease',
+ animation: previewTransitioning
+ ? 'none'
+ : 'previewFadeIn 300ms ease',
+ }}>
+ {/* Title */}
+ <XDSText type="display-2">{t.name}</XDSText>
- {/* Author */}
- <XDSStack
- direction="horizontal"
- gap={3}
- vAlign="center"
- style={{marginTop: 16}}>
- <XDSAvatar
- name="Andrea Anderson"
- size={36}
- src={AVATAR_IMAGE}
- />
- <XDSStack direction="vertical">
- <XDSText type="supporting" color="secondary">
- Crafted by
- </XDSText>
- <XDSText
- type="body"
- style={{fontWeight: 600, fontSize: 16}}>
- Andrea Anderson
+ {/* Description */}
+ <div style={{marginTop: 8}}>
+ <XDSText type="body" color="secondary">
+ A ready-to-use {t.name.toLowerCase()} template built
+ with XDS components. Customize it with your own
+ content and theme to match your brand.
</XDSText>
+ </div>
+
+ {/* Author */}
+ <XDSStack
+ direction="horizontal"
+ gap={3}
+ vAlign="center"
+ style={{marginTop: 16}}>
+ <XDSAvatar
+ name={t.author}
+ size={36}
+ src={
+ t.author === 'XDS Design'
+ ? XDS_DESIGN_AVATAR
+ : AVATAR_IMAGE
+ }
+ />
+ <XDSStack direction="vertical">
+ <XDSText type="supporting" color="secondary">
+ Crafted by
+ </XDSText>
+ <XDSText
+ type="body"
+ style={{fontWeight: 600, fontSize: 16}}>
+ {t.author}
+ </XDSText>
+ </XDSStack>
</XDSStack>
- </XDSStack>
+ </div>
{/* CTA buttons */}
<XDSStack
direction="vertical"
gap={2}
- style={{marginTop: 16, position: 'relative'}}>
+ style={{marginTop: 32, position: 'relative'}}>
<XDSButton
variant="primary"
label="Start crafting"
@@ -717,31 +1642,21 @@ function DocsiteLandingTemplate() {
setChatOpen(true);
}}
/>
- <XDSStack
- direction="horizontal"
- gap={2}
- style={{width: '100%'}}>
- <XDSPopover
- label="Add to project"
- isOpen={card4ShowAddPopover}
- onOpenChange={setCard4ShowAddPopover}
- placement="below"
- alignment="start"
- width={340}
- style={{flex: 1, minWidth: 0}}
- content={
- <SharePopoverContent
- cliCommand={`npx xds template ${t.name.toLowerCase().replace(/\s+/g, '-')} ./my-project`}
- onClose={() => setCard4ShowAddPopover(false)}
- />
- }>
- <XDSButton
- variant="secondary"
- label="Use in your product"
- size="lg"
- style={{width: '100%'}}
- />
- </XDSPopover>
+ <div
+ style={{
+ display: 'flex',
+ gap: 8,
+ width: '100%',
+ }}>
+ <XDSButton
+ variant="secondary"
+ label="Use in your product"
+ size="lg"
+ style={{flex: 1}}
+ onClick={() =>
+ setCard4ShowAddPopover(!card4ShowAddPopover)
+ }
+ />
<XDSTooltip content="Bookmark">
<XDSButton
label={card4Bookmarked ? '893' : '892'}
@@ -758,7 +1673,23 @@ function DocsiteLandingTemplate() {
onClick={() => setCard4Bookmarked(prev => !prev)}
/>
</XDSTooltip>
- </XDSStack>
+ </div>
+ {card4ShowAddPopover && (
+ <XDSCard
+ style={{
+ position: 'absolute',
+ top: '100%',
+ left: 0,
+ right: 0,
+ marginTop: 8,
+ zIndex: 10,
+ }}>
+ <SharePopoverContent
+ cliCommand={`npx xds template ${t.name.toLowerCase().replace(/\s+/g, '-')} ./my-project`}
+ onClose={() => setCard4ShowAddPopover(false)}
+ />
+ </XDSCard>
+ )}
</XDSStack>
{/* Themes — pinned grid */}
@@ -1092,7 +2023,7 @@ function DocsiteLandingTemplate() {
</div>
{/* More like this */}
- <div style={{padding: '0 24px'}}>
+ <div style={{padding: '0 32px'}}>
<XDSHeading level={3}>More like this</XDSHeading>
<div
style={{
@@ -1106,11 +2037,15 @@ function DocsiteLandingTemplate() {
key={img.originalIndex}
padding={0}
onClick={() => {
- setPreviewTarget(img.originalIndex);
- card4ScrollRef.current?.scrollTo({
- top: 0,
- behavior: 'smooth',
- });
+ setPreviewTransitioning(true);
+ setTimeout(() => {
+ setPreviewTarget(img.originalIndex);
+ card4ScrollRef.current?.scrollTo({top: 0});
+ setTimeout(
+ () => setPreviewTransitioning(false),
+ 50,
+ );
+ }, 250);
}}
style={{
cursor: 'pointer',
@@ -1126,6 +2061,11 @@ function DocsiteLandingTemplate() {
objectFit: 'cover',
objectPosition: 'top',
display: 'block',
+ opacity: previewTransitioning ? 0 : 1,
+ transition: 'opacity 250ms ease',
+ animation: previewTransitioning
+ ? 'none'
+ : 'previewFadeIn 300ms ease',
}}
/>
</XDSCard>
@@ -1134,7 +2074,7 @@ function DocsiteLandingTemplate() {
</div>
{/* Explore more */}
- <div style={{padding: '24px 24px 0'}}>
+ <div style={{padding: '32px 32px 0'}}>
<XDSHeading level={3}>Explore more</XDSHeading>
<div
style={{
@@ -1142,6 +2082,11 @@ function DocsiteLandingTemplate() {
flexWrap: 'wrap',
gap: 8,
marginTop: 16,
+ opacity: previewTransitioning ? 0 : 1,
+ transition: 'opacity 250ms ease',
+ animation: previewTransitioning
+ ? 'none'
+ : 'previewFadeIn 300ms ease',
}}>
{[
'website',
@@ -1160,14 +2105,18 @@ function DocsiteLandingTemplate() {
key={tag}
label={tag}
xstyle={tokenStyles.pill}
- style={{backgroundColor: 'transparent'}}
+ style={{
+ backgroundColor: 'transparent',
+ cursor: 'pointer',
+ }}
+ onClick={() => handleTokenClick(tag)}
/>
))}
</div>
</div>
{/* Component used */}
- <div style={{padding: '24px 24px 24px'}}>
+ <div style={{padding: '32px 32px 32px'}}>
<XDSHeading level={3}>Component used</XDSHeading>
<div
style={{
@@ -1175,6 +2124,11 @@ function DocsiteLandingTemplate() {
flexWrap: 'wrap',
gap: 8,
marginTop: 16,
+ opacity: previewTransitioning ? 0 : 1,
+ transition: 'opacity 250ms ease',
+ animation: previewTransitioning
+ ? 'none'
+ : 'previewFadeIn 300ms ease',
}}>
{[
'XDSAppShell',
@@ -1192,7 +2146,11 @@ function DocsiteLandingTemplate() {
key={c}
label={c}
xstyle={tokenStyles.outline}
- style={{backgroundColor: 'transparent'}}
+ style={{
+ backgroundColor: 'transparent',
+ cursor: 'pointer',
+ }}
+ onClick={() => handleTokenClick(c)}
/>
))}
</div>
@@ -1201,6 +2159,92 @@ function DocsiteLandingTemplate() {
</XDSDialog>
);
})()}
+
+ {/* Settings dialog */}
+ <XDSDialog
+ isOpen={isSettingsOpen}
+ onOpenChange={setIsSettingsOpen}
+ width={560}
+ purpose="form"
+ title="Settings">
+ <XDSStack direction="vertical" gap={4} style={{padding: '8px 0'}}>
+ <XDSStack direction="horizontal" hAlign="between" vAlign="center">
+ <XDSStack direction="vertical" gap={1}>
+ <XDSText type="body" style={{fontWeight: 600}}>
+ Dark mode
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ Switch between light and dark appearance
+ </XDSText>
+ </XDSStack>
+ <XDSButton
+ label={previewMode === 'dark' ? 'On' : 'Off'}
+ variant="secondary"
+ size="sm"
+ onClick={() =>
+ setPreviewMode(previewMode === 'dark' ? 'light' : 'dark')
+ }
+ />
+ </XDSStack>
+ <XDSDivider />
+ <XDSStack direction="horizontal" hAlign="between" vAlign="center">
+ <XDSStack direction="vertical" gap={1}>
+ <XDSText type="body" style={{fontWeight: 600}}>
+ Theme
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ Choose a visual theme for previews
+ </XDSText>
+ </XDSStack>
+ <XDSDropdownMenu
+ button={{
+ label:
+ previewTheme.charAt(0).toUpperCase() + previewTheme.slice(1),
+ variant: 'secondary',
+ size: 'sm',
+ }}
+ items={[
+ {label: 'Default', onClick: () => setPreviewTheme('default')},
+ {label: 'Neutral', onClick: () => setPreviewTheme('neutral')},
+ {
+ label: 'Brutalist',
+ onClick: () => setPreviewTheme('brutalist'),
+ },
+ {label: 'Meta', onClick: () => setPreviewTheme('meta')},
+ {label: 'WhatsApp', onClick: () => setPreviewTheme('whatsapp')},
+ ]}
+ />
+ </XDSStack>
+ <XDSDivider />
+ <XDSStack direction="horizontal" hAlign="between" vAlign="center">
+ <XDSStack direction="vertical" gap={1}>
+ <XDSText type="body" style={{fontWeight: 600}}>
+ Default sort
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ How templates are ordered by default
+ </XDSText>
+ </XDSStack>
+ <XDSDropdownMenu
+ button={{
+ label:
+ sortOption === 'trending'
+ ? 'Trending'
+ : sortOption === 'newest'
+ ? 'Newest first'
+ : 'Oldest first',
+ variant: 'secondary',
+ size: 'sm',
+ }}
+ items={[
+ {label: 'Trending', onClick: () => setSortOption('trending')},
+ {label: 'Newest first', onClick: () => setSortOption('newest')},
+ {label: 'Oldest first', onClick: () => setSortOption('oldest')},
+ ]}
+ />
+ </XDSStack>
+ </XDSStack>
+ </XDSDialog>
</XDSAppShell>
);
}
diff --git a/packages/core/src/Chat/XDSChatComposer.tsx b/packages/core/src/Chat/XDSChatComposer.tsx
index ebe3eb9b10..5e77271d29 100644
--- a/packages/core/src/Chat/XDSChatComposer.tsx
+++ b/packages/core/src/Chat/XDSChatComposer.tsx
@@ -361,7 +361,7 @@ export function XDSChatComposer(props: XDSChatComposerProps) {
<div
{...mergeProps(
xdsClassName('chat-composer', {density}),
- stylex.props(styles.root, isDisabled && styles.rootDisabled, xstyle),
+ stylex.props(styles.root, isDisabled && styles.rootDisabled),
className,
style,
)}
@@ -375,6 +375,7 @@ export function XDSChatComposer(props: XDSChatComposerProps) {
{...stylex.props(
styles.body,
density === 'compact' && styles.compact,
+ xstyle,
)}>
{(headerActions || headerContext) && (
<div {...stylex.props(styles.header)}>