-
Notifications
You must be signed in to change notification settings - Fork 4
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 #63 from pureblazor/icon-and-theme-refactor
Icon and theme refactor
- Loading branch information
Showing
68 changed files
with
1,143 additions
and
496 deletions.
There are no files selected for viewing
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 @@ | ||
v20.12.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/bash | ||
# file: css.sh | ||
|
||
./tailwindcss-macos-arm64 -c src/Pure.Blazor.Components/tailwind.config.js -i src/Pure.Blazor.Components/wwwroot/app.css -o src/Pure.Blazor.Components/wwwroot/pureblazor.css | ||
source ~/.zshrc | ||
nvm use | ||
npm install tailwindcss@next @tailwindcss/vite@next | ||
npx @tailwindcss/cli@next -i src/Pure.Blazor.Components/tailwind.css -o src/Pure.Blazor.Components/wwwroot/pureblazor.css --watch |
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
30 changes: 30 additions & 0 deletions
30
src/Pure.Blazor.Components.Icons/Pure.Blazor.Components.Icons.csproj
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,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<LangVersion>preview</LangVersion> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>Nullable</WarningsAsErrors> | ||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> | ||
<Title>PureBlazor Icons</Title> | ||
<Version>0.21</Version> | ||
<PackageId>PureBlazor.Components.Icons</PackageId> | ||
<Description>Blazor Icons</Description> | ||
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/pureblazor/components</RepositoryUrl> | ||
<PackageTags>blazor, icons, maui, ssr, wasm, tailwind, tailwindcss, heroicons, pureblazor</PackageTags> | ||
<IncludeSymbols>True</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<PackageReleaseNotes>Component Library Updates</PackageReleaseNotes> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<Company>PureBlazor</Company> | ||
<Authors>codymullins</Authors> | ||
<Copyright>Copyright 2024 PureBlazor</Copyright> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Pure.Blazor.Components.Primitives\Pure.Blazor.Components.Primitives.csproj"/> | ||
</ItemGroup> | ||
|
||
</Project> |
4 changes: 2 additions & 2 deletions
4
src/Pure.Blazor.Components/Icons/PureIcon.cs → src/Pure.Blazor.Components.Icons/PureIcon.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public class ButtonDefaults | ||
{ | ||
public Effect PressEffect { get; set; } | ||
public Effect HoverEffect { get; set; } | ||
} |
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,56 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public class ComponentStyle | ||
{ | ||
private readonly IReadOnlyDictionary<Accent, string> accents; | ||
private readonly IReadOnlyDictionary<PureVariant, Dictionary<Accent, string>> variants; | ||
private readonly IReadOnlyDictionary<PureSize, string> sizes; | ||
|
||
public ComponentStyle(string baseStyle, | ||
IReadOnlyDictionary<Accent, string>? accents, | ||
IReadOnlyDictionary<PureVariant, Dictionary<Accent, string>>? variants, | ||
IReadOnlyDictionary<PureSize, string>? sizes) | ||
{ | ||
this.accents = accents ?? new Dictionary<Accent, string>(); | ||
this.variants = variants ?? new Dictionary<PureVariant, Dictionary<Accent, string>>(); | ||
this.sizes = sizes ?? new Dictionary<PureSize, string>(); | ||
Base = baseStyle; | ||
} | ||
|
||
/// <summary> | ||
/// Basic style applied to the outer container of the component. | ||
/// </summary> | ||
public string Base { get; set; } | ||
|
||
/// <summary> | ||
/// Optional advanced style for the outer container of the component. | ||
/// Not all components with an outer container have this, only if the outer container requires Accent or Variant | ||
/// modifications. | ||
/// </summary> | ||
public ComponentStyle? OuterContainer { get; set; } | ||
|
||
/// <summary> | ||
/// Optional advanced style for the inner container of the component. Not all components have an inner container. | ||
/// </summary> | ||
public ComponentStyle? InnerContainer { get; set; } | ||
|
||
public string Accent(Accent accent) | ||
{ | ||
return accents.TryGetValue(accent, out var value) ? value : string.Empty; | ||
} | ||
|
||
public string Variant(PureVariant variant, Accent accent) | ||
{ | ||
if (variants.TryGetValue(variant, out var value) && value.TryGetValue(accent, out var style)) | ||
{ | ||
return style; | ||
} | ||
|
||
return string.Empty; // or return a default style | ||
} | ||
|
||
public string Size(PureSize size) | ||
{ | ||
return sizes.TryGetValue(size, out var value) ? value : string.Empty; | ||
} | ||
} |
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,33 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
/// <summary> | ||
/// Animation effects that can be applied to any component that supports it. | ||
/// </summary> | ||
public enum Effect | ||
{ | ||
/// <summary> | ||
/// Unset effect. Default values will be inherited from ancestors. | ||
/// </summary> | ||
Unset, | ||
|
||
/// <summary> | ||
/// Explicitly indicates no effect. | ||
/// </summary> | ||
None, | ||
|
||
// what's the best name here? | ||
Jiggle, | ||
|
||
/// <summary> | ||
/// Fade in and out effect. | ||
/// </summary> | ||
Pulse, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
Ping | ||
|
||
// TODO: https://github.com/pureblazor/components/issues/57 | ||
//Ripple, | ||
} |
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,19 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public interface IPureTheme | ||
{ | ||
public ButtonDefaults ButtonDefaults { get; set; } | ||
public IStylePrioritizer StylePrioritizer { get; set; } | ||
public Dictionary<string, ComponentStyle> Styles { get; set; } | ||
|
||
public ComponentStyle GetStyle(Type type) | ||
{ | ||
return GetStyleByName(type.Name); | ||
} | ||
|
||
public ComponentStyle GetStyleByName(string name) | ||
{ | ||
// TODO: decide if we want this to be an exceptional event | ||
return Styles.GetValueOrDefault(name) ?? new ComponentStyle("", null, null, null); | ||
} | ||
} |
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,6 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public interface IStylePrioritizer | ||
{ | ||
public string PrioritizeStyles(string style1, string style2); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Pure.Blazor.Components.Primitives/Pure.Blazor.Components.Primitives.csproj
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,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<LangVersion>preview</LangVersion> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>Nullable</WarningsAsErrors> | ||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> | ||
<Title>PureBlazor Icons</Title> | ||
<Version>0.21</Version> | ||
<PackageId>PureBlazor.Components.Primitives</PackageId> | ||
<Description>PureBlazor.Components.Primitives</Description> | ||
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/pureblazor/components</RepositoryUrl> | ||
<PackageTags>blazor, icons, maui, ssr, wasm, tailwind, tailwindcss, heroicons, pureblazor</PackageTags> | ||
<IncludeSymbols>True</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<PackageReleaseNotes>Component Library Updates</PackageReleaseNotes> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<Company>PureBlazor</Company> | ||
<Authors>codymullins</Authors> | ||
<Copyright>Copyright 2024 PureBlazor</Copyright> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components"/> | ||
</ItemGroup> | ||
|
||
</Project> |
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,8 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public enum PureAlign | ||
{ | ||
Start, | ||
Center, | ||
End | ||
} |
4 changes: 2 additions & 2 deletions
4
...e.Blazor.Components/Common/PureAnimate.cs → ...azor.Components.Primitives/PureAnimate.cs
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
namespace Pure.Blazor.Components.Common; | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public enum PureAnimate | ||
{ | ||
None, | ||
Default, | ||
Spin | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public enum PureSize | ||
{ | ||
ExtraSmall, | ||
Small, | ||
Medium, | ||
Large, | ||
ExtraLarge | ||
} |
4 changes: 2 additions & 2 deletions
4
...Blazor.Components/Display/BadgeVariant.cs → ...azor.Components.Primitives/PureVariant.cs
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
namespace Pure.Blazor.Components.Display; | ||
namespace Pure.Blazor.Components.Primitives; | ||
|
||
public enum PureVariant | ||
{ | ||
Default, | ||
Outline, | ||
Subtle | ||
} | ||
} |
Oops, something went wrong.