From 25cd34afdb458ab343d89e30c56c28f6007fdab8 Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Wed, 14 Sep 2022 15:07:54 +0200 Subject: [PATCH 1/6] fix(navigation): adjust mobile behaviour --- package-lock.json | 24 -------- .../bal-list-item-accordion-head.tsx | 5 +- .../bal-list/bal-list-item/bal-list-item.tsx | 5 ++ .../src/components/bal-logo/bal-logo.sass | 3 +- .../bal-navigation-meta.tsx | 2 +- .../bal-navigation/bal-navigation.sass | 20 ++++--- .../bal-navigation/bal-navigation.tsx | 55 +++++++++++++++++-- .../stories/bal-navigation.stories.ts | 2 +- .../src/components/bal-stage/bal-stage.tsx | 17 ++++-- .../src/components/bal-tabs/bal-tabs.tsx | 3 - .../src/stories/design/css.stories.ts | 5 -- packages/css/scss/form/button.sass | 1 + packages/css/scss/form/tools.sass | 10 +++- packages/css/scss/layout/container.sass | 2 - 14 files changed, 94 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeecc498a..53eacbbbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,10 +7,6 @@ "name": "root", "hasInstallScript": true, "license": "Apache-2.0", - "dependencies": { - "@types/body-scroll-lock": "^3.1.0", - "body-scroll-lock": "^4.0.0-beta.0" - }, "devDependencies": { "@angular/common": "~12.2.16", "@angular/compiler": "~12.2.16", @@ -12495,11 +12491,6 @@ "integrity": "sha512-UiWyJ6TLWoHeHZ8VUyngzCOwJDVxTsPnqfAMR/85X93rkRk5A4T2U42BCx0wCmZdtMHGHN/utJ8ft5xWu0V1bA==", "dev": true }, - "node_modules/@types/body-scroll-lock": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/body-scroll-lock/-/body-scroll-lock-3.1.0.tgz", - "integrity": "sha512-3owAC4iJub5WPqRhxd8INarF2bWeQq1yQHBgYhN0XLBJMpd5ED10RrJ3aKiAwlTyL5wK7RkBD4SZUQz2AAAMdA==" - }, "node_modules/@types/chai": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", @@ -15104,11 +15095,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/body-scroll-lock": { - "version": "4.0.0-beta.0", - "resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-4.0.0-beta.0.tgz", - "integrity": "sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==" - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -50033,11 +50019,6 @@ "integrity": "sha512-UiWyJ6TLWoHeHZ8VUyngzCOwJDVxTsPnqfAMR/85X93rkRk5A4T2U42BCx0wCmZdtMHGHN/utJ8ft5xWu0V1bA==", "dev": true }, - "@types/body-scroll-lock": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/body-scroll-lock/-/body-scroll-lock-3.1.0.tgz", - "integrity": "sha512-3owAC4iJub5WPqRhxd8INarF2bWeQq1yQHBgYhN0XLBJMpd5ED10RrJ3aKiAwlTyL5wK7RkBD4SZUQz2AAAMdA==" - }, "@types/chai": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", @@ -52185,11 +52166,6 @@ } } }, - "body-scroll-lock": { - "version": "4.0.0-beta.0", - "resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-4.0.0-beta.0.tgz", - "integrity": "sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==" - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", diff --git a/packages/components/src/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.tsx b/packages/components/src/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.tsx index d7ac1f98b..93166c958 100644 --- a/packages/components/src/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.tsx +++ b/packages/components/src/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.tsx @@ -12,6 +12,7 @@ export class ListItemAccordionHead { * If `true` the list accordion is open */ @Prop() accordionOpen = false + /** * Icon name string with value 'plus' on default */ @@ -34,7 +35,7 @@ export class ListItemAccordionHead { return this.el.closest('bal-list-item') } - clickHandler() { + private onClick = () => { const listItem = this.getClosestListItem() if (listItem) { this.accordionOpen = !this.accordionOpen @@ -49,7 +50,7 @@ export class ListItemAccordionHead { 'bal-list-item-accordion-head bal-list-item': true, 'is-open': this.accordionOpen, }} - onClick={() => this.clickHandler()} + onClick={this.onClick} > diff --git a/packages/components/src/components/bal-list/bal-list-item/bal-list-item.tsx b/packages/components/src/components/bal-list/bal-list-item/bal-list-item.tsx index 155ead418..ab74410cd 100644 --- a/packages/components/src/components/bal-list/bal-list-item/bal-list-item.tsx +++ b/packages/components/src/components/bal-list/bal-list-item/bal-list-item.tsx @@ -1,4 +1,5 @@ import { Component, Host, h, Prop, Event, EventEmitter, Element } from '@stencil/core' +import { stopEventBubbling } from '../../../helpers/form-input.helpers' import { Props } from '../../../types' @Component({ @@ -139,6 +140,10 @@ export class ListItem { 'is-disabled': this.disabled, 'is-sub-accordion-item': this.subAccordionItem, }} + onClick={(event: MouseEvent) => { + stopEventBubbling(event) + this.balNavigate.emit(event) + }} >
diff --git a/packages/components/src/components/bal-logo/bal-logo.sass b/packages/components/src/components/bal-logo/bal-logo.sass index 2db06865a..ffb3b0986 100644 --- a/packages/components/src/components/bal-logo/bal-logo.sass +++ b/packages/components/src/components/bal-logo/bal-logo.sass @@ -8,7 +8,8 @@ & > div height: 1.25rem +modifier('animated') - margin-left: -7px + +desktop + margin-left: -7px +modifier('white') +fillSvg($white) +desktop diff --git a/packages/components/src/components/bal-navigation/bal-navigation-meta/bal-navigation-meta.tsx b/packages/components/src/components/bal-navigation/bal-navigation-meta/bal-navigation-meta.tsx index ab213b01c..60bc11cc9 100644 --- a/packages/components/src/components/bal-navigation/bal-navigation-meta/bal-navigation-meta.tsx +++ b/packages/components/src/components/bal-navigation/bal-navigation-meta/bal-navigation-meta.tsx @@ -19,7 +19,7 @@ export class NavigationMeta implements ComponentInterface { ...metaEl.class(), }} > -