Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Copy link
Member

@rajsite rajsite Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For folders that are nested let's align on the naming conventions in other libraries by not repeating the full parent folder in the name, i.e TableColumn\TableColumnAnchor\ -> TableColumn\Anchor\

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-opening as the following are not aligned with the other library layouts:

LabelProviderCore -> LabelProvider\Core
LabelProviderTable -> LabelProvider\Table
'Mapping\NimbleMappingBase.cs' -> Mapping\Base\NimbleMappingBase.cs
RichTextViewer -> RichText\Viewer
TableColumn\NimbleTableColumn.cs -> TableColumn\Base\NimbleTableColumn.cs
TableColumn\NimbleTableColumnEnumBase.cs -> TableColumn\EnumBase\NimbleTableColumnEnumBase.cs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spright as well:

Chat\MessageInbound -> Chat\Message\Inboud
Chat\MessageOutbound -> Chat\Message\Outboud
Chat\MessageSystem -> Chat\Message\System

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "major",
"comment": "Prepend NationalInstruments to Blazor namespaces",
"packageName": "@ni/nimble-blazor",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "major",
"comment": "Prepend NationalInstruments to Blazor namespaces",
"packageName": "@ni/ok-blazor",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "major",
"comment": "Prepend NationalInstruments to Blazor namespaces",
"packageName": "@ni/spright-blazor",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/blazor-workspace/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
NimbleBlazor/wwwroot/nimble-tokens/
NimbleBlazor/wwwroot/nimble-components/
NimbleBlazor/wwwroot/NimbleBlazor.HybridWorkaround.js
NimbleBlazor/Components/Icons/
NimbleBlazor/Source/Icons/
NimbleBlazor/NuGetFiles/files/
SprightBlazor/wwwroot/nimble-tokens/
SprightBlazor/wwwroot/spright-components/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,25 +353,25 @@
"AspNetCore.SassCompiler": "[1.97.1, )",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )",
"NI.CSharp.Analyzers": "[2.0.35, )",
"NimbleBlazor": "[1.0.0, )",
"OkBlazor": "[1.0.0, )",
"SprightBlazor": "[1.0.0, )"
"NationalInstruments.NimbleBlazor": "[1.0.0, )",
"NationalInstruments.OkBlazor": "[1.0.0, )",
"NationalInstruments.SprightBlazor": "[1.0.0, )"
}
},
"nimbleblazor": {
"NationalInstruments.NimbleBlazor": {
"type": "Project",
"dependencies": {
"Apache.Arrow": "[22.1.0, 22.1.0]",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"okblazor": {
"NationalInstruments.OkBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"sprightblazor": {
"NationalInstruments.SprightBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<base href="./" />
<link href="css/site.css" rel="stylesheet" />
<link href="Demo.Client.styles.css" rel="stylesheet" />
<link href="_content/NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link href="_content/NationalInstruments.NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link rel="icon" href="favicon.ico" sizes="any">
</head>

Expand All @@ -21,7 +21,7 @@
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_content/OkBlazor/ok-components/all-components-bundle.min.js"></script>
<script src="_content/NationalInstruments.OkBlazor/ok-components/all-components-bundle.min.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
</body>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@using Microsoft.AspNetCore.Components.Web
@using NimbleBlazor
@using NationalInstruments.NimbleBlazor
Original file line number Diff line number Diff line change
Expand Up @@ -360,25 +360,25 @@
"AspNetCore.SassCompiler": "[1.97.1, )",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )",
"NI.CSharp.Analyzers": "[2.0.35, )",
"NimbleBlazor": "[1.0.0, )",
"OkBlazor": "[1.0.0, )",
"SprightBlazor": "[1.0.0, )"
"NationalInstruments.NimbleBlazor": "[1.0.0, )",
"NationalInstruments.OkBlazor": "[1.0.0, )",
"NationalInstruments.SprightBlazor": "[1.0.0, )"
}
},
"nimbleblazor": {
"NationalInstruments.NimbleBlazor": {
"type": "Project",
"dependencies": {
"Apache.Arrow": "[22.1.0, 22.1.0]",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"okblazor": {
"NationalInstruments.OkBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"sprightblazor": {
"NationalInstruments.SprightBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- This is the style that should always match the name of your project -->
<link href="css/app.css" rel="stylesheet" />
<link href="Demo.Hybrid.styles.css" rel="stylesheet" />
<link href="_content/NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link href="_content/NationalInstruments.NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
</head>

<body>
Expand All @@ -21,7 +21,7 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js"></script>
<script src="_content/OkBlazor/ok-components/all-components-bundle.min.js"></script>
<script src="_content/NationalInstruments.OkBlazor/ok-components/all-components-bundle.min.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<base href="/" />
<link href="css/site.css" rel="stylesheet" />
<link href="Demo.Server.styles.css" rel="stylesheet" />
<link href="_content/NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link href="_content/NationalInstruments.NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link rel="icon" href="favicon.ico" sizes="any">
<HeadOutlet @rendermode="InteractiveServer" />
</head>

<body>
<Demo.Shared.Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
<script src="_content/OkBlazor/ok-components/all-components-bundle.min.js"></script>
<script src="_content/NationalInstruments.OkBlazor/ok-components/all-components-bundle.min.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -265,25 +265,25 @@
"AspNetCore.SassCompiler": "[1.97.1, )",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )",
"NI.CSharp.Analyzers": "[2.0.35, )",
"NimbleBlazor": "[1.0.0, )",
"OkBlazor": "[1.0.0, )",
"SprightBlazor": "[1.0.0, )"
"NationalInstruments.NimbleBlazor": "[1.0.0, )",
"NationalInstruments.OkBlazor": "[1.0.0, )",
"NationalInstruments.SprightBlazor": "[1.0.0, )"
}
},
"nimbleblazor": {
"NationalInstruments.NimbleBlazor": {
"type": "Project",
"dependencies": {
"Apache.Arrow": "[22.1.0, 22.1.0]",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"okblazor": {
"NationalInstruments.OkBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"sprightblazor": {
"NationalInstruments.SprightBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
Since examples are in the same solution as NimbleBlazor, manually import .targets to copy Nimble
token SCSS. See NimbleBlazor README for correct workflow for external clients to use SCSS.
-->
<Import Project="../../NimbleBlazor/NuGetFiles/build/NimbleBlazor.targets" />
<Import Project="../../NimbleBlazor/NuGetFiles/build/NationalInstruments.NimbleBlazor.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Globalization;
using Apache.Arrow;
using Apache.Arrow.Types;
using NimbleBlazor;
using SprightBlazor;
using NationalInstruments.NimbleBlazor;
using NationalInstruments.SprightBlazor;

namespace Demo.Shared.Pages;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@using Microsoft.AspNetCore.Components
@using NimbleBlazor
@using NationalInstruments.NimbleBlazor
@namespace Demo.Shared
@inherits LayoutComponentBase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;
using NimbleBlazor;
using NationalInstruments.NimbleBlazor;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace Demo.Shared;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using NimbleBlazor
@using SprightBlazor
@using OkBlazor
@using NationalInstruments.NimbleBlazor
@using NationalInstruments.SprightBlazor
@using NationalInstruments.OkBlazor
@using Demo.Shared.Pages
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,20 @@
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg=="
},
"nimbleblazor": {
"NationalInstruments.NimbleBlazor": {
"type": "Project",
"dependencies": {
"Apache.Arrow": "[22.1.0, 22.1.0]",
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"okblazor": {
"NationalInstruments.OkBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
}
},
"sprightblazor": {
"NationalInstruments.SprightBlazor": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Components.Web": "[8.0.24, )"
Expand Down
4 changes: 2 additions & 2 deletions packages/blazor-workspace/NimbleBlazor/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The C# code for a property supporting 2-way binding will look like this:
```

- For a form/ input control (textbox, etc.,), the component should derive from `NimbleInputBase<TValue>`, the `.razor` file needs to bind a DOM element attribute to `CurrentValue` or `CurrentValueAsString`, and set one of those 2 properties in the DOM event listener (generally `@onchange`). `NimbleInputBase` will then handle invoking the `EventCallback`. See `NimbleTextField` for an example. Note that [Nimble has gaps in its `EditForm` support](https://github.com/ni/nimble/issues/766).
- The `@onchange` event callback built-in to Blazor supports DOM elements that fire a `change` event, and provides only `element.value` (which must be `string`, `string[]`, or `boolean`) in the event args. Most other cases (custom events with different names, the need to pass additional info from the DOM element to C# in the event args, etc.) will require using Blazor's [custom event arguments/ custom event type](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-8.0#custom-event-arguments) support. See `NimbleDrawer` for an example. The event and its event arg type are declared in `EventHandlers.cs`, and `NimbleBlazor.lib.module.js` should be updated to register the custom event type, and create the event args in JavaScript. The event listener (C#) in this case needs to invoke the `[PropertyName]Changed` `EventCallback` itself.
- The `@onchange` event callback built-in to Blazor supports DOM elements that fire a `change` event, and provides only `element.value` (which must be `string`, `string[]`, or `boolean`) in the event args. Most other cases (custom events with different names, the need to pass additional info from the DOM element to C# in the event args, etc.) will require using Blazor's [custom event arguments/ custom event type](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-8.0#custom-event-arguments) support. See `NimbleDrawer` for an example. The event and its event arg type are declared in `EventHandlers.cs`, and `NationalInstruments.NimbleBlazor.lib.module.js` should be updated to register the custom event type, and create the event args in JavaScript. The event listener (C#) in this case needs to invoke the `[PropertyName]Changed` `EventCallback` itself.

## Testing

Expand All @@ -87,7 +87,7 @@ Testing the Nimble Blazor components is possible through the use of xUnit and bU

Test Project: `NimbleBlazor.Tests.Acceptance`

In order to fully test the Nimble Blazor components, consider writing new automated acceptance tests for new/modified components. Any component which requires custom JS code in `NimbleBlazor.lib.module.js` should generally have corresponding acceptance tests, because the bUnit tests in `NimbleBlazor.Tests` are unable to exercise/test that JavaScript code.
In order to fully test the Nimble Blazor components, consider writing new automated acceptance tests for new/modified components. Any component which requires custom JS code in `NationalInstruments.NimbleBlazor.lib.module.js` should generally have corresponding acceptance tests, because the bUnit tests in `NimbleBlazor.Tests` are unable to exercise/test that JavaScript code.

The `NimbleBlazor.Tests.Acceptance` project starts a local Blazor Web App which serves Razor pages that host the Nimble components. Then, xUnit-based acceptance tests start a Chromium instance using [Playwright](https://playwright.dev/), load those Razor pages, and interact with them. The majority of the tests use the `InteractiveServer` render mode, but the project also supports the Interactive Web Assembly render mode (and static server-side rendering mode) for tests. Tests should disable prerendering (as shown in the steps below) to ensure the components are ready for interaction when the Playwright test starts.

Expand Down
2 changes: 2 additions & 0 deletions packages/blazor-workspace/NimbleBlazor/NimbleBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<AssemblyName>NationalInstruments.NimbleBlazor</AssemblyName>
<RootNamespace>NationalInstruments.NimbleBlazor</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("NimbleBlazor.Tests")]
[assembly: InternalsVisibleTo("NationalInstruments.NimbleBlazor.Tests")]
6 changes: 3 additions & 3 deletions packages/blazor-workspace/NimbleBlazor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ Additional Resources: [Microsoft tutorial: Build a web app with Blazor](https://
- Visual Studio: "Project" >> "Manage NuGet Packages". Click the gear/Settings button. Add a new Package Source ("NimbleBlazor") as `[NimbleRepoDirectory]\packages\blazor-workspace\dist` and commit/ close Settings. Pick "NimbleBlazor" in the "Package Source" dropdown, and ensure "Include prerelease" is checked. Search for "NimbleBlazor", select it and click the "Install" button.
- VS Code: Run the command `dotnet add package NimbleBlazor --source [NimbleRepoDirectory]\packages\blazor-workspace\dist` in the Terminal window.
2. Add required references to Blazor code
- Open `_Imports.razor`, and add a new line at the bottom: `@using NimbleBlazor`
- Open `_Imports.razor`, and add a new line at the bottom: `@using NationalInstruments.NimbleBlazor`
- Open the HTML page (generally `App.razor` for Blazor Web Apps, or `wwwroot/index.html` for Blazor WebAssembly / Hybrid)

At the bottom of the `<head>` section (right before `</head>`), add
```html
<link href="_content/NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
<link href="_content/NationalInstruments.NimbleBlazor/nimble-tokens/css/fonts.css" rel="stylesheet" />
```
At the bottom of the `<body>` section (right before `</body>`), add
```html
<script src="_content/NimbleBlazor/nimble-components/all-components-bundle.min.js"></script>
<script src="_content/NationalInstruments.NimbleBlazor/nimble-components/all-components-bundle.min.js"></script>
```

Additional Resources: [`dotnet add package` documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-package)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
@inherits NimbleAnchorBase
<nimble-anchor
href="@Href"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

public partial class NimbleAnchor : NimbleAnchorBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
@inherits NimbleAnchorBase
<nimble-anchor-button
href="@Href"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

public partial class NimbleAnchorButton : NimbleAnchorBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
@inherits NimbleAnchorBase
<nimble-anchor-menu-item
href="@Href"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

public partial class NimbleAnchorMenuItem : NimbleAnchorBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
@inherits NimbleAnchorBase
<nimble-anchor-tab
href="@Href"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

/// <summary>
/// A link styled as a tab
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
<nimble-anchor-tabs
activeid="@BindConverter.FormatValue(ActiveId)"
@attributes="AdditionalAttributes">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

/// <summary>
/// A sequence of links styled as tabs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace NimbleBlazor
@namespace NationalInstruments.NimbleBlazor
@inherits NimbleAnchorBase
<nimble-anchor-tree-item
href="@Href"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;

namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

public partial class NimbleAnchorTreeItem : NimbleAnchorBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NimbleBlazor;
namespace NationalInstruments.NimbleBlazor;

public enum BannerSeverity
{
Expand Down
Loading
Loading