generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lwb-16 Implement h3 sections component (#32)
* lwb-10 Implement address sections component * lwb-12 Implement footer sections component * lwb-13 Implement header sections component * lwb-14 Implement h1 sections component * lwb-15 Implement h2 sections component * lwb-16 Implement h3 sections component
- Loading branch information
Showing
4 changed files
with
172 additions
and
0 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,3 @@ | ||
<h3 {!! $globalAttributes !!}> | ||
{{ $slot }} | ||
</h3> |
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,41 @@ | ||
<?php | ||
|
||
namespace T73biz\LwBits\Components\Sections; | ||
|
||
use Illuminate\Contracts\Foundation\Application as ContractedApplication; | ||
use Illuminate\Contracts\View\Factory; | ||
use Illuminate\Contracts\View\View as ContractedView; | ||
use Illuminate\Foundation\Application; | ||
use Illuminate\View\View; | ||
use Livewire\Component; | ||
use T73biz\LwBits\Components\GlobalAttributesTrait; | ||
|
||
/** | ||
* Class H3 | ||
*/ | ||
class H3 extends Component | ||
{ | ||
use GlobalAttributesTrait; | ||
|
||
/** | ||
* Standard mount function | ||
*/ | ||
public function mount(): void | ||
{ | ||
$this->setGlobalAttributes(); | ||
} | ||
|
||
/** | ||
* Standard render function | ||
*/ | ||
public function render(): Application|ContractedApplication|ContractedView|Factory|View | ||
{ | ||
return view( | ||
'lw-bits::sections.h3', | ||
[ | ||
'globalAttributes' => $this->getGlobalAttributes(), | ||
'slot' => '', | ||
] | ||
); | ||
} | ||
} |
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,119 @@ | ||
<?php | ||
|
||
use Livewire\Livewire; | ||
use T73biz\LwBits\Tests\TestSupport\Components\Sections\MyH3; | ||
|
||
it('can render', function () { | ||
Livewire::test(MyH3::class) | ||
->assertStatus(200); | ||
}); | ||
|
||
it('can render with accesskey', function () { | ||
Livewire::test(MyH3::class, ['accessKey' => true]) | ||
->assertSee('accesskey'); | ||
}); | ||
|
||
it('can render with autocapitalize', function () { | ||
Livewire::test(MyH3::class, ['autoCapitalize' => true]) | ||
->assertSee('autocapitalize'); | ||
}); | ||
|
||
it('can render with autofocus', function () { | ||
Livewire::test(MyH3::class, ['autoFocus' => true]) | ||
->assertSee('autofocus'); | ||
}); | ||
|
||
it('can render with contenteditable', function () { | ||
Livewire::test(MyH3::class, ['contentEditable' => true]) | ||
->assertSee('contenteditable'); | ||
}); | ||
|
||
it('can render with css classes', function () { | ||
Livewire::test(MyH3::class, ['cssClasses' => ['class1', 'class2']]) | ||
->assertSee('class="class1 class2"', false); | ||
}); | ||
|
||
it('can render with data-*', function () { | ||
Livewire::test(MyH3::class, ['data' => ['name' => 'main-h3']]) | ||
->assertSee('data-name="main-h3"', false); | ||
}); | ||
|
||
it('can render with dir', function () { | ||
Livewire::test(MyH3::class, ['direction' => 'rtl']) | ||
->assertSee('dir="rtl"', false); | ||
}); | ||
|
||
it('can render with draggable', function () { | ||
Livewire::test(MyH3::class, ['draggable' => true]) | ||
->assertSee('draggable'); | ||
}); | ||
|
||
it('can render with enterkeyhint', function () { | ||
Livewire::test(MyH3::class, ['enterKeyHint' => 'enter']) | ||
->assertSee('enterkeyhint="enter"', false); | ||
}); | ||
|
||
it('can render with hidden', function () { | ||
Livewire::test(MyH3::class, ['hidden' => true]) | ||
->assertSee('hidden'); | ||
}); | ||
|
||
it('can render with id', function () { | ||
Livewire::test(MyH3::class, ['id' => 'main-h3']) | ||
->assertSee('id="main-h3"', false); | ||
}); | ||
|
||
it('can render with language', function () { | ||
Livewire::test(MyH3::class, ['language' => 'en']) | ||
->assertSee('lang="en"', false); | ||
}); | ||
|
||
it('can render with nonce', function () { | ||
Livewire::test(MyH3::class, ['nonce' => 'abc123']) | ||
->assertSee('nonce="abc123"', false); | ||
}); | ||
|
||
it('can render with parts', function () { | ||
Livewire::test(MyH3::class, ['parts' => ['part1', 'part2']]) | ||
->assertSee('part="part1 part2"', false); | ||
}); | ||
|
||
it('can render with popOver', function () { | ||
Livewire::test(MyH3::class, ['popOver' => true]) | ||
->assertSee('popover'); | ||
}); | ||
|
||
it('can render with role', function () { | ||
Livewire::test(MyH3::class, ['role' => 'main']) | ||
->assertSee('role="main"', false); | ||
}); | ||
|
||
it('can render with slot', function () { | ||
Livewire::test(MyH3::class, ['slotAttribute' => 'main-h3']) | ||
->assertSee('slot="main-h3"', false); | ||
}); | ||
|
||
it('can render with spellcheck', function () { | ||
Livewire::test(MyH3::class, ['spellCheck' => true]) | ||
->assertSee('spellcheck'); | ||
}); | ||
|
||
it('can render with styles', function () { | ||
Livewire::test(MyH3::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) | ||
->assertSee('style="color:red;font-size:16px"', false); | ||
}); | ||
|
||
it('can render with tabindex', function () { | ||
Livewire::test(MyH3::class, ['tabIndex' => 1]) | ||
->assertSee('tabindex="1"', false); | ||
}); | ||
|
||
it('can render with title', function () { | ||
Livewire::test(MyH3::class, ['title' => 'main-h3']) | ||
->assertSee('title="main-h3"', false); | ||
}); | ||
|
||
it('can render with translate', function () { | ||
Livewire::test(MyH3::class, ['translate' => true]) | ||
->assertSee('translate'); | ||
}); |
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,9 @@ | ||
<?php | ||
|
||
namespace T73biz\LwBits\Tests\TestSupport\Components\Sections; | ||
|
||
use T73biz\LwBits\Components\Sections\H3; | ||
|
||
class MyH3 extends H3 | ||
{ | ||
} |