Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8785 - Update the new selected states in appmenu #9014

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# What's New with Enterprise

## v4.100.0

### v4.100.0 Features

- `[Application Menu]` Applied the new design to the selected states. ([#8785](https://github.com/infor-design/enterprise/issues/8785))

## v4.99.0

### v4.99.0 Features
Expand Down
5 changes: 3 additions & 2 deletions src/components/applicationmenu/_applicationmenu-new.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
}

.icon {
color: $app-menu-accordion-text-color !important;
top: -2px;

&.plus-minus {
Expand All @@ -211,7 +212,7 @@
}

&.is-focused:not(.hide-focus) {
border-color: $ids-color-palette-white;
border-color: $app-menu-accordion-header-focused-border-color;
box-shadow: none;
}

Expand All @@ -236,7 +237,7 @@
}

&.is-selected {
border-bottom-color: $ids-color-palette-white;
border-bottom-color: $app-menu-accordion-header-border-color;

> a > span {
font-weight: $ids-number-font-weight-bold;
Expand Down
24 changes: 24 additions & 0 deletions src/components/applicationmenu/_applicationmenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ body.is-open-touch {
overflow: hidden;
}

.application-menu {
.accordion.panel {
.accordion-header {
&.is-selected {
background-color: $app-menu-accordion-header-selected-bg-color !important;
border-color: transparent;

&.is-focused,
&:hover {
border-color: $app-menu-accordion-header-border-color-hover;
}

a > span {
color: $app-menu-accordion-header-text-selected !important;
}

.icon {
color: $app-menu-accordion-header-text-selected !important;
}
}
}
}
}

.resize-app-menu-container {
@include css3(transform, translateZ(0));
@include transition(left 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94),
Expand Down
7 changes: 7 additions & 0 deletions src/core/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,13 @@ $application-menu-searchfield-text-active-color: $ids-color-palette-white;

$application-menu-new-border-color: $ids-color-palette-white;

$app-menu-accordion-header-selected-bg-color: $ids-color-palette-azure-60;
$app-menu-accordion-header-focused-border-color: $app-menu-accordion-header-selected-bg-color;
$app-menu-accordion-header-text-selected: $ids-color-palette-white;
$app-menu-accordion-header-border-color: transparent;
$app-menu-accordion-header-border-color-hover: $ids-color-palette-slate-90;
$app-menu-accordion-text-color: $ids-color-palette-slate-20;

// Module Nav (App menu alternative)
$module-nav-bg-color: $ids-color-palette-slate-10;
$module-nav-border-color: $ids-color-palette-slate-30;
Expand Down
15 changes: 15 additions & 0 deletions tests/applicationmenu/applicationmenu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,22 @@ test.describe('Applicationmenu tests', () => {

test('should match the visual snapshot in percy', async ({ page, browserName }) => {
if (browserName !== 'chromium') return;

// Take the initial snapshot before the menu is opened
await percySnapshot(page, 'application-menu-light');

// Find and click the app menu button
const appMenuButton = await page.locator('#header-hamburger');
await appMenuButton.click();

// Wait for the 'transitionend' event to ensure the menu transition has finished
await page.evaluate(() => new Promise((resolve) => {
const element = document.querySelector('#application-menu');
element.addEventListener('transitionend', resolve, { once: true });
}));

// Take the snapshot after the transition is complete
await percySnapshot(page, 'application-menu-open-light');
});
});

Expand Down
Loading