From 00d2be23061d5c9be57ec5e54dddbe8c812e995a Mon Sep 17 00:00:00 2001 From: Cory Rylan Date: Thu, 30 Apr 2026 16:30:39 -0500 Subject: [PATCH 1/2] chore(docs): improve migration docs and layouts Signed-off-by: Cory Rylan --- projects/site/eleventy.config.js | 8 +- projects/site/src/_11ty/shortcodes/index.js | 24 ++ projects/site/src/docs/about/migration.md | 218 +++++++++--------- projects/site/src/docs/about/support.md | 2 +- .../site/src/docs/changelog/index.11ty.js | 2 +- projects/site/src/docs/patterns/index.md | 2 +- 6 files changed, 145 insertions(+), 111 deletions(-) diff --git a/projects/site/eleventy.config.js b/projects/site/eleventy.config.js index 9c6517d87..d0f2282cf 100644 --- a/projects/site/eleventy.config.js +++ b/projects/site/eleventy.config.js @@ -21,7 +21,12 @@ import { elementLoaderTransform } from './src/_11ty/transforms/element-loader.js import { anchorGeneratorTransform } from './src/_11ty/transforms/anchor-generator.js'; import { htmlMinifyTransform } from './src/_11ty/transforms/html-minify.js'; import { envReplaceTransform } from './src/_11ty/transforms/env-replace.js'; -import { installShortcode, doDontShortcode, splitShortcode } from './src/_11ty/shortcodes/index.js'; +import { + installShortcode, + doDontShortcode, + beforeAfterShortcode, + splitShortcode +} from './src/_11ty/shortcodes/index.js'; import { exampleShortcode, exampleTagsShortcode } from './src/_11ty/shortcodes/example.js'; import { exampleDocShortcode } from './src/_11ty/shortcodes/example-doc.js'; import { exampleGroupShortcode } from './src/_11ty/shortcodes/example-group.js'; @@ -198,6 +203,7 @@ export default function (eleventyConfig) { eleventyConfig.addShortcode('artifactory-usage', renderArtifactoryUsageShortcode); eleventyConfig.addPairedShortcode('dodont', doDontShortcode); eleventyConfig.addPairedShortcode('split', splitShortcode); + eleventyConfig.addPairedShortcode('before-after', beforeAfterShortcode); // Register custom transforms for content processing eleventyConfig.addTransform('env-replace', envReplaceTransform); diff --git a/projects/site/src/_11ty/shortcodes/index.js b/projects/site/src/_11ty/shortcodes/index.js index 190838647..95d4c4c89 100644 --- a/projects/site/src/_11ty/shortcodes/index.js +++ b/projects/site/src/_11ty/shortcodes/index.js @@ -66,6 +66,30 @@ export async function doDontShortcode(content) { `; } +export async function beforeAfterShortcode(content) { + return /* html */ ` +
+ +
+ Before + After +
+
+ ${content} +
+
`; +} + export async function splitShortcode(content) { return /* html */ `
diff --git a/projects/site/src/docs/about/migration.md b/projects/site/src/docs/about/migration.md index 38696dfd2..439a0067c 100644 --- a/projects/site/src/docs/about/migration.md +++ b/projects/site/src/docs/about/migration.md @@ -6,6 +6,12 @@ } --- + + # {{ title }} This guide covers migrating from the internal `@nve/*` packages to the new open source `@nvidia-elements/*` packages. @@ -14,8 +20,6 @@ This guide covers migrating from the internal `@nve/*` packages to the new open The Elements Design System is now hosted and developed in a public GitHub repository. Packages are now published to the public npm registry under the `@nvidia-elements` scope. The component APIs, tag names, and theming system remain the same. The primary changes are package names, import paths, and registry configuration. -## Package Name Changes - | Internal Package | New Package | | -------------------- | --------------------------- | | `@nve/elements` | `@nvidia-elements/core` | @@ -30,8 +34,6 @@ The Elements Design System is now hosted and developed in a public GitHub reposi | `@nve-labs/media` | `@nvidia-elements/media` | | `@nve-labs/lint` | `@nvidia-elements/lint` | -Note: `@nve/elements` is now `@nvidia-elements/core`, not `@nvidia-elements/elements`. - ## Migration Steps ### 1. Update Registry Configuration @@ -71,84 +73,89 @@ Replace import paths throughout your source code: + import '@nvidia-elements/themes/dist/index.css'; ``` -### 4. Install Updated Packages +## Deprecations & Removals -```shell -# pnpm -pnpm install +The following are the active deprecations. Each next major release removes the prior deprecations. Read more about the versioning and deprecation cycle policy. -# npm -npm install -``` +### Logo removed -### 5. Verify +The `nve-logo` component no longer includes the NVIDIA SVG logo; consumers must provide their own SVG as child content in the default slot. -Run your project's build and tests to confirm everything resolves correctly: +{% before-after %} -```shell -pnpm run build -pnpm run test +```html + ``` -## API Changes - -`@nvidia-elements/core` no longer includes the following internal-only or deprecated pre-1.0 Maglev APIs, and the public packages omit them: +```html + + NVIDIA + +``` -| API | Change | -| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `@nvidia-elements/core/app-header` | (pre-maglev) replaced by `@nvidia-elements/core/page-header` | -| `@nvidia-elements/core/css/*` | (pre-maglev) replaced by `@nvidia-elements/styles` | -| `@nvidia-elements/core/index.css` | (pre-maglev) replaced by `@nvidia-elements/styles` | -| `@nvidia-elements/core/logo` | The logo component no longer includes the NVIDIA SVG logo; consumers must provide their own SVG as child content in the default slot | +{% endbefore-after %} -All prior Maglev based conventions and prefixes are now removed. +### Popover Behavior Triggers deprecated -## What Stays the Same +Before native HTML popovers, popovers required `behaviorTrigger` or `behavior-trigger` for stateful popovers. The native [HTML popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) replaces this approach. -- **Component tag prefix**: All components continue to use the `nve-` prefix (``, ``, etc.) -- **CSS custom properties**: Theme tokens and component CSS custom properties keep the same names (`--nve-*`) -- **Component APIs**: Properties, attributes, events, slots, and CSS parts remain the same -- **Theme files**: Same theme names and token structure +{% before-after %} -## Deprecations +```html + +tooltip +``` -The following are the active deprecations. Each next major release removes the prior deprecations. Read more about the versioning and deprecation cycle policy. +```html +hello there +tooltip +``` -### @nvidia-elements 0.x +{% endbefore-after %} -TBD +### Layout Full deprecated -### @nve/testing deprecated +The `grow` property now uses `full` instead to avoid confusion with flexbox grow behavior. -The custom test utilities are now deprecated. +{% before-after %} -### @nve/elements +```html +
+``` -#### Scoped Tags deprecated +```html +
+``` -Avoid `@nve/elements/scoped`. Instead, consuming applications define their own tag name and leverage the `@lit-labs/scoped-registry-mixin` package directly. +{% endbefore-after %} -#### Popover Behavior Triggers deprecated +### Typography "eyebrow" deprecated -Before native HTML popovers, popovers required `behaviorTrigger` or `behavior-trigger` for stateful popovers. The native [HTML popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) replaces this approach. +The typography `eyebrow` utility no longer exists, to align with the standardized semantic names and size options available. -Before: +{% before-after %} ```html - -tooltip +
``` -After: - ```html -hello there -tooltip +
``` -### @maglev/elements +{% endbefore-after %} + +### @nve/testing removed + +The custom test utilities are no longer supported in the public scope. + +### Scoped Tags removed + +Avoid `@nve/elements/scoped`. Instead, consuming applications define their own tag name and leverage the `@lit-labs/scoped-registry-mixin` package directly. + +### Maglev - CSS Entrypoints removed -#### Scope deprecated +{% before-after %} ```css /* before */ @@ -156,8 +163,6 @@ Before native HTML popovers, popovers required `behaviorTrigger` or `behavior-tr @import '@maglev/elements/inter.css'; ``` -After: - ```css @import '@nvidia-elements/themes/fonts/inter.css'; @import '@nvidia-elements/themes/index.css'; @@ -171,9 +176,13 @@ Before native HTML popovers, popovers required `behaviorTrigger` or `behavior-tr @import '@nvidia-elements/styles/view-transitions.css'; ``` +{% endbefore-after %} + +### Maglev - CSS Prefix removed + Update any CSS Custom property usage -Before: +{% before-after %} ```css .selector { @@ -181,51 +190,79 @@ Update any CSS Custom property usage } ``` -After: - ```css .selector { color: var(--nve-ref-color-brand-green-200); } ``` +{% endbefore-after %} + +### Maglev - Attribute Prefix removed + Update style utility attributes -Before: +{% before-after %} -````html +```html

``` -After: - ```html

-```` +``` + +{% endbefore-after %} + +### Maglev - HTML Prefix removed Update HTML elements -Before: +{% before-after %} ```html ... ``` -After: - ```html ... ``` -#### Alert Banner deprecated +{% endbefore-after %} + +### Maglev - App Header removed + +`nve-page-header` replaces the early Maglev scoped package `mlv-app-header`. + +{% before-after %} + +```html + + ... + +``` + +```html + + NV +

Infrastructure

+ Link 1 + Link 2 + EL + +``` + +{% endbefore-after %} + +### Maglev - Alert Banner removed The alert banner component no longer exists. Use `nve-alert-group` with the `prominence="emphasis"` option. -Before: +{% before-after %} ```html @@ -235,8 +272,6 @@ The alert banner component no longer exists. Use `nve-alert-group` with the `pro ``` -After: - ```html @@ -245,48 +280,17 @@ The alert banner component no longer exists. Use `nve-alert-group` with the `pro ``` -#### JSON Viewer deprecated - -The JSON viewer element is an internal API. You can access this API via the public exports but should avoid using it. Use `nve-codeblock` or `nve-monaco-input` for JSON content rendering. - -#### Layout Full deprecated - -The `grow` property now uses `full` instead to avoid confusion with flexbox grow behavior. +{% endbefore-after %} -Before: +### Maglev - JSON Viewer removed -```html -
-``` - -After: - -```html -
-``` - -#### Typography "eyebrow" deprecated - -The typography `eyebrow` utility no longer exists, to align with the standardized semantic names and size options available. - -Before: - -```html -
-``` - -After: - -```html -
-``` +The JSON viewer element is an internal API. You can access this API via the public exports but should avoid using it. Use `nve-codeblock` or `nve-monaco-input` for JSON content rendering. -#### Icon Names deprecated +### Maglev - Icon Names removed The following icons now use new names: - | before | after | | ------------------ | ------------------------- | @@ -324,11 +328,11 @@ The following icons now use new names: -### Icon Button Name Directions deprecated +### Maglev - Icon Button Name Directions removed With the deprecation of directional icons the icon button now requires a explicit direction. -Before: +{% before-after %} ```html @@ -345,8 +349,6 @@ With the deprecation of directional icons the icon button now requires a explici ``` -After: - ```html @@ -360,3 +362,5 @@ With the deprecation of directional icons the icon button now requires a explici ``` + +{% endbefore-after %} diff --git a/projects/site/src/docs/about/support.md b/projects/site/src/docs/about/support.md index 6d8aba57f..051618f80 100644 --- a/projects/site/src/docs/about/support.md +++ b/projects/site/src/docs/about/support.md @@ -23,7 +23,7 @@ Elements [supports a wide variety](https://custom-elements-everywhere.com) of JavaScript frameworks and libraries as well as vanilla JS. Read more at the [installation](./docs/about/installation/) page. -
+
{% svg-logo 'typescript' '18' %} TypeScript diff --git a/projects/site/src/docs/changelog/index.11ty.js b/projects/site/src/docs/changelog/index.11ty.js index e5b4085df..5d92b010a 100644 --- a/projects/site/src/docs/changelog/index.11ty.js +++ b/projects/site/src/docs/changelog/index.11ty.js @@ -19,7 +19,7 @@ export function render() { # Changelog -
+
${changelogs .map( changelog => /* html */ ` diff --git a/projects/site/src/docs/patterns/index.md b/projects/site/src/docs/patterns/index.md index aecee0a70..57a4d7740 100644 --- a/projects/site/src/docs/patterns/index.md +++ b/projects/site/src/docs/patterns/index.md @@ -20,7 +20,7 @@ Patterns are an essential component of creating a cohesive and consistent user experience. Patterns are pre-defined combinations of existing components that teams reuse across different parts of the platform to streamline development and ensure consistency in the UI. By grouping components into patterns, teams can create a more organized and maintainable UI, as well as provide a unified look and feel for all users. -