Create all project worktrees under the repository's ignored .worktrees/
directory, for example git worktree add .worktrees/<name>. The .gitignore
rule **/.worktrees/ keeps those checkouts out of tracked files.
Sufficit User Interface (SUI) is a Razor class library built with Blazor, HTML, CSS, and JavaScript ES modules. It ships its own component source and visual styles.
- Target framework:
net10.0. - Package ID:
Sufficit.Blazor.UI. - Distribution: NuGet package or local
ProjectReference. - Components namespace:
Sufficit.Blazor.UI.Components. - Themes namespace:
Sufficit.Blazor.UI.Themes. - Generated artwork namespace:
Sufficit.Blazor.UI.Artwork.
The development line targets net10.0. Removing a target framework requires
an explicit consumer migration. SUI uses Sufficit calendar versioning.
See the versioning policy
and the API cleanup record.
CI builds with warnings treated as errors, inspects the .nupkg, and installs it
in a temporary Razor class library and Blazor Web App. The smoke app checks
server-rendered markup, global and isolated CSS, and JavaScript assets at
the root and under PathBase. Dependabot proposes weekly servicing updates.
The locked restore keeps the library dependency graph stable between builds.
Debug uses 2.99.0.0. Release and Packing use 2.yy.MMdd.HHmm in UTC, the
Sufficit calendar format also used by Sufficit.Identity.Core. The major stays at 2
because legacy versions 1.27.0, 1.28.0, 2.0.0, 2.1.1, and 2.2.1
were published by mistake in August 2026. NuGet.org retains them, and
a floating range could rank a new 1.yy below them. Releases start from a
v2.yy.MMdd.HHmm tag. NuGet removes leading zeroes in numeric segments.
Publication follows the .NET 10, component, Playwright/axe, and exact-package
checks. See the release runbook
and the changelog.
The recorded consumer scan found references in 11 application or library projects
and one test project. Ten production paths resolved the current structure.
The remaining legacy path in sufficit-checkout was tracked in the consumer rollout.
Install the NuGet package:
<PackageReference Include="Sufficit.Blazor.UI" Version="2.*" />During joint development, a consumer can also point to src/Sufficit.Blazor.UI.csproj with ProjectReference.
Include in the <head> both the global entrypoint of RCL and the bundle of CSS isolation generated for the consumer application:
<link href="_content/Sufficit.Blazor.UI/sufficit-ui.css" rel="stylesheet" />
<link href="MyApplication.styles.css" rel="stylesheet" />Replace MyApplication with the host project assembly. The first file is generated and minified from modular sources; without @import in runtime, it carries tokens, shared primitives, portals and global rules still in migration; the second brings together the application .razor.css and referenced RCLs. Loading only one of them leaves part of the components unstyled. The sufficit-ui.css entrypoint remains compatible during the consumer migration window.
Let components load their own JavaScript modules and release their event listeners during disposal.
Edit the authored foundations, portal styles, compatibility rules, and entry point in src/styles. After editing them, run the following commands.
npm ci
npm run build:css
npm run check:cssThe first command installs the locked version of Lightning CSS; the second generates the public bundle src/wwwroot/sufficit-ui.css and synchronizes the compatibility CSS to src/wwwroot/styles; the third confirms that the artifact is up-to-date and inside the raw budgets, gzip and Brotli. Trace CSS diagnostics to the source modules and make the correction there.
Register services in Program.cs:
using Sufficit.Blazor.UI;
builder.Services.AddSufficitUI();And install the provider once at the interactive root of the application:
@using Sufficit.Blazor.UI.Themes
<SUIThemeProvider>
<Routes />
</SUIThemeProvider>The public contract uses the actual code casing: ISUITheme, SUIPalette, SUITypography, SUILayout, DefaultSUITheme and SUIThemeProvider.
An application can provide your theme by DI:
builder.Services.AddSufficitUI(options =>
options.Theme = new IdentitySUITheme());Or directly to the provider:
<SUIThemeProvider Theme="Theme">
<Routes />
</SUIThemeProvider>The provider publishes the --sui-* tokens globally, including color-scheme, so that menus, dialogs, tooltips and toasts attached to body receive the same palette. ISUITheme.IsDark selects the scheme; the palette continues to belong to the consumer theme. Without configuration, DefaultSUITheme provides light blue fallback.
Hosts with strict Content-Security-Policy pass the nonce of the response in <SUIThemeProvider Nonce="…">; it is copied to the inline <style> that publishes the tokens. See the contract provider.
With style-src-attr 'none' (or style-src without 'unsafe-inline') the browser ignores every style attribute in pre-rendered HTML and when Blazor defines it later. The SUI components do not depend on it: limited values turn classes (SUISection gap, SUIText color) and free values (ColumnTemplate, MinColumnWidth, widths, progress) go to data-sui-style and are applied via CSSOM by the package's JS booter (Sufficit.Blazor.UI.lib.module.js, automatically loaded by blazor.web.js). The Style parameter of any component (and RowStyleFunc of SUITable) is from the consumer and is ignored under that
policy: use Class with a style sheet rule. Details in CSP strict.
Use SUITheme.Light and SUITheme.Dark as complete presets and with to customize palette, typography and layout. Change only IsDark does not recalculate the colors of an arbitrary theme. InfoContrast, SuccessContrast, WarningContrast and ErrorContrast define the text on semantic funds.
Exemplos de tokens:
- cores:
--sui-color-primary,--sui-color-primary-contrast,--sui-color-primary-action,--sui-color-primary-action-contrast,--sui-surface,--sui-text-primary,--sui-border; - tipografia:
--sui-font,--sui-fs-body,--sui-lh-body; - layout:
--sui-space-*,--sui-radius-*,--sui-shadow-*e--sui-control-h-*.
At SUIPalette, Primary remains the brand accent. Optional fields PrimaryAction/PrimaryActionContrast allow a surface suitable for filled primary buttons; when omitted, the provider retreats to Primary/PrimaryContrast and preserves existing themes.
The samples/Sufficit.Blazor.UI.Showcase display executes the 87 components in Blazor WebAssembly. Includes search, examples copyable Razor, public parameters, compositions and theme editor with persistent light, dark, and system preferences, three palettes, two densities and C# export. All the data is local.
dotnet run --project samples/Sufficit.Blazor.UI.ShowcaseThe regression server host remains in samples/Sufficit.Blazor.UI.Catalog. The two refer to RCL samples/Sufficit.Blazor.UI.Demos. Workflow .github/workflows/pages.yml validates and publishes the display in GitHub Pages after push in main; in the repository, configure Pages from GitHub Actions. See the runbook of the display to publish in the root or a subpath, maintain examples and run the artifact tests.
The reference by family, form contracts and pages of Select, Tooltip, NavGroup, Dialog and ThemeProvider are in docs/components.
All public components use the SUI prefix. The table below is derived from src/Components/<Family>/ and checked by ReadmeCatalogTests; SUIThemeProvider lives in src/Themes and SUIArtwork in src/Artwork.
| Family | Components |
|---|---|
| Actions | SUIActionGroup, SUIButton, SUICopyToClipboard, SUIIconButton, SUILink, SUILoadingButton |
| Forms | SUIAutocomplete, SUICheckbox, SUIChoiceCard, SUIDateField, SUIForm, SUIValidatedField, SUIFormGrid, SUINumericField, SUISelect, SUISelectItem, SUISwitch, SUISwitchButton, SUIFileUpload, SUITextField |
| Layout | SUIAppBar, SUICard, SUICardActions, SUICardContent, SUICardHeader, SUIContainer, SUIDivider, SUIDrawer, SUIGrid, SUIItem, SUILayout, SUIPageHeader, SUIResponsive, SUISection, SUISpacer, SUIStack |
| Navigation | SUIFilterScope, SUIFilterTree, SUINavGroup, SUINavLink, SUIProgressSteps, SUISlidingTabPanel, SUISlidingTabs, SUITabPanel, SUITabs |
| Data display | SUIAudioPlayer, SUIAvatar, SUIChip, SUIDataTable, SUIDateTime, SUIIcon, SUIList, SUIListItem, SUIPagination, SUIRecordTable, SUIStat, SUITable, SUITableEmpty, SUITableSortLabel, SUITd, SUIText, SUITh, SUITimeline, SUITimelineItem |
| Feedback | SUIAlert, SUIEmptyState, SUIExpansionPanel, SUIPendingChangesBar, SUIPresence, SUIProgressCircular, SUIProgressLinear, SUISkeletonLoader, SUISnackbarHost, SUIStatusBadge, SUIStatusBanner, SUIToast, SUIToastHost |
| Overlays | SUIConfirmDialog, SUIContextMenu, SUIDecisionDialog, SUIDialogHost, SUIMenu, SUIPopover, SUIPopup, SUITooltip |
SUIArtwork is not a control: it is a decorative layer designed by mathematics (SVG inline, without image file and without generated style, safe under strict CSP), placed as the first child of a prominent area. The element that contains it turns the positioning and cutting box, and the other children are on top. That's why you live in your own namespace (Sufficit.Blazor.UI.Artwork) and require explicit @using.
@using Sufficit.Blazor.UI.Artwork
<section class="hero">
<SUIArtwork Pattern="SUIArtworkPattern.SignalWaves" Calm="SUIArtworkCalm.Adaptive" Peak="0.63" />
<h1>Panorama da operação</h1>
<SUICard VariantValue="SUIVariant.Glass">…</SUICard>
</section>Rules: at most one per screen, only in highlighted areas (hero, login, TV panel), never behind run text. Calm defines the side that stays calm for the text; cards about the drawing use SUIVariant.Glass. The lines use the text color of the element containing the art and the highlight line uses --sui-primary. The movement when passing the pointer is turned off under prefers-reduced-motion, and the art disappears in forced-colors.
Enums such as SUIColor, SUIVariant, SUISize, SUIButtonType, SUIEdge, SUITypo, SUIAlign, SUIOrigin, and SUITone avoid dependence on external visual types. Some APIs still accept values legacy by a compatibility bridge; New code should use the enums SUI.
<SUIButton ColorValue="SUIColor.Primary" OnClick="SaveAsync">
Salvar alterações
</SUIButton>
<SUIStatusBanner Tone="SUITone.Success"
Title="Runtime estável"
Description="Todos os workers responderam." /><SUIChoiceCard TValue="PaymentMethod"
Value="PaymentMethod.Pix"
SelectedValue="SelectedMethod"
SelectedValueChanged="SelectMethod"
Name="payment-method"
Title="PIX"
Description="Confirmação rápida, a qualquer hora"
LeadingTone="SUITone.Success" /><SUISelect TValue="string"
Label="Região"
Value="SelectedRegion"
ValueChanged="OnRegionChanged"
MenuMaxWidth="36rem">
<SUISelectItem Value="sudeste">Sudeste</SUISelectItem>
<SUISelectItem Value="sul">Sul</SUISelectItem>
</SUISelect>The SUISelect menu uses the top layer when available, repositions on the edge of the viewport and supports ArrowUp, ArrowDown, Home, End, Enter, Space and Escape. Use native <select> when HTML posting or operating system selector are required.
<SUITooltip Text="Armazenamento"
Placement="SUITooltipPlacement.Right"
MaxWidth="280">
<SUIIconButton Icon="@Icons.Storage" AriaLabel="Armazenamento" />
</SUITooltip>The suite is divided into three layers. They all run in the I.C. and fail the build.
| Layer | Project or gate | Coverage |
|---|---|---|
| Code contract | tests/Sufficit.Blazor.UI.Tests |
bUnit (render, lifecycle, forward attributes, form accessibility), public API compatibility, name and namespace conventions, file size, CSS contract, byte budgets, and third-party anti-library guard |
| Browser | tests/Sufficit.Blazor.UI.BrowserTests |
Playwright and axe on Chromium, Firefox, and WebKit. Desktop and mobile coverage includes light and dark themes, keyboard and visible focus, focus traps, forced colors, RTL, 200% zoom, 44 px targets, visual baselines, and runtime budgets for requests, DOM, transferred bytes, LCP, and CLS. |
| Full Page | job lighthouse |
eng/lighthouse-budget.json + scripts/check-lighthouse.mjs: categories performance/accessibility/best-practices/SEO and metrics FCP, LCP, TBT, CLS, Speed Index |
dotnet test tests/Sufficit.Blazor.UI.Tests/Sufficit.Blazor.UI.Tests.csproj
# Start the catalog before running the browser and Lighthouse checks.
dotnet run --project samples/Sufficit.Blazor.UI.Catalog/Sufficit.Blazor.UI.Catalog.csproj \
-c Release --urls http://127.0.0.1:5180 &
dotnet test tests/Sufficit.Blazor.UI.BrowserTests/Sufficit.Blazor.UI.BrowserTests.csproj -- Playwright.BrowserName=chromium
npm ci --prefix scripts/lighthouse
scripts/lighthouse/node_modules/.bin/lighthouse http://127.0.0.1:5180 --preset=desktop --output=json \
--output-path=artifacts/lighthouse/report.json --budget-path=eng/lighthouse-budget.json
node scripts/check-lighthouse.mjs artifacts/lighthouse/report.jsonBudgets are ceiling, don't move: when a file or payload pops, the fix is split or reduce. The few inherited cases are frozen in explicit debit lists (FileSizeBudgetTests.Debt, NamingConventionTests.LegacyParameterNames) that can only shrink.
- Completed architecture and hardening activity
- Rollout and consumer rollback
- Documentation Index
- SUI skill and conventions
- Sufficit Frontend — general frontend, SUI integration and validation, distributed by the public skill catalog.
The activity records migration to organization by families, hybrid CSS, JavaScript modules placed, executable catalog, component testing, accessibility gates, final package and consumer validation.
MIT-0. See LICENSE.