Skip to content

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

TypeScript

refactor: migrate all templates to auto-discovery system (#1105)

Joey8b23fedd1d71
diff --git a/apps/sandbox/src/app/sandboxPages.ts b/apps/sandbox/src/app/sandboxPages.ts
index 1a60f2b043..e227b7c791 100644
--- a/apps/sandbox/src/app/sandboxPages.ts
+++ b/apps/sandbox/src/app/sandboxPages.ts
@@ -97,64 +97,6 @@ export const categories: SandboxCategory[] = [
description:
'Full-page application templates — dashboards, forms, and data views built with XDS.',
pages: [
- {
- name: 'Dashboard (WIP)',
- href: '/pages/template-dashboard/',
- description:
- 'Analytics dashboard with KPI cards, charts, and data tables',
- },
- {
- name: 'Login (Card)',
- href: '/pages/template-login/',
- description: 'Centered login card with social sign-in and email form',
- },
- {
- name: 'Login (Split)',
- href: '/pages/template-login-02/',
- description: 'Split-screen login with form and cover image',
- },
- {
- name: 'Login (SSO)',
- href: '/pages/template-login-sso/',
- description: 'SSO login with email-based provider detection',
- },
- {
- name: 'Settings (Sidebar)',
- href: '/pages/template-settings-02/',
- description: 'Account settings with sidebar nav and inline editing',
- },
- {
- name: 'Settings (Dialog)',
- href: '/pages/template-settings-03/',
- description: 'Account settings in a dialog with sidebar nav',
- },
- {
- name: 'Data Table (WIP)',
- href: '/pages/template-data-table/',
- description: 'Sortable data table with search and pagination',
- },
- {
- name: 'File Explorer',
- href: '/pages/file-explorer/',
- description: 'Column-based file browser inspired by macOS Finder',
- },
- {
- name: 'Detail Page',
- href: '/pages/template-detail-2/',
- description: 'Order detail page with timeline and line items',
- },
- {
- name: 'Product Detail',
- href: '/pages/template-product-detail/',
- description: 'Product page with image gallery and collapsible sections',
- },
- {
- name: 'Page Editor',
- href: '/pages/editor/',
- description:
- 'Block-based page builder with sidebar config and live preview',
- },
- // Auto-discovered templates from packages/cli/templates/
...autoDiscoveredTemplates.map(t => ({
name: t.isReady ? t.name : t.name + ' (WIP)',
href: t.href,
diff --git a/packages/cli/templates/demo-dashboard/template.doc.mjs b/packages/cli/templates/blank/template.doc.mjs
similarity index 53%
rename from packages/cli/templates/demo-dashboard/template.doc.mjs
rename to packages/cli/templates/blank/template.doc.mjs
index 41c054497e..ceb9f15834 100644
--- a/packages/cli/templates/demo-dashboard/template.doc.mjs
+++ b/packages/cli/templates/blank/template.doc.mjs
@@ -1,6 +1,6 @@
/** @type {import('../../../core/src/docs-types').TemplateDoc} */
export const doc = {
- name: 'Dashboard',
- description: 'Analytics dashboard with KPI cards and a data table.',
+ name: 'Blank Page',
+ description: 'Minimal page scaffold',
isReady: true,
};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-dashboard/page.tsx b/packages/cli/templates/dashboard/page.tsx
similarity index 53%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-dashboard/page.tsx
rename to packages/cli/templates/dashboard/page.tsx
index b423ab7a2b..77cb5d92b0 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/template-dashboard/page.tsx
+++ b/packages/cli/templates/dashboard/page.tsx
@@ -3,11 +3,7 @@
import {useState} from 'react';
import * as stylex from '@stylexjs/stylex';
import {XDSAppShell} from '@xds/core/AppShell';
-import {
- XDSSideNav,
- XDSSideNavItem,
- XDSSideNavSection,
-} from '@xds/core/SideNav';
+import {XDSSideNav, XDSSideNavItem, XDSSideNavSection} from '@xds/core/SideNav';
import {XDSTopNav, XDSTopNavHeading} from '@xds/core/TopNav';
import {XDSVStack, XDSHStack} from '@xds/core/Layout';
import {XDSText, XDSHeading} from '@xds/core/Text';
@@ -25,10 +21,14 @@ import {
XDSSegmentedControlItem,
} from '@xds/core/SegmentedControl';
-
// Icons
const DashboardIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<rect x="3" y="3" width="7" height="7" rx="1" />
<rect x="14" y="3" width="7" height="7" rx="1" />
<rect x="3" y="14" width="7" height="7" rx="1" />
@@ -36,92 +36,192 @@ const DashboardIcon = (props: React.SVGProps<SVGSVGElement>) => (
</svg>
);
const LifecycleIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<circle cx="12" cy="12" r="9" />
<path d="M12 7v5l3 3" />
</svg>
);
const AnalyticsIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<path d="M18 20V10M12 20V4M6 20v-6" />
</svg>
);
const ProjectsIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<path d="M2 17l10 5 10-5M2 12l10 5 10-5M12 2L2 7l10 5 10-5-10-5z" />
</svg>
);
const TeamIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
);
const DataIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<ellipse cx="12" cy="5" rx="9" ry="3" />
<path d="M21 12c0 1.66-4.03 3-9 3s-9-1.34-9-3" />
<path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" />
</svg>
);
const ReportsIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
<path d="M14 2v6h6M16 13H8M16 17H8M10 9H8" />
</svg>
);
const WordIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<path d="M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" />
</svg>
);
const SettingsIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<circle cx="12" cy="12" r="3" />
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
</svg>
);
const HelpIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<circle cx="12" cy="12" r="10" />
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01" />
</svg>
);
const SearchIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<circle cx="11" cy="11" r="8" />
<path d="M21 21l-4.35-4.35" />
</svg>
);
const MailIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
<rect x="2" y="4" width="20" height="16" rx="2" />
<path d="M22 7l-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
</svg>
);
const MoreIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} {...props}>
- <circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ {...props}>
+ <circle cx="12" cy="12" r="1" />
+ <circle cx="19" cy="12" r="1" />
+ <circle cx="5" cy="12" r="1" />
</svg>
);
const TrendUpIcon = () => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} width={16} height={16}>
- <path d="M23 6l-9.5 9.5-5-5L1 18" /><path d="M17 6h6v6" />
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={2}
+ width={16}
+ height={16}>
+ <path d="M23 6l-9.5 9.5-5-5L1 18" />
+ <path d="M17 6h6v6" />
</svg>
);
const TrendDownIcon = () => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} width={16} height={16}>
- <path d="M23 18l-9.5-9.5-5 5L1 6" /><path d="M17 18h6v-6" />
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={2}
+ width={16}
+ height={16}>
+ <path d="M23 18l-9.5-9.5-5 5L1 6" />
+ <path d="M17 18h6v-6" />
</svg>
);
// Mock data
const stats = [
- {label: 'Total Revenue', value: '$1,250.00', change: '+12.5%', positive: true, desc: 'Trending up this month'},
- {label: 'New Customers', value: '1,234', change: '-20%', positive: false, desc: 'Down 20% this period'},
- {label: 'Active Accounts', value: '45,678', change: '+12.5%', positive: true, desc: 'Strong user retention'},
- {label: 'Growth Rate', value: '4.5%', change: '+4.5%', positive: true, desc: 'Steady performance increase'},
+ {
+ label: 'Total Revenue',
+ value: '$1,250.00',
+ change: '+12.5%',
+ positive: true,
+ desc: 'Trending up this month',
+ },
+ {
+ label: 'New Customers',
+ value: '1,234',
+ change: '-20%',
+ positive: false,
+ desc: 'Down 20% this period',
+ },
+ {
+ label: 'Active Accounts',
+ value: '45,678',
+ change: '+12.5%',
+ positive: true,
+ desc: 'Strong user retention',
+ },
+ {
+ label: 'Growth Rate',
+ value: '4.5%',
+ change: '+4.5%',
+ positive: true,
+ desc: 'Steady performance increase',
+ },
];
interface DocRow extends Record<string, unknown> {
@@ -135,11 +235,51 @@ interface DocRow extends Record<string, unknown> {
}
const docRows: DocRow[] = [
- {id: '1', header: 'Cover page', sectionType: 'Cover page', status: 'In Process', target: 18, limit: 5, reviewer: 'Eddie Lake'},
- {id: '2', header: 'Table of contents', sectionType: 'Table of contents', status: 'Done', target: 20, limit: 24, reviewer: 'Eddie Lake'},
- {id: '3', header: 'Executive summary', sectionType: 'Summary', status: 'In Process', target: 12, limit: 8, reviewer: 'Eddie Lake'},
- {id: '4', header: 'Technical approach', sectionType: 'Technical', status: 'Draft', target: 45, limit: 30, reviewer: 'Eddie Lake'},
- {id: '5', header: 'Design methodology', sectionType: 'Design', status: 'In Process', target: 22, limit: 15, reviewer: 'Eddie Lake'},
+ {
+ id: '1',
+ header: 'Cover page',
+ sectionType: 'Cover page',
+ status: 'In Process',
+ target: 18,
+ limit: 5,
+ reviewer: 'Eddie Lake',
+ },
+ {
+ id: '2',
+ header: 'Table of contents',
+ sectionType: 'Table of contents',
+ status: 'Done',
+ target: 20,
+ limit: 24,
+ reviewer: 'Eddie Lake',
+ },
+ {
+ id: '3',
+ header: 'Executive summary',
+ sectionType: 'Summary',
+ status: 'In Process',
+ target: 12,
+ limit: 8,
+ reviewer: 'Eddie Lake',
+ },
+ {
+ id: '4',
+ header: 'Technical approach',
+ sectionType: 'Technical',
+ status: 'Draft',
+ target: 45,
+ limit: 30,
+ reviewer: 'Eddie Lake',
+ },
+ {
+ id: '5',
+ header: 'Design methodology',
+ sectionType: 'Design',
+ status: 'In Process',
+ target: 22,
+ limit: 15,
+ reviewer: 'Eddie Lake',
+ },
];
const docColumns: XDSTableColumn<DocRow>[] = [
@@ -151,7 +291,13 @@ const docColumns: XDSTableColumn<DocRow>[] = [
width: pixel(130),
renderCell: (item: DocRow) => (
<XDSBadge
- variant={item.status === 'Done' ? 'success' : item.status === 'Draft' ? undefined : 'info'}
+ variant={
+ item.status === 'Done'
+ ? 'success'
+ : item.status === 'Draft'
+ ? undefined
+ : 'info'
+ }
label={item.status}
/>
),
@@ -170,11 +316,11 @@ const docColumns: XDSTableColumn<DocRow>[] = [
// Chart data — approximate the area chart from the screenshot
const chartPoints = [
- 10, 15, 12, 18, 25, 30, 28, 35, 32, 38, 42, 35, 30, 28, 32, 25, 20, 22,
- 28, 35, 30, 25, 22, 28, 32, 38, 42, 45, 40, 35, 38, 42, 48, 45, 40, 38,
- 42, 45, 50, 48, 42, 38, 35, 40, 45, 42, 38, 35, 30, 28, 32, 35, 38, 42,
- 45, 48, 52, 50, 45, 42, 38, 35, 32, 30, 28, 25, 22, 20, 18, 22, 25, 28,
- 32, 35, 38, 42, 45, 48, 42, 38, 35, 32, 35, 38, 42, 45, 48, 52, 55, 50,
+ 10, 15, 12, 18, 25, 30, 28, 35, 32, 38, 42, 35, 30, 28, 32, 25, 20, 22, 28,
+ 35, 30, 25, 22, 28, 32, 38, 42, 45, 40, 35, 38, 42, 48, 45, 40, 38, 42, 45,
+ 50, 48, 42, 38, 35, 40, 45, 42, 38, 35, 30, 28, 32, 35, 38, 42, 45, 48, 52,
+ 50, 45, 42, 38, 35, 32, 30, 28, 25, 22, 20, 18, 22, 25, 28, 32, 35, 38, 42,
+ 45, 48, 42, 38, 35, 32, 35, 38, 42, 45, 48, 52, 55, 50,
];
const styles = stylex.create({
@@ -216,18 +362,46 @@ function AreaChart() {
x: pad + (i / (chartPoints.length - 1)) * (w - pad * 2),
y: h - pad - (v / max) * (h - pad * 2),
}));
- const line = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');
+ const line = points
+ .map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`)
+ .join(' ');
const area = `${line} L${points[points.length - 1].x},${h} L${points[0].x},${h} Z`;
- const months = ['Apr 7', 'Apr 13', 'Apr 19', 'Apr 26', 'May 2', 'May 8', 'May 14', 'May 21', 'May 28', 'Jun 3', 'Jun 9', 'Jun 15', 'Jun 22', 'Jun 30'];
+ const months = [
+ 'Apr 7',
+ 'Apr 13',
+ 'Apr 19',
+ 'Apr 26',
+ 'May 2',
+ 'May 8',
+ 'May 14',
+ 'May 21',
+ 'May 28',
+ 'Jun 3',
+ 'Jun 9',
+ 'Jun 15',
+ 'Jun 22',
+ 'Jun 30',
+ ];
return (
<div {...stylex.props(styles.chartContainer)}>
- <svg viewBox={`0 0 ${w} ${h + 30}`} {...stylex.props(styles.chartSvg)} preserveAspectRatio="none">
+ <svg
+ viewBox={`0 0 ${w} ${h + 30}`}
+ {...stylex.props(styles.chartSvg)}
+ preserveAspectRatio="none">
<defs>
<linearGradient id="areaGrad" x1="0" y1="0" x2="0" y2="1">
- <stop offset="0%" stopColor="var(--color-accent, #000)" stopOpacity="0.15" />
- <stop offset="100%" stopColor="var(--color-accent, #000)" stopOpacity="0.01" />
+ <stop
+ offset="0%"
+ stopColor="var(--color-accent, #000)"
+ stopOpacity="0.15"
+ />
+ <stop
+ offset="100%"
+ stopColor="var(--color-accent, #000)"
+ stopOpacity="0.01"
+ />
</linearGradient>
</defs>
{/* Grid lines */}
@@ -243,7 +417,12 @@ function AreaChart() {
/>
))}
<path d={area} fill="url(#areaGrad)" />
- <path d={line} fill="none" stroke="var(--color-text-primary, #000)" strokeWidth="1.5" />
+ <path
+ d={line}
+ fill="none"
+ stroke="var(--color-text-primary, #000)"
+ strokeWidth="1.5"
+ />
{/* X-axis labels */}
{months.map((label, i) => (
<text
@@ -252,8 +431,7 @@ function AreaChart() {
y={h + 20}
textAnchor="middle"
fontSize="11"
- fill="var(--color-text-secondary, #888)"
- >
+ fill="var(--color-text-secondary, #888)">
{label}
</text>
))}
@@ -262,21 +440,28 @@ function AreaChart() {
);
}
-function StatCard({label, value, change, positive, desc}: typeof stats[0]) {
+function StatCard({label, value, change, positive, desc}: (typeof stats)[0]) {
return (
<XDSCard>
<XDSVStack gap={2}>
<div {...stylex.props(styles.statRow)}>
- <XDSText type="supporting" color="secondary">{label}</XDSText>
+ <XDSText type="supporting" color="secondary">
+ {label}
+ </XDSText>
<XDSHStack gap={1} vAlign="center">
{positive ? <TrendUpIcon /> : <TrendDownIcon />}
- <span {...stylex.props(positive ? styles.changePositive : styles.changeNegative)}>
+ <span
+ {...stylex.props(
+ positive ? styles.changePositive : styles.changeNegative,
+ )}>
<XDSText type="supporting">{change}</XDSText>
</span>
</XDSHStack>
</div>
<XDSHeading level={2}>{value}</XDSHeading>
- <XDSText type="supporting" color="secondary">{desc}</XDSText>
+ <XDSText type="supporting" color="secondary">
+ {desc}
+ </XDSText>
</XDSVStack>
</XDSCard>
);
@@ -289,44 +474,131 @@ function DashboardSideNav() {
header={
<XDSVStack gap={3} style={{padding: '12px 16px'}}>
<XDSHStack gap={2} vAlign="center">
- <XDSNavIcon icon={<DashboardIcon style={{width: 16, height: 16}} />} />
- <XDSText type="body" weight="bold">Acme Inc.</XDSText>
+ <XDSNavIcon
+ icon={<DashboardIcon style={{width: 16, height: 16}} />}
+ />
+ <XDSText type="body" weight="bold">
+ Acme Inc.
+ </XDSText>
</XDSHStack>
<XDSHStack gap={2}>
- <XDSButton label="Quick Create" variant="primary" size="sm" xstyle={{flex: 1} as never} />
- <XDSButton label="Mail" variant="ghost" size="sm" icon={<MailIcon style={{width: 16, height: 16}} />} />
+ <XDSButton
+ label="Quick Create"
+ variant="primary"
+ size="sm"
+ xstyle={{flex: 1} as never}
+ />
+ <XDSButton
+ label="Mail"
+ variant="ghost"
+ size="sm"
+ icon={<MailIcon style={{width: 16, height: 16}} />}
+ />
</XDSHStack>
</XDSVStack>
}
footer={
<XDSVStack gap={0} style={{padding: '8px 0'}}>
- <XDSSideNavItem label="Settings" icon={SettingsIcon} isSelected={active === 'settings'} onClick={() => setActive('settings')} />
- <XDSSideNavItem label="Get Help" icon={HelpIcon} isSelected={active === 'help'} onClick={() => setActive('help')} />
- <XDSSideNavItem label="Search" icon={SearchIcon} isSelected={active === 'search'} onClick={() => setActive('search')} />
- <div style={{padding: '12px 16px', borderTop: '1px solid var(--color-divider)'}}>
+ <XDSSideNavItem
+ label="Settings"
+ icon={SettingsIcon}
+ isSelected={active === 'settings'}
+ onClick={() => setActive('settings')}
+ />
+ <XDSSideNavItem
+ label="Get Help"
+ icon={HelpIcon}
+ isSelected={active === 'help'}
+ onClick={() => setActive('help')}
+ />
+ <XDSSideNavItem
+ label="Search"
+ icon={SearchIcon}
+ isSelected={active === 'search'}
+ onClick={() => setActive('search')}
+ />
+ <div
+ style={{
+ padding: '12px 16px',
+ borderTop: '1px solid var(--color-divider)',
+ }}>
<XDSHStack gap={3} vAlign="center">
<XDSAvatar name="shadcn" size="small" />
<XDSVStack gap={0} style={{flex: 1}}>
- <XDSText type="body" weight="bold">shadcn</XDSText>
- <XDSText type="supporting" color="secondary">[email protected]</XDSText>
+ <XDSText type="body" weight="bold">
+ shadcn
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ </XDSText>
</XDSVStack>
- <XDSButton label="More" variant="ghost" size="sm" icon={<MoreIcon style={{width: 16, height: 16}} />} />
+ <XDSButton
+ label="More"
+ variant="ghost"
+ size="sm"
+ icon={<MoreIcon style={{width: 16, height: 16}} />}
+ />
</XDSHStack>
</div>
</XDSVStack>
}>
<XDSSideNavSection title="Platform">
- <XDSSideNavItem label="Dashboard" icon={DashboardIcon} isSelected={active === 'dashboard'} onClick={() => setActive('dashboard')} />
- <XDSSideNavItem label="Lifecycle" icon={LifecycleIcon} isSelected={active === 'lifecycle'} onClick={() => setActive('lifecycle')} />
- <XDSSideNavItem label="Analytics" icon={AnalyticsIcon} isSelected={active === 'analytics'} onClick={() => setActive('analytics')} />
- <XDSSideNavItem label="Projects" icon={ProjectsIcon} isSelected={active === 'projects'} onClick={() => setActive('projects')} />
- <XDSSideNavItem label="Team" icon={TeamIcon} isSelected={active === 'team'} onClick={() => setActive('team')} />
+ <XDSSideNavItem
+ label="Dashboard"
+ icon={DashboardIcon}
+ isSelected={active === 'dashboard'}
+ onClick={() => setActive('dashboard')}
+ />
+ <XDSSideNavItem
+ label="Lifecycle"
+ icon={LifecycleIcon}
+ isSelected={active === 'lifecycle'}
+ onClick={() => setActive('lifecycle')}
+ />
+ <XDSSideNavItem
+ label="Analytics"
+ icon={AnalyticsIcon}
+ isSelected={active === 'analytics'}
+ onClick={() => setActive('analytics')}
+ />
+ <XDSSideNavItem
+ label="Projects"
+ icon={ProjectsIcon}
+ isSelected={active === 'projects'}
+ onClick={() => setActive('projects')}
+ />
+ <XDSSideNavItem
+ label="Team"
+ icon={TeamIcon}
+ isSelected={active === 'team'}
+ onClick={() => setActive('team')}
+ />
</XDSSideNavSection>
<XDSSideNavSection title="Documents">
- <XDSSideNavItem label="Data Library" icon={DataIcon} isSelected={active === 'data'} onClick={() => setActive('data')} />
- <XDSSideNavItem label="Reports" icon={ReportsIcon} isSelected={active === 'reports'} onClick={() => setActive('reports')} />
- <XDSSideNavItem label="Word Assistant" icon={WordIcon} isSelected={active === 'word'} onClick={() => setActive('word')} />
- <XDSSideNavItem label="More" icon={MoreIcon} isSelected={active === 'more'} onClick={() => setActive('more')} />
+ <XDSSideNavItem
+ label="Data Library"
+ icon={DataIcon}
+ isSelected={active === 'data'}
+ onClick={() => setActive('data')}
+ />
+ <XDSSideNavItem
+ label="Reports"
+ icon={ReportsIcon}
+ isSelected={active === 'reports'}
+ onClick={() => setActive('reports')}
+ />
+ <XDSSideNavItem
+ label="Word Assistant"
+ icon={WordIcon}
+ isSelected={active === 'word'}
+ onClick={() => setActive('word')}
+ />
+ <XDSSideNavItem
+ label="More"
+ icon={MoreIcon}
+ isSelected={active === 'more'}
+ onClick={() => setActive('more')}
+ />
</XDSSideNavSection>
</XDSSideNav>
);
@@ -342,7 +614,9 @@ export default function DashboardTemplate() {
topNav={
<XDSTopNav
endContent={
- <XDSLink label="GitHub" href="#">GitHub</XDSLink>
+ <XDSLink label="GitHub" href="#">
+ GitHub
+ </XDSLink>
}>
<XDSTopNavHeading>Documents</XDSTopNavHeading>
</XDSTopNav>
@@ -367,7 +641,10 @@ export default function DashboardTemplate() {
Total for the last 3 months
</XDSText>
</XDSVStack>
- <XDSSegmentedControl label="Time period" value={period} onChange={setPeriod}>
+ <XDSSegmentedControl
+ label="Time period"
+ value={period}
+ onChange={setPeriod}>
<XDSSegmentedControlItem value="3m" label="Last 3 months" />
<XDSSegmentedControlItem value="30d" label="Last 30 days" />
<XDSSegmentedControlItem value="7d" label="Last 7 days" />
@@ -386,7 +663,11 @@ export default function DashboardTemplate() {
<XDSTab value="focus" label="Focus Documents" />
</XDSTabList>
<XDSHStack gap={3}>
- <XDSButton label="Customize Columns" variant="secondary" size="sm" />
+ <XDSButton
+ label="Customize Columns"
+ variant="secondary"
+ size="sm"
+ />
<XDSButton label="+ Add Section" variant="secondary" size="sm" />
</XDSHStack>
</div>
diff --git a/packages/cli/templates/dashboard/template.doc.mjs b/packages/cli/templates/dashboard/template.doc.mjs
new file mode 100644
index 0000000000..d3c0ce662a
--- /dev/null
+++ b/packages/cli/templates/dashboard/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Dashboard',
+ description: 'Analytics dashboard with KPI cards, charts, and data tables',
+ isReady: false,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-data-table/page.tsx b/packages/cli/templates/data-table/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-data-table/page.tsx
rename to packages/cli/templates/data-table/page.tsx
diff --git a/packages/cli/templates/data-table/template.doc.mjs b/packages/cli/templates/data-table/template.doc.mjs
new file mode 100644
index 0000000000..47cc9afe10
--- /dev/null
+++ b/packages/cli/templates/data-table/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Data Table',
+ description: 'Sortable data table with search and pagination',
+ isReady: false,
+};
diff --git a/packages/cli/templates/demo-dashboard/page.tsx b/packages/cli/templates/demo-dashboard/page.tsx
deleted file mode 100644
index 966f81804b..0000000000
--- a/packages/cli/templates/demo-dashboard/page.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-'use client';
-
-import {useState} from 'react';
-import * as stylex from '@stylexjs/stylex';
-import {XDSAppShell} from '@xds/core/AppShell';
-import {XDSSideNav, XDSSideNavItem, XDSSideNavSection} from '@xds/core/SideNav';
-import {XDSText, XDSHeading} from '@xds/core/Text';
-import {XDSCard} from '@xds/core/Card';
-import {XDSBadge} from '@xds/core/Badge';
-import {XDSDivider} from '@xds/core/Divider';
-import {colorVars, spacingVars} from '@xds/core/theme/tokens.stylex';
-
-const kpis = [
- {label: 'Total Users', value: '12,847', change: '+14%', trend: 'up' as const},
- {label: 'Active Now', value: '1,024', change: '+3%', trend: 'up' as const},
- {label: 'Revenue', value: '$48.2k', change: '-2%', trend: 'down' as const},
- {label: 'Conversion', value: '3.2%', change: '+0.4%', trend: 'up' as const},
-];
-
-const recentItems = [
- {id: 1, name: 'Acme Corp', status: 'Active', amount: '$12,400'},
- {id: 2, name: 'Globex Inc', status: 'Pending', amount: '$8,200'},
- {id: 3, name: 'Initech', status: 'Active', amount: '$6,800'},
- {id: 4, name: 'Umbrella Ltd', status: 'Churned', amount: '$3,100'},
- {id: 5, name: 'Stark Industries', status: 'Active', amount: '$22,900'},
-];
-
-const styles = stylex.create({
- content: {
- display: 'flex',
- flexDirection: 'column',
- gap: spacingVars['--spacing-6'],
- maxWidth: 1200,
- },
- kpiGrid: {
- display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
- gap: spacingVars['--spacing-4'],
- },
- kpiCard: {
- padding: spacingVars['--spacing-5'],
- display: 'flex',
- flexDirection: 'column',
- gap: spacingVars['--spacing-2'],
- },
- kpiValue: {
- fontSize: 28,
- fontWeight: 700,
- color: colorVars['--color-text-primary'],
- },
- table: {
- width: '100%',
- borderCollapse: 'collapse',
- },
- th: {
- textAlign: 'start' as const,
- padding: `${spacingVars['--spacing-3']} ${spacingVars['--spacing-4']}`,
- borderBottom: `1px solid ${colorVars['--color-border']}`,
- color: colorVars['--color-text-secondary'],
- fontSize: 13,
- fontWeight: 500,
- },
- td: {
- padding: `${spacingVars['--spacing-3']} ${spacingVars['--spacing-4']}`,
- borderBottom: `1px solid ${colorVars['--color-border']}`,
- },
-});
-
-const HomeIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- width={20}
- height={20}
- {...props}>
- <path d="M3 12l9-8 9 8" strokeLinecap="round" strokeLinejoin="round" />
- <path
- d="M5 10v10a1 1 0 001 1h3v-6h6v6h3a1 1 0 001-1V10"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- </svg>
-);
-
-const ChartIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- width={20}
- height={20}
- {...props}>
- <rect x="3" y="12" width="4" height="9" rx="1" />
- <rect x="10" y="7" width="4" height="14" rx="1" />
- <rect x="17" y="3" width="4" height="18" rx="1" />
- </svg>
-);
-
-const UsersIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- width={20}
- height={20}
- {...props}>
- <circle cx="9" cy="7" r="4" />
- <path d="M3 21v-2a4 4 0 014-4h4a4 4 0 014 4v2" />
- <circle cx="17" cy="9" r="3" />
- <path d="M21 21v-2a3 3 0 00-2-2.83" />
- </svg>
-);
-
-function statusVariant(status: string) {
- if (status === 'Active') return 'success' as const;
- if (status === 'Pending') return 'warning' as const;
- return 'error' as const;
-}
-
-export default function DemoDashboard() {
- const [activePage, setActivePage] = useState('dashboard');
-
- return (
- <XDSAppShell
- sideNav={
- <XDSSideNav>
- <XDSSideNavSection title="Main" isHeaderHidden>
- <XDSSideNavItem
- label="Home"
- icon={HomeIcon}
- isSelected={activePage === 'home'}
- onClick={() => setActivePage('home')}
- />
- <XDSSideNavItem
- label="Dashboard"
- icon={ChartIcon}
- isSelected={activePage === 'dashboard'}
- onClick={() => setActivePage('dashboard')}
- />
- <XDSSideNavItem
- label="Customers"
- icon={UsersIcon}
- isSelected={activePage === 'customers'}
- onClick={() => setActivePage('customers')}
- />
- </XDSSideNavSection>
- </XDSSideNav>
- }
- contentPadding={6}>
- <div {...stylex.props(styles.content)}>
- <XDSHeading level={1}>Dashboard</XDSHeading>
-
- <div {...stylex.props(styles.kpiGrid)}>
- {kpis.map(kpi => (
- <XDSCard key={kpi.label}>
- <div {...stylex.props(styles.kpiCard)}>
- <XDSText type="body" color="secondary" size="sm">
- {kpi.label}
- </XDSText>
- <div {...stylex.props(styles.kpiValue)}>{kpi.value}</div>
- <XDSBadge
- variant={kpi.trend === 'up' ? 'success' : 'error'}
- label={kpi.change}
- />
- </div>
- </XDSCard>
- ))}
- </div>
-
- <XDSDivider />
-
- <div>
- <XDSHeading level={2}>Recent Customers</XDSHeading>
- <table {...stylex.props(styles.table)}>
- <thead>
- <tr>
- <th {...stylex.props(styles.th)}>Name</th>
- <th {...stylex.props(styles.th)}>Status</th>
- <th {...stylex.props(styles.th)}>Amount</th>
- </tr>
- </thead>
- <tbody>
- {recentItems.map(item => (
- <tr key={item.id}>
- <td {...stylex.props(styles.td)}>
- <XDSText type="body">{item.name}</XDSText>
- </td>
- <td {...stylex.props(styles.td)}>
- <XDSBadge
- variant={statusVariant(item.status)}
- label={item.status}
- />
- </td>
- <td {...stylex.props(styles.td)}>
- <XDSText type="body">{item.amount}</XDSText>
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- </div>
- </XDSAppShell>
- );
-}
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-detail-2/page.tsx b/packages/cli/templates/detail-page/page.tsx
similarity index 98%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-detail-2/page.tsx
rename to packages/cli/templates/detail-page/page.tsx
index 3b5a8a9bd5..f6ce21eb0a 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/template-detail-2/page.tsx
+++ b/packages/cli/templates/detail-page/page.tsx
@@ -199,11 +199,14 @@ const ArrowLeftIcon = (props: React.SVGProps<SVGSVGElement>) => (
stroke="currentColor"
strokeWidth={1.5}
{...props}>
- <path strokeLinecap="round" strokeLinejoin="round" d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" />
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"
+ />
</svg>
);
-
// ─── Styles ─────────────────────────────────────────────────────────────────
const pageStyles = stylex.create({
maxWidth: {
@@ -388,9 +391,7 @@ function ShopSideNav() {
header={
<XDSHStack gap={2} vAlign="center" style={{padding: '8px 12px'}}>
<XDSNavIcon icon={<ShopIcon style={{width: 16, height: 16}} />} />
- <XDSHeading level={4}>
- Acme
- </XDSHeading>
+ <XDSHeading level={4}>Acme</XDSHeading>
</XDSHStack>
}
footer={
@@ -515,7 +516,9 @@ function PageHeader({
<XDSText type="body">Needs attention</XDSText>
</XDSHStack>
<Bullet />
- <XDSLink href="#" label="See all" color="secondary">See all</XDSLink>
+ <XDSLink href="#" label="See all" color="secondary">
+ See all
+ </XDSLink>
</XDSHStack>
</XDSVStack>
@@ -555,10 +558,7 @@ function ItemsCard() {
</XDSHStack>
<XDSHStack gap={2}>
<XDSButton label="Fulfill item" variant="ghost" />
- <XDSButton
- label="Create shipping label"
- variant="secondary"
- />
+ <XDSButton label="Create shipping label" variant="secondary" />
</XDSHStack>
</XDSHStack>
@@ -757,7 +757,9 @@ function RightPanel() {
Customer is a repeat buyer — 3rd order this quarter. Prefers brown
leather goods and grid-format notebooks. Requested gift wrapping
for this order. Ships to a residential address in CA.{' '}
- <XDSLink href="#" label="Show more" color="secondary">Show more</XDSLink>
+ <XDSLink href="#" label="Show more" color="secondary">
+ Show more
+ </XDSLink>
</XDSText>
</XDSCollapsible>
</div>
diff --git a/packages/cli/templates/detail-page/template.doc.mjs b/packages/cli/templates/detail-page/template.doc.mjs
new file mode 100644
index 0000000000..33872547f4
--- /dev/null
+++ b/packages/cli/templates/detail-page/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Detail Page',
+ description: 'Order detail page with timeline and line items',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/editor/page.tsx b/packages/cli/templates/editor/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/editor/page.tsx
rename to packages/cli/templates/editor/page.tsx
diff --git a/packages/cli/templates/editor/template.doc.mjs b/packages/cli/templates/editor/template.doc.mjs
new file mode 100644
index 0000000000..d60a030a92
--- /dev/null
+++ b/packages/cli/templates/editor/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Page Editor',
+ description: 'Block-based page builder with sidebar config and live preview',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/file-explorer/page.tsx b/packages/cli/templates/file-explorer/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/file-explorer/page.tsx
rename to packages/cli/templates/file-explorer/page.tsx
diff --git a/packages/cli/templates/file-explorer/template.doc.mjs b/packages/cli/templates/file-explorer/template.doc.mjs
new file mode 100644
index 0000000000..8dd78df4b9
--- /dev/null
+++ b/packages/cli/templates/file-explorer/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'File Explorer',
+ description: 'Column-based file browser inspired by macOS Finder',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-login/page.tsx b/packages/cli/templates/login-card/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-login/page.tsx
rename to packages/cli/templates/login-card/page.tsx
diff --git a/packages/cli/templates/login-card/template.doc.mjs b/packages/cli/templates/login-card/template.doc.mjs
new file mode 100644
index 0000000000..9dc34e53d3
--- /dev/null
+++ b/packages/cli/templates/login-card/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Login (Card)',
+ description: 'Centered login card with social sign-in and email form',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-login-02/page.tsx b/packages/cli/templates/login-split/page.tsx
similarity index 96%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-login-02/page.tsx
rename to packages/cli/templates/login-split/page.tsx
index d1018a1840..b5b0c1e383 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/template-login-02/page.tsx
+++ b/packages/cli/templates/login-split/page.tsx
@@ -14,7 +14,20 @@ import {
spacingVars,
radiusVars,
} from '@xds/core/theme/tokens.stylex';
-import {ImageIcon} from '../../../icons';
+const ImageIcon = (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" ry="2" />
+ <circle cx="8.5" cy="8.5" r="1.5" />
+ <polyline points="21 15 16 10 5 21" />
+ </svg>
+);
const AppleIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
diff --git a/packages/cli/templates/login-split/template.doc.mjs b/packages/cli/templates/login-split/template.doc.mjs
new file mode 100644
index 0000000000..60ec811bc5
--- /dev/null
+++ b/packages/cli/templates/login-split/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Login (Split)',
+ description: 'Split-screen login with form and cover image',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-login-sso/page.tsx b/packages/cli/templates/login-sso/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-login-sso/page.tsx
rename to packages/cli/templates/login-sso/page.tsx
diff --git a/packages/cli/templates/login-sso/template.doc.mjs b/packages/cli/templates/login-sso/template.doc.mjs
new file mode 100644
index 0000000000..a8ea98cc87
--- /dev/null
+++ b/packages/cli/templates/login-sso/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Login (SSO)',
+ description: 'SSO login with email-based provider detection',
+ isReady: true,
+};
diff --git a/packages/cli/templates/login/template.doc.mjs b/packages/cli/templates/login/template.doc.mjs
new file mode 100644
index 0000000000..a259385045
--- /dev/null
+++ b/packages/cli/templates/login/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Login',
+ description: 'Auth form with email and password inputs',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-product-detail/page.tsx b/packages/cli/templates/product-detail/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-product-detail/page.tsx
rename to packages/cli/templates/product-detail/page.tsx
diff --git a/packages/cli/templates/product-detail/template.doc.mjs b/packages/cli/templates/product-detail/template.doc.mjs
new file mode 100644
index 0000000000..8a3c6dc892
--- /dev/null
+++ b/packages/cli/templates/product-detail/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Product Detail',
+ description: 'Product page with image gallery and collapsible sections',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-settings-03/page.tsx b/packages/cli/templates/settings-dialog/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-settings-03/page.tsx
rename to packages/cli/templates/settings-dialog/page.tsx
diff --git a/packages/cli/templates/settings-dialog/template.doc.mjs b/packages/cli/templates/settings-dialog/template.doc.mjs
new file mode 100644
index 0000000000..93858b6e93
--- /dev/null
+++ b/packages/cli/templates/settings-dialog/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Settings (Dialog)',
+ description: 'Account settings in a dialog with sidebar nav',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-settings-02/page.tsx b/packages/cli/templates/settings-sidebar/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-settings-02/page.tsx
rename to packages/cli/templates/settings-sidebar/page.tsx
diff --git a/packages/cli/templates/settings-sidebar/template.doc.mjs b/packages/cli/templates/settings-sidebar/template.doc.mjs
new file mode 100644
index 0000000000..5c0245c7cd
--- /dev/null
+++ b/packages/cli/templates/settings-sidebar/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Settings (Sidebar)',
+ description: 'Account settings with sidebar nav and inline editing',
+ isReady: true,
+};
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/template-settings/page.tsx b/packages/cli/templates/settings/page.tsx
similarity index 100%
rename from apps/sandbox/src/app/(fullscreen)/pages/template-settings/page.tsx
rename to packages/cli/templates/settings/page.tsx
diff --git a/packages/cli/templates/settings/template.doc.mjs b/packages/cli/templates/settings/template.doc.mjs
new file mode 100644
index 0000000000..066e2abae4
--- /dev/null
+++ b/packages/cli/templates/settings/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Settings',
+ description: 'Basic account settings page',
+ isReady: true,
+};
diff --git a/packages/cli/templates/table/page.tsx b/packages/cli/templates/table/page.tsx
index a2deae06e8..16f3583a21 100644
--- a/packages/cli/templates/table/page.tsx
+++ b/packages/cli/templates/table/page.tsx
@@ -27,7 +27,9 @@ const columns: XDSTableColumn<Item>[] = [
key: 'name',
header: 'Name',
renderCell: (item: Item) => (
- <XDSText weight="semibold">{item.name}</XDSText>
+ <XDSText type="body" weight="semibold">
+ {item.name}
+ </XDSText>
),
},
{
@@ -44,7 +46,9 @@ const columns: XDSTableColumn<Item>[] = [
key: 'updatedAt',
header: 'Updated',
renderCell: (item: Item) => (
- <XDSText color="secondary">{item.updatedAt}</XDSText>
+ <XDSText type="body" color="secondary">
+ {item.updatedAt}
+ </XDSText>
),
},
{
@@ -71,7 +75,7 @@ export default function TablePage() {
}
content={
<XDSLayoutContent>
- <XDSTable<Item> data={data} columns={columns} rowKey="id" hasHover />
+ <XDSTable<Item> data={data} columns={columns} idKey="id" hasHover />
</XDSLayoutContent>
}
/>
diff --git a/packages/cli/templates/table/template.doc.mjs b/packages/cli/templates/table/template.doc.mjs
new file mode 100644
index 0000000000..eb51a67716
--- /dev/null
+++ b/packages/cli/templates/table/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Table',
+ description: 'Data table with actions',
+ isReady: true,
+};