Skip to content

Commit 9ad01e1

Browse files
committed
update registry
1 parent 776623f commit 9ad01e1

50 files changed

Lines changed: 229 additions & 224 deletions

Some content is hidden

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

app/Http/Controllers/AnimateController.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,4 @@ public function index()
2424
'categories' => $categories,
2525
]);
2626
}
27-
28-
public function show(string $name)
29-
{
30-
return response()->json(
31-
Animate::where('name', $name)->firstOrFail()->toRegistry()
32-
);
33-
}
3427
}

app/Http/Controllers/FontsController.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,4 @@ public function index()
2323
]),
2424
]);
2525
}
26-
27-
public function show(string $name)
28-
{
29-
$font = Font::where('name', $name)->firstOrFail();
30-
31-
return response()->json($font->toRegistry());
32-
}
3326
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use App\Models\Animate;
6+
use App\Models\Font;
7+
use App\Models\Registry;
8+
use App\Models\Theme;
9+
use Illuminate\Http\JsonResponse;
10+
11+
class RegistriesController extends Controller
12+
{
13+
public function show(string $type, string $name): JsonResponse
14+
{
15+
$model = match ($type) {
16+
'fonts' => Font::class,
17+
'animate-css' => Animate::class,
18+
'themes', 'theme' => Theme::class,
19+
default => Registry::class,
20+
};
21+
22+
if ($name === 'registry') {
23+
$items = $model::all()->map->toRegistry()->values();
24+
25+
return response()->json([
26+
'$schema' => 'https://ui.shadcn.com/schema/registry.json',
27+
'name' => 'designbycode',
28+
'homepage' => 'https://ui.designbycode.co.za',
29+
'items' => $items->all(),
30+
]);
31+
}
32+
33+
return response()->json(
34+
$model::where('name', $name)->firstOrFail()->toRegistry()
35+
);
36+
}
37+
}

app/Http/Controllers/ThemesController.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ public function apiIndex()
4343
return $query->paginate(50)->withQueryString();
4444
}
4545

46-
public function show(string $name)
47-
{
48-
return response()->json(
49-
Theme::where('name', $name)->firstOrFail()->toRegistry()
50-
);
51-
}
52-
5346
public function css(string $name)
5447
{
5548
return response(

bun.lock

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
},
3434
"dependencies": {
3535
"@base-ui/react": "^1.4.1",
36+
"@fontsource-variable/pixelify-sans": "^5.2.7",
37+
"@fontsource/bebas-neue": "^5.2.7",
3638
"@gsap/react": "^2.1.2",
3739
"@headlessui/react": "^2.2.0",
3840
"@inertiajs/react": "^3.0.0",

public/build/assets/animate-css-Co3MoQqc.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/animate-css-DIp07okz.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

public/build/assets/app-C9SEdfyF.css

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)