diff --git a/.gitignore b/.gitignore index 8bbf8e72f5..61594e6e47 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ dist .docs-review # Internal process artifacts (superpowers / brainstorming specs) -docs/superpowers/ \ No newline at end of file +docs/superpowers/ +.superpowers/ \ No newline at end of file diff --git a/fern/components/index.tsx b/fern/components/index.tsx new file mode 100644 index 0000000000..289efdaf69 --- /dev/null +++ b/fern/components/index.tsx @@ -0,0 +1,8 @@ +// Barrel for docs MDX components. Each component lives in its own subdirectory as an index.tsx +// for organization. MDX pages import this barrel as a file path — +// `import { VoiceWidget } from "@/components/index"` — because Fern's resolver only resolves file +// paths, not directories (and not directory→index). For the same reason the re-exports below use +// explicit `/index` file paths rather than bare directory paths. `export *` pulls in each +// component's public surface (components + types) without enumerating them. +export * from "./voice-widget/index"; +export * from "./skeleton/index"; diff --git a/fern/components/skeleton/index.tsx b/fern/components/skeleton/index.tsx new file mode 100644 index 0000000000..c59f770bdc --- /dev/null +++ b/fern/components/skeleton/index.tsx @@ -0,0 +1,50 @@ +import type { CSSProperties } from "react"; + +// Reusable loading-skeleton primitive for custom MDX components that fetch data at runtime. +// Compose a few of these to mimic the shape of the content that's loading. Pairs with this folder's +// styles.css (loaded via docs.yml `css:` — Fern's component bundler doesn't process CSS imports). +// Theme-aware (light/dark) through Fern's grayscale vars. +// +// import { Skeleton, SkeletonText } from "@/components/index"; +// if (!data) return ; + +export interface SkeletonProps { + /** CSS width — number (px) or any CSS length (e.g. "60%"). */ + width?: string | number; + /** CSS height — number (px) or any CSS length. Default: 14. */ + height?: string | number; + /** Border radius override — number (px) or any CSS length (e.g. "50%" for a circle). */ + radius?: string | number; + className?: string; + style?: CSSProperties; +} + +export function Skeleton({ width, height = 14, radius, className, style }: SkeletonProps) { + return ( +