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 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Tailwind v2.0 with Tailwind Forms (#26)
* Added support for Tailwind v2.0 with Tailwind Forms * Move to GA
- Loading branch information
1 parent
c7292e8
commit b642e4d
Showing
15 changed files
with
222 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: run-tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: [7.4] | ||
laravel: [8.*, 7.*] | ||
framework: [tailwind, tailwind-2, bootstrap-4] | ||
dependency-version: [prefer-lowest, prefer-stable] | ||
include: | ||
- laravel: 8.* | ||
testbench: 6.* | ||
livewire: ^2.0 | ||
- laravel: 7.* | ||
testbench: 5.* | ||
livewire: ^1.3.2 | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.framework }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/files | ||
key: dependencies-laravel-${{ matrix.laravel }}-livewire-${{ matrix.livewire }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "laravel/framework:${{ matrix.laravel }}" "livewire/livewire:${{ matrix.livewire }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest | ||
- name: Execute tests | ||
env: | ||
FORM_COMPONENTS_FRAMEWORK: ${{ matrix.framework }} | ||
run: vendor/bin/phpunit |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,24 @@ | ||
<div class="flex flex-col"> | ||
<label class="flex items-center"> | ||
<input {!! $attributes !!} | ||
type="checkbox" | ||
value="{{ $value }}" | ||
|
||
@if($isWired()) | ||
wire:model="{{ $name }}" | ||
@else | ||
name="{{ $name }}" | ||
@endif | ||
|
||
@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' => 'text-red-500 text-xs italic']) !!}> | ||
{{ $message }} | ||
</p> | ||
@enderror |
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> |
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 ' . ($label ? 'mt-1' : '') | ||
]) !!} | ||
@if($isWired()) | ||
wire:model="{{ $name }}" | ||
@else | ||
name="{{ $name }}" | ||
value="{{ $value }}" | ||
@endif | ||
|
||
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 |
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,25 @@ | ||
<div> | ||
<label class="inline-flex items-center"> | ||
<input {!! $attributes !!} | ||
type="radio" | ||
|
||
@if($isWired()) | ||
wire:model="{{ $name }}" | ||
@else | ||
name="{{ $name }}" | ||
@endif | ||
|
||
value="{{ $value }}" | ||
|
||
@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,32 @@ | ||
<div class="mt-4"> | ||
<label class="block"> | ||
<x-form-label :label="$label" /> | ||
|
||
<select | ||
@if($isWired()) | ||
wire:model="{{ $name }}" | ||
@else | ||
name="{{ $name }}" | ||
@endif | ||
|
||
@if($multiple) | ||
multiple | ||
@endif | ||
|
||
{!! $attributes->merge([ | ||
'class' => ($label ? 'mt-1' : '') . ' block w-full' | ||
]) !!}> | ||
@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' => 'bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 focus:outline-none focus:shadow-outline', | ||
'type' => 'submit' | ||
]) !!}> | ||
{!! trim($slot) ?: __('Submit') !!} | ||
</button> | ||
</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,19 @@ | ||
<div class="mt-4"> | ||
<label class="block"> | ||
<x-form-label :label="$label" /> | ||
|
||
<textarea | ||
@if($isWired()) | ||
wire:model="{{ $name }}" | ||
@else | ||
name="{{ $name }}" | ||
@endif | ||
|
||
{!! $attributes->merge(['class' => 'block w-full ' . ($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> |