Files
scadaproj/components/ui-theme/validation/scadabridge-ui/host/Components/Pages/AccentCanary.razor
T

42 lines
2.4 KiB
Plaintext

@page "/accent"
<PageTitle>Four-family accent component canary</PageTitle>
<h1>Four-family accent component canary</h1>
<p>Fixture-only shared components under the actual CentralUI stylesheet. These four cases use the release-decision table and validate the shared light scheme, not a full sister application.</p>
<nav aria-label="Accent fixture cases">
<a href="/accent?family=default">Default blue</a> ·
<a href="/accent?family=historian">Historian green</a> ·
<a href="/accent?family=btdb">BTDB teal</a> ·
<a href="/accent?family=overview">Overview purple</a> ·
<a href="/">Actual CentralUI component fixture</a>
</nav>
<ThemeShell Product="@Selected.Label" Accent="@Selected.Accent" AccentDeep="@Selected.Deep"
AccentTint="@Selected.Tint" AccentBorder="@Selected.Border" AccentFocus="@Selected.Deep">
<Nav>
<NavRailItem Href="/accent" Text="Selected sample" Match="NavLinkMatch.All" />
</Nav>
<ChildContent>
<h2 id="accent-family-title">@Selected.Label</h2>
<p><a id="canary-family-link" href="#accent-family-title">An actual theme-styled link</a></p>
<div class="canary-action-row">
<TechButton id="canary-family-primary" @onclick="CountClick">Local primary action</TechButton>
<TechButton id="canary-family-ghost" Variant="ButtonVariant.Ghost" @onclick="CountClick">Local ghost action</TechButton>
<TechButton id="canary-family-disabled" disabled="true">Disabled primary action</TechButton>
</div>
<StatusPill State="StatusState.Info">Independent semantic information</StatusPill>
<p id="canary-family-outcome" role="status">Synthetic local clicks: @_clicks</p>
</ChildContent>
</ThemeShell>
@code {
[SupplyParameterFromQuery(Name = "family")] public string? Family { get; set; }
private int _clicks;
private void CountClick() => _clicks++;
private AccentCase Selected => Family?.ToLowerInvariant() switch
{
"historian" => new("Historian green", "#2f855a", "#1c6540", "#edf5f0", "#bddbc9"),
"btdb" => new("BTDB teal", "#1b7f8e", "#125764", "#eaf5f6", "#b7d9dd"),
"overview" => new("Overview purple", "#6d28d9", "#4c1d95", "#f2ecfc", "#d7c5f2"),
_ => new("Default blue", "#2f5fd0", "#1e3f99", "#eef2fc", "#cdd9f7")
};
private sealed record AccentCase(string Label, string Accent, string Deep, string Tint, string Border);
}