Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions resources/views/docs/mobile/4/edge-components/bottom-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ Per Material 3, the container color resolves from `theme.surface`. For a custom
```
@endverbatim

<aside>

Inline handlers like `@press="$showSheet = true"` work in Jump previews. In your own app, call a method instead:

```php
public bool $showSheet = false;

public function openSheet(): void { $this->showSheet = true; }
public function closeSheet(): void { $this->showSheet = false; }
```

@verbatim
```blade
<native:button label="Open" @press="openSheet" />
<native:bottom-sheet :visible="$showSheet" @dismiss="closeSheet">
```
@endverbatim

</aside>

## Props

- `visible` - Whether the sheet is shown (required, boolean)
Expand Down
20 changes: 20 additions & 0 deletions resources/views/docs/mobile/4/edge-components/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ Per Material 3, backdrop and surface colors come from `theme.background`. The cl
```
@endverbatim

<aside>

Inline handlers like `@press="$showDetails = true"` work in Jump previews. In your own app, call a method instead:

```php
public bool $showDetails = false;

public function openDetails(): void { $this->showDetails = true; }
public function closeDetails(): void { $this->showDetails = false; }
```

@verbatim
```blade
<native:button label="View details" @press="openDetails" />
<native:modal :visible="$showDetails" @dismiss="closeDetails">
```
@endverbatim

</aside>

## Props

- `visible` - Whether the modal is shown (required, boolean)
Expand Down
18 changes: 18 additions & 0 deletions tests/Feature/DocumentationRenderingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ public function layouts_page_shows_example_component_tag_literally_instead_of_co
->assertSee('<x-layouts.app>');
}

#[Test]
public function modal_and_bottom_sheet_pages_note_that_inline_handlers_only_work_in_jump(): void
{
$pages = [
'modal' => 'openDetails',
'bottom-sheet' => 'openSheet',
];

foreach ($pages as $page => $method) {
$this->withoutVite()
->get("/docs/mobile/4/edge-components/{$page}")
->assertOk()
->assertSee('work in Jump previews. In your own app, call a method instead', false)
->assertSee("public function {$method}(): void", false)
->assertSee("@press=&quot;{$method}&quot;", false);
}
}

#[Test]
public function every_documentation_page_renders_without_evaluating_example_variables(): void
{
Expand Down