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

Feat: Introduce NavigationItem subcomponent and showcase Header with Navigation and Dropdown #1840

Open
wants to merge 4 commits into
base: feature/unstyled-button
Choose a base branch
from

Conversation

crishpeen
Copy link
Member

Description

Additional context

Issue reference

@crishpeen crishpeen added the run-visual-tests Runs visual regression testing on this PR label Jan 8, 2025
@github-actions github-actions bot added the feature New feature or request label Jan 8, 2025
@crishpeen crishpeen mentioned this pull request Jan 8, 2025
@coveralls
Copy link

Coverage Status

coverage: 96.838%. remained the same
when pulling d36c4c0 on feature/header-navigation-dropdown
into 14ebbb7 on feature/unstyled-button.

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for spirit-design-system-storybook ready!

Name Link
🔨 Latest commit d36c4c0
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/677e866885318d0008963f11
😎 Deploy Preview https://deploy-preview-1840--spirit-design-system-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit d36c4c0
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system/deploys/677e86681fd98400086e136d
😎 Deploy Preview https://deploy-preview-1840--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (no change from production)
Accessibility: 91 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@adamkudrna adamkudrna left a comment

Choose a reason for hiding this comment

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

Nice!

align-items: center;
}

.NavigationItem--stretchChildren,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's just the AlignmentYExtended dictionary alone, isn't it? 🙂 Now it looks a bit strange to me like this, but I think we will be able to get rid of this modifier once we abstract the alignment classes (and people will be able to use also other alignments here if needed).

Comment on lines 6 to 10
$link-typography: tokens.$body-small-semibold;
$link-gap: tokens.$space-600;
$link-spacing: tokens.$space-600;
$link-color-state-default: tokens.$component-header-item-state-default;
$link-color-state-hover: tokens.$component-header-item-state-hover;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't these all start with action instead of link?

Comment on lines +43 to +44
It centers its children vertically if the children are not NavigationAction components or
it does not have the `.NavigationItem--stretchChildren` class.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would turn this around so it's more comprehensible (hopefully): If there is a NavigationAction inside or the XY modifier is present, it stretches its content vertically. In all other cases, the content is vertically centered.

display: flex;
align-items: stretch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed? It works without it for me.

@@ -29,7 +29,9 @@ export type NavigationActionProps<E extends ElementType> = {
elementType?: E;
} & NavigationActionBaseProps;

export interface SpiritNavigationItemProps extends ChildrenProps, StyleProps {}
export interface SpiritNavigationItemProps extends ChildrenProps, StyleProps {
isStretchingChildren?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

🕺 🙈

hasChildrenStretched / hasStretchedChildren Also not great…

@@ -43,11 +43,27 @@ import { NavigationItem } from '@lmc-eu/spirit-web-react';
<NavigationItem>{/* Navigation actions go here */}</NavigationItem>;
```

If the children are not `NavigationAction` components or the `NavigationItem` does not have the
`isStretchingChildren` class, it will centre its children vertically.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`isStretchingChildren` class, it will centre its children vertically.
`isStretchingChildren` prop, it will centre its children vertically.

Otherwise better than in web 🙂.

<NavigationItem>
<ButtonLink href="#" color="secondary">
Sign up
Log out
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request run-visual-tests Runs visual regression testing on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants