import './globals.css';
import React, { useEffect, useState } from 'react';
import { ThemeShell, NavGroup, NavItem, MarkdownViewer } from '../../common/ThemeShell';
/**
* Firecrawl 主题演示页
*/
const groups: NavGroup[] = [
{ id: 'docs', title: '说明', order: 1 },
{ id: 'foundation', title: '基础', order: 2 },
{ id: 'components', title: '组件', order: 3 },
];
const items: NavItem[] = [
{ id: 'design-spec', label: '设计规范 Design Spec', groupId: 'docs' },
{ id: 'colors', label: '色彩系统', groupId: 'foundation' },
{ id: 'typography', label: '字体系统', groupId: 'foundation' },
{ id: 'spacing', label: '间距', groupId: 'foundation' },
{ id: 'radius', label: '圆角', groupId: 'foundation' },
{ id: 'shadows', label: '阴影', groupId: 'foundation' },
{ id: 'icons', label: '图标', groupId: 'foundation' },
{ id: 'buttons', label: '按钮', groupId: 'components' },
{ id: 'cards', label: '卡片', groupId: 'components' },
{ id: 'inputs', label: '输入框', groupId: 'components' },
];
function ColorSwatch({
name,
color,
hex,
textDark = false,
light = false
}: {
name: string;
color: string;
hex: string;
textDark?: boolean;
light?: boolean;
}) {
return (
{textDark && (
Aa
)}
{name}
{hex}
);
}
function ColorsSection() {
return (
);
}
function TypographySection() {
return (
字体系统 (Typography)
H1 / 28px / 500
Firecrawl UI Spec
H2 / 20px / 450
Section Heading
Body / 16px / 400
The quick brown fox jumps over the lazy dog. 敏捷的棕色狐狸跳过了懒狗。
Body Small / 14px / 400
辅助说明文本与注释内容。
Label / 14px / 450
Label Text
Code / 14px / Geist Mono
curl -X POST https://api.firecrawl.dev
);
}
function SpacingSection() {
return (
间距 (Spacing)
2/4/8px Rhythm
{[
{ name: '--spacing-1', value: 'var(--spacing-1)' },
{ name: '--spacing-2', value: 'var(--spacing-2)' },
{ name: '--spacing-3', value: 'var(--spacing-3)' },
{ name: '--spacing-4', value: 'var(--spacing-4)' },
{ name: '--spacing-6', value: 'var(--spacing-6)' },
{ name: '--spacing-8', value: 'var(--spacing-8)' },
{ name: '--spacing-10', value: 'var(--spacing-10)' },
{ name: '--spacing-12', value: 'var(--spacing-12)' },
{ name: '--spacing-20', value: 'var(--spacing-20)' },
].map(({ name, value }) => (
))}
);
}
function RadiusSection() {
return (
圆角 (Radius)
Border Radius Tokens
{[
{ name: '--radius-sm', value: 'var(--radius-sm)' },
{ name: '--radius-md', value: 'var(--radius-md)' },
{ name: '--radius-lg', value: 'var(--radius-lg)' },
{ name: '--radius-xl', value: 'var(--radius-xl)' },
{ name: '--radius-2xl', value: 'var(--radius-2xl)' },
{ name: '--radius-full', value: 'var(--radius-full)' },
].map(({ name, value }) => (
))}
);
}
function ShadowsSection() {
return (
阴影 (Shadows)
{[
{ name: '--shadow-sm', value: 'var(--shadow-sm)', desc: '轻量卡片、列表' },
{ name: '--shadow-md', value: 'var(--shadow-md)', desc: '浮层、弹窗' },
].map(({ name, value, desc }) => (
))}
);
}
function IconsSection() {
const iconStyle: React.CSSProperties = {
width: '24px',
height: '24px',
color: 'var(--muted-foreground)'
};
return (
图标 (Icons)
{[
{ name: 'Spark', svg: (
) },
{ name: 'Search', svg: (
) },
{ name: 'Terminal', svg: (
) },
{ name: 'Globe', svg: (
) },
{ name: 'Code', svg: (
) },
{ name: 'Webhook', svg: (
) },
].map(({ name, svg }) => (
))}
);
}
function ButtonsSection() {
return (
按钮 (Buttons)
);
}
function CardsSection() {
return (
卡片 (Cards)
Card Title
这是一个基础卡片组件,使用 card 背景色与轻量阴影。
Elevated Card
悬浮卡片使用更明显的阴影层级。
Accent Card
使用品牌色作为强调边框,突出重要内容。
);
}
function InputsSection() {
return (
);
}
function renderContent(activeId: string) {
switch (activeId) {
case 'design-spec':
return null;
case 'colors':
return ;
case 'typography':
return ;
case 'spacing':
return ;
case 'radius':
return ;
case 'shadows':
return ;
case 'icons':
return ;
case 'buttons':
return ;
case 'cards':
return ;
case 'inputs':
return ;
default:
return ;
}
}
function Component() {
const [activeId, setActiveId] = useState('design-spec');
const [designSpec, setDesignSpec] = useState('');
useEffect(() => {
fetch(new URL('./DESIGN.md', import.meta.url).href)
.then(res => res.text())
.then(text => setDesignSpec(text))
.catch(err => console.error('Failed to load Design Spec:', err));
}, []);
return (
{activeId === 'design-spec' ? (
designSpec ? : (
加载设计规范中...
)
) : (
renderContent(activeId)
)}
);
}
export default Component;