This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a113fd
commit 1578e71
Showing
13 changed files
with
204 additions
and
35 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
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
24 changes: 24 additions & 0 deletions
24
resources/views/tailwind-forms-simple/form-checkbox.blade.php
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,24 @@ | ||
<div class="flex flex-col"> | ||
<label class="flex items-center"> | ||
<input {!! $attributes->merge(['class' => 'rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50']) !!} | ||
type="checkbox" | ||
value="{{ $value }}" | ||
|
||
@if($isWired()) | ||
wire:model{!! $wireModifier() !!}="{{ $name }}" | ||
@endif | ||
|
||
name="{{ $name }}" | ||
|
||
@if($checked) | ||
checked="checked" | ||
@endif | ||
/> | ||
|
||
<span class="ml-2">{{ $label }}</span> | ||
</label> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
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,5 @@ | ||
@error($name, $bag) | ||
<p {!! $attributes->merge(['class' => 'mt-2 text-sm text-red-600']) !!}> | ||
{{ $message }} | ||
</p> | ||
@enderror |
11 changes: 11 additions & 0 deletions
11
resources/views/tailwind-forms-simple/form-group.blade.php
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,11 @@ | ||
<div {!! $attributes->merge(['class' => 'mt-4']) !!}> | ||
<x-form-label :label="$label" /> | ||
|
||
<div class="@if($label) mt-2 @endif @if($inline) flex flex-wrap space-x-6 @endif"> | ||
{!! $slot !!} | ||
</div> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
21 changes: 21 additions & 0 deletions
21
resources/views/tailwind-forms-simple/form-input.blade.php
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,21 @@ | ||
<div class="@if($type === 'hidden') hidden @else mt-4 @endif"> | ||
<label class="block"> | ||
<x-form-label :label="$label" /> | ||
|
||
<input {!! $attributes->merge([ | ||
'class' => 'block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 ' . ($label ? 'mt-1' : '') | ||
]) !!} | ||
@if($isWired()) | ||
wire:model{!! $wireModifier() !!}="{{ $name }}" | ||
@else | ||
value="{{ $value }}" | ||
@endif | ||
|
||
name="{{ $name }}" | ||
type="{{ $type }}" /> | ||
</label> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
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,3 @@ | ||
@if($label) | ||
<span {!! $attributes->merge(['class' => 'text-gray-700']) !!}>{{ $label }}</span> | ||
@endif |
24 changes: 24 additions & 0 deletions
24
resources/views/tailwind-forms-simple/form-radio.blade.php
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,24 @@ | ||
<div> | ||
<label class="inline-flex items-center"> | ||
<input {!! $attributes->merge(['class' => 'rounded-full border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50']) !!} | ||
type="radio" | ||
|
||
@if($isWired()) | ||
wire:model{!! $wireModifier() !!}="{{ $name }}" | ||
@endif | ||
|
||
name="{{ $name }}" | ||
value="{{ $value }}" | ||
|
||
@if($checked) | ||
checked="checked" | ||
@endif | ||
/> | ||
|
||
<span class="ml-2">{{ $label }}</span> | ||
</label> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
43 changes: 43 additions & 0 deletions
43
resources/views/tailwind-forms-simple/form-select.blade.php
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,43 @@ | ||
<div class="mt-4"> | ||
<label class="block"> | ||
<x-form-label :label="$label" /> | ||
|
||
<select | ||
@if($isWired()) | ||
wire:model{!! $wireModifier() !!}="{{ $name }}" | ||
@endif | ||
|
||
name="{{ $name }}" | ||
|
||
@if($multiple) | ||
multiple | ||
@endif | ||
|
||
@if($placeholder) | ||
placeholder="{{ $placeholder }}" | ||
@endif | ||
|
||
{!! $attributes->merge([ | ||
'class' => ($label ? 'mt-1 ' : '') . 'block w-full mt-1 rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50' | ||
]) !!}> | ||
|
||
@if($placeholder) | ||
<option value="" disabled @if($nothingSelected()) selected="selected" @endif> | ||
{{ $placeholder }} | ||
</option> | ||
@endif | ||
|
||
@forelse($options as $key => $option) | ||
<option value="{{ $key }}" @if($isSelected($key)) selected="selected" @endif> | ||
{{ $option }} | ||
</option> | ||
@empty | ||
{!! $slot !!} | ||
@endforelse | ||
</select> | ||
</label> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
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,8 @@ | ||
<div class="mt-6 flex items-center justify-between"> | ||
<button {!! $attributes->merge([ | ||
'class' => 'inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition', | ||
'type' => 'submit' | ||
]) !!}> | ||
{!! trim($slot) ?: __('Submit') !!} | ||
</button> | ||
</div> |
19 changes: 19 additions & 0 deletions
19
resources/views/tailwind-forms-simple/form-textarea.blade.php
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,19 @@ | ||
<div class="mt-4"> | ||
<label class="block"> | ||
<x-form-label :label="$label" /> | ||
|
||
<textarea | ||
@if($isWired()) | ||
wire:model{!! $wireModifier() !!}="{{ $name }}" | ||
@endif | ||
|
||
name="{{ $name }}" | ||
|
||
{!! $attributes->merge(['class' => 'block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50' . ($label ? ' mt-1' : '')]) !!} | ||
>@unless($isWired()){!! $value !!}@endunless</textarea> | ||
</label> | ||
|
||
@if($hasErrorAndShow($name)) | ||
<x-form-errors :name="$name" /> | ||
@endif | ||
</div> |
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,11 @@ | ||
<form method="{{ $spoofMethod ? 'POST' : $method }}" {!! $attributes !!}> | ||
@unless(in_array($method, ['HEAD', 'GET', 'OPTIONS'])) | ||
@csrf | ||
@endunless | ||
|
||
@if($spoofMethod) | ||
@method($method) | ||
@endif | ||
|
||
{!! $slot !!} | ||
</form> |