mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
React.lazy expects default exports, but all finance registry files were using named exports. This caused build failures with the error: "Element type is invalid: expected a string ... but got: undefined" Changes: - Updated all finance registry files to import and re-export as default - Removed non-existent mini-chart and symbol-overview MDX files - Updated sidebar navigation to remove mini-chart and symbol-overview - Fixed market-overview, ticker-tape, and trading-panel registry files The finance components now properly load in ComponentPreview during static site generation.
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
import { z } from "zod"
|
|
|
|
export const blockChunkSchema = z.object({
|
|
name: z.string(),
|
|
description: z.string(),
|
|
component: z.any(),
|
|
file: z.string(),
|
|
code: z.string().optional(),
|
|
container: z
|
|
.object({
|
|
className: z.string().nullish(),
|
|
})
|
|
.optional(),
|
|
})
|
|
|
|
export const registryEntrySchema = z.object({
|
|
name: z.string(),
|
|
description: z.string().optional(),
|
|
dependencies: z.array(z.string()).optional(),
|
|
devDependencies: z.array(z.string()).optional(),
|
|
registryDependencies: z.array(z.string()).optional(),
|
|
files: z.array(z.string()),
|
|
source: z.string().optional(),
|
|
type: z.enum([
|
|
"components:ui",
|
|
"components:component",
|
|
"components:example",
|
|
"components:block",
|
|
"components:ai",
|
|
"components:code",
|
|
"components:3d",
|
|
"components:animation",
|
|
"components:layout",
|
|
"components:marketing",
|
|
"components:navigation",
|
|
"components:special-effects",
|
|
"components:text-effects",
|
|
"components:visualization",
|
|
"components:finance",
|
|
]),
|
|
category: z.string().optional(),
|
|
subcategory: z.string().optional(),
|
|
chunks: z.array(blockChunkSchema).optional(),
|
|
})
|
|
|
|
export const registrySchema = z.array(registryEntrySchema)
|
|
|
|
export type RegistryEntry = z.infer<typeof registryEntrySchema>
|
|
|
|
export type Registry = z.infer<typeof registrySchema>
|
|
|
|
export const blockSchema = registryEntrySchema.extend({
|
|
type: z.literal("components:block"),
|
|
style: z.literal("default"),
|
|
component: z.any(),
|
|
container: z
|
|
.object({
|
|
height: z.string().optional(),
|
|
className: z.string().nullish(),
|
|
})
|
|
.optional(),
|
|
code: z.string(),
|
|
highlightedCode: z.string(),
|
|
})
|
|
|
|
export type Block = z.infer<typeof blockSchema>
|
|
|
|
export type BlockChunk = z.infer<typeof blockChunkSchema>
|