Skip to content

Commit e80649c

Browse files
authored
Merge pull request #1222 from firebase/@invertase/shadcn-registry
2 parents 11119ae + 819f8fc commit e80649c

File tree

200 files changed

+19820
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+19820
-299
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ dist-ssr
2121
# Coverage
2222
coverage
2323

24+
# Firebase
25+
.firebase
26+
2427
# Editor directories and files
2528
.vscode/*
2629
!.vscode/extensions.json

eslint.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const config: any[] = [
2020
"**/shadcn/public-dev/**",
2121
"packages/styles/dist.css",
2222
"packages/angular/**",
23+
"packages/shadcn/public",
2324
]),
2425
...tseslint.configs.recommended,
2526
{
@@ -48,7 +49,7 @@ const config: any[] = [
4849
},
4950
{
5051
// React package specific rules
51-
files: ["packages/react/src/**/*.{ts,tsx}"],
52+
files: ["packages/react/src/**/*.{ts,tsx}", "packages/shadcn/src/**/*.{ts,tsx}"],
5253
plugins: { react: pluginReact, "react-hooks": pluginReactHooks },
5354
languageOptions: {
5455
parserOptions: {

examples/shadcn/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/shadcn/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO

examples/shadcn/add-all.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import parser from "yargs-parser";
2+
import readline from "node:readline";
3+
import registryJson from "../../packages/shadcn/registry-spec.json";
4+
import { execSync } from "node:child_process";
5+
6+
const components = registryJson.items.map((item) => item.name);
7+
const args = parser(process.argv.slice(2));
8+
const prefix = String(args.prefix) || "@dev";
9+
10+
const rl = readline.createInterface({
11+
input: process.stdin,
12+
output: process.stdout,
13+
});
14+
15+
const items = components
16+
.map((component) => {
17+
return `${prefix}/${component}`;
18+
})
19+
.join(" ");
20+
21+
rl.question(
22+
`Add ${components.length} components. This will overrwrite all existing files. Continue? (y/N) `,
23+
(answer: unknown) => {
24+
const answerString = String(answer || "n").toLowerCase();
25+
26+
if (answerString === "y") {
27+
try {
28+
execSync(`pnpm dlx shadcn@latest add -y -o -a ${items}`, { stdio: "inherit" });
29+
process.exit(0);
30+
} catch (error) {
31+
console.error(error);
32+
process.exit(1);
33+
}
34+
}
35+
36+
console.log("Aborting...");
37+
process.exit(0);
38+
}
39+
);

examples/shadcn/components.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {
22+
"@dev": "http://localhost:5178/{name}.json",
23+
"@firebase-ui": "https://ui.firebase.com/{name}.json"
24+
}
25+
}

examples/shadcn/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>shadcn</title>
8+
<link rel="stylesheet" href="src/index.css" />
9+
</head>
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.tsx"></script>
13+
</body>
14+
</html>

examples/shadcn/package.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"name": "shadcn",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"shadcn:add-all": "tsx add-all.ts"
9+
},
10+
"dependencies": {
11+
"@firebase-ui/core": "workspace:*",
12+
"@firebase-ui/react": "workspace:*",
13+
"@firebase-ui/styles": "workspace:*",
14+
"@hookform/resolvers": "^5.2.2",
15+
"@radix-ui/react-accordion": "^1.2.12",
16+
"@radix-ui/react-alert-dialog": "^1.1.15",
17+
"@radix-ui/react-aspect-ratio": "^1.1.7",
18+
"@radix-ui/react-avatar": "^1.1.10",
19+
"@radix-ui/react-checkbox": "^1.3.3",
20+
"@radix-ui/react-collapsible": "^1.1.12",
21+
"@radix-ui/react-context-menu": "^2.2.16",
22+
"@radix-ui/react-dialog": "^1.1.15",
23+
"@radix-ui/react-dropdown-menu": "^2.1.16",
24+
"@radix-ui/react-hover-card": "^1.1.15",
25+
"@radix-ui/react-label": "^2.1.7",
26+
"@radix-ui/react-menubar": "^1.1.16",
27+
"@radix-ui/react-navigation-menu": "^1.2.14",
28+
"@radix-ui/react-popover": "^1.1.15",
29+
"@radix-ui/react-progress": "^1.1.7",
30+
"@radix-ui/react-radio-group": "^1.3.8",
31+
"@radix-ui/react-scroll-area": "^1.2.10",
32+
"@radix-ui/react-select": "^2.2.6",
33+
"@radix-ui/react-separator": "^1.1.7",
34+
"@radix-ui/react-slider": "^1.3.6",
35+
"@radix-ui/react-slot": "^1.2.3",
36+
"@radix-ui/react-switch": "^1.2.6",
37+
"@radix-ui/react-tabs": "^1.1.13",
38+
"@radix-ui/react-toggle": "^1.1.10",
39+
"@radix-ui/react-toggle-group": "^1.1.11",
40+
"@radix-ui/react-tooltip": "^1.2.8",
41+
"class-variance-authority": "^0.7.1",
42+
"clsx": "^2.1.1",
43+
"cmdk": "^1.1.1",
44+
"date-fns": "^4.1.0",
45+
"embla-carousel-react": "^8.6.0",
46+
"firebase": "catalog:",
47+
"input-otp": "^1.4.2",
48+
"lucide-react": "^0.544.0",
49+
"next-themes": "^0.4.6",
50+
"react": "catalog:",
51+
"react-day-picker": "^9.11.1",
52+
"react-dom": "catalog:",
53+
"react-hook-form": "^7.64.0",
54+
"react-resizable-panels": "^3.0.6",
55+
"react-router": "^7.9.3",
56+
"react-router-dom": "^6.28.0",
57+
"recharts": "2.15.4",
58+
"sonner": "^2.0.7",
59+
"tailwind-merge": "^3.3.1",
60+
"vaul": "^1.1.2",
61+
"zod": "catalog:"
62+
},
63+
"devDependencies": {
64+
"@tailwindcss/vite": "catalog:",
65+
"@types/node": "catalog:",
66+
"@types/react": "catalog:",
67+
"@types/react-dom": "catalog:",
68+
"@types/yargs-parser": "^21.0.3",
69+
"@vitejs/plugin-react": "catalog:",
70+
"tailwindcss": "catalog:",
71+
"tsx": "^4.20.6",
72+
"tw-animate-css": "^1.4.0",
73+
"typescript": "catalog:",
74+
"vite": "catalog:",
75+
"yargs-parser": "^22.0.0"
76+
}
77+
}

examples/shadcn/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/shadcn/src/App.tsx

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { NavLink } from "react-router";
18+
import { useUser } from "./firebase/hooks";
19+
20+
function App() {
21+
const user = useUser();
22+
23+
return (
24+
<div className="p-8 ">
25+
<h1 className="text-3xl font-bold mb-6">Firebase UI Demo</h1>
26+
<div className="mb-6">{user && <div>Welcome: {user.email || user.phoneNumber}</div>}</div>
27+
<div>
28+
<h2 className="text-2xl font-bold mb-4">Auth Screens</h2>
29+
<ul className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
30+
<li>
31+
<NavLink to="/screens/sign-in-auth-screen" className="text-blue-500 hover:underline">
32+
Sign In Auth Screen
33+
</NavLink>
34+
</li>
35+
<li>
36+
<NavLink to="/screens/sign-in-auth-screen-w-handlers" className="text-blue-500 hover:underline">
37+
Sign In Auth Screen with Handlers
38+
</NavLink>
39+
</li>
40+
<li>
41+
<NavLink to="/screens/sign-in-auth-screen-w-oauth" className="text-blue-500 hover:underline">
42+
Sign In Auth Screen with OAuth
43+
</NavLink>
44+
</li>
45+
<li>
46+
<NavLink to="/screens/email-link-auth-screen" className="text-blue-500 hover:underline">
47+
Email Link Auth Screen
48+
</NavLink>
49+
</li>
50+
<li>
51+
<NavLink to="/screens/email-link-auth-screen-w-oauth" className="text-blue-500 hover:underline">
52+
Email Link Auth Screen with OAuth
53+
</NavLink>
54+
</li>
55+
<li>
56+
<NavLink to="/screens/phone-auth-screen" className="text-blue-500 hover:underline">
57+
Phone Auth Screen
58+
</NavLink>
59+
</li>
60+
<li>
61+
<NavLink to="/screens/phone-auth-screen-w-oauth" className="text-blue-500 hover:underline">
62+
Phone Auth Screen with OAuth
63+
</NavLink>
64+
</li>
65+
<li>
66+
<NavLink to="/screens/sign-up-auth-screen" className="text-blue-500 hover:underline">
67+
Sign Up Auth Screen
68+
</NavLink>
69+
</li>
70+
<li>
71+
<NavLink to="/screens/sign-up-auth-screen-w-oauth" className="text-blue-500 hover:underline">
72+
Sign Up Auth Screen with OAuth
73+
</NavLink>
74+
</li>
75+
<li>
76+
<NavLink to="/screens/oauth-screen" className="text-blue-500 hover:underline">
77+
OAuth Screen
78+
</NavLink>
79+
</li>
80+
<li>
81+
<NavLink to="/screens/password-reset-screen" className="text-blue-500 hover:underline">
82+
Password Reset Screen
83+
</NavLink>
84+
</li>
85+
</ul>
86+
</div>
87+
</div>
88+
);
89+
}
90+
91+
export default App;

0 commit comments

Comments
 (0)