From 14aca65eeec1237e6149e6dd84672e29a311abf3 Mon Sep 17 00:00:00 2001 From: shadcn Date: Tue, 15 Oct 2024 12:49:22 +0400 Subject: [PATCH] docs: add sidebar docs --- apps/www/components/component-preview.tsx | 15 + apps/www/config/docs.ts | 8 +- apps/www/content/docs/components/sidebar.mdx | 1139 +++++++++++++++++ apps/www/public/images/sidebar-menu-dark.png | Bin 0 -> 39920 bytes apps/www/public/images/sidebar-menu.png | Bin 0 -> 40132 bytes .../public/images/sidebar-structure-dark.png | Bin 0 -> 40438 bytes apps/www/public/images/sidebar-structure.png | Bin 0 -> 41061 bytes 7 files changed, 1160 insertions(+), 2 deletions(-) create mode 100644 apps/www/content/docs/components/sidebar.mdx create mode 100644 apps/www/public/images/sidebar-menu-dark.png create mode 100644 apps/www/public/images/sidebar-menu.png create mode 100644 apps/www/public/images/sidebar-structure-dark.png create mode 100644 apps/www/public/images/sidebar-structure.png diff --git a/apps/www/components/component-preview.tsx b/apps/www/components/component-preview.tsx index f21523ee41..31d64083a8 100644 --- a/apps/www/components/component-preview.tsx +++ b/apps/www/components/component-preview.tsx @@ -25,10 +25,12 @@ interface ComponentPreviewProps extends React.HTMLAttributes { align?: "center" | "start" | "end" description?: string hideCode?: boolean + type?: "block" | "component" | "example" } export function ComponentPreview({ name, + type, children, className, extractClassname, @@ -73,6 +75,19 @@ export function ComponentPreview({ } }, [Code]) + if (type === "block") { + return ( +
+
+