This commit is contained in:
Saeed Vaziry
2023-07-02 12:47:50 +02:00
commit 5c72f12490
825 changed files with 41659 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
@props(['status'])
@if ($status)
<div {{ $attributes->merge(['class' => 'font-medium text-sm text-green-600 dark:text-green-400']) }}>
{{ $status }}
</div>
@endif

View File

@ -0,0 +1,21 @@
<div class="mb-6 @if(isset($aside)) flex justify-between @endif">
<div>
@if(isset($title))
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-300">
{{ $title }}
</h3>
@endif
@if(isset($description))
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
{{ $description }}
</p>
@endif
</div>
<div>
@if(isset($aside))
{{ $aside }}
@endif
</div>
</div>

View File

@ -0,0 +1,25 @@
<div class="mx-auto mb-10">
<x-card-header>
@if(isset($title))
<x-slot name="title">{{ $title }}</x-slot>
@endif
@if(isset($description))
<x-slot name="description">{{ $description }}</x-slot>
@endif
@if(isset($aside))
<x-slot name="aside">{{ $aside }}</x-slot>
@endif
</x-card-header>
<div class="mt-5">
<div class="bg-white px-4 py-5 dark:bg-gray-800 sm:p-6 border border-gray-200 dark:border-gray-700 {{ isset($actions) ? 'sm:rounded-tl-md sm:rounded-tr-md': 'sm:rounded-md' }}">
{{ $slot }}
</div>
@if(isset($actions))
<div class="flex items-center justify-end bg-gray-50 border border-r border-b border-l border-t-transparent dark:border-t-transparent border-gray-200 dark:border-gray-700 px-4 py-3 text-right dark:bg-gray-800 dark:bg-opacity-70 sm:rounded-bl-md sm:rounded-br-md sm:px-6">
{{ $actions }}
</div>
@endif
</div>
</div>

View File

@ -0,0 +1,18 @@
@props(['name', 'input', 'title', 'description', 'method'])
<x-modal :name="$name">
<form wire:submit.prevent="{{ $method }}" class="p-6">
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __('Confirm') }}
</h2>
<p>{{ $description }}</p>
<div class="mt-6 flex justify-end">
<x-secondary-button type="button" x-on:click="$dispatch('close')">
{{ __('Cancel') }}
</x-secondary-button>
<x-danger-button class="ml-3" @confirmed.window="$dispatch('close')" wire:loading.attr="disabled">
{{ __('Confirm') }}
</x-danger-button>
</div>
</form>
</x-modal>

View File

@ -0,0 +1,3 @@
<div class="h-96 w-full overflow-auto whitespace-pre-line rounded-md border border-gray-200 bg-gray-900 p-5 text-gray-50 dark:border-gray-800">
{{ $slot }}
</div>

View File

@ -0,0 +1,3 @@
<div {!! $attributes->merge(['class' => 'py-12 max-w-7xl mx-auto px-6']) !!}>
{{ $slot }}
</div>

View File

@ -0,0 +1,3 @@
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex w-max items-center justify-center rounded-md border border-transparent bg-red-600 px-4 py-1 h-9 font-semibold capitalize text-white transition hover:bg-red-500 focus:border-red-700 focus:outline-none focus:ring focus:ring-red-200 active:bg-red-600 disabled:opacity-25']) }}>
{{ $slot }}
</button>

View File

@ -0,0 +1,3 @@
@props(['value'])
{{ date_with_timezone($value, auth()->user()->timezone) }}

View File

@ -0,0 +1 @@
<a {{ $attributes->merge(['class' => 'block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out flex items-center justify-start']) }}>{{ $slot }}</a>

View File

@ -0,0 +1,46 @@
@props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white dark:bg-gray-700'])
@php
switch ($align) {
case 'left':
$alignmentClasses = 'origin-top-left left-0';
break;
case 'top':
$alignmentClasses = 'origin-top';
break;
case 'right':
default:
$alignmentClasses = 'origin-top-right right-0';
break;
}
switch ($width) {
case '48':
$width = 'w-48';
break;
case 'full':
$width = 'w-full';
break;
}
@endphp
<div class="relative" x-data="{ open: false }" @click.outside="open = false" @close.stop="open = false">
<div @click="open = ! open">
{{ $trigger }}
</div>
<div x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="absolute z-50 mt-2 {{ $width }} rounded-md shadow-lg {{ $alignmentClasses }}"
style="display: none;"
@click="open = false">
<div class="rounded-md ring-1 ring-black ring-opacity-5 {{ $contentClasses }}">
{{ $content }}
</div>
</div>
</div>

View File

@ -0,0 +1,15 @@
@props(['href'])
@php
$class = 'w-max inline-flex items-center justify-center px-2 py-1 font-semibold capitalize transition hover:opacity-50 outline-0 focus:ring focus:ring-primary-200 disabled:opacity-25 dark:focus:ring-primary-700 dark:focus:ring-opacity-40';
@endphp
@if(isset($href))
<a href="{{ $href }}" {{ $attributes->merge(['class' => $class]) }}>
{{ $slot }}
</a>
@else
<button {{ $attributes->merge(['type' => 'submit', 'class' => $class]) }}>
{{ $slot }}
</button>
@endif

View File

@ -0,0 +1,9 @@
@props(['messages'])
@if ($messages)
<ul {{ $attributes->merge(['class' => 'text-sm text-red-600 dark:text-red-400 space-y-1']) }}>
@foreach ((array) $messages as $message)
<li>{{ $message }}</li>
@endforeach
</ul>
@endif

View File

@ -0,0 +1,5 @@
@props(['value'])
<label {{ $attributes->merge(['class' => 'block font-medium text-sm text-gray-700 dark:text-gray-300']) }}>
{{ $value ?? $slot }}
</label>

View File

@ -0,0 +1,3 @@
<div class="rounded-t-md rounded-b-md flex h-20 items-center justify-between border border-gray-200 bg-white p-7 text-center dark:border-gray-700 dark:bg-gray-800">
{{ $slot }}
</div>

View File

@ -0,0 +1,80 @@
@props([
'name',
'show' => false,
'maxWidth' => '2xl'
])
@php
$maxWidth = [
'sm' => 'sm:max-w-sm',
'md' => 'sm:max-w-md',
'lg' => 'sm:max-w-lg',
'xl' => 'sm:max-w-xl',
'2xl' => 'sm:max-w-2xl',
'3xl' => 'sm:max-w-3xl',
'4xl' => 'sm:max-w-4xl',
][$maxWidth];
@endphp
<div
x-data="{
show: @js($show),
focusables() {
// All focusable element types...
let selector = 'a, button, input:not([type=\'hidden\']), textarea, select, details, [tabindex]:not([tabindex=\'-1\'])'
return [...$el.querySelectorAll(selector)]
// All non-disabled elements...
.filter(el => ! el.hasAttribute('disabled'))
},
firstFocusable() { return this.focusables()[0] },
lastFocusable() { return this.focusables().slice(-1)[0] },
nextFocusable() { return this.focusables()[this.nextFocusableIndex()] || this.firstFocusable() },
prevFocusable() { return this.focusables()[this.prevFocusableIndex()] || this.lastFocusable() },
nextFocusableIndex() { return (this.focusables().indexOf(document.activeElement) + 1) % (this.focusables().length + 1) },
prevFocusableIndex() { return Math.max(0, this.focusables().indexOf(document.activeElement)) -1 },
}"
x-init="$watch('show', value => {
if (value) {
document.body.classList.add('overflow-y-hidden');
{{ $attributes->has('focusable') ? 'setTimeout(() => firstFocusable().focus(), 100)' : '' }}
} else {
document.body.classList.remove('overflow-y-hidden');
}
})"
x-on:open-modal.window="$event.detail == '{{ $name }}' ? show = true : null"
x-on:close-modal.window="$event.detail == '{{ $name }}' ? show = false : null"
x-on:close.stop="show = false"
x-on:keydown.escape.window="show = false"
x-on:keydown.tab.prevent="$event.shiftKey || nextFocusable().focus()"
x-on:keydown.shift.tab.prevent="prevFocusable().focus()"
x-show="show"
class="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50"
style="display: {{ $show ? 'block' : 'none' }};"
>
<div
x-show="show"
class="fixed inset-0 transform transition-all"
x-on:click="show = false"
x-transition:enter="ease-out duration-300"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
>
<div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75"></div>
</div>
<div
x-show="show"
class="mb-6 bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full {{ $maxWidth }} sm:mx-auto"
x-transition:enter="ease-out duration-300"
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
x-transition:leave="ease-in duration-200"
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
{{ $slot }}
</div>
</div>

View File

@ -0,0 +1,11 @@
@props(['active'])
@php
$classes = ($active ?? false)
? 'px-2 inline-flex items-center px-1 pt-1 border-b-2 border-primary-400 dark:border-primary-600 text-sm font-medium leading-5 text-gray-900 dark:text-gray-100 focus:outline-none focus:border-primary-700 transition duration-150 ease-in-out'
: 'px-2 inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-700 focus:outline-none focus:text-gray-700 dark:focus:text-gray-300 focus:border-gray-300 dark:focus:border-gray-700 transition duration-150 ease-in-out';
@endphp
<a {{ $attributes->merge(['class' => $classes]) }}>
{{ $slot }}
</a>

View File

@ -0,0 +1,15 @@
@props(['href'])
@php
$class = 'w-max inline-flex items-center justify-center rounded-md border border-transparent bg-primary-600 px-4 py-1 h-9 font-semibold text-white transition hover:bg-primary-700 focus:border-primary-700 focus:border-primary-300 outline-0 focus:ring focus:ring-primary-200 focus:ring-opacity-50 active:bg-primary-700 disabled:opacity-25 dark:focus:border-primary-700 dark:focus:ring-primary-700 dark:focus:ring-opacity-40';
@endphp
@if(isset($href))
<a href="{{ $href }}" {{ $attributes->merge(['class' => $class]) }}>
{{ $slot }}
</a>
@else
<button {{ $attributes->merge(['type' => 'submit', 'class' => $class]) }}>
{{ $slot }}
</button>
@endif

View File

@ -0,0 +1,11 @@
@props(['active'])
@php
$classes = ($active ?? false)
? 'block w-full pl-3 pr-4 py-2 border-l-4 border-primary-400 dark:border-primary-600 text-left text-base font-medium text-primary-700 dark:text-primary-300 bg-primary-50 dark:bg-primary-900/50 focus:outline-none focus:text-primary-800 dark:focus:text-primary-200 focus:bg-primary-100 dark:focus:bg-primary-900 focus:border-primary-700 dark:focus:border-primary-300 transition duration-150 ease-in-out'
: 'block w-full pl-3 pr-4 py-2 border-l-4 border-transparent text-left text-base font-medium text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-300 dark:hover:border-gray-600 focus:outline-none focus:text-gray-800 dark:focus:text-gray-200 focus:bg-gray-50 dark:focus:bg-gray-700 focus:border-gray-300 dark:focus:border-gray-600 transition duration-150 ease-in-out';
@endphp
<a {{ $attributes->merge(['class' => $classes]) }}>
{{ $slot }}
</a>

View File

@ -0,0 +1,24 @@
@props(['href', 'type', 'span', 'disabled'])
@php
$class = 'inline-flex items-center px-4 py-1 h-9 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-gray-700 dark:text-gray-300 shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150';
@endphp
@if(isset($href))
@if(isset($disabled))
@php
$class .= ' opacity-25 cursor-default';
@endphp
<span {{ $attributes->merge(['class' => $class]) }}>
{{ $slot }}
</span>
@else
<a href="{{ $href }}" {{ $attributes->merge(['class' => $class]) }}>
{{ $slot }}
</a>
@endif
@else
<button {{ $attributes->merge(['type' => $type ?? 'submit', 'class' => $class]) }}>
{{ $slot }}
</button>
@endif

View File

@ -0,0 +1,19 @@
<div {!! $attributes->merge(['class' => 'flex justify-between md:col-span-1 mb-5']) !!}>
@if(isset($title) || isset($description))
<div>
@if(isset($title))
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-300">{{ $title }}</h3>
@endif
@if(isset($description))
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
{{ $description }}
</p>
@endif
</div>
@endif
@if(isset($aside))
<div>
{{ $aside }}
</div>
@endif
</div>

View File

@ -0,0 +1,5 @@
@props(['disabled' => false])
<select {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-primary-500 dark:focus:border-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600 rounded-md shadow-sm']) !!}>
{{ $slot }}
</select>

View File

@ -0,0 +1,12 @@
@props(['active'])
@php
$class = 'flex w-full items-center justify-center rounded-md border-2 bg-primary-50 px-3 pt-3 pb-2 dark:bg-primary-500 dark:bg-opacity-10 cursor-pointer';
$classes = ($active ?? false)
? $class . ' border-primary-600'
: $class . ' border-primary-200 dark:border-primary-600 dark:border-opacity-20'
@endphp
<div {{ $attributes->merge(['class' => $classes]) }}>
{{ $slot }}
</div>

View File

@ -0,0 +1,11 @@
@props(['active'])
@php
$classes = ($active ?? false)
? 'text-md font-semibold flex items-center text-primary-500 transition duration-150 ease-in-out mb-4'
: 'text-md font-semibold flex items-center hover:text-primary-600 text-gray-600 dark:text-gray-500 transition duration-150 ease-in-out mb-4';
@endphp
<a {{ $attributes->merge(['class' => $classes]) }}>
{{ $slot }}
</a>

View File

@ -0,0 +1,3 @@
<div {!! $attributes->merge(['class' => 'bg-white border boarder-gray-200 dark:border-gray-700 dark:bg-gray-800 p-6 rounded-md']) !!}>
{{ $slot }}
</div>

View File

@ -0,0 +1,12 @@
@props(['active'])
@php
$class = 'flex w-full items-center justify-center rounded-md border-2 bg-primary-50 px-3 pt-3 pb-2 dark:bg-primary-500 dark:bg-opacity-10 cursor-pointer';
$classes = ($active ?? false)
? $class . ' border-primary-600'
: $class . ' border-primary-200 dark:border-primary-600 dark:border-opacity-20'
@endphp
<div {{ $attributes->merge(['class' => $classes]) }}>
{{ $slot }}
</div>

View File

@ -0,0 +1,15 @@
@props(['status'])
@php
$class = [
"success" => "rounded-full bg-green-50 px-2 py-1 text-xs uppercase text-green-500 dark:bg-green-500 dark:bg-opacity-10",
"danger" => "rounded-full bg-red-50 px-2 py-1 text-xs uppercase text-red-500 dark:bg-red-500 dark:bg-opacity-10",
"warning" => "rounded-full bg-yellow-50 px-2 py-1 text-xs uppercase text-yellow-500 dark:bg-yellow-500 dark:bg-opacity-10",
"disabled" => "rounded-full bg-gray-50 px-2 py-1 text-xs uppercase text-gray-500 dark:bg-gray-500 dark:bg-opacity-30 dark:text-gray-400",
"info" => "rounded-full bg-primary-50 px-2 py-1 text-xs uppercase text-primary-500 dark:bg-primary-500 dark:bg-opacity-10",
];
@endphp
<div {{ $attributes->merge(['class' => $class[$status]]) }}>
{{ $slot }}
</div>

View File

@ -0,0 +1,5 @@
<div {!! $attributes->merge(['class' => 'inline-block min-w-full overflow-x-auto rounded-md bg-white align-middle border border-gray-200 dark:border-gray-700 dark:bg-gray-800']) !!}>
<table class="min-w-full">
{{ $slot }}
</table>
</div>

View File

@ -0,0 +1,3 @@
<td {!! $attributes->merge(['class' => 'whitespace-nowrap border-t border-gray-200 px-6 py-4 text-gray-700 dark:border-gray-700 dark:text-gray-300 w-1']) !!}>
{{ $slot }}
</td>

View File

@ -0,0 +1,3 @@
@props(['disabled' => false])
<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-primary-500 dark:focus:border-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600 rounded-md shadow-sm']) !!}>

View File

@ -0,0 +1,3 @@
@props(['disabled' => false])
<textarea {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-primary-500 dark:focus:border-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600 rounded-md shadow-sm w-full']) !!}>{{ $slot }}</textarea>

View File

@ -0,0 +1,3 @@
<th {!! $attributes->merge(['class' => 'whitespace-nowrap bg-gray-50 px-6 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-500 dark:bg-gray-700 dark:text-gray-400']) !!}>
{{ $slot }}
</th>

View File

@ -0,0 +1,14 @@
<div>
<script>
window.addEventListener('toast', (e) => {
window.toastr[e.detail.type](e.detail.message)
});
</script>
@if(session()->has('toast.type') && session()->has('toast.message'))
<script>
document.addEventListener("DOMContentLoaded", () => {
window.toastr['{{ session()->get('toast.type') }}']('{{ session()->get('toast.message') }}');
});
</script>
@endif
</div>