Skip to content

Commit

Permalink
AppSideNav - deprioritize adoption (#2518)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex <alex-ju@users.noreply.github.com>
Co-authored-by: Jory Tindall <jory.tindall@hashicorp.com>
  • Loading branch information
3 people committed Oct 29, 2024
1 parent 35bbd4f commit b4973a6
Show file tree
Hide file tree
Showing 33 changed files with 479 additions and 512 deletions.
5 changes: 0 additions & 5 deletions .changeset/seven-mugs-think.md

This file was deleted.

12 changes: 0 additions & 12 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@
"./components/hds/app-frame/parts/main.js": "./dist/_app_/components/hds/app-frame/parts/main.js",
"./components/hds/app-frame/parts/modals.js": "./dist/_app_/components/hds/app-frame/parts/modals.js",
"./components/hds/app-frame/parts/sidebar.js": "./dist/_app_/components/hds/app-frame/parts/sidebar.js",
"./components/hds/app-header/home-link.js": "./dist/_app_/components/hds/app-header/home-link.js",
"./components/hds/app-header/index.js": "./dist/_app_/components/hds/app-header/index.js",
"./components/hds/app-header/menu-button.js": "./dist/_app_/components/hds/app-header/menu-button.js",
"./components/hds/app-side-nav/index.js": "./dist/_app_/components/hds/app-side-nav/index.js",
"./components/hds/app-side-nav/list/back-link.js": "./dist/_app_/components/hds/app-side-nav/list/back-link.js",
"./components/hds/app-side-nav/list/index.js": "./dist/_app_/components/hds/app-side-nav/list/index.js",
"./components/hds/app-side-nav/list/item.js": "./dist/_app_/components/hds/app-side-nav/list/item.js",
"./components/hds/app-side-nav/list/link.js": "./dist/_app_/components/hds/app-side-nav/list/link.js",
"./components/hds/app-side-nav/list/title.js": "./dist/_app_/components/hds/app-side-nav/list/title.js",
"./components/hds/app-side-nav/portal/index.js": "./dist/_app_/components/hds/app-side-nav/portal/index.js",
"./components/hds/app-side-nav/portal/target.js": "./dist/_app_/components/hds/app-side-nav/portal/target.js",
"./components/hds/app-side-nav/toggle-button.js": "./dist/_app_/components/hds/app-side-nav/toggle-button.js",
"./components/hds/application-state/body.js": "./dist/_app_/components/hds/application-state/body.js",
"./components/hds/application-state/footer.js": "./dist/_app_/components/hds/application-state/footer.js",
"./components/hds/application-state/header.js": "./dist/_app_/components/hds/application-state/header.js",
Expand Down
10 changes: 8 additions & 2 deletions packages/components/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ const plugins = [
'components/**/!(*types).js',
'helpers/**/*.js',
'modifiers/**/*.js',
'instance-initializers/**/*.js',
]),
'instance-initializers/**/*.js'],
{
exclude: [
'components/**/app-header/**/*.js',
'components/**/app-side-nav/**/*.js',
],
}
),

// Follow the V2 Addon rules about dependencies. Your code can import from
// `dependencies` and `peerDependencies` as well as standard Ember-provided
Expand Down
3 changes: 0 additions & 3 deletions packages/components/src/components/hds/side-nav/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{!
THIS COMPONENT IS NOW DEPRECATED
}}

{{! IMPORTANT: we need to add "squishies" here (~) because otherwise the whitespace added by Ember causes the empty element to still have visible padding - See https://handlebarsjs.com/guide/expressions.html#whitespace-control }}

Expand Down
15 changes: 0 additions & 15 deletions packages/components/src/components/hds/side-nav/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { registerDestructor } from '@ember/destroyable';
import { deprecate } from '@ember/debug';

import type { HdsSideNavBaseSignature } from './base';

Expand Down Expand Up @@ -74,20 +73,6 @@ export default class HdsSideNav extends Component<HdsSideNavSignature> {
registerDestructor(this, (): void => {
this.removeEventListeners();
});

deprecate(
'The `Hds::SideNav` component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::AppSideNav` instead.',
false,
{
id: 'hds.components.sidenav',
until: '5.0.0',
url: 'https://helios.hashicorp.design/components/side-nav?tab=version%20history#4140',
for: '@hashicorp/design-system-components',
since: {
enabled: '4.14.0',
},
}
);
}

addEventListeners(): void {
Expand Down
8 changes: 5 additions & 3 deletions showcase/app/templates/components/app-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

{{page-title "AppHeader Component"}}

<Shw::Text::H1>AppHeader</Shw::Text::H1>
<Shw::Text::H1>
AppHeader: removed from rollup, examples have been commented out
</Shw::Text::H1>

<section data-test-percy>
<Shw::Text::H2>Content</Shw::Text::H2>

<Shw::Text::H3>With generic content</Shw::Text::H3>
{{!-- <Shw::Text::H3>With generic content</Shw::Text::H3>
<Shw::Grid @columns={{1}} {{style gap="2rem"}} as |SG|>
<SG.Item>
Expand Down Expand Up @@ -570,5 +572,5 @@
</Hds::Dropdown>
</div>
</SG.Item>
</Shw::Grid>
</Shw::Grid> --}}
</section>
8 changes: 5 additions & 3 deletions showcase/app/templates/components/app-side-nav.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

{{page-title "AppSideNav Component"}}

<Shw::Text::H1>AppSideNav</Shw::Text::H1>
<Shw::Text::H1>
AppSideNav: removed from rollup, examples have been commented out
</Shw::Text::H1>

<section data-test-percy>
<Shw::Text::H2>Content</Shw::Text::H2>

<Shw::Text::H3>With generic content</Shw::Text::H3>
{{!-- <Shw::Text::H3>With generic content</Shw::Text::H3>
<Shw::Flex as |SF|>
<SF.Item @label="Body base invocation">
Expand Down Expand Up @@ -519,5 +521,5 @@
</SF.Item>
{{/each}}
{{/let}}
</Shw::Flex>
</Shw::Flex> --}}
</section>
7 changes: 5 additions & 2 deletions showcase/app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</li>
</ol>
</div>

<div>
<Shw::Text::H2>Components</Shw::Text::H2>
<ol class="shw-text-body">
Expand All @@ -42,7 +43,7 @@
AppFooter
</LinkTo>
</li>
<li>
{{! <li>
<LinkTo @route="components.app-header">
AppHeader
</LinkTo>
Expand All @@ -51,7 +52,7 @@
<LinkTo @route="components.app-side-nav">
AppSideNav
</LinkTo>
</li>
</li> }}
<li>
<LinkTo @route="components.application-state">
Application State
Expand Down Expand Up @@ -264,6 +265,7 @@
</li>
</ol>
</div>

<div>
<Shw::Text::H2>Layouts</Shw::Text::H2>
<ol class="shw-text-body">
Expand All @@ -281,6 +283,7 @@
</LinkTo>
</li>
</ol>

<Shw::Text::H2>Utilities</Shw::Text::H2>
<ol class="shw-text-body">
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

{{page-title "AppFrame Component - Frameless"}}

{{! NOTE: AppHeader & AppSideNav components are not published so components are commented out for now to satisfy linter }}

<Hds::AppFrame as |Frame|>
<Frame.Header>
<Hds::AppHeader>
{{!-- <Hds::AppHeader>
<:logo>
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" />
</:logo>
Expand Down Expand Up @@ -46,11 +48,11 @@
<dd.Interactive @href="#" @text="Account Settings" />
</Hds::Dropdown>
</:utilityActions>
</Hds::AppHeader>
</Hds::AppHeader> --}}
</Frame.Header>

<Frame.Sidebar>
<Hds::AppSideNav @isResponsive={{true}} @isCollapsible={{true}}>
{{!-- <Hds::AppSideNav @isResponsive={{true}} @isCollapsible={{true}}>
<Hds::AppSideNav::List class="hds-app-side-nav-hide-when-minimized" aria-label="Dashboard" as |SNL|>
<SNL.Link @icon="dashboard" @text="Dashboard" @isActive={{true}} />
</Hds::AppSideNav::List>
Expand All @@ -73,7 +75,7 @@
<SNL.Link @text="Settings" @icon="settings" @href="#" @hasSubItems={{true}} />
<SNL.Link @href="#" @isHrefExternal={{true}} @icon="guide" @text="Documentation" />
</Hds::AppSideNav::List>
</Hds::AppSideNav>
</Hds::AppSideNav> --}}
</Frame.Sidebar>

<Frame.Main>
Expand Down
2 changes: 2 additions & 0 deletions showcase/app/templates/layouts/app-frame/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@

<Shw::Text::H3>Framed</Shw::Text::H3>

{{! NOTE: AppHeader & AppSideNav components are not published so examples are commented out for now
<Shw::Frame
@id="demo-full-app-frame-with-app-header-and-app-side-nav"
@src="/layouts/app-frame/frameless/demo-full-app-frame-with-app-header-and-app-side-nav"
Expand All @@ -372,6 +373,7 @@
@height="780"
@label="Full AppFrame with AppHeader & old SideNav"
/>
}}

<Shw::Frame
@id="demo-full-app-frame-with-side-nav"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MPL-2.0
*/

import { module, test } from 'qunit';
import { module, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, resetOnerror, setupOnerror } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand All @@ -15,7 +15,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) {
resetOnerror();
});

test('it should render the component with a CSS class that matches the component name', async function (assert) {
skip('it should render the component with a CSS class that matches the component name', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" id="test-home-link" />`
);
Expand All @@ -24,7 +24,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) {

// CONTENT

test('it renders the passed in args', async function (assert) {
skip('it renders the passed in args', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" @href="https://www.hashicorp.com/" id="test-home-link" />`
);
Expand All @@ -35,7 +35,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) {
.hasAttribute('aria-label', 'HashiCorp');
});

test('it renders the logo with a custom passed in color', async function (assert) {
skip('it renders the logo with a custom passed in color', async function (assert) {
await render(
hbs`<Hds::AppHeader::HomeLink @icon="boundary" @ariaLabel="Boundary" @color="var(--token-color-boundary-brand)" @href="#" />`
);
Expand All @@ -46,7 +46,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) {

// ASSERTIONS

test('it should throw an assertion if @ariaLabel is missing/has no value', async function (assert) {
skip('it should throw an assertion if @ariaLabel is missing/has no value', async function (assert) {
const errorMessage =
'@ariaLabel for "Hds::AppHeader::HomeLink" ("Logo") must have a valid value';
assert.expect(2);
Expand Down
Loading

0 comments on commit b4973a6

Please sign in to comment.