Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
25cac76
HDS-3770 Update SideNav Showcase to replace deprecated IconButton & a…
KristinLBradley Aug 21, 2024
b842c96
HDS-3770 Fix issue with width of Showcase examples
KristinLBradley Aug 26, 2024
ec2b2c2
HDS-3770 Fix layout of nested content examples
KristinLBradley Aug 27, 2024
d740854
HDS-3770 Deprecate actual IconButton component
KristinLBradley Aug 27, 2024
cdb11cd
HDS-3770 Tweaks to text, version numbers, and comment
KristinLBradley Aug 27, 2024
b6e7ae4
HDS-3770 Update version number and url in deprecation, add changeset
KristinLBradley Aug 27, 2024
60d53d7
HDS-377 Improve deprecation notice
KristinLBradley Aug 27, 2024
bb27a1a
Apply suggestions from code review
KristinLBradley Aug 29, 2024
8fd4318
HDS-3770 Add link to :actions code example in Web docs deprecation no…
KristinLBradley Aug 30, 2024
0e8dca4
HDS-3770 Refactor nested Button state examples to reduce code repetition
KristinLBradley Aug 30, 2024
28154d7
HDS-3770 Refactor styles for Showcase button example wrappers
KristinLBradley Aug 30, 2024
f6fb8db
HDS-3770 Rename classname to reference sidenav
KristinLBradley Aug 30, 2024
8295889
HDS-3770 Add version history file
KristinLBradley Sep 3, 2024
488679c
Update new-teachers-pay.md
KristinLBradley Sep 3, 2024
1441b72
Update website/docs/components/side-nav/partials/version-history/4.10…
KristinLBradley Sep 3, 2024
ba7d5c2
Update showcase/app/styles/showcase-pages/side-nav.scss
KristinLBradley Sep 3, 2024
54a75c7
Merge branch 'main' into hds-3770-deprecate-sidenav-iconbutton
KristinLBradley Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/new-teachers-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashicorp/design-system-components": minor
---

`Hds::SideNav::Header::IconButton` - Deprecate the component. Use the `Hds::Button` component with `isIconOnly` set to `true` as a replacement.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}

{{!
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of adding this to the template πŸ‘

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I copied from someone else :)

THIS SUBCOMPONENT IS NOW DEPRECATED
}}
<Hds::Interactive
class="hds-side-nav__icon-button"
@current-when={{@current-when}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Component from '@glimmer/component';
import { assert } from '@ember/debug';
import { assert, deprecate } from '@ember/debug';

import type { HdsIconSignature } from '../../icon';
import type { HdsInteractiveSignature } from '../../interactive/';
Expand All @@ -18,11 +18,27 @@ interface HdsSideNavHeaderIconButtonSignature {
}

export default class HdsSideNavHeaderIconButtonComponent extends Component<HdsSideNavHeaderIconButtonSignature> {
/**
* @param ariaLabel
* @type {string}
* @description The value of `aria-label`
*/
constructor(
owner: unknown,
args: HdsSideNavHeaderIconButtonSignature['Args']
) {
super(owner, args);

deprecate(
'The `Hds::SideNav::Header::IconButton` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::Button` with the `isIconOnly` variant instead.',
false,
{
id: 'hds.components.sidenav.header.iconbutton',
until: '5.0.0',
url: 'https://helios.hashicorp.design/components/side-nav?tab=version%20history#4100',
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like we're missing the actual content that should appear on the version tab outlining the changes here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you explain a bit more? Do I manually add an .md file in "website/docs/components/side-nav/partials/version-history/" like the "4.8.0.md" in there now?

Do I copy the changeset text into it (pasted below)?

"Deprecated the component. Use the Hds::Button component with isIconOnly set to true as a replacement."

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds roughly correct to me. You should be able to mimic what Zack did in https://github.com/hashicorp/design-system/pull/2347/files if you're looking for a reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for: '@hashicorp/design-system-components',
since: {
enabled: '4.10.0',
},
}
);
}

get ariaLabel(): string {
const { ariaLabel } = this.args;

Expand Down
24 changes: 23 additions & 1 deletion showcase/app/routes/components/side-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,26 @@

import Route from '@ember/routing/route';

export default class ComponentsSideNavRoute extends Route {}
import { COLORS as DROPDOWN_TOGGLE_BUTTON_COLORS } from '@hashicorp/design-system-components/components/hds/dropdown/toggle/button';
import { COLORS as DROPDOWN_ITEM_INTERACTIVE_COLORS } from '@hashicorp/design-system-components/components/hds/dropdown/list-item/interactive';

export default class ComponentsSideNavRoute extends Route {
model() {
// these are used only for presentation purpose in the showcase
const DROPDOWN_TOGGLE_STATES = [
'default',
'hover',
'active',
'focus',
'disabled',
];
const DROPDOWN_ITEM_STATES = ['default', 'hover', 'active', 'focus'];

return {
DROPDOWN_TOGGLE_BUTTON_COLORS,
DROPDOWN_TOGGLE_STATES,
DROPDOWN_ITEM_INTERACTIVE_COLORS,
DROPDOWN_ITEM_STATES,
};
}
}
28 changes: 28 additions & 0 deletions showcase/app/styles/showcase-pages/side-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
body.components-side-nav {
$shw-component-side-nav-background: #0c0c0e;

// constrain max-width of button examples
.shw-component-button-examples-section {
.hds-side-nav:has(button) {
width: max-content;
// The heights don't make a visual difference with the current component style but if you inspect you will see that
// there is extra space around the button examples which could cause an unforeseen issue. So for that reason, we override the height.
height: auto;
min-height: 0;
}
}

// used to simulate a "root" container for the sidenav
.shw-component-sim-side-nav-root-container {
height: 600px;
Expand Down Expand Up @@ -79,4 +90,21 @@ body.components-side-nav {
transform: none !important;
}
}

.shw-component-sidenav-dropdown-states-matrix {
.shw-grid__item {
// we hide all the labels (except for the first "row")
&:nth-child(n + 7) {
.shw-label {
visibility: hidden;
}
}
// we show the labels in the first "column"
&:nth-child(6n + 1) {
.shw-label {
visibility: visible;
}
}
}
}
}
48 changes: 16 additions & 32 deletions showcase/app/templates/components/app-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -347,38 +347,22 @@

<Shw::Text::H4>States</Shw::Text::H4>

<Shw::Text::Body>Secondary</Shw::Text::Body>
<Shw::Flex as |SF|>
{{#let (array "default" "hover" "active" "focus" "disabled") as |states|}}
{{#each states as |state|}}
<SF.Item @label={{state}}>
<div class="hds-app-header">
<Hds::Button
@color="secondary"
@icon="search"
@isIconOnly={{true}}
@text="Search"
mock-state-value={{state}}
/>
</div>
</SF.Item>
{{/each}}
{{/let}}
</Shw::Flex>

<Shw::Text::Body>Primary</Shw::Text::Body>
<Shw::Flex as |SF|>
{{#let (array "default" "hover" "active" "focus" "disabled") as |states|}}
{{#each states as |state|}}
<SF.Item @label={{state}}>

<div class="hds-app-header">
<Hds::Button @icon="search" @isIconOnly={{true}} @text="Search" mock-state-value={{state}} />
</div>
</SF.Item>
{{/each}}
{{/let}}
</Shw::Flex>
{{#let (array "Primary" "Secondary") as |colors|}}
{{#each colors as |color|}}
<Shw::Text::Body>{{color}}</Shw::Text::Body>
<Shw::Flex as |SF|>
{{#let (array "default" "hover" "active" "focus" "disabled") as |states|}}
{{#each states as |state|}}
<SF.Item @label={{state}}>
<div class="hds-app-header">
<Hds::Button @icon="search" @isIconOnly={{true}} @text="Search" mock-state-value={{state}} />
</div>
</SF.Item>
{{/each}}
{{/let}}
</Shw::Flex>
{{/each}}
{{/let}}

<Shw::Divider @level="2" />

Expand Down
Loading