Skip to content

Commit 8480196

Browse files
committed
add doc for password input
1 parent 3c6e1ca commit 8480196

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Documentation;
4+
5+
use App\View\Components\Layouts\Documentation;
6+
use Illuminate\Contracts\View\View;
7+
use Livewire\Component;
8+
9+
class PasswordInput extends Component
10+
{
11+
public string $passwordExample = <<<HTML
12+
<x-inputs.password label="Secret 🙈" value="I love WireUI ❤️" />
13+
HTML;
14+
15+
public function render(): View
16+
{
17+
return view('livewire.documentation.password-input')->layout(Documentation::class);
18+
}
19+
}

app/View/Components/Layouts/Documentation.php

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function getSidebarMenu(): array
3434
'label' => 'Inputs',
3535
'route' => route('docs.inputs'),
3636
],
37+
[
38+
'label' => 'Password Input',
39+
'route' => route('docs.inputs.password'),
40+
],
3741
[
3842
'label' => 'Textarea',
3943
'route' => route('docs.textarea'),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="space-y-10">
2+
<x-slot name="summary">
3+
<x-summary>
4+
<x-summary.header href="#inputs" label="Password Inputs">
5+
<x-summary.item href="#password-input" label="Password Input" />
6+
</x-summary.header>
7+
8+
<x-summary.header href="#input-options" label="Inputs Options" />
9+
</x-summary>
10+
</x-slot>
11+
12+
<div>
13+
<x-section.title id="inputs" title="Password Input" />
14+
15+
<div class="mt-5 prose text-gray-500 xl:max-w-4xl xl:mb-8 dark:text-gray-400">
16+
This component will add an toggle button to see/hide the password value
17+
</div>
18+
</div>
19+
20+
<div class="space-y-4">
21+
<x-code-preview
22+
title="Password Input"
23+
href="#password-input"
24+
id="password-input"
25+
language="blade"
26+
:code="$passwordExample">
27+
<div class="max-w-sm mx-auto">
28+
<x-inputs.password label="Secret 🙈" value="I love WireUI ❤️" />
29+
</div>
30+
</x-code-preview>
31+
</div>
32+
33+
<div id="input-options">
34+
<x-section.title href="#input-options" title="Input Options" />
35+
36+
<div class="mt-5 prose xl:max-w-3xl xl:mb-8 text-gray-500">
37+
<p>
38+
The phone input accepts all
39+
<a class="dark:text-secondary-500" href="{{ route('docs.inputs') }}#input-options">input</a>
40+
options and slots
41+
</p>
42+
</div>
43+
</div>
44+
</div>

routes/web.php

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Route::get('notifications', Documentation\Notifications::class)->name('notifications');
2626
Route::get('hooks', Documentation\Hooks::class)->name('hooks');
2727
Route::get('inputs', Documentation\Inputs::class)->name('inputs');
28+
Route::get('inputs-password', Documentation\PasswordInput::class)->name('inputs.password');
2829
Route::get('errors', Documentation\Errors::class)->name('errors');
2930
Route::get('maskable-inputs', Documentation\MaskableInput::class)->name('maskable-inputs');
3031
Route::get('phone-input', Documentation\PhoneInput::class)->name('phone-input');

0 commit comments

Comments
 (0)