-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: moved all spinners into button components
- Loading branch information
1 parent
3ad16ca
commit 0a1376a
Showing
14 changed files
with
78 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
@props(['centered' => false, 'iconOnly' => false]) | ||
@props(['centered' => false, 'iconOnly' => false, 'loadingText' => 'Loading...', 'action' => '']) | ||
|
||
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center ' . ($iconOnly ? 'px-3.5 py-2' : 'px-7 py-2.5') . ' bg-red-600 border border-transparent rounded-[0.70rem] font-semibold text-sm text-white hover:bg-red-500 active:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition ease-in-out duration-150' . ($centered ? ' justify-center w-full' : '')]) }}> | ||
{{ $slot }} | ||
<button | ||
{{ $attributes->merge([ | ||
'type' => 'submit', | ||
'class' => 'inline-flex items-center ' . | ||
($iconOnly ? 'px-3.5 py-2' : 'px-7 py-2.5') . | ||
' bg-red-600 border border-transparent rounded-[0.70rem] font-semibold text-sm text-white hover:bg-red-500 active:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition ease-in-out duration-150' . | ||
($centered ? ' justify-center w-full' : ''), | ||
'wire:loading.attr' => 'disabled', | ||
'wire:loading.class' => 'opacity-50 cursor-not-allowed', | ||
'wire:target' => $action | ||
]) }} | ||
> | ||
@if($action) | ||
<div wire:loading wire:target="{{ $action }}"> | ||
<x-spinner class="mr-2 text-white h-4 w-4 inline"/> | ||
{{ __($loadingText) }} | ||
</div> | ||
<div wire:loading.remove wire:target="{{ $action }}"> | ||
{{ $slot }} | ||
</div> | ||
@else | ||
{{ $slot }} | ||
@endif | ||
</button> |
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
@props(['centered' => false, 'iconOnly' => false, 'fat' => false]) | ||
@props(['centered' => false, 'iconOnly' => false, 'fat' => false, 'loading' => false, 'loadingText' => 'Saving...', 'action' => '']) | ||
|
||
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center ' . ($iconOnly ? 'px-3.5 py-2' : ($fat ? 'px-8 py-4 text-lg' : 'px-7 py-2.5')) . ' bg-primary-900 dark:bg-white dark:hover:bg-gray-200 dark:text-gray-900 border border-transparent rounded-[0.70rem] font-semibold text-sm text-white hover:bg-primary-950 focus:bg-primary-950 dark:focus:bg-white active:bg-primary-950 dark:active:bg-white focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2 transition ease-in-out duration-150' . ($centered ? ' justify-center w-full' : '')]) }}> | ||
{{ $slot }} | ||
<div wire:loading wire:target="{{ $action }}"> | ||
<x-spinner class="mr-2 text-white dark:text-gray-900 h-4 w-4 inline"/> | ||
{{ __($loadingText) }} | ||
</div> | ||
<div wire:loading.remove wire:target="{{ $action }}"> | ||
{{ $slot }} | ||
</div> | ||
</button> |
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
@props(['centered' => false, 'iconOnly' => false]) | ||
@props(['centered' => false, 'iconOnly' => false, 'loadingText' => 'Loading...', 'action' => '']) | ||
|
||
<button {{ $attributes->merge(['type' => 'button', 'class' => 'inline-flex items-center ' . ($iconOnly ? 'px-3 py-2' : 'px-7 py-2.5') . ' bg-gray-100/75 dark:bg-gray-800 dark:border-gray-600 border border-gray-400/25 rounded-[0.70rem] font-semibold text-sm text-gray-700 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 dark:focus:ring-gray-800 focus:ring-offset-2 disabled:opacity-25 transition ease-in-out duration-150' . ($centered ? ' justify-center w-full' : '')]) }}> | ||
{{ $slot }} | ||
<button | ||
{{ $attributes->merge([ | ||
'type' => 'button', | ||
'class' => 'inline-flex items-center ' . | ||
($iconOnly ? 'px-3 py-2' : 'px-7 py-2.5') . | ||
' bg-gray-100/75 dark:bg-gray-800 dark:border-gray-600 border border-gray-400/25 rounded-[0.70rem] font-semibold text-sm text-gray-700 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 dark:focus:ring-gray-800 focus:ring-offset-2 disabled:opacity-25 transition ease-in-out duration-150' . | ||
($centered ? ' justify-center w-full' : ''), | ||
'wire:loading.attr' => 'disabled', | ||
'wire:loading.class' => 'opacity-50 cursor-not-allowed', | ||
'wire:target' => $action | ||
]) }} | ||
> | ||
@if($action) | ||
<div wire:loading wire:target="{{ $action }}"> | ||
<x-spinner class="mr-2 text-gray-700 dark:text-gray-100 h-4 w-4 inline"/> | ||
{{ __($loadingText) }} | ||
</div> | ||
<div wire:loading.remove wire:target="{{ $action }}"> | ||
{{ $slot }} | ||
</div> | ||
@else | ||
{{ $slot }} | ||
@endif | ||
</button> |
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
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
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
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
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
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