Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- One version for every ShellUI package -->
<PropertyGroup>
<ShellUIVersion>0.3.1</ShellUIVersion>
<ShellUIVersion>0.3.2</ShellUIVersion>
<ShellUIVersionSuffix></ShellUIVersionSuffix>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

| Channel | Version | Notes |
|---|---|---|
| Latest stable (recommended) | `0.3.1` | Tailwind CSS `4.3.2` |
| Latest stable (recommended) | `0.3.2` | Tailwind CSS `4.3.2` |
| Previous stable | `0.2.1` | Superseded by `0.3.0` |

The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10. The `ShellUI.Components` NuGet package targets .NET 10 only; on .NET 8 or 9, use the CLI.
Expand Down
77 changes: 77 additions & 0 deletions ShellUI.Tests/PackageRenderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using Bunit;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using ShellUI.Components;
using ShellUI.Components.Services;

namespace ShellUI.Tests;

public class PackageRenderTests
{
public sealed class Row
{
public string Name { get; set; } = "";
}

// Other render failures come from a missing parent or required parameter; these two are always bugs.
private static readonly string[] BindingErrors =
{
"does not have a property matching the name",
"declares more than one parameter matching the name",
};

[Fact]
public void EveryPackageComponent_RendersWithoutParameterBindingErrors()
{
var types = typeof(Shell).Assembly.GetExportedTypes()
.Where(t => typeof(IComponent).IsAssignableFrom(t) && !t.IsAbstract && t.Namespace == "ShellUI.Components")
.ToList();
Assert.NotEmpty(types);

var offenders = new List<string>();
foreach (var type in types)
{
var closed = type.IsGenericTypeDefinition ? Close(type) : type;
if (closed is null)
{
offenders.Add($"{type.Name}: could not choose type arguments");
continue;
}

using var ctx = new BunitContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.Services.AddShellUISonner();
ctx.Services.AddScoped<IThemeService, ThemeService>();

try
{
ctx.Render<DynamicComponent>(p => p.Add(c => c.Type, closed));
}
catch (Exception ex)
{
var message = Flatten(ex);
if (BindingErrors.Any(message.Contains)) offenders.Add($"{type.Name}: {message}");
}
}

Assert.True(offenders.Count == 0, "Package components that fail parameter binding:\n " + string.Join("\n ", offenders));
}

private static Type? Close(Type definition)
{
foreach (var candidate in new[] { typeof(Row), typeof(string), typeof(int) })
{
try
{
return definition.MakeGenericType(definition.GetGenericArguments().Select(_ => candidate).ToArray());
}
catch (ArgumentException) { }
}
return null;
}

private static string Flatten(Exception ex) =>
ex is AggregateException agg
? string.Join(" | ", agg.Flatten().InnerExceptions.Select(Flatten))
: ex.InnerException is null ? ex.Message : ex.Message + " | " + Flatten(ex.InnerException);
}
2 changes: 2 additions & 0 deletions ShellUI.Tests/ShellUI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="bunit" Version="2.11.3" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
Expand All @@ -24,6 +25,7 @@
<ProjectReference Include="..\src\ShellUI.Templates\ShellUI.Templates.csproj" />
<ProjectReference Include="..\src\ShellUI.CLI\ShellUI.CLI.csproj" />
<ProjectReference Include="..\tools\ShellUI.SafelistGenerator\ShellUI.SafelistGenerator.csproj" />
<ProjectReference Include="..\src\ShellUI.Components\ShellUI.Components.csproj" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions VERSIONING_STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ShellUI uses one centralized version for the source templates, CLI tool, and pac

| Scope | Value |
|---|---|
| Version | `0.3.1` |
| Version | `0.3.2` |
| Target framework | .NET 10 |
| Tailwind version | `4.3.2` |

Expand All @@ -18,15 +18,15 @@ The root `Directory.Build.props` supplies the version:

```xml
<PropertyGroup>
<ShellUIVersion>0.3.1</ShellUIVersion>
<ShellUIVersion>0.3.2</ShellUIVersion>
<ShellUIVersionSuffix></ShellUIVersionSuffix>
</PropertyGroup>
```

`Directory.Build.props` composes the package and assembly metadata:

- `Version` is `0.3.1`; with a suffix such as `rc.1` it becomes `0.3.1-rc.1`.
- `AssemblyVersion` and `FileVersion` use the numeric base `0.3.1`.
- `Version` is `0.3.2`; with a suffix such as `rc.1` it becomes `0.3.2-rc.1`.
- `AssemblyVersion` and `FileVersion` use the numeric base `0.3.2`.
- `InformationalVersion` includes the prerelease suffix.
- Component metadata reads the centralized properties when running from the repository. `VersionHelper` uses assembly metadata as a fallback when its repository search does not find the solution file.

Expand Down Expand Up @@ -57,7 +57,7 @@ The CLI writes the computed version into `shellui.json` for each installed entry
"InstalledComponents": [
{
"Name": "button",
"Version": "0.3.1",
"Version": "0.3.2",
"InstalledAt": "2026-01-01T00:00:00Z",
"IsCustomized": false
}
Expand Down
4 changes: 2 additions & 2 deletions docs/CLI_INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Context | Version |
|---|---|
| Latest stable (recommended) | `0.3.1`, needs the .NET 10 runtime |
| Latest stable (recommended) | `0.3.2`, needs the .NET 10 runtime |
| Previous stable | `0.2.1` |
| Tailwind | `4.3.2` |

Expand Down Expand Up @@ -43,7 +43,7 @@ The manifest is `.config/dotnet-tools.json` and uses the installed package versi
"isRoot": true,
"tools": {
"shellui.cli": {
"version": "0.3.1",
"version": "0.3.2",
"commands": ["shellui"]
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/CLI_SYNTAX.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ShellUI CLI Syntax

This reference covers CLI `0.3.1`: it runs on .NET 10, sets up Blazor projects on .NET 8, 9 and 10, uses Tailwind CSS `4.3.2`, and has and 76 direct component targets. Older versions, such as `0.2.1`, lack some of these commands.
This reference covers CLI `0.3.2`: it runs on .NET 10, sets up Blazor projects on .NET 8, 9 and 10, uses Tailwind CSS `4.3.2`, and has and 76 direct component targets. Older versions, such as `0.2.1`, lack some of these commands.

## Command prefix

Expand Down Expand Up @@ -205,7 +205,7 @@ Representative fields look like this:
"InstalledComponents": [
{
"Name": "button",
"Version": "0.3.1",
"Version": "0.3.2",
"InstalledAt": "2026-01-01T00:00:00Z",
"IsCustomized": false
}
Expand Down
4 changes: 2 additions & 2 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Answers for the current ShellUI source and the currently published packages.

### Which version should I use?

Use `0.3.1`. It uses Tailwind CSS `4.3.2` and has 76 direct component targets:
Use `0.3.2`. It uses Tailwind CSS `4.3.2` and has 76 direct component targets:

```bash
dotnet tool install -g ShellUI.CLI
Expand Down Expand Up @@ -145,7 +145,7 @@ A representative Tailwind and component record is:
"InstalledComponents": [
{
"Name": "button",
"Version": "0.3.1",
"Version": "0.3.2",
"InstalledAt": "2026-01-01T00:00:00Z",
"IsCustomized": false
}
Expand Down
2 changes: 1 addition & 1 deletion docs/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ShellUI Quick Start

This quick start uses ShellUI `0.3.1`: Tailwind CSS `4.3.2` and 76 direct component targets. The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10.
This quick start uses ShellUI `0.3.2`: Tailwind CSS `4.3.2` and 76 direct component targets. The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10.

## Prerequisites

Expand Down
20 changes: 20 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# ShellUI Release Notes

# ShellUI v0.3.2

> A patch release with component fixes for both the `ShellUI.Components` NuGet package and the CLI templates.

## 🐛 Fixes

- `MultiSeriesChart` threw on every render in the NuGet package. It now renders, inside the same card as `Chart`.
- NuGet package: `ThemeToggle` flipped its icon but did not change the theme, dialogs, sheets and drawers did not lock page scrolling, and close-on-scroll dropdowns stayed open. The package's `shellui.js` now loads automatically through a Blazor JS initializer, with no `<script>` tag needed, and includes the functions `ThemeToggle`, `ThemeService` and `FileUpload` call.
- `ThemeToggle` kept a list of instances shared by every user on Blazor Server, so one user's toggle tried to re-render other users' components. Toggles now follow the page's `dark` class, so all toggles on a page stay in sync and start from the page's actual theme.
- `DatePicker` and `DateRangePicker`: the calendar popover has a width, so it is no longer squeezed in a flex row.
- `DataPicker` and `MultiSelect`: option rows are left-aligned, so custom `OptionTemplate`s no longer render centered.
- Removed leftover files from the Razor class library template (`Component1`, `ExampleJsInterop`, `background.png`) from the package.

A new test renders every package component and fails on parameter errors like the `MultiSeriesChart` one.

## ⬆️ Upgrading

- **NuGet package:** update to `0.3.2`.
- **CLI:** update the tool, then run `shellui update` to rewrite installed components, including `shellui.js`, from the new templates. `update` overwrites the files, so commit or back up any components you customized first.

# ShellUI v0.3.1

> A patch release for the `ShellUI.Components` NuGet package. The CLI and its templates have no changes beyond the version number.
Expand Down
8 changes: 4 additions & 4 deletions src/ShellUI.CLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ dotnet watch

## Documentation

- [README](https://github.com/shellui-dev/shellui/blob/v0.3.1/README.md)
- [CLI reference](https://github.com/shellui-dev/shellui/blob/v0.3.1/docs/CLI_SYNTAX.md)
- [Release notes](https://github.com/shellui-dev/shellui/blob/v0.3.1/docs/RELEASE_NOTES.md)
- [README](https://github.com/shellui-dev/shellui/blob/v0.3.2/README.md)
- [CLI reference](https://github.com/shellui-dev/shellui/blob/v0.3.2/docs/CLI_SYNTAX.md)
- [Release notes](https://github.com/shellui-dev/shellui/blob/v0.3.2/docs/RELEASE_NOTES.md)

## License

[MIT](https://github.com/shellui-dev/shellui/blob/v0.3.1/LICENSE.txt)
[MIT](https://github.com/shellui-dev/shellui/blob/v0.3.2/LICENSE.txt)
3 changes: 0 additions & 3 deletions src/ShellUI.Components/Component1.razor

This file was deleted.

6 changes: 0 additions & 6 deletions src/ShellUI.Components/Component1.razor.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/ShellUI.Components/Components/DataPicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<button type="button"
@onclick="() => SelectItem(item)"
@onmouseenter="() => _highlightedIndex = localIdx"
class="@Shell.Cn("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none", isHighlighted ? "bg-accent text-accent-foreground" : "", isSelected && !isHighlighted ? "bg-accent/50" : "")">
class="@Shell.Cn("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 text-left pl-2 pr-8 text-sm outline-none", isHighlighted ? "bg-accent text-accent-foreground" : "", isSelected && !isHighlighted ? "bg-accent/50" : "")">
@if (OptionTemplate is not null)
{
@OptionTemplate(item)
Expand Down
2 changes: 1 addition & 1 deletion src/ShellUI.Components/Components/DatePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@if (IsOpen)
{
<div class="absolute z-50 mt-1 rounded-md border border-border bg-popover p-4 shadow-md animate-in fade-in-0 zoom-in-95">
<div class="absolute z-50 mt-1 w-max rounded-md border border-border bg-popover p-4 shadow-md animate-in fade-in-0 zoom-in-95">
<div class="space-y-4">
<div class="flex items-center justify-between">
<button type="button" @onclick="PreviousMonth" class="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-7 w-7">
Expand Down
2 changes: 1 addition & 1 deletion src/ShellUI.Components/Components/DateRangePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@if (_isOpen)
{
<div class="absolute z-50 mt-1 rounded-md border bg-popover p-3 text-popover-foreground shadow-md">
<div class="absolute z-50 mt-1 w-max rounded-md border bg-popover p-3 text-popover-foreground shadow-md">
<div class="flex items-center justify-between mb-2">
<button type="button" @onclick="PreviousMonth" class="p-1 hover:bg-accent rounded">
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand Down
2 changes: 1 addition & 1 deletion src/ShellUI.Components/Components/MultiSelect.razor
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<button type="button"
@onclick="() => ToggleItem(item)"
@onmouseenter="() => _highlightedIndex = localIdx"
class="@Shell.Cn("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none", isHighlighted ? "bg-accent text-accent-foreground" : "")">
class="@Shell.Cn("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 text-left pl-8 pr-2 text-sm outline-none", isHighlighted ? "bg-accent text-accent-foreground" : "")">
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
@if (isSelected)
{
Expand Down
21 changes: 9 additions & 12 deletions src/ShellUI.Components/Components/MultiSeriesChart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
@inherits Chart<TItem>
@typeparam TItem where TItem : class

<ApexChart TItem="TItem"
Title="@Title"
Subtitle="@Subtitle"
Options="@ChartOptions"
Height="@Height"
Width="@Width">
@ChildContent
</ApexChart>

@code {
[Parameter] public new RenderFragment? ChildContent { get; set; }
}
<div class="@ComputedClass" data-chart-theme="@Theme.ToString().ToLower()">
<ApexChart TItem="TItem"
Title="@Title"
Options="@ChartOptions"
Height="@Height"
Width="@Width">
@ChildContent
</ApexChart>
</div>
Loading
Loading