generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
display outside panels done 'auth pages so to speak'
- Loading branch information
1 parent
f459331
commit 4dab053
Showing
7 changed files
with
218 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@props([ | ||
'src', | ||
'alt' => '', | ||
'circular' => false, | ||
]) | ||
<img | ||
src="{{ $src }}" | ||
{{ $attributes | ||
->class([ | ||
'object-cover object-center max-w-none', | ||
'rounded-full' => $circular, | ||
'rounded-md' => ! $circular, | ||
]) | ||
}} | ||
@class([ | ||
]) | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<x-filament::dropdown | ||
teleport | ||
:placement="$placement" | ||
:width="$isFlagsOnly ? 'flags-only' : 'fls-dropdown-width'" | ||
class="fi-dropdown fi-user-menu" | ||
> | ||
<x-slot name="trigger"> | ||
<div | ||
@class([ | ||
'flex items-center justify-center text-sm font-semibold w-9 h-9 language-switch-trigger text-primary-500 bg-primary-500/10', | ||
'rounded-full' => $isCircular, | ||
'rounded-lg' => !$isCircular, | ||
'p-1 ring-2 ring-inset ring-gray-200 hover:ring-gray-300 dark:ring-gray-500 hover:dark:ring-gray-400' => $isFlagsOnly || $hasFlags, | ||
]) | ||
@if ($isFlagsOnly || $hasFlags) | ||
x-tooltip="{ | ||
content: @js($languageSwitch->getLabel(app()->getLocale())), | ||
theme: $store.theme, | ||
arrowless: true, | ||
placement: 'right' | ||
}" | ||
@endif | ||
> | ||
@if ($isFlagsOnly || $hasFlags) | ||
<x-filament-language-switch::flag | ||
:src="$languageSwitch->getFlag(app()->getLocale())" | ||
:circular="$isCircular" | ||
:alt="$languageSwitch->getLabel(app()->getLocale())" | ||
/> | ||
@else | ||
<span>{{ $languageSwitch->getFlag(app()->getLocale()) }}</span> | ||
@endif | ||
</div> | ||
</x-slot> | ||
|
||
<x-filament::dropdown.list @class(['!border-t-0 space-y-1'])> | ||
@foreach ($locales as $locale) | ||
@if (!app()->isLocale($locale)) | ||
<button | ||
type="button" | ||
wire:click="changeLocale('{{ $locale }}')" | ||
@if ($isFlagsOnly) | ||
x-tooltip="{ | ||
content: @js($languageSwitch->getLabel($locale)), | ||
theme: $store.theme, | ||
arrowless: true, | ||
placement: 'right' | ||
}" | ||
@endif | ||
|
||
@class([ | ||
'flex items-center w-full px-2 py-0.5 text-sm transition-colors duration-75 rounded-md outline-none fi-dropdown-list-item whitespace-nowrap disabled:pointer-events-none disabled:opacity-70 fi-dropdown-list-item-color-gray hover:bg-gray-950/5 focus:bg-gray-950/5 dark:hover:bg-white/5 dark:focus:bg-white/5', | ||
'justify-center' => $isFlagsOnly, | ||
'justify-start space-x-1' => !$isFlagsOnly, | ||
]) | ||
> | ||
|
||
@if ($isFlagsOnly) | ||
<x-filament-language-switch::flag | ||
:src="$languageSwitch->getFlag($locale)" | ||
:circular="$isCircular" | ||
:alt="$languageSwitch->getLabel($locale)" | ||
/> | ||
@else | ||
@if ($hasFlags) | ||
<x-filament-language-switch::flag | ||
:src="$languageSwitch->getFlag($locale)" | ||
:circular="$isCircular" | ||
:alt="$languageSwitch->getLabel($locale)" | ||
class="p-1 !rounded-lg w-7 h-7" | ||
/> | ||
@else | ||
<span | ||
@class([ | ||
'flex items-center justify-center flex-shrink-0 w-6 h-6 p-4 text-xs font-semibold group-hover:bg-white group-hover:text-primary-600 group-hover:border group-hover:border-primary-500/10 group-focus:text-white bg-primary-500/10 text-primary-500', | ||
'rounded-full' => $isCircular, | ||
'rounded-lg' => !$isCircular, | ||
]) | ||
> | ||
{{ $languageSwitch->getFlag($locale) }} | ||
</span> | ||
@endif | ||
<span class="font-medium text-gray-700 hover:bg-transparent dark:text-gray-200"> | ||
{{ $languageSwitch->getLabel($locale) }} | ||
</span> | ||
|
||
@endif | ||
</button> | ||
@endif | ||
@endforeach | ||
</x-filament::dropdown.list> | ||
</x-filament::dropdown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BezhanSalleh\FilamentLanguageSwitch\Enums; | ||
|
||
enum Alignment: string | ||
{ | ||
case TopLeft = 'top-left'; | ||
|
||
case TopCenter = 'top-center'; | ||
|
||
case TopRight = 'top-right'; | ||
|
||
case BottomLeft = 'bottom-left'; | ||
|
||
case BottomCenter = 'bottom-center'; | ||
|
||
case BottomRight = 'bottom-right'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters