Add some basic Tailwind elements

This commit is contained in:
Patrik Leifert
2024-02-26 02:24:15 +01:00
parent d29b19f602
commit 153eb77e71
17 changed files with 292 additions and 3 deletions

View File

@@ -21,6 +21,6 @@ public function __construct()
*/
public function render(): View|Closure|string
{
return view('components.layouts.raw');
return view('layouts.raw');
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\alerts;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class error extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.alerts.error');
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\alerts;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class success extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.alerts.success');
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\alerts;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class warning extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.alerts.warning');
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\tables;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class table extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.tables.table');
}
}

26
dist/app/View/Components/tables/td.php vendored Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\tables;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class td extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.tables.td');
}
}

26
dist/app/View/Components/tables/th.php vendored Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\tables;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class th extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.tables.th');
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\tables;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class thead extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.tables.thead');
}
}

View File

@@ -0,0 +1,29 @@
@props(['heading'])
<div id="alert" class="w-9/12 mx-auto mt-2 bg-red-100 border-t-4 border-red-500 rounded-b text-red-900 px-4 py-3 shadow-md" role="alert">
<div class="flex">
<div class="py-1"><svg class="fill-current h-6 w-6 text-red-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0zm1 14H9v-2h2v2zm0-4H9V5h2v5z" clip-rule="evenodd" />
</svg>
</div>
<div>
@if (!empty($heading))
<p class="font-bold">{{ $heading }}</p>
@endif
<p class="text-sm">{{ $slot }}</p>
</div>
<div class="ml-auto">
<button type="button" class="text-gray-500 hover:text-gray-700 focus:outline-none" onclick="this.parentElement.parentElement.parentElement.style.display='none';">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M15.293 5.293a1 1 0 0 1 1.414 1.414L11.414 10l5.293 5.293a1 1 0 1 1-1.414 1.414L10 11.414l-5.293 5.293a1 1 0 1 1-1.414-1.414L8.586 10 3.293 4.707a1 1 0 0 1 1.414-1.414L10 8.586l5.293-5.293a1 1 0 0 1 1.414 0z" clip-rule="evenodd"/>
</svg>
</button>
</div>
</div>
</div>
<script>
document.getElementById('closeAlert').addEventListener('click', function () {
document.getElementById('alert').style.display = 'none';
});
</script>

View File

@@ -0,0 +1,29 @@
@props(['heading'])
<div id="alert" class="w-9/12 mx-auto mt-2 bg-teal-100 border-t-4 border-teal-500 rounded-b text-teal-900 px-4 py-3 shadow-md" role="alert">
<div class="flex">
<div class="py-1">
<svg class="fill-current h-6 w-6 text-teal-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z" />
</svg>
</div>
<div>
@if (!empty($heading))
<p class="font-bold">{{ $heading }}</p>
@endif
<p class="text-sm">{{ $slot }}</p>
</div>
<div class="ml-auto">
<button type="button" class="text-gray-500 hover:text-gray-700 focus:outline-none" onclick="this.parentElement.parentElement.parentElement.style.display='none';">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M15.293 5.293a1 1 0 0 1 1.414 1.414L11.414 10l5.293 5.293a1 1 0 1 1-1.414 1.414L10 11.414l-5.293 5.293a1 1 0 1 1-1.414-1.414L8.586 10 3.293 4.707a1 1 0 0 1 1.414-1.414L10 8.586l5.293-5.293a1 1 0 0 1 1.414 0z" clip-rule="evenodd" />
</svg>
</button>
</div>
</div>
</div>
<script>
document.getElementById('closeAlert').addEventListener('click', function() {
document.getElementById('alert').style.display = 'none';
});
</script>

View File

@@ -0,0 +1,29 @@
@props(['heading'])
<div id="alert" class="w-9/12 mx-auto mt-2 bg-yellow-100 border-t-4 border-yellow-500 rounded-b text-yellow-900 px-4 py-3 shadow-md" role="alert">
<div class="flex">
<div class="py-1">
<svg class="fill-current h-6 w-6 text-yellow-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0zm0 14h-2v-2h2v2zm0-4h-2V6h2v4z" clip-rule="evenodd" />
</svg>
</div>
<div>
@if (!empty($heading))
<p class="font-bold">{{ $heading }}</p>
@endif
<p class="text-sm">{{ $slot }}</p>
</div>
<div class="ml-auto">
<button type="button" class="text-gray-500 hover:text-gray-700 focus:outline-none" onclick="this.parentElement.parentElement.parentElement.style.display='none';">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M15.293 5.293a1 1 0 0 1 1.414 1.414L11.414 10l5.293 5.293a1 1 0 1 1-1.414 1.414L10 11.414l-5.293 5.293a1 1 0 1 1-1.414-1.414L8.586 10 3.293 4.707a1 1 0 0 1 1.414-1.414L10 8.586l5.293-5.293a1 1 0 0 1 1.414 0z" clip-rule="evenodd" />
</svg>
</button>
</div>
</div>
</div>
<script>
document.getElementById('closeAlert').addEventListener('click', function() {
document.getElementById('alert').style.display = 'none';
});
</script>

View File

@@ -0,0 +1,4 @@
<input {{ $attributes->merge(['class' =>
"w-full rounded-md border border-gray-600 bg-gray-800/75 py-2 px-4 text-base font-medium text-[#6B7280] outline-none focus:border-[#6A64F1] focus:shadow-md"
]) }}
/>

View File

@@ -0,0 +1,3 @@
<table {{ $attributes->merge(['class' => 'w-full']) }}>
{{ $slot }}
</table>

View File

@@ -0,0 +1,4 @@
@props(['numeric' => false])
<td {{ $attributes->merge(['class' => 'first:rounded-l-md last:rounded-r-md text-sm bg-gray-50 dark:bg-gray-800/50 first:pl-3 last:pr-3 px-1 @sm:px-3 py-3' . ($numeric ? ' text-right tabular-nums whitespace-nowrap' : '')]) }}>
{{ $slot }}
</td>

View File

@@ -0,0 +1,3 @@
<th {{ $attributes->merge(['class' => 'text-xs text-gray-500 uppercase py-2 first:pl-3 last:pr-3 px-1 @sm:px-3 default:text-left']) }}>
{{ $slot }}
</th>

View File

@@ -0,0 +1,3 @@
<thead class="sticky z-10 top-0 bg-white dark:bg-gray-900">
{{ $slot }}
</thead>

View File

@@ -1,11 +1,14 @@
<!DOCTYPE html>
<html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="csrf-token" content="{{ csrf_token() }}">
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body>
<body class="bg-gray-950 font-sans text-white antialiased">
{{ $slot }}
</body>
@stack('js')
</html>