Skip to content

Commit 79275af

Browse files
authored
Merge pull request #23 from Mythetech/feat/app-context-drawer
Feat/app context drawer
2 parents 588f260 + 19f544f commit 79275af

File tree

15 files changed

+799
-8
lines changed

15 files changed

+799
-8
lines changed

Mythetech.Framework.Desktop/Mythetech.Framework.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<PackageId>Mythetech.Framework.Desktop</PackageId>
8-
<Version>0.6.0</Version>
8+
<Version>0.7.0</Version>
99
<Authors>Mythetech</Authors>
1010
<Description>Desktop-specific components for cross platform blazor applications</Description>
1111
<PackageTags>blazor;desktop;photino;components;ui;framework;cross-platform</PackageTags>
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
@using Mythetech.Framework.Components.AppContextDrawer
2+
@using MudBlazor
3+
@attribute [Stories("Components/AppContextDrawer")]
4+
5+
<Stories TComponent="AppContextDrawer">
6+
7+
<Story Name="Basic Usage" Layout="typeof(DefaultMudLayout)">
8+
<Template>
9+
<MudLayout Style="height: 500px; position: relative;">
10+
<MudDrawer @bind-Open="@_drawerOpen" Variant="DrawerVariant.Mini" Style="overflow: hidden;">
11+
<AppContextDrawer @bind-IsOpen="@_drawerOpen"
12+
@bind-ActivePanelId="@_activePanelId"
13+
ShowPluginPanels="false">
14+
<IconBarHeader>
15+
<MudIconButton Icon="@Icons.Material.Filled.Home" Color="Color.Primary" Class="my-2" />
16+
</IconBarHeader>
17+
18+
<PanelNavContent>
19+
<ContextPanelItem Id="files" Icon="@Icons.Material.Filled.Folder" Title="Files">
20+
<PanelContent>
21+
<MudStack Spacing="2">
22+
<MudText Typo="Typo.body1">File Explorer</MudText>
23+
<MudTreeView T="string" Hover="true">
24+
<MudTreeViewItem Value="@("src")" Icon="@Icons.Material.Filled.Folder">
25+
<MudTreeViewItem Value="@("components")" Icon="@Icons.Material.Filled.Folder" />
26+
<MudTreeViewItem Value="@("pages")" Icon="@Icons.Material.Filled.Folder" />
27+
</MudTreeViewItem>
28+
<MudTreeViewItem Value="@("tests")" Icon="@Icons.Material.Filled.Folder" />
29+
</MudTreeView>
30+
</MudStack>
31+
</PanelContent>
32+
</ContextPanelItem>
33+
34+
<ContextPanelItem Id="search" Icon="@Icons.Material.Filled.Search" Title="Search">
35+
<PanelContent>
36+
<MudStack Spacing="2">
37+
<MudTextField T="string" Label="Search" Variant="Variant.Outlined" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" />
38+
<MudText Typo="Typo.body2" Class="mud-text-secondary">Enter a search term to find files</MudText>
39+
</MudStack>
40+
</PanelContent>
41+
</ContextPanelItem>
42+
43+
<ContextPanelItem Id="git" Icon="@Icons.Custom.Brands.GitHub" Title="Source Control" BadgeColor="Color.Warning">
44+
<PanelContent>
45+
<MudStack Spacing="2">
46+
<MudText Typo="Typo.body1">Source Control</MudText>
47+
<MudAlert Severity="Severity.Warning" Dense="true">3 uncommitted changes</MudAlert>
48+
<MudList T="string" Dense="true">
49+
<MudListItem Icon="@Icons.Material.Filled.Add" IconColor="Color.Success">new-file.cs</MudListItem>
50+
<MudListItem Icon="@Icons.Material.Filled.Edit" IconColor="Color.Warning">modified.cs</MudListItem>
51+
<MudListItem Icon="@Icons.Material.Filled.Delete" IconColor="Color.Error">deleted.cs</MudListItem>
52+
</MudList>
53+
</MudStack>
54+
</PanelContent>
55+
</ContextPanelItem>
56+
</PanelNavContent>
57+
58+
<PanelFooterContent>
59+
<MudIconButton Icon="@Icons.Material.Filled.Settings" Color="Color.Default" Class="mb-2" />
60+
</PanelFooterContent>
61+
</AppContextDrawer>
62+
</MudDrawer>
63+
64+
<MudMainContent Style="padding: 16px;">
65+
<MudStack Spacing="2">
66+
<MudText Typo="Typo.h5">Main Content Area</MudText>
67+
<MudText Typo="Typo.body1">Click the icons in the side panel to expand different sections.</MudText>
68+
<MudText Typo="Typo.body2" Class="mud-text-secondary">
69+
Active Panel: @(_activePanelId ?? "None") | Drawer Open: @_drawerOpen
70+
</MudText>
71+
</MudStack>
72+
</MudMainContent>
73+
</MudLayout>
74+
</Template>
75+
</Story>
76+
77+
<Story Name="With Badges" Layout="typeof(DefaultMudLayout)">
78+
<Template>
79+
<MudLayout Style="height: 400px; position: relative;">
80+
<MudDrawer Open="true" Variant="DrawerVariant.Mini" Style="overflow: hidden;">
81+
<AppContextDrawer IsOpen="true"
82+
ActivePanelId="notifications"
83+
ShowPluginPanels="false">
84+
<PanelNavContent>
85+
<ContextPanelItem Id="notifications" Icon="@Icons.Material.Filled.Notifications" Title="Notifications" BadgeColor="Color.Error">
86+
<PanelContent>
87+
<MudStack Spacing="2">
88+
<MudText Typo="Typo.body1">Notifications</MudText>
89+
<MudAlert Severity="Severity.Error" Dense="true">5 new alerts</MudAlert>
90+
</MudStack>
91+
</PanelContent>
92+
</ContextPanelItem>
93+
94+
<ContextPanelItem Id="status" Icon="@Icons.Material.Filled.Circle" Title="Status" BadgeColor="Color.Success">
95+
<PanelContent>
96+
<MudText Typo="Typo.body1">All systems operational</MudText>
97+
</PanelContent>
98+
</ContextPanelItem>
99+
100+
<ContextPanelItem Id="sync" Icon="@Icons.Material.Filled.Sync" Title="Sync" BadgeColor="Color.Warning">
101+
<PanelContent>
102+
<MudText Typo="Typo.body1">Syncing...</MudText>
103+
<MudProgressLinear Indeterminate="true" Color="Color.Warning" />
104+
</PanelContent>
105+
</ContextPanelItem>
106+
</PanelNavContent>
107+
</AppContextDrawer>
108+
</MudDrawer>
109+
110+
<MudMainContent Style="padding: 16px;">
111+
<MudText>Badge colors indicate status: Success (green), Warning (yellow), Error (red)</MudText>
112+
</MudMainContent>
113+
</MudLayout>
114+
</Template>
115+
</Story>
116+
117+
</Stories>
118+
119+
@code {
120+
private bool _drawerOpen = true;
121+
private string? _activePanelId = "files";
122+
}

Mythetech.Framework.Test/Components/VirtualizeContainer/VirtualizeContainerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.AspNetCore.Components;
33
using MudBlazor.Services;
44
using Mythetech.Framework.Components;
5+
using Mythetech.Framework.Components.Enums;
56
using Mythetech.Framework.Components.VirtualizeContainer;
67
using Shouldly;
78

Mythetech.Framework.WebAssembly/Mythetech.Framework.WebAssembly.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<PackageId>Mythetech.Framework.WebAssembly</PackageId>
8-
<Version>0.6.0</Version>
8+
<Version>0.7.0</Version>
99
<Authors>Mythetech</Authors>
1010
<Description>WebAssembly-specific components for building blazor applications</Description>
1111
<PackageTags>blazor;wasm;webassembly;components;ui;framework</PackageTags>

0 commit comments

Comments
 (0)