Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into features/api-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed Apr 27, 2024
2 parents fc7bf98 + c0014ba commit df84b3c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
22 changes: 21 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,30 @@ with the project's goals or because someone else is already working on it.

1. Fork and clone the repository
2. Run `npm install` to install dependencies
3. Run `dotnet build Ignis.sln` to build the project
3. Run `dotnet build ./Ignis.sln -c Release` to build the project

This should be all you need to get started. If you run into any issues, please let us know by opening an issue.

#### Generated content

Both the `Ignis.Components.HeroIcons` and the `Ignis.Website` projects contain generated content.

The `Ignis.Components.HeroIcons` project contains the generated C# code for the HeroIcons. This code is generated from
the official [heroicons repository](https://github.com/tailwindlabs/heroicons) , which you can run with the following
command:

```shell
dotnet run --project ./tools/Ignis.Components.HeroIcons.Generator
```

The `Ignis.Website` project contains the generated documentation for the Ignis repository. This documentation is
generated from the markdown files in the [docs](docs) directory. You can generate the documentation with the following
command:

```shell
dotnet run --project ./tools/Ignis.Website.Generator
```

## Coding standards

We use [Husky.Net](https://github.com/alirezanet/Husky.Net) to enforce coding standards. As long as you followed the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;

namespace Ignis.Components.HeadlessUI.Aria;

Expand All @@ -11,6 +12,7 @@ public static void SetActiveDescendant(this IAriaPopup popup, IAriaDescendant de
if (isActive)
{
popup.ActiveDescendant = descendant;
_ = ScrollIntoViewAsync(popup);
}
else if (popup.ActiveDescendant == descendant)
{
Expand Down Expand Up @@ -60,4 +62,15 @@ public static void OnKeyDown(this IAriaPopup popup, KeyboardEventArgs eventArgs)
}
}
}

private static readonly object ScrollOptions = new { Behavior = "smooth", Block = "nearest" };

private static async Task ScrollIntoViewAsync(IAriaPopup popup)
{
var id = popup.GetId(popup.ActiveDescendant);
if (id == null) return;

await using var element = await popup.JSRuntime.InvokeAsync<IJSObjectReference>("document.getElementById", id);
await element.InvokeVoidAsync("scrollIntoView", ScrollOptions);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Ignis.Components.Web;
using Microsoft.JSInterop;

namespace Ignis.Components.HeadlessUI.Aria;

Expand Down Expand Up @@ -47,4 +48,7 @@ public interface IAriaPopup : IAriaControl, IAriaLabeled, IOpenClose, IWithTrans
/// The button which controls the popup.
/// </summary>
IAriaComponentPart? Button { get; set; }

// ReSharper disable once InconsistentNaming
internal IJSRuntime JSRuntime { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageOutputPath>..\..\..\nuget</PackageOutputPath>
<NoWarn>BL0007</NoWarn>
<NoWarn>BL0007,MA0004</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down

0 comments on commit df84b3c

Please sign in to comment.