-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from DissNik/releases-2.4
Releases 2.4
- Loading branch information
Showing
30 changed files
with
723 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
58 changes: 58 additions & 0 deletions
58
resources/views/pages/en/components/decoration_when.blade.php
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,58 @@ | ||
<x-page | ||
title="Component When" | ||
:sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
The <em>When</em> component allows you to display other components based on a condition. | ||
</x-p> | ||
|
||
<x-p> | ||
You can create <em>When</em> using the static <code>make()</code> method. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(Closure $condition, Closure $components, ?Closure $default = null) | ||
</x-code> | ||
|
||
<x-p> | ||
<ul> | ||
<li><code>$condition</code> - method execution condition;</li> | ||
<li><code>$components</code> - a closure that returns an array of elements when the condition is met;</li> | ||
<li><code>$default</code> - a closure that returns an array of default elements.</li> | ||
</ul> | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
namespace App\MoonShine; | ||
|
||
use MoonShine\Components\Layout\{LayoutBlock, LayoutBuilder, Menu, Profile, Sidebar}; | ||
use MoonShine\Components\When; // [tl! focus] | ||
use MoonShine\Contracts\MoonShineLayoutContract; | ||
|
||
final class MoonShineLayout implements MoonShineLayoutContract | ||
{ | ||
public static function build(): LayoutBuilder | ||
{ | ||
return LayoutBuilder::make([ | ||
Sidebar::make([ | ||
Menu::make()->customAttributes(['class' => 'mt-2']), | ||
When::make( | ||
static fn() => config('moonshine.auth.enable', true), | ||
static fn() => [Profile::make(withBorder: true)] | ||
) // [tl! focus:-3] | ||
]), | ||
|
||
//... | ||
]); | ||
} | ||
} | ||
</x-code> | ||
|
||
</x-page> |
59 changes: 59 additions & 0 deletions
59
resources/views/pages/en/components/system_profile.blade.php
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,59 @@ | ||
<x-page | ||
title="System component Profile" | ||
:sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
The <em>Profile</em> system component is used to display information about an authorized user in | ||
<strong>MoonShine</strong>. | ||
</x-p> | ||
|
||
<x-p> | ||
You can create a <em>Profile</em> using the static method <code>make()</code> | ||
class <code>Profile</code>. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(bool $withBorder = false) | ||
</x-code> | ||
|
||
<x-p> | ||
<code>$withBorder</code> - split before the component. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
namespace App\MoonShine; | ||
|
||
use MoonShine\Components\Layout\LayoutBlock; | ||
use MoonShine\Components\Layout\LayoutBuilder; | ||
use MoonShine\Components\Layout\Menu; | ||
use MoonShine\Components\Layout\Profile; // [tl! focus] | ||
use MoonShine\Components\Layout\Sidebar; | ||
use MoonShine\Contracts\MoonShineLayoutContract; | ||
|
||
final class MoonShineLayout implements MoonShineLayoutContract | ||
{ | ||
public static function build(): LayoutBuilder | ||
{ | ||
return LayoutBuilder::make([ | ||
Sidebar::make([ | ||
Menu::make()->customAttributes(['class' => 'mt-2']), | ||
Profile::make(withBorder: true) // [tl! focus] | ||
]), | ||
|
||
//... | ||
]); | ||
} | ||
} | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/profile.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/profile_dark.png') }}"></x-image> | ||
|
||
</x-page> |
58 changes: 58 additions & 0 deletions
58
resources/views/pages/en/components/system_sidebar.blade.php
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,58 @@ | ||
<x-page | ||
title="System component Sidebar" | ||
:sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
The <em>Sidebar</em> system component is used to create a side menu in <strong>MoonShine</strong>. | ||
</x-p> | ||
|
||
<x-p> | ||
You can create a <em>Sidebar</em> using the static <code>make()</code> method | ||
class <code>Sidebar</code>. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(array $components = []) | ||
</x-code> | ||
|
||
<x-p> | ||
The <code>make()</code> method takes an array of components as a parameter. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
namespace App\MoonShine; | ||
|
||
use MoonShine\Components\Layout\LayoutBlock; | ||
use MoonShine\Components\Layout\LayoutBuilder; | ||
use MoonShine\Components\Layout\Menu; | ||
use MoonShine\Components\Layout\Profile; | ||
use MoonShine\Components\Layout\Sidebar; // [tl! focus] | ||
use MoonShine\Contracts\MoonShineLayoutContract; | ||
|
||
final class MoonShineLayout implements MoonShineLayoutContract | ||
{ | ||
public static function build(): LayoutBuilder | ||
{ | ||
return LayoutBuilder::make([ | ||
Sidebar::make([ // [tl! focus] | ||
Menu::make()->customAttributes(['class' => 'mt-2']), | ||
Profile::make(withBorder: true) | ||
]), // [tl! focus] | ||
|
||
//... | ||
]); | ||
} | ||
} | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/sidebar.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/sidebar_dark.png') }}"></x-image> | ||
|
||
</x-page> |
99 changes: 99 additions & 0 deletions
99
resources/views/pages/en/components/system_top_bar.blade.php
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,99 @@ | ||
<x-page | ||
title="System component TopBar" | ||
:sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
['url' => '#actions', 'label' => 'Actions'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
The <em>TopBar</em> system component is used to create the top navigation bar in <strong>MoonShine</strong>. | ||
</x-p> | ||
|
||
<x-p> | ||
You can create a <em>TopBar</em> using the static <code>make()</code> method | ||
class <code>TopBar</code>. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(array $components = []) | ||
</x-code> | ||
|
||
<x-p> | ||
В качестве параметра метод <code>make()</code> принимает массив с компонентами. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
namespace App\MoonShine; | ||
|
||
use MoonShine\Components\Layout\LayoutBlock; | ||
use MoonShine\Components\Layout\LayoutBuilder; | ||
use MoonShine\Components\Layout\Menu; | ||
use MoonShine\Components\Layout\Profile; | ||
use MoonShine\Components\Layout\TopBar; // [tl! focus] | ||
use MoonShine\Contracts\MoonShineLayoutContract; | ||
|
||
final class MoonShineLayout implements MoonShineLayoutContract | ||
{ | ||
public static function build(): LayoutBuilder | ||
{ | ||
return LayoutBuilder::make([ | ||
TopBar::make([ // [tl! focus] | ||
Menu::make()->top() | ||
]), // [tl! focus] | ||
|
||
//... | ||
]); | ||
} | ||
} | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/topbar.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/topbar_dark.png') }}"></x-image> | ||
|
||
<x-sub-title id="actions">Actions</x-sub-title> | ||
|
||
<x-p> | ||
The <code>actions()</code> method of the <em>TopBar</em> component allows you to add additional elements to the areas | ||
<em>actions</em>. The method takes an array of components as a parameter. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
namespace App\MoonShine; | ||
|
||
use MoonShine\Components\Layout\LayoutBlock; | ||
use MoonShine\Components\Layout\LayoutBuilder; | ||
use MoonShine\Components\Layout\Menu; | ||
use MoonShine\Components\Layout\Profile; | ||
use MoonShine\Components\Layout\TopBar; | ||
use MoonShine\Contracts\MoonShineLayoutContract; | ||
|
||
final class MoonShineLayout implements MoonShineLayoutContract | ||
{ | ||
public static function build(): LayoutBuilder | ||
{ | ||
return LayoutBuilder::make([ | ||
TopBar::make([ | ||
Menu::make()->top(), | ||
]) | ||
->actions([ // [tl! focus:start] | ||
When::make( | ||
static fn() => config('moonshine.auth.enable', true), | ||
static fn() => [Profile::make()] | ||
) | ||
]), // [tl! focus:end] | ||
|
||
//... | ||
]); | ||
} | ||
} | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/topbar_actions.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/topbar_actions_dark.png') }}"></x-image> | ||
|
||
</x-page> |
Oops, something went wrong.