Skip to content

Commit

Permalink
Merge pull request #37 from tallstackui/1.35.0
Browse files Browse the repository at this point in the history
1.35.0
  • Loading branch information
devajmeireles authored Aug 14, 2024
2 parents c9f5d85 + 0c38b67 commit d4ae9dd
Show file tree
Hide file tree
Showing 14 changed files with 367 additions and 77 deletions.
29 changes: 29 additions & 0 deletions app/Enums/Examples/Ui/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,35 @@ public function save()
}
HTML;

public const CONTROLLERS = <<<'HTML'
use Illuminate\Http\Request;
use TallStackUi\Traits\Interactions;
class PaymentController extends Controller
{
use Interactions; // [tl! highlight]
public function index()
{
return view('payment.index', [
//
]);
}
public function update(Request $request)
{
// ...
$this->banner() // [tl! highlight:5]
->success('...')
->close()
->enter(seconds: 3)
->leave(seconds: 10)
->send();
}
}
HTML;

public const PERSONALIZATION = <<<'HTML'
TallStackUi::personalize()
->banner()
Expand Down
74 changes: 74 additions & 0 deletions app/Enums/Examples/Ui/Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,54 @@ public function save(): void
</div>
HTML;

public const HOOKS = <<<'HTML'
public function save(): void
{
$this->dialog()
->success('...')
->hooks([
// When using `success()`, `error()`, `warning()`, `info()` and pressing the OK button.
'ok' => [
'method' => 'method',
// The parameters can be anything you want: arrays, strings, int.
'params' => ['param1', 'param2']
],
// When close the dialog by clicking on the "x" button.
'close' => [
'method' => 'method',
'params' => ['param1', 'param2']
],
// When close the dialog by dismiss (clicking out of the dialog).
'dismiss' => [
'method' => 'method',
'params' => ['param1', 'param2']
],
])
->send();
}
HTML;

public const HOOKS_CALLABLE = <<<'HTML'
public function save(): void
{
$this->dialog()
->success('...')
->hooks([
'ok' => [
'method' => 'method',
'params' => fn () => ['param1', 'param2'] // [tl! highlight]
],
'dismiss' => [
'method' => 'method',
'params' => function () { // [tl! highlight:2]
return ['param1', 'param2'];
}
],
])
->send();
}
HTML;

public const JAVASCRIPT = <<<'HTML'
<div>
<x-button color="green" onclick="show()">Success</x-button>
Expand Down Expand Up @@ -189,6 +237,32 @@ public function save()
}
HTML;

public const CONTROLLERS = <<<'HTML'
use Illuminate\Http\Request;
use TallStackUi\Traits\Interactions;
class PaymentController extends Controller
{
use Interactions; // [tl! highlight]
public function index()
{
return view('payment.index', [
//
]);
}
public function update(Request $request)
{
// ...
$this->dialog() // [tl! highlight:2]
->success('...')
->send();
}
}
HTML;

public const PERSONALIZATION = <<<'HTML'
TallStackUi::personalize()
->dialog()
Expand Down
8 changes: 8 additions & 0 deletions app/Enums/Examples/Ui/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ class Stats
<x-stats href="https://tallstackui.com" target="_blank" :number="100" />
HTML;

public const NAVIGATE = <<<'HTML'
<!-- <a href="https://tallstackui.com" wire:navigate ...> -->
<x-stats href="https://tallstackui.com" target="_blank" :number="100" navigate />
<!-- <a href="https://tallstackui.com" wire:navigate.hover ...> -->
<x-stats href="https://tallstackui.com" target="_blank" :number="100" navigate-nover />
HTML;

public const ICONS = <<<'HTML'
<x-stats icon="swatch" :number="100" />
<x-stats icon="swatch" :number="100" light />
Expand Down
17 changes: 17 additions & 0 deletions app/Enums/Examples/Ui/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ class Tab
</x-tab>
HTML;

public const EVENTS = <<<'HTML'
<x-tab selected="Invoices" x-on:navigate="alert($event.detail.select)">
<x-tab.items tab="Invoices">
<x-slot:right>
<x-icon name="document-text" class="w-5 h-5" />
</x-slot:right>
Invoices
</x-tab.items>
<x-tab.items tab="Transactions">
<x-slot:left>
<x-icon name="currency-dollar" class="w-5 h-5" />
</x-slot:left>
Transactions
</x-tab.items>
</x-tab>
HTML;

public const WIREABLE = <<<'HTML'
<!-- Livewire string property: $tab - initial value: "Tab 1" -->
Expand Down
69 changes: 69 additions & 0 deletions app/Enums/Examples/Ui/Toast.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,49 @@ public function save(): void
</div>
HTML;

public const HOOKS = <<<'HTML'
public function save(): void
{
$this->toast()
->success('...')
->hooks([
// When close the toast by clicking on the "x" button.
'close' => [
'method' => 'method',
// The parameters can be anything you want: arrays, strings, int.
'params' => ['param1', 'param2']
],
// When the toast is automatically closed by the timeout.
'timeout' => [
'method' => 'method',
'params' => ['param1', 'param2']
],
])
->send();
}
HTML;

public const HOOKS_CALLABLE = <<<'HTML'
public function save(): void
{
$this->toast()
->success('...')
->hooks([
'close' => [
'method' => 'method',
'params' => fn () => ['param1', 'param2'] // [tl! highlight]
],
'timeout' => [
'method' => 'method',
'params' => function () { // [tl! highlight:2]
return ['param1', 'param2'];
}
],
])
->send();
}
HTML;

public const JAVASCRIPT = <<<'HTML'
<div>
<x-button color="green" onclick="show()">Success</x-button>
Expand Down Expand Up @@ -226,6 +269,32 @@ public function save()
}
HTML;

public const CONTROLLERS = <<<'HTML'
use Illuminate\Http\Request;
use TallStackUi\Traits\Interactions;
class PaymentController extends Controller
{
use Interactions; // [tl! highlight]
public function index()
{
return view('payment.index', [
//
]);
}
public function update(Request $request)
{
// ...
$this->toast() // [tl! highlight:2]
->success('...')
->send();
}
}
HTML;

public const PERSONALIZATION = <<<'HTML'
TallStackUi::personalize()
->toast()
Expand Down
Loading

0 comments on commit d4ae9dd

Please sign in to comment.