-
Notifications
You must be signed in to change notification settings - Fork 14
feat: add navigation-item component #1167
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
Conversation
|
🔭🐙🐈 Test this branch here: https://db-ui.github.io/mono/review/feat-nav-item-component |
This reverts commit 972f22b.
…nent # Conflicts: # __snapshots__/button/showcase-button.spec.ts-snapshots/DBButton-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/button/showcase-button.spec.ts-snapshots/DBButton-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/home/showcase-home.spec.ts-snapshots/Home-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/home/showcase-home.spec.ts-snapshots/Home-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/infotext/showcase-infotext.spec.ts-snapshots/DBInfotext-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/infotext/showcase-infotext.spec.ts-snapshots/DBInfotext-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/input/showcase-input.spec.ts-snapshots/DBInput-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/input/showcase-input.spec.ts-snapshots/DBInput-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/link/showcase-link.spec.ts-snapshots/DBLink-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/link/showcase-link.spec.ts-snapshots/DBLink-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/section/showcase-section.spec.ts-snapshots/DBSection-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/section/showcase-section.spec.ts-snapshots/DBSection-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png
…at-nav-item-component
…nent # Conflicts: # __snapshots__/button/showcase-button.spec.ts-snapshots/DBButton-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/home/showcase-home.spec.ts-snapshots/Home-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/infotext/showcase-infotext.spec.ts-snapshots/DBInfotext-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/infotext/showcase-infotext.spec.ts-snapshots/DBInfotext-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/input/showcase-input.spec.ts-snapshots/DBInput-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/input/showcase-input.spec.ts-snapshots/DBInput-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-webkit-linux.png # __snapshots__/link/showcase-link.spec.ts-snapshots/DBLink-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png # __snapshots__/section/showcase-section.spec.ts-snapshots/DBSection-should-match-screenshot-for-tonality-regular-and-color-neutral-0-1-chromium-linux.png
packages/components/src/components/navigation-item/navigation-item.lite.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/navigation-item/navigation-item.lite.tsx
Show resolved
Hide resolved
packages/components/src/components/navigation-item/navigation-item.lite.tsx
Show resolved
Hide resolved
packages/components/src/components/navigation-item/navigation-item.lite.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/navigation-item/navigation-item.lite.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/navigation-item/navigation-item.scss
Outdated
Show resolved
Hide resolved
…nent # Conflicts: # __snapshots__/button/showcase/chromium/regular/neutral-0/DBButton-should-match-screenshot.png # __snapshots__/button/showcase/mobile-chrome/regular/neutral-0/DBButton-should-match-screenshot.png # __snapshots__/button/showcase/mobile-safari/regular/neutral-0/DBButton-should-match-screenshot.png # __snapshots__/button/showcase/webkit/regular/neutral-0/DBButton-should-match-screenshot.png # __snapshots__/infotext/showcase/chromium/regular/neutral-0/DBInfotext-should-match-screenshot.png # __snapshots__/infotext/showcase/mobile-chrome/regular/neutral-0/DBInfotext-should-match-screenshot.png # __snapshots__/infotext/showcase/mobile-safari/regular/neutral-0/DBInfotext-should-match-screenshot.png # __snapshots__/infotext/showcase/webkit/regular/neutral-0/DBInfotext-should-match-screenshot.png # __snapshots__/input/showcase/chromium/regular/neutral-0/DBInput-should-match-screenshot.png # __snapshots__/input/showcase/mobile-chrome/regular/neutral-0/DBInput-should-match-screenshot.png # __snapshots__/input/showcase/mobile-safari/regular/neutral-0/DBInput-should-match-screenshot.png # __snapshots__/input/showcase/webkit/regular/neutral-0/DBInput-should-match-screenshot.png # __snapshots__/link/showcase/chromium/regular/neutral-0/DBLink-should-match-screenshot.png # __snapshots__/link/showcase/mobile-chrome/regular/neutral-0/DBLink-should-match-screenshot.png # __snapshots__/link/showcase/mobile-safari/regular/neutral-0/DBLink-should-match-screenshot.png # __snapshots__/link/showcase/webkit/regular/neutral-0/DBLink-should-match-screenshot.png # __snapshots__/section/showcase/chromium/regular/neutral-0/DBSection-should-match-screenshot.png # __snapshots__/section/showcase/mobile-chrome/regular/neutral-0/DBSection-should-match-screenshot.png # __snapshots__/section/showcase/mobile-safari/regular/neutral-0/DBSection-should-match-screenshot.png # __snapshots__/section/showcase/webkit/regular/neutral-0/DBSection-should-match-screenshot.png
| ... | ||
| <body> | ||
| <a href="mypath"> | ||
| <li aria-haspopup="false" class="db-navigation-item"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-haspopup isn't supposed to get set on tags with this role:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#associated_roles
| <!-- If you want to use it as main-naivgation with pulse--> | ||
| <div class="active-indicator" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check whether we really need a block level element for this and cannot achieve it either via ::after { content: ""; } or at least changing it to a <span>.
| state.iconVisible(props.iconAfter) ? props.iconAfter : undefined | ||
| } | ||
| aria-current={props.active ? 'page' : undefined} | ||
| data-disabled={props.disabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use aria-disabled instead of data-disabled, as the latter doesn't imply any semantic meaning which we'd like to enable by using aria-disabled instead.
| return ( | ||
| <li | ||
| ref={component} | ||
| role={state.hasAreaPopup ? 'button' : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would lead to having several buttons and menus wrapped into each other, which would either be a nightmare or totally abstracted content especially to screenreader users.
| if (children?.length > 0) { | ||
| state.hasAreaPopup = true; | ||
| } else { | ||
| state.hideSubNavigation = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This it not necessarily about showing or hiding depending on a (dynamic like e.g. viewport size) condition, but not having any subitems and that for we wouldn't want to render that part. So it might be more clear and even also separated from the visual meaning to name it e.g. like lacksSubNavigation
No description provided.