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(Menu)!: updates menu variants and usage guidance #2993

Merged
merged 15 commits into from
Jan 31, 2025

Conversation

aresnik11
Copy link
Contributor

@aresnik11 aresnik11 commented Dec 13, 2024

Overview

Updates Menu variants and usage guidance according to figma. The action variant is now popover, the navigation variant is now fixed and the border has been removed, and the select variant is no more.

PR Checklist

Testing Instructions

In storybook preview confirm you see new usage guidance and variants for Menu.
See monolith and mono PRs for specific testing instructions for Menus used in action.

PR Links and Envs

Repository PR Link PR Env
Monolith Monolith PR Monolith Env
Portal Portal Link Portal Env

Copy link

nx-cloud bot commented Dec 13, 2024

View your CI Pipeline Execution ↗ for commit ac0a472.


☁️ Nx Cloud last updated this comment at 2025-01-30 17:52:34 UTC

@aresnik11 aresnik11 changed the title Ajr update menu variants usage feat(Menu)!: updates menu variants and usage guidance Jan 7, 2025
@aresnik11 aresnik11 marked this pull request as ready for review January 10, 2025 22:03
@aresnik11 aresnik11 requested a review from a team as a code owner January 10, 2025 22:03
Copy link
Contributor

@LinKCoding LinKCoding left a comment

Choose a reason for hiding this comment

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

Code looks good to me!
I have some Qs about the story though.

These Qs aren't blocking, but if merging isn't a rush, it might be better to just check with Stacey/Emily beforehand.

@@ -37,7 +37,7 @@ Use an alert to display an important, succinct message with actions for users to
- Form field validation– for inline form errors or validation messages, use inline messaging within the form fields instead of an alert.

## Anatomy
<ImageWrapper src="./alertAnatomy.png" alt="Alert Anatomy diagram"/>
<ImageWrapper src="./molecules/alertAnatomy.png" alt="Alert Anatomy diagram"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

<3

packages/styleguide/src/lib/Molecules/Menu/Menu.mdx Outdated Show resolved Hide resolved
packages/styleguide/src/lib/Molecules/Menu/Menu.mdx Outdated Show resolved Hide resolved

## Popover menus

You can create popover menus by utilizing our **PopoverContainer**. Once you have your base positioning, you just need to adjust the `y` axis by `48` for the `normal` spacing or `32` for the `condensed` spacing for each of the `MenuItem`s. You may also need to change the `alignment` of the `PopoverContainer` to ensure correct positioning.
You can create popover menus by utilizing our <LinkTo id="Atoms/PopoverContainer">PopoverContainer</LinkTo>. Once you have your base positioning, you just need to adjust the y axis by 48 for the normal spacing or 32 for the condensed spacing for each of the MenuItems. You may also need to change the alignment of the PopoverContainer to ensure correct positioning.
Copy link
Contributor

Choose a reason for hiding this comment

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

Another potential question, for a future style guide?

When to use markdown styling? E.g. the old story added backticks to the attributes and the component, but this new copy in Figma strips it out.

<Canvas of={MenuStories.Default} />
A general purpose menu type that can be used for actions or navigation.
</Column>
Use the Popover menu to present a temporary surface for actions, options, or links, ensuring access only when needed while keeping the interface clean and focused. The Popover menu has the menu role by default, but if it contains only a list of navigation links, it should use the `<nav>` element, which implicitly includes the navigation role.
Copy link
Contributor

Choose a reason for hiding this comment

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

for the 2nd sentence:

The Popover menu has the menu role by default, but if it contains only a list of navigation links, it should use the <nav> element, which implicitly includes the navigation role.

The sentence could be more clear about what "it should use the <nav> element ..."
Would suggest a rewrite of:
"The Popover menu has the menu role by default. But, if the menu contains only a list of navigation links, it should be nested in a <nav> element, which implicitly includes the navigation role."

And then also provide a story that showcases how this would look like.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1!

Copy link
Contributor

@dreamwasp dreamwasp Jan 16, 2025

Choose a reason for hiding this comment

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

maybe we should just add the menu + nav role behavior as default for each of the types. i'll take a look at mono and see if there's any example of Menus that are neither a navigation list or a menu list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the copy. i'll defer to you both if you want to ship this when i'm out as is or make these additional updates

packages/styleguide/src/lib/Molecules/Menu/Menu.mdx Outdated Show resolved Hide resolved
@@ -187,8 +224,3 @@ export const PopoverMenuExample: React.FC = () => {
</FlexBox>
);
};

export const Popover: Story = {
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL you can set a canvas with just a component!

Copy link
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

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

agree with Kenny's comments and think we should probably have a way for the navigation roles to work more automagically (maybe connected to role=navigation prop?) but that work can also be split into a separate PR

Copy link
Contributor

@LinKCoding LinKCoding left a comment

Choose a reason for hiding this comment

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

LGTM. left a question in slack about the anatomy guidance — but honestly it's non-blocking and can be touched up in a separate PR (or part of another PR)

@codecademydev
Copy link
Collaborator

📬Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

@codecademydev
Copy link
Collaborator

🚀 Styleguide deploy preview ready!

https://679bbc765c6a290092e1be69--gamut-preview.netlify.app

Deploy Logs

@aresnik11 aresnik11 added the Ship It :shipit: Automerge this PR when possible label Jan 31, 2025
@codecademydev codecademydev merged commit 3b3e1f6 into main Jan 31, 2025
15 of 16 checks passed
@codecademydev codecademydev removed the Ship It :shipit: Automerge this PR when possible label Jan 31, 2025
@codecademydev codecademydev deleted the ajr-update-menu-variants-usage branch January 31, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants