Skip to content

Commit

Permalink
fix: missing demos
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdibha committed Dec 3, 2024
1 parent ceeb460 commit ac6125b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
34 changes: 34 additions & 0 deletions www/src/__demos__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ export const Index: Record<string, any> = {
files: ["registry/demos/alert/variants.tsx"],
component: React.lazy(() => import("@/registry/demos/alert/variants")),
},
"aspect-ratio-as-child": {
name: "aspect-ratio-as-child",
files: ["registry/demos/aspect-ratio/as-child.tsx"],
component: React.lazy(
() => import("@/registry/demos/aspect-ratio/as-child")
),
},
"aspect-ratio-default": {
name: "aspect-ratio-default",
files: ["registry/demos/aspect-ratio/default.tsx"],
component: React.lazy(
() => import("@/registry/demos/aspect-ratio/default")
),
},
"avatar-composition": {
name: "avatar-composition",
files: ["registry/demos/avatar/composition.tsx"],
Expand All @@ -61,6 +75,26 @@ export const Index: Record<string, any> = {
files: ["registry/demos/avatar/sizes.tsx"],
component: React.lazy(() => import("@/registry/demos/avatar/sizes")),
},
"badge-default": {
name: "badge-default",
files: ["registry/demos/badge/default.tsx"],
component: React.lazy(() => import("@/registry/demos/badge/default")),
},
"badge-icon": {
name: "badge-icon",
files: ["registry/demos/badge/icon.tsx"],
component: React.lazy(() => import("@/registry/demos/badge/icon")),
},
"badge-sizes": {
name: "badge-sizes",
files: ["registry/demos/badge/sizes.tsx"],
component: React.lazy(() => import("@/registry/demos/badge/sizes")),
},
"badge-variants": {
name: "badge-variants",
files: ["registry/demos/badge/variants.tsx"],
component: React.lazy(() => import("@/registry/demos/badge/variants")),
},
"breadcrumbs-basic": {
name: "breadcrumbs-basic",
files: ["registry/demos/breadcrumbs/basic.tsx"],
Expand Down
11 changes: 0 additions & 11 deletions www/src/lib/get-files-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,5 @@ export const getFilesSource = async (relativePath: string) => {
};

const getFilePath = (relativePath: string) => {
if (relativePath.startsWith("core")) {
return path.join(
process.cwd(),
"src",
"registry",
"ui",
"default",
relativePath,
relativePath.split("/").pop() || ""
);
}
return path.join(process.cwd(), "src", "registry", relativePath);
};
4 changes: 2 additions & 2 deletions www/src/registry/index/demos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const demos: RegistryDemos = [
"title",
"variants",
]),
...buildDemos("aspect-ratio", []),
...buildDemos("aspect-ratio", ["as-child", "default"]),
...buildDemos("avatar", ["composition", "default", "shape", "sizes"]),
...buildDemos("badge", []),
...buildDemos("badge", ["default", "icon", "sizes", "variants"]),
...buildDemos("breadcrumbs", [
"basic",
"composition",
Expand Down
2 changes: 1 addition & 1 deletion www/src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "tailwindcss";
@plugin "tailwindcss-animate";
@plugin "tailwindcss-rac";
/* @plugin "tailwindcss-rac"; */


@variant dark (&:where(.dark, .dark *));
Expand Down
6 changes: 3 additions & 3 deletions www/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"paths": {
"@/*": ["./src/*"],
"~/*": ["./*"]
},
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
".next/types/**/*.ts", "src/lib/tw-plugins/tw-rac.js",
".next/types/**/*.ts",
],
"exclude": ["node_modules"]
}
}

0 comments on commit ac6125b

Please sign in to comment.