From 62cfaada73f9aee39667a35433c51f25ff06e8c5 Mon Sep 17 00:00:00 2001 From: russkyc Date: Wed, 1 Jan 2025 18:32:43 +0800 Subject: [PATCH] :sparkles: Add overview pages, improve web gallery splash, add installation guide, add pills documentation --- .github/resources/images/nuget-button.svg | 61 +++++++++ Directory.Packages.props | 3 +- README.md | 69 ++++++++-- .../wwwroot/app.css | 32 ++--- .../wwwroot/index.html | 20 ++- .../ViewModels/MainViewModel.cs | 30 +---- .../Views/MainView.axaml | 10 +- .../Views/Pages/ExamplesView.axaml | 11 ++ .../Views/Pages/ExamplesView.axaml.cs | 13 ++ .../Views/Pages/InstallationView.axaml | 58 ++++++++ .../Views/Pages/InstallationView.axaml.cs | 35 +++++ .../Views/Pages/IntroductionView.axaml | 39 ++++++ .../Views/Pages/IntroductionView.axaml.cs | 11 ++ .../Views/Pages/PillView.axaml | 62 +++++++++ .../Views/Pages/PillView.axaml.cs | 37 ++++++ .../Views/Pages/ThemingView.axaml | 11 ++ .../Views/Pages/ThemingView.axaml.cs | 11 ++ .../Views/Sidebar.axaml | 125 ++++++++++++++++-- Russkyc.UI.Avalonia/Base.axaml | 5 +- Russkyc.UI.Avalonia/Controls.axaml | 2 +- Russkyc.UI.Avalonia/Controls/Border.axaml | 94 ++++++++++--- Russkyc.UI.Avalonia/PackageIcon.png | Bin 0 -> 11720 bytes Russkyc.UI.Avalonia/README.md | 44 ++++++ .../Russkyc.UI.Avalonia.csproj | 26 +++- Russkyc.UI.Avalonia/Themes/Zinc.axaml | 1 - 25 files changed, 704 insertions(+), 106 deletions(-) create mode 100644 .github/resources/images/nuget-button.svg create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml.cs create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml.cs create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml.cs create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml.cs create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml create mode 100644 Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml.cs create mode 100644 Russkyc.UI.Avalonia/PackageIcon.png create mode 100644 Russkyc.UI.Avalonia/README.md diff --git a/.github/resources/images/nuget-button.svg b/.github/resources/images/nuget-button.svg new file mode 100644 index 0000000..909ab04 --- /dev/null +++ b/.github/resources/images/nuget-button.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + + + nstall or Download + + + + + + + + + + + + + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props index 4e9ac78..d79624e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,8 +7,7 @@ - - + diff --git a/README.md b/README.md index d6458fe..0d2e77f 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,35 @@ Russkyc.UI.Avalonia provides clean, beautifully-designed, and customizable components inspired by the design of shadcn/ui for Avalonia applications.

-## Installation +## Installation (Pre-release) #### 1. Download +The package can be downloaded installed by the Nuget package manager UI, +Package Reference, Nuget CLI, Package manager, and other Nuget supported +channels. -> [!WARNING] -> Russkyc.UI.Avalonia is in early development stage and currently has no available nuget packages +
+
+ + Nuget + +
+
+ +PackageReference +``` + +``` + +Nuget CLI +``` +dotnet add package Russkyc.UI.Avalonia --version 0.1.0-pre +``` + +Package Manager +``` +NuGet\Install-Package Russkyc.UI.Avalonia -Version 0.1.0-pre +``` #### 2. Configuration @@ -60,25 +83,26 @@ All components use the defaults and theme provided in this template. ```xaml - + 5 1 - 2 + 1 12,7 - + 36 + - + - + #FFFFFF #000000 #FFFFFF #000000 #FFFFFF #000000 - #18181b + #18181b #FAFAFA - #f4f4f5 + #f4f4f5 #18181B #F4F4F5 #71717A @@ -95,18 +119,18 @@ All components use the defaults and theme provided in this template. #06000000 #12000000 - + - + #09090B #FAFAFA #09090B #FAFAFA #09090B #FAFAFA - #FAFAFA + #FAFAFA #18181B - #27272A + #27272A #FAFAFA #27272A #A1A1AA @@ -127,6 +151,23 @@ All components use the defaults and theme provided in this template. ``` +Which will now replace the default theme in `App.axaml` + +```xaml + + + + + + + + + + + +``` + + ## License This project is licensed under the [MIT License](LICENSE.md) diff --git a/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/app.css b/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/app.css index 01f9851..75f0036 100644 --- a/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/app.css +++ b/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/app.css @@ -10,24 +10,24 @@ pointer-events: none; } -@media (prefers-color-scheme: light) { - html, body { - background: white; - } - .avalonia-splash { - background: white; - color: black; - } +html, body { + background: white; } -@media (prefers-color-scheme: dark) { - html, body { - background: black; - } - .avalonia-splash { - background: black; - color: white; - } +.avalonia-splash a { + color: #101010; +} + +.avalonia-splash h4 { + font-weight: 400; +} + +.avalonia-splash { + background: white; + color: black; + display: flex; + flex-direction: column; + flex-wrap: nowrap; } .avalonia-splash.splash-close { diff --git a/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/index.html b/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/index.html index 9625cc0..5cb515a 100644 --- a/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/index.html +++ b/Russkyc.UI.Avalonia.Gallery.Browser/wwwroot/index.html @@ -11,9 +11,23 @@
-

- Powered by Russkyc.UI.Avalonia -

+ + + + + + + + + + + + + + +

+ Powered by Avalonia, Styled by Russkyc.UI.Avalonia +

diff --git a/Russkyc.UI.Avalonia.Gallery/ViewModels/MainViewModel.cs b/Russkyc.UI.Avalonia.Gallery/ViewModels/MainViewModel.cs index b74c82a..39661bf 100644 --- a/Russkyc.UI.Avalonia.Gallery/ViewModels/MainViewModel.cs +++ b/Russkyc.UI.Avalonia.Gallery/ViewModels/MainViewModel.cs @@ -1,40 +1,16 @@ -using System.Collections.Generic; -using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using Russkyc.UI.Avalonia.Gallery.Views.Pages; namespace Russkyc.UI.Avalonia.Gallery.ViewModels; public partial class MainViewModel : ViewModelBase { - private List _pages; - - [ObservableProperty] - private int _activePageIndex; - [ObservableProperty] private object _activePage; - public MainViewModel() - { - _pages = [ - new ButtonView(), - new ToggleButtonView(), - new ToggleSwitchView(), - new RadioButtonView(), - new TextBoxView(), - new ComboBoxView(), - new CardView() - ]; - - ActivePageIndex = 0; - ActivePage = _pages[0]; - } - [RelayCommand] - void OpenPage(int pageIndex) + void OpenPage(object page) { - ActivePage = _pages[pageIndex]; - ActivePageIndex = pageIndex; + ActivePage = page; } } \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/MainView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/MainView.axaml index 1dc67be..6e018c9 100644 --- a/Russkyc.UI.Avalonia.Gallery/Views/MainView.axaml +++ b/Russkyc.UI.Avalonia.Gallery/Views/MainView.axaml @@ -13,19 +13,15 @@ - - - - + + + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml new file mode 100644 index 0000000..2f1224c --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml @@ -0,0 +1,11 @@ + + Welcome to Avalonia! + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml.cs b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml.cs new file mode 100644 index 0000000..9055033 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ExamplesView.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Russkyc.UI.Avalonia.Gallery.Views.Pages; + +public partial class ExamplesView : UserControl +{ + public ExamplesView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml new file mode 100644 index 0000000..99dd1f5 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml.cs b/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml.cs new file mode 100644 index 0000000..7bed42c --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/InstallationView.axaml.cs @@ -0,0 +1,35 @@ +using Avalonia.Controls; + +namespace Russkyc.UI.Avalonia.Gallery.Views.Pages; + +public partial class InstallationView : UserControl +{ + public InstallationView() + { + InitializeComponent(); + ConfigurationBlock.Text = """ + + + + + + + + + + + + + + + + + + + """; + } +} \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml new file mode 100644 index 0000000..b933572 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml.cs b/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml.cs new file mode 100644 index 0000000..a832a02 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/IntroductionView.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace Russkyc.UI.Avalonia.Gallery.Views.Pages; + +public partial class IntroductionView : UserControl +{ + public IntroductionView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml new file mode 100644 index 0000000..3acc413 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml.cs b/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml.cs new file mode 100644 index 0000000..2d3c8c9 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/PillView.axaml.cs @@ -0,0 +1,37 @@ +using Avalonia.Controls; + +namespace Russkyc.UI.Avalonia.Gallery.Views.Pages; + +public partial class PillView : UserControl +{ + public PillView() + { + InitializeComponent(); + CodeBlock.Text = """ + + + + + + + + + + + + + + + + + + + + """; + } +} \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml new file mode 100644 index 0000000..979052f --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml @@ -0,0 +1,11 @@ + + Welcome to Avalonia! + diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml.cs b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml.cs new file mode 100644 index 0000000..b254960 --- /dev/null +++ b/Russkyc.UI.Avalonia.Gallery/Views/Pages/ThemingView.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace Russkyc.UI.Avalonia.Gallery.Views.Pages; + +public partial class ThemingView : UserControl +{ + public ThemingView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Russkyc.UI.Avalonia.Gallery/Views/Sidebar.axaml b/Russkyc.UI.Avalonia.Gallery/Views/Sidebar.axaml index b3f9c62..9199b71 100644 --- a/Russkyc.UI.Avalonia.Gallery/Views/Sidebar.axaml +++ b/Russkyc.UI.Avalonia.Gallery/Views/Sidebar.axaml @@ -4,23 +4,108 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:pages="clr-namespace:Russkyc.UI.Avalonia.Gallery.Views.Pages" xmlns:viewModels="clr-namespace:Russkyc.UI.Avalonia.Gallery.ViewModels" + x:Name="SidebarView" d:DesignWidth="250" x:DataType="viewModels:MainViewModel" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Content="Button"> - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + + + + + + + + + + + + + + diff --git a/Russkyc.UI.Avalonia/Base.axaml b/Russkyc.UI.Avalonia/Base.axaml index 6953af6..9299da9 100644 --- a/Russkyc.UI.Avalonia/Base.axaml +++ b/Russkyc.UI.Avalonia/Base.axaml @@ -1,6 +1,5 @@ - - + + diff --git a/Russkyc.UI.Avalonia/Controls.axaml b/Russkyc.UI.Avalonia/Controls.axaml index f6275a9..d9b79f8 100644 --- a/Russkyc.UI.Avalonia/Controls.axaml +++ b/Russkyc.UI.Avalonia/Controls.axaml @@ -7,8 +7,8 @@ - + diff --git a/Russkyc.UI.Avalonia/Controls/Border.axaml b/Russkyc.UI.Avalonia/Controls/Border.axaml index 8e104bb..c6e0b12 100644 --- a/Russkyc.UI.Avalonia/Controls/Border.axaml +++ b/Russkyc.UI.Avalonia/Controls/Border.axaml @@ -1,27 +1,89 @@ - - + + - + - - - - + Background="{DynamicResource BackgroundBrush}" + Classes="Card"> + + + + + + + + Password + +