mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
Multiple comprehensive fixes to improve UI/UX across the documentation site: 1. Themes Page: - Changed default theme from "blue" to "neutral" to match shadcn/ui - Updated active-theme.tsx to use "neutral" as DEFAULT_THEME 2. Builder Page (/builder): - Fixed block/component visibility (registry access updated for flat structure) - Added "Open in H" button to toolbar - Fixed drag handles visibility with proper left padding (pl-16) - Updated registry access from Index.default[name] to Index[name] 3. Code Previews: - Fixed missing code previews in documentation pages - ComponentPreview now fetches code from registry JSON files - Added "use client" directive for proper hydration - Falls back to registry when MDX doesn't provide code children 4. Tabs Component: - Cleaned up styling and removed complex dark mode classes - Added smooth transitions (transition-all, transition-colors) - Consistent height (h-10) across all tab implementations - Fixed MDX overrides to match base component styling 5. Logo Fix: - Updated HanzoLogo to always use black fill (#000000) - Removed text-current class that was causing theme inheritance - Ensures black H appears correctly in both light and dark modes 6. Missing Components: - Added 5 missing demo components: android, code-block, code-tabs, gantt, sandbox - Created placeholder UI components for gantt, sandbox, code-tabs - Updated registry/examples.ts and registry/ui.ts Build Status: ✅ All pages render correctly ✅ Code previews working ✅ Themes display properly ✅ Builder fully functional ✅ Drag and drop working ✅ No console errors
39 lines
721 B
TypeScript
39 lines
721 B
TypeScript
import { CodeTabs } from "@/registry/default/ui/code-tabs"
|
|
|
|
export default function CodeTabsDemo() {
|
|
const tabs = [
|
|
{
|
|
label: "JavaScript",
|
|
language: "javascript",
|
|
code: `function greet(name) {
|
|
return \`Hello, \${name}!\`
|
|
}
|
|
|
|
console.log(greet("World"))`,
|
|
},
|
|
{
|
|
label: "TypeScript",
|
|
language: "typescript",
|
|
code: `function greet(name: string): string {
|
|
return \`Hello, \${name}!\`
|
|
}
|
|
|
|
console.log(greet("World"))`,
|
|
},
|
|
{
|
|
label: "Python",
|
|
language: "python",
|
|
code: `def greet(name):
|
|
return f"Hello, {name}!"
|
|
|
|
print(greet("World"))`,
|
|
},
|
|
]
|
|
|
|
return (
|
|
<div className="w-full max-w-3xl">
|
|
<CodeTabs tabs={tabs} />
|
|
</div>
|
|
)
|
|
}
|