Skip to content

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

TypeScript

feat(sandbox): docsite nav updates — remove Explore, rename Docs to Library, add Learn tab (#1275)

rubyycheung905a2a8d50ca
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/doc-docs/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/doc-docs/page.tsx
index f414251178..87fe780025 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/doc-docs/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/doc-docs/page.tsx
@@ -343,7 +343,6 @@ export default function DocDocsPage() {
variant="ghost"
size="sm"
icon={<HamburgerIcon />}
- isIconOnly
/>
<span
style={{
@@ -376,7 +375,6 @@ export default function DocDocsPage() {
variant="ghost"
size="sm"
icon={<SidebarCollapseIcon />}
- isIconOnly
/>
</div>
@@ -525,7 +523,6 @@ export default function DocDocsPage() {
variant="ghost"
size="sm"
icon={<ExternalLinkIcon />}
- isIconOnly
/>
<XDSDropdownMenu
button={{
@@ -558,14 +555,12 @@ export default function DocDocsPage() {
size="sm"
icon={<CodeIcon />}
onClick={() => setShowCode(!showCode)}
- isIconOnly
/>
<XDSButton
label="Fullscreen"
variant="ghost"
size="sm"
icon={<FullscreenIcon />}
- isIconOnly
/>
</div>
</div>
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
index 07a51c88c4..7985cf351a 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/docsite/page.tsx
@@ -15,10 +15,9 @@ import {
import {XDSSkeleton} from '@xds/core/Skeleton';
import {XDSAvatar} from '@xds/core/Avatar';
import {XDSBadge} from '@xds/core/Badge';
-import {XDSTextInput} from '@xds/core/TextInput';
import {XDSToken} from '@xds/core/Token';
import {XDSToolbar} from '@xds/core/Toolbar';
-import {XDSTooltip} from '@xds/core/Tooltip';
+import {XDSList, XDSListItem} from '@xds/core/List';
import {createStaticSource} from '@xds/core/Typeahead';
// ---------------------------------------------------------------------------
@@ -48,19 +47,6 @@ const ProfileIcon = (props: React.SVGProps<SVGSVGElement>) => (
<path d="M20 21a8 8 0 10-16 0" />
</svg>
);
-const HamburgerIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- {...props}>
- <line x1="3" y1="6" x2="21" y2="6" />
- <line x1="3" y1="12" x2="21" y2="12" />
- <line x1="3" y1="18" x2="21" y2="18" />
- </svg>
-);
-
const FilterIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
@@ -152,17 +138,6 @@ const SendIcon = (props: React.SVGProps<SVGSVGElement>) => (
</svg>
);
-const CheckIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- {...props}>
- <polyline points="20 6 9 17 4 12" />
- </svg>
-);
-
const SidebarCollapseIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
@@ -252,18 +227,6 @@ const FullscreenIcon = (props: React.SVGProps<SVGSVGElement>) => (
</svg>
);
-const GearIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={1.5}
- {...props}>
- <circle cx="12" cy="12" r="3" />
- <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
- </svg>
-);
-
const FolderIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
@@ -583,11 +546,10 @@ function BoidsCanvas({
// Template data — real images from /public/templates/
// ---------------------------------------------------------------------------
-const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '';
-const DUMMY_IMAGE = `${basePath}/templates/dummy-placeholder.png`;
-const FIRST_CARD_IMAGE = `${basePath}/templates/first-card.png`;
-const SHOPPING_DETAILS_IMAGE = `${basePath}/templates/shopping-details.png`;
-const SCREENSHOT_3_IMAGE = `${basePath}/templates/screenshot-3.png`;
+const DUMMY_IMAGE = '/templates/dummy-placeholder.png';
+const FIRST_CARD_IMAGE = '/templates/first-card.png';
+const SHOPPING_DETAILS_IMAGE = '/templates/shopping-details.png';
+const SCREENSHOT_3_IMAGE = '/templates/screenshot-3.png';
const TEMPLATE_IMAGES = [DUMMY_IMAGE, DUMMY_IMAGE, DUMMY_IMAGE, DUMMY_IMAGE];
@@ -698,7 +660,6 @@ function TemplateCard({
size: 'sm',
icon: <MoreIcon />,
style: {color: '#fff'},
- isIconOnly: true,
}}
hasChevron={false}
items={[
@@ -857,7 +818,6 @@ function AIComposer() {
variant="ghost"
size="sm"
icon={<PlusIcon />}
- isIconOnly
/>
<XDSButton
label="Send"
@@ -865,7 +825,6 @@ function AIComposer() {
size="sm"
icon={<SendIcon />}
style={{borderRadius: 9999}}
- isIconOnly
/>
</div>
</div>
@@ -935,8 +894,8 @@ function ChatPanel({
}: {
isGenerating: boolean;
onSend?: () => void;
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (view: 'craft' | 'docs' | 'explore' | 'profile') => void;
+ activeView: 'craft' | 'library' | 'learn' | 'profile';
+ setActiveView: (view: 'craft' | 'library' | 'learn' | 'profile') => void;
}) {
const [prompt, setPrompt] = useState('');
@@ -957,64 +916,15 @@ function ChatPanel({
padding: '12px 16px',
flexShrink: 0,
}}>
- <div style={{display: 'flex', alignItems: 'center', gap: 8}}>
- <XDSDropdownMenu
- button={{
- label: 'Menu',
- variant: 'ghost',
- size: 'sm',
- icon: <HamburgerIcon />,
- isIconOnly: true,
- }}
- hasChevron={false}
- items={[
- {
- label: 'Craft',
- icon: activeView === 'craft' ? CheckIcon : undefined,
- onClick: () => setActiveView('craft'),
- },
- {
- label: 'Explore',
- icon: activeView === 'explore' ? CheckIcon : undefined,
- onClick: () => setActiveView('explore'),
- },
- {
- label: 'Docs',
- icon: activeView === 'docs' ? CheckIcon : undefined,
- onClick: () => setActiveView('docs'),
- },
- ]}
- />
- <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>
- </div>
+ <LogoNav activeView={activeView} setActiveView={setActiveView} />
<XDSButton
label="Toggle sidebar"
variant="ghost"
size="sm"
icon={<SidebarIcon />}
- isIconOnly
/>
</div>
+
{/* Chat thread */}
<div style={{flex: 1, padding: 16, overflow: 'auto'}}>
{/* User message */}
@@ -1048,6 +958,7 @@ function ChatPanel({
<ShimmerText isActive={isGenerating} />
</div>
</div>
+
{/* Composer pinned to bottom */}
<div style={{padding: 12}}>
<div
@@ -1103,7 +1014,6 @@ function ChatPanel({
variant="ghost"
size="sm"
icon={<PlusIcon />}
- isIconOnly
/>
<XDSButton
label="Send"
@@ -1112,7 +1022,6 @@ function ChatPanel({
icon={<SendIcon />}
style={{borderRadius: 9999}}
onClick={onSend}
- isIconOnly
/>
</div>
</div>
@@ -1164,6 +1073,20 @@ const PaletteIcon = (props: React.SVGProps<SVGSVGElement>) => (
</svg>
);
+const ContrastIcon = (props: React.SVGProps<SVGSVGElement>) => (
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={2}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ {...props}>
+ <circle cx="12" cy="12" r="10" />
+ <path d="M12 2a10 10 0 0 1 0 20z" fill="currentColor" />
+ </svg>
+);
+
const DesktopIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
@@ -1362,27 +1285,53 @@ function TemplatePreview({
<>
<XDSButton
label="Back"
- variant="secondary"
+ variant="ghost"
size="sm"
icon={<ArrowLeftIcon />}
onClick={onBack}
style={{marginLeft: -8}}
- isIconOnly
/>
- <XDSTooltip content="Point" placement="below">
- <XDSButton
- label="Point"
- variant="ghost"
- icon={<CursorIcon />}
- isIconOnly
- />
- </XDSTooltip>
+ <XDSText type="body">{templateName}</XDSText>
+ </>
+ }
+ centerContent={
+ <XDSSegmentedControl
+ value={viewportSize}
+ onChange={setViewportSize}
+ label="Viewport size"
+ size="sm">
+ <XDSSegmentedControlItem
+ value="desktop"
+ label="Desktop"
+ isLabelHidden
+ icon={<DesktopIcon />}
+ />
+ <XDSSegmentedControlItem
+ value="tablet"
+ label="Tablet"
+ isLabelHidden
+ icon={<TabletIcon />}
+ />
+ <XDSSegmentedControlItem
+ value="phone"
+ label="Phone"
+ isLabelHidden
+ icon={<PhoneIcon />}
+ />
+ </XDSSegmentedControl>
+ }
+ endContent={
+ <>
+ <XDSButton
+ label="Point"
+ variant="ghost"
+ icon={<CursorIcon />}
+ />
<XDSDropdownMenu
button={{
label: 'Theme',
variant: 'ghost',
icon: <PaletteIcon />,
- isIconOnly: true,
}}
hasChevron={false}
items={XDS_THEMES.map(t => ({
@@ -1390,51 +1339,29 @@ function TemplatePreview({
onClick: () => {},
}))}
/>
- <XDSSegmentedControl
- value={viewportSize}
- onChange={setViewportSize}
- label="Viewport size"
- size="sm">
- <XDSSegmentedControlItem
- value="desktop"
- label="Desktop"
- isLabelHidden
- icon={<DesktopIcon />}
- />
- <XDSSegmentedControlItem
- value="tablet"
- label="Tablet"
- isLabelHidden
- icon={<TabletIcon />}
- />
- <XDSSegmentedControlItem
- value="phone"
- label="Phone"
- isLabelHidden
- icon={<PhoneIcon />}
- />
- </XDSSegmentedControl>
+ <XDSButton
+ label="Toggle theme"
+ variant="ghost"
+ icon={<ContrastIcon />}
+ />
+ <XDSDropdownMenu
+ button={{label: 'Share', variant: 'ghost'}}
+ hasChevron={false}
+ menuWidth={220}
+ items={[
+ {
+ label: 'Copy CLI Command...',
+ icon: TerminalIcon,
+ onClick: () => {},
+ },
+ {type: 'divider' as const},
+ {label: 'Claude Code', icon: ClaudeIcon, onClick: () => {}},
+ {label: 'VSCode', icon: VSCodeIcon, onClick: () => {}},
+ {label: 'Cursor', icon: CursorAIIcon, onClick: () => {}},
+ ]}
+ />
</>
}
- centerContent={<XDSButton label={templateName} variant="ghost" />}
- endContent={
- <XDSDropdownMenu
- button={{label: 'Use in...', variant: 'ghost'}}
- hasChevron={false}
- menuWidth={220}
- items={[
- {
- label: 'Copy CLI Command...',
- icon: TerminalIcon,
- onClick: () => {},
- },
- {type: 'divider' as const},
- {label: 'Claude Code', icon: ClaudeIcon, onClick: () => {}},
- {label: 'VSCode', icon: VSCodeIcon, onClick: () => {}},
- {label: 'Cursor', icon: CursorAIIcon, onClick: () => {}},
- ]}
- />
- }
/>
{/* Preview image in muted container with grid dots */}
@@ -1764,10 +1691,10 @@ const XDS_LOGO_PLAIN = (
</svg>
);
-const NAV_ITEMS: Array<{key: 'craft' | 'explore' | 'docs'; label: string}> = [
+const NAV_ITEMS: Array<{key: 'craft' | 'library' | 'learn'; label: string}> = [
{key: 'craft', label: 'Craft'},
- {key: 'explore', label: 'Explore'},
- {key: 'docs', label: 'Docs'},
+ {key: 'library', label: 'Library'},
+ {key: 'learn', label: 'Learn'},
];
function LogoNav({
@@ -1775,8 +1702,8 @@ function LogoNav({
setActiveView,
logo,
}: {
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (view: 'craft' | 'docs' | 'explore' | 'profile') => void;
+ activeView: 'craft' | 'library' | 'learn' | 'profile';
+ setActiveView: (view: 'craft' | 'library' | 'learn' | 'profile') => void;
logo?: React.ReactNode;
}) {
const [isOpen, setIsOpen] = useState(false);
@@ -1790,7 +1717,7 @@ function LogoNav({
setIsOpen(false);
setHoveredItem(null);
}}>
- <div style={{cursor: 'pointer'}}>{logo || XDS_LOGO_SVG}</div>
+ <div style={{cursor: 'pointer'}}>{logo || XDS_LOGO_PLAIN}</div>
{isOpen && (
<div
style={{
@@ -1805,7 +1732,7 @@ function LogoNav({
zIndex: 100,
}}>
<div style={{marginBottom: 12, paddingLeft: 8, paddingRight: 8}}>
- {logo || XDS_LOGO_SVG}
+ {logo || XDS_LOGO_PLAIN}
</div>
<div
style={{display: 'flex', flexDirection: 'column' as const, gap: 2}}>
@@ -1846,14 +1773,16 @@ function AppTopNav({
activeView,
setActiveView,
}: {
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (view: 'craft' | 'docs' | 'explore' | 'profile') => void;
+ activeView: 'craft' | 'library' | 'learn' | 'profile';
+ setActiveView: (view: 'craft' | 'library' | 'learn' | 'profile') => void;
}) {
const [isSearchOpen, setIsSearchOpen] = useState(false);
- const [activeTab, setActiveTab] = useState('newest');
+ const [activeTab, setActiveTab] = useState('all');
+ const [isFilterOpen, setIsFilterOpen] = useState(false);
return (
<>
+ {/* Top nav bar */}
<nav
style={{
display: 'flex',
@@ -1862,22 +1791,16 @@ function AppTopNav({
height: 48,
padding: '0 16px',
backgroundColor: 'var(--color-background-surface, white)',
+ position: 'sticky',
+ top: 0,
+ zIndex: 11,
}}>
{/* Left: logo nav */}
<div style={{display: 'flex', alignItems: 'center', gap: 8, flex: 1}}>
<LogoNav activeView={activeView} setActiveView={setActiveView} />
</div>
- {/* Center: tabs */}
- <div style={{display: 'flex', alignItems: 'center', gap: 0}}>
- <XDSTabList value={activeTab} onChange={setActiveTab} size="sm">
- <XDSTab value="newest" label="Newest" />
- <XDSTab value="templates" label="Templates" />
- <XDSTab value="theme" label="Theme" />
- </XDSTabList>
- </div>
-
- {/* Right: filter + search */}
+ {/* Right: search + profile */}
<div
style={{
display: 'flex',
@@ -1886,20 +1809,12 @@ function AppTopNav({
flex: 1,
justifyContent: 'flex-end',
}}>
- <XDSButton
- label="Filter"
- variant="ghost"
- size="sm"
- icon={<FilterIcon />}
- isIconOnly
- />
<XDSButton
label="Search"
variant="ghost"
size="sm"
icon={<SearchIcon />}
onClick={() => setIsSearchOpen(true)}
- isIconOnly
/>
<XDSButton
label="Profile"
@@ -1907,10 +1822,135 @@ function AppTopNav({
size="sm"
icon={<ProfileIcon />}
onClick={() => setActiveView('profile')}
- isIconOnly
/>
</div>
</nav>
+
+ {/* Hero section */}
+ <div
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ padding: '16px 16px 32px',
+ }}>
+ <div style={{textAlign: 'center'}}>
+ <div style={{paddingBottom: 4}}>
+ <XDSText type="display-3" color="secondary">
+ Explore the possibilities.
+ </XDSText>
+ </div>
+ <XDSText type="display-2">Craft what you imagine.</XDSText>
+ </div>
+ </div>
+
+ {/* Tabs row with filter icon on the right */}
+ <div
+ style={{
+ display: 'grid',
+ gridTemplateColumns: '1fr auto 1fr',
+ alignItems: 'center',
+ padding: '0 16px 8px',
+ position: 'sticky',
+ top: 48,
+ zIndex: 10,
+ backgroundColor: 'var(--color-background-card, white)',
+ }}>
+ <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'}}>
+ <XDSButton
+ label="Filter"
+ variant="ghost"
+ size="sm"
+ icon={<FilterIcon />}
+ onClick={() => setIsFilterOpen(!isFilterOpen)}
+ />
+ </div>
+ </div>
+
+ <div
+ style={{
+ display: 'grid',
+ gridTemplateColumns: isFilterOpen
+ ? '1fr 1fr 1fr 1fr'
+ : '1fr 1fr 1fr 1fr',
+ gap: isFilterOpen ? 24 : 0,
+ padding: isFilterOpen ? '24px 40px' : '0 40px',
+ maxHeight: isFilterOpen ? 400 : 0,
+ overflow: 'hidden',
+ opacity: isFilterOpen ? 1 : 0,
+ transition:
+ 'max-height var(--duration-medium, 410ms) var(--ease-standard, cubic-bezier(0.24, 1, 0.4, 1)), opacity var(--duration-fast, 175ms) var(--ease-standard, cubic-bezier(0.24, 1, 0.4, 1)), padding var(--duration-medium, 410ms) var(--ease-standard, cubic-bezier(0.24, 1, 0.4, 1)), gap var(--duration-medium, 410ms) var(--ease-standard, cubic-bezier(0.24, 1, 0.4, 1))',
+ }}>
+ {[
+ {
+ heading: 'Categories',
+ items: [
+ 'AI',
+ 'Health & Fitness',
+ 'Productivity',
+ 'Shopping',
+ 'Education',
+ ],
+ },
+ {
+ heading: 'Screens',
+ items: [
+ 'My Account & Profile',
+ 'Charts',
+ 'Login',
+ 'Filter & Sort',
+ 'Signup',
+ ],
+ },
+ {
+ heading: 'UI Elements',
+ items: [
+ 'Dropdown Menu',
+ 'Side Navigation',
+ 'Stepper',
+ 'Text Field',
+ 'Navigation Menu',
+ ],
+ },
+ {
+ heading: 'Flows',
+ items: [
+ 'Reporting',
+ 'Resetting Password',
+ 'Onboarding',
+ 'Setting Up',
+ 'Filtering & Sorting',
+ ],
+ },
+ ].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} onClick={() => {}} />
+ ))}
+ </XDSList>
+ </div>
+ </div>
+ ))}
+ </div>
+
<XDSCommandPalette
isOpen={isSearchOpen}
onOpenChange={setIsSearchOpen}
@@ -2114,8 +2154,8 @@ function DocsView({
activeView,
setActiveView,
}: {
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (v: 'craft' | 'docs' | 'explore' | 'profile') => void;
+ activeView: 'craft' | 'library' | 'learn' | 'profile';
+ setActiveView: (v: 'craft' | 'library' | 'learn' | 'profile') => void;
}) {
const [activeNav, setActiveNav] = useState('button');
const [inputsExpanded, setInputsExpanded] = useState(true);
@@ -2165,7 +2205,6 @@ function DocsView({
variant="ghost"
size="sm"
icon={<SidebarCollapseIcon />}
- isIconOnly
/>
</div>
@@ -2246,6 +2285,7 @@ function DocsView({
)}
</nav>
</aside>
+
{/* MAIN CONTENT */}
<main
style={{
@@ -2310,7 +2350,6 @@ function DocsView({
variant="ghost"
size="sm"
icon={<ExternalLinkIcon />}
- isIconOnly
/>
<XDSDropdownMenu
button={{
@@ -2343,14 +2382,12 @@ function DocsView({
size="sm"
icon={<CodeIcon />}
onClick={() => setShowCode(!showCode)}
- isIconOnly
/>
<XDSButton
label="Fullscreen"
variant="ghost"
size="sm"
icon={<FullscreenIcon />}
- isIconOnly
/>
</div>
</div>
@@ -2375,8 +2412,9 @@ function DocsView({
label="Button"
variant="primary"
icon={<PlusIcon />}
- endContent={<XDSBadge label="New" variant="info" />}
- />
+ endContent={<XDSBadge label="New" variant="info" />}>
+ Button
+ </XDSButton>
</div>
{/* Code Panel */}
@@ -2476,6 +2514,7 @@ function DocsView({
</ul>
</div>
</main>
+
{/* RIGHT SIDEBAR */}
<aside
style={{
@@ -2531,97 +2570,6 @@ function DocsView({
);
}
-// ---------------------------------------------------------------------------
-// Explore Icons
-// ---------------------------------------------------------------------------
-
-const CompassIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <circle cx="12" cy="12" r="10" />
- <polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76" />
- </svg>
-);
-
-const LayoutIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <rect x="3" y="3" width="18" height="18" rx="2" />
- <line x1="3" y1="9" x2="21" y2="9" />
- <line x1="9" y1="21" x2="9" y2="9" />
- </svg>
-);
-
-const PackageIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <path d="M16.5 9.4l-9-5.19M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z" />
- <polyline points="3.27 6.96 12 12.01 20.73 6.96" />
- <line x1="12" y1="22.08" x2="12" y2="12" />
- </svg>
-);
-
-const ZapIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
- </svg>
-);
-
-const GridIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <rect x="3" y="3" width="7" height="7" />
- <rect x="14" y="3" width="7" height="7" />
- <rect x="3" y="14" width="7" height="7" />
- <rect x="14" y="14" width="7" height="7" />
- </svg>
-);
-
-const VerifiedIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <path d="M22 11.08V12a10 10 0 11-5.93-9.14" />
- <polyline points="22 4 12 14.01 9 11.01" />
- </svg>
-);
-
const DownloadIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
@@ -2637,647 +2585,6 @@ const DownloadIcon = (props: React.SVGProps<SVGSVGElement>) => (
</svg>
);
-const StarIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- {...props}>
- <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
- </svg>
-);
-
-// ---------------------------------------------------------------------------
-// ExploreView
-// ---------------------------------------------------------------------------
-
-function ExploreView({
- activeView,
- setActiveView,
-}: {
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (v: 'craft' | 'docs' | 'explore' | 'profile') => void;
-}) {
- const [featuredTab, setFeaturedTab] = useState('trending');
-
- return (
- <div
- style={{
- display: 'flex',
- flexDirection: 'column' as const,
- height: '100vh',
- backgroundColor: 'var(--color-background-surface, #ffffff)',
- fontFamily: 'system-ui, -apple-system, sans-serif',
- }}>
- {/* Top Nav Bar */}
- <nav
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 48,
- padding: '0 16px',
- flexShrink: 0,
- }}>
- <div style={{display: 'flex', alignItems: 'center', gap: 8}}>
- <LogoNav activeView={activeView} setActiveView={setActiveView} />
- </div>
- <div style={{display: 'flex', alignItems: 'center', gap: 4}}>
- <XDSButton
- label="Search"
- variant="ghost"
- size="sm"
- icon={<SearchIcon />}
- isIconOnly
- />
- <XDSButton
- label="Create new"
- variant="secondary"
- size="sm"
- icon={<PlusIcon />}
- />
- <XDSButton
- label="Profile"
- variant="ghost"
- size="sm"
- icon={<ProfileIcon />}
- onClick={() => setActiveView('profile')}
- isIconOnly
- />
- </div>
- </nav>
- {/* Scrollable content */}
- <div
- style={{
- flex: 1,
- overflowY: 'auto' as const,
- padding: '40px 48px 64px',
- }}>
- <div style={{maxWidth: 1200, margin: '0 auto'}}>
- {/* a. Hero */}
- <div style={{marginBottom: 48}}>
- <XDSHeading
- level={1}
- style={{fontSize: 40, letterSpacing: '-0.02em', marginBottom: 8}}>
- Discover templates, themes &amp; components
- </XDSHeading>
- <XDSText
- type="body"
- color="secondary"
- style={{marginBottom: 24, maxWidth: 600}}>
- Browse curated resources to kickstart your next project. Find
- templates, themes, and components built by XDS and the community.
- </XDSText>
- <XDSTextInput
- label="Search"
- isLabelHidden
- value=""
- onChange={() => {}}
- startIcon={SearchIcon}
- size="lg"
- placeholder="Search..."
- style={{marginBottom: 16, maxWidth: 600}}
- />
- <div style={{display: 'flex', flexWrap: 'wrap' as const, gap: 6}}>
- <XDSToken label="Dashboard" size="sm" />
- <XDSToken label="Admin Panel" size="sm" />
- <XDSToken label="E-commerce" size="sm" />
- <XDSToken label="Landing Page" size="sm" />
- <XDSToken label="Settings" size="sm" />
- <XDSToken label="Auth" size="sm" />
- <XDSToken label="Data Table" size="sm" />
- </div>
- </div>
-
- {/* b. Featured */}
- <div style={{marginBottom: 48}}>
- <XDSHeading level={2} style={{marginBottom: 16}}>
- Featured
- </XDSHeading>
- <XDSSegmentedControl
- value={featuredTab}
- onChange={setFeaturedTab}
- label="Featured filter"
- size="sm"
- style={{marginBottom: 16}}>
- <XDSSegmentedControlItem value="trending" label="Trending" />
- <XDSSegmentedControlItem value="popular" label="Most popular" />
- <XDSSegmentedControlItem value="newest" label="Newest" />
- </XDSSegmentedControl>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(3, 1fr)',
- gap: 16,
- }}>
- {[
- {
- title: 'Product detail',
- desc: 'Description',
- users: '1.5K',
- hearts: 5,
- img: FIRST_CARD_IMAGE,
- },
- {
- title: 'Meta Theme',
- desc: 'Description',
- users: '1.5K',
- hearts: 5,
- img: SHOPPING_DETAILS_IMAGE,
- },
- {
- title: 'Daiily',
- desc: 'Description',
- users: '1.5K',
- hearts: 5,
- img: SCREENSHOT_3_IMAGE,
- },
- ].map((item, i) => (
- <XDSCard key={i} padding={0}>
- <div style={{position: 'relative'}}>
- <img
- src={item.img}
- alt={item.title}
- style={{
- display: 'block',
- width: '100%',
- height: 180,
- objectFit: 'cover',
- }}
- />
- </div>
- <div style={{padding: '12px 16px'}}>
- <XDSHeading level={2}>{item.title}</XDSHeading>
- <XDSText type="supporting" color="secondary">
- {item.desc}
- </XDSText>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 12,
- marginTop: 8,
- }}>
- <svg
- width="14"
- height="14"
- viewBox="0 0 24 24"
- fill="none"
- style={{flexShrink: 0}}>
- <path
- d="M9 12l2 2 4-4"
- stroke="#0866ff"
- strokeWidth={2.5}
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- <circle
- cx="12"
- cy="12"
- r="10"
- stroke="#0866ff"
- strokeWidth={2}
- />
- </svg>
- <XDSText type="supporting" color="secondary">
- {item.users}
- </XDSText>
- <XDSText type="supporting" color="secondary">
- ♡ {item.hearts}
- </XDSText>
- </div>
- </div>
- </XDSCard>
- ))}
- </div>
- </div>
-
- {/* c. Designed by XDS */}
- <div style={{marginBottom: 48}}>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 8,
- marginBottom: 16,
- }}>
- <XDSHeading level={2}>Designed by XDS</XDSHeading>
- <VerifiedIcon width={20} height={20} style={{color: '#0066FF'}} />
- </div>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(3, 1fr)',
- gap: 16,
- }}>
- {[
- {name: 'Admin Console', desc: 'Full-featured admin panel'},
- {name: 'Data Explorer', desc: 'Interactive data visualization'},
- {name: 'Onboarding Flow', desc: 'Multi-step onboarding wizard'},
- ].map((item, i) => (
- <XDSCard key={i}>
- <div
- style={{
- height: 140,
- backgroundColor: 'var(--color-background-body, #f5f6f7)',
- borderRadius: 8,
- marginBottom: 12,
- }}
- />
- <div
- style={{
- display: 'flex',
- flexDirection: 'column' as const,
- gap: 4,
- }}>
- <XDSText type="body" weight="bold">
- {item.name}
- </XDSText>
- <XDSText type="supporting" color="secondary">
- {item.desc}
- </XDSText>
- </div>
- </XDSCard>
- ))}
- </div>
- </div>
-
- {/* d. From the community */}
- <div style={{marginBottom: 48}}>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- marginBottom: 16,
- }}>
- <XDSHeading level={2}>From the community</XDSHeading>
- <XDSButton label="View all" variant="ghost" size="sm" />
- </div>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 16,
- }}>
- {[
- {name: 'CRM Dashboard', author: 'Alex Chen'},
- {name: 'Social Feed', author: 'Maria Lopez'},
- {name: 'Task Board', author: 'James Wilson'},
- {name: 'Chat Interface', author: 'Sarah Kim'},
- ].map((item, i) => (
- <XDSCard key={i}>
- <div
- style={{
- height: 120,
- backgroundColor: 'var(--color-background-body, #f5f6f7)',
- borderRadius: 8,
- marginBottom: 12,
- }}
- />
- <XDSText type="body" weight="bold">
- {item.name}
- </XDSText>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 8,
- marginTop: 8,
- }}>
- <XDSAvatar name={item.author} size="xsmall" />
- <XDSText type="supporting" color="secondary">
- {item.author}
- </XDSText>
- </div>
- </XDSCard>
- ))}
- </div>
- </div>
-
- {/* e. Starter kits */}
- <div style={{marginBottom: 48}}>
- <XDSHeading level={2} style={{marginBottom: 16}}>
- Starter kits
- </XDSHeading>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(3, 1fr)',
- gap: 16,
- }}>
- {[
- {
- name: 'SaaS Starter',
- gradient: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
- },
- {
- name: 'Internal Tool Kit',
- gradient: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
- },
- {
- name: 'Data Platform',
- gradient: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
- },
- ].map((item, i) => (
- <XDSCard key={i} padding={0}>
- <div
- style={{
- height: 160,
- background: item.gradient,
- borderRadius: '8px 8px 0 0',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- }}>
- <PackageIcon
- width={40}
- height={40}
- style={{color: '#fff'}}
- />
- </div>
- <div style={{padding: 16}}>
- <XDSText type="body" weight="bold">
- {item.name}
- </XDSText>
- <XDSText type="supporting" color="secondary">
- Complete starter template
- </XDSText>
- </div>
- </XDSCard>
- ))}
- </div>
- </div>
-
- {/* f. Popular themes */}
- <div style={{marginBottom: 48}}>
- <XDSHeading level={2} style={{marginBottom: 16}}>
- Popular themes
- </XDSHeading>
- <div
- style={{
- display: 'flex',
- gap: 16,
- overflowX: 'auto' as const,
- paddingBottom: 8,
- }}>
- {[
- {name: 'Ocean', colors: ['#0066FF', '#00BFFF', '#E0F4FF']},
- {name: 'Forest', colors: ['#228B22', '#90EE90', '#F0FFF0']},
- {name: 'Sunset', colors: ['#FF6347', '#FFA07A', '#FFF5EE']},
- {name: 'Midnight', colors: ['#191970', '#4169E1', '#E8EAF6']},
- {name: 'Rose', colors: ['#E91E63', '#F48FB1', '#FCE4EC']},
- {name: 'Amber', colors: ['#FF8F00', '#FFB74D', '#FFF8E1']},
- ].map((theme, i) => (
- <XDSCard key={i} style={{minWidth: 180, flexShrink: 0}}>
- <div style={{display: 'flex', gap: 6, marginBottom: 12}}>
- {theme.colors.map((color, j) => (
- <div
- key={j}
- style={{
- width: 24,
- height: 24,
- borderRadius: '50%',
- backgroundColor: color,
- border:
- '1px solid var(--color-divider, rgba(0,0,0,0.1))',
- }}
- />
- ))}
- </div>
- <XDSText type="body" weight="bold">
- {theme.name}
- </XDSText>
- </XDSCard>
- ))}
- </div>
- </div>
-
- {/* g. Browse by use case */}
- <div style={{marginBottom: 48}}>
- <XDSHeading level={2} style={{marginBottom: 16}}>
- Browse by use case
- </XDSHeading>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 12,
- }}>
- {[
- {label: 'Dashboards', icon: LayoutIcon},
- {label: 'Forms', icon: AaIcon},
- {label: 'Data Tables', icon: GridIcon},
- {label: 'Navigation', icon: CompassIcon},
- {label: 'Authentication', icon: FilterIcon},
- {label: 'Settings', icon: PackageIcon},
- {label: 'Onboarding', icon: ZapIcon},
- {label: 'E-commerce', icon: StarIcon},
- ].map((item, i) => (
- <div
- key={i}
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 12,
- padding: '16px 20px',
- borderRadius: 12,
- border: '1px solid var(--color-divider, rgba(0,0,0,0.1))',
- cursor: 'pointer',
- backgroundColor: 'var(--color-background-surface, #fff)',
- }}>
- <item.icon
- width={20}
- height={20}
- style={{flexShrink: 0, opacity: 0.7}}
- />
- <XDSText type="body" weight="bold">
- {item.label}
- </XDSText>
- </div>
- ))}
- </div>
- </div>
-
- {/* h. All templates and themes */}
- <div style={{marginBottom: 48}}>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- marginBottom: 16,
- }}>
- <XDSHeading level={2}>All templates and themes</XDSHeading>
- <div style={{display: 'flex', gap: 8}}>
- <XDSDropdownMenu
- button={{label: 'Category', variant: 'secondary', size: 'sm'}}
- hasChevron
- items={[
- {label: 'All', onClick: () => {}},
- {label: 'Templates', onClick: () => {}},
- {label: 'Themes', onClick: () => {}},
- {label: 'Components', onClick: () => {}},
- ]}
- />
- <XDSDropdownMenu
- button={{label: 'Sort by', variant: 'secondary', size: 'sm'}}
- hasChevron
- items={[
- {label: 'Most popular', onClick: () => {}},
- {label: 'Newest', onClick: () => {}},
- {label: 'Most downloads', onClick: () => {}},
- ]}
- />
- </div>
- </div>
- <div
- style={{
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: 16,
- }}>
- {[
- {
- name: 'Admin Dashboard Pro',
- category: 'Template',
- downloads: '2.4k',
- stars: 186,
- isOfficial: true,
- img: FIRST_CARD_IMAGE,
- },
- {
- name: 'Dark Mode Theme',
- category: 'Theme',
- downloads: '5.1k',
- stars: 342,
- isOfficial: true,
- img: DUMMY_IMAGE,
- },
- {
- name: 'Login Page Bundle',
- category: 'Template',
- downloads: '3.2k',
- stars: 210,
- isOfficial: false,
- img: SHOPPING_DETAILS_IMAGE,
- },
- {
- name: 'Brutalist Theme',
- category: 'Theme',
- downloads: '1.8k',
- stars: 95,
- isOfficial: true,
- img: DUMMY_IMAGE,
- },
- {
- name: 'E-commerce Kit',
- category: 'Template',
- downloads: '4.7k',
- stars: 289,
- isOfficial: false,
- img: SCREENSHOT_3_IMAGE,
- },
- {
- name: 'Neutral Theme',
- category: 'Theme',
- downloads: '2.1k',
- stars: 134,
- isOfficial: true,
- img: DUMMY_IMAGE,
- },
- {
- name: 'Settings Panel',
- category: 'Template',
- downloads: '1.9k',
- stars: 112,
- isOfficial: true,
- img: DUMMY_IMAGE,
- },
- {
- name: 'WhatsApp Theme',
- category: 'Theme',
- downloads: '1.4k',
- stars: 78,
- isOfficial: true,
- img: DUMMY_IMAGE,
- },
- ].map((item, i) => (
- <XDSCard key={i} padding={0}>
- <div style={{position: 'relative'}}>
- <img
- src={item.img}
- alt={item.name}
- style={{
- display: 'block',
- width: '100%',
- height: 160,
- objectFit: 'cover',
- }}
- />
- </div>
- <div style={{padding: '12px 16px'}}>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 8,
- marginBottom: 4,
- }}>
- <XDSText type="body" weight="bold">
- {item.name}
- </XDSText>
- {item.isOfficial && (
- <XDSBadge label="Official" variant="info" />
- )}
- </div>
- <XDSText type="supporting" color="secondary">
- {item.category}
- </XDSText>
- <div
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 12,
- marginTop: 8,
- }}>
- <div
- style={{display: 'flex', alignItems: 'center', gap: 4}}>
- <DownloadIcon
- width={14}
- height={14}
- style={{opacity: 0.4}}
- />
- <XDSText type="supporting" color="secondary">
- {item.downloads}
- </XDSText>
- </div>
- <div
- style={{display: 'flex', alignItems: 'center', gap: 4}}>
- <StarIcon
- width={14}
- height={14}
- style={{opacity: 0.4}}
- />
- <XDSText type="supporting" color="secondary">
- {item.stars}
- </XDSText>
- </div>
- </div>
- </div>
- </XDSCard>
- ))}
- </div>
- </div>
- </div>
- </div>
- </div>
- );
-}
-
// ---------------------------------------------------------------------------
// ProfileView
// ---------------------------------------------------------------------------
@@ -3308,8 +2615,8 @@ function ProfileView({
activeView,
setActiveView,
}: {
- activeView: 'craft' | 'docs' | 'explore' | 'profile';
- setActiveView: (v: 'craft' | 'docs' | 'explore' | 'profile') => void;
+ activeView: 'craft' | 'library' | 'learn' | 'profile';
+ setActiveView: (v: 'craft' | 'library' | 'learn' | 'profile') => void;
}) {
const [profileTab, setProfileTab] = useState('used');
const [expandedCollection, setExpandedCollection] = useState<string | null>(
@@ -3344,17 +2651,16 @@ function ProfileView({
variant="ghost"
size="sm"
icon={<SearchIcon />}
- isIconOnly
/>
<XDSButton
label="Profile"
variant="ghost"
size="sm"
icon={<ProfileIcon />}
- isIconOnly
/>
</div>
</nav>
+
{/* Scrollable content */}
<div
style={{
@@ -3469,8 +2775,9 @@ function ProfileView({
<XDSButton
label="New collection"
variant="secondary"
- icon={<PlusIcon />}
- />
+ icon={<PlusIcon />}>
+ New collection
+ </XDSButton>
</div>
<div
style={{
@@ -3575,8 +2882,9 @@ function ProfileView({
label="Create new"
variant="secondary"
size="sm"
- icon={<PlusIcon />}
- />
+ icon={<PlusIcon />}>
+ Create new
+ </XDSButton>
</div>
<div
style={{
@@ -3683,7 +2991,7 @@ function ProfileView({
export default function DocsiteLandingTemplate() {
const [activeView, setActiveView] = useState<
- 'craft' | 'docs' | 'explore' | 'profile'
+ 'craft' | 'library' | 'learn' | 'profile'
>('craft');
const [selected, setSelected] = useState<Set<number>>(new Set());
const [isMobile, setIsMobile] = useState(false);
@@ -3777,13 +3085,52 @@ export default function DocsiteLandingTemplate() {
const isGenerating = generatingSource !== null;
- if (activeView === 'docs') {
+ if (activeView === 'library') {
return <DocsView activeView={activeView} setActiveView={setActiveView} />;
}
- if (activeView === 'explore') {
+ if (activeView === 'learn') {
return (
- <ExploreView activeView={activeView} setActiveView={setActiveView} />
+ <div
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ height: '100vh',
+ backgroundColor: 'var(--color-background-card, white)',
+ }}>
+ <div
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ padding: '12px 24px',
+ borderBottom: '1px solid var(--color-border-default, #e0e0e0)',
+ backgroundColor: 'var(--color-background-card, white)',
+ }}>
+ <LogoNav activeView={activeView} setActiveView={setActiveView} />
+ </div>
+ <div
+ style={{
+ flex: 1,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ }}>
+ <div style={{textAlign: 'center', opacity: 0.5}}>
+ <div style={{fontSize: 48, marginBottom: 16}}>📚</div>
+ <div style={{fontSize: 20, fontWeight: 600, marginBottom: 8}}>
+ Learn
+ </div>
+ <div
+ style={{
+ fontSize: 14,
+ color: 'var(--color-text-secondary, #666)',
+ }}>
+ Tutorials, guides, and resources — coming soon
+ </div>
+ </div>
+ </div>
+ </div>
);
}