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: skip links #3317
feat: skip links #3317
Conversation
Run & review this pull request in StackBlitz Codeflow. |
π¦ Changeset detectedLatest commit: 325bd53 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
β Deploy Preview for paste-theme-designer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for paste-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 325bd53:
|
Passing run #6246 βοΈ
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Size Change: +575 B (0%) Total Size: 1.02 MB
βΉοΈ View Unchanged
|
βοΈ Nx Cloud ReportCI is running/has finished running commands for commit 325bd53. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. π See all runs for this branch β Successfully ran 1 targetSent with π from NxCloud. |
AccountSwitcherBadge.displayName = 'AccountSwitcherBadge'; | ||
AccountSwitcherBadge.propTypes = MenuBadgePropTypes; | ||
AccountSwitcherBadge.propTypes = accountSwitcherPropTypes; |
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.
Throwing errors in test and storybook
@@ -18,7 +18,7 @@ const MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>( | |||
|
|||
export const MenuItemPropTypes = { | |||
href: PropTypes.string, | |||
variant: PropTypes.oneOf([Object.values(MenuItemVariants)]), | |||
variant: PropTypes.oneOf(Object.values(MenuItemVariants)), |
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.
Throwing errors in test and storybook
@@ -18,7 +18,7 @@ const MenuItemCheckbox = React.forwardRef<HTMLDivElement, MenuItemCheckboxProps> | |||
|
|||
export const MenuItemCheckboxPropTypes = { | |||
href: PropTypes.string, | |||
variant: PropTypes.oneOf([Object.values(MenuItemVariants)]), | |||
variant: PropTypes.oneOf(Object.values(MenuItemVariants)), |
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.
Throwing errors in test and storybook
ProductSwitcherButton.displayName = 'ProductSwitcherButton'; | ||
ProductSwitcherButton.propTypes = MenuButtonPropTypes; | ||
ProductSwitcherButton.propTypes = productSwitcherButtonPropTypes; |
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.
Throwing errors in test and storybook
render(<CustomizedUserDialog />); | ||
await waitFor(() => { | ||
render(<CustomizedUserDialog />); | ||
}); |
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.
Noisy test
@@ -16,6 +16,8 @@ const AccountSwitcherBadge = React.forwardRef<HTMLButtonElement, AccountSwitcher | |||
} | |||
); | |||
|
|||
// omit variant from MenuBadgePropTypes because it conflicts with AccountSwitcherBadge | |||
const {variant, ...accountSwitcherPropTypes} = MenuBadgePropTypes; |
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.
question: No error for variant being unused?
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 set it in the component above. AccountSwitcher is a subset of Menu, So I want to reuse the proptypes from Menu as much as I can, but because we set variant inside account switcher, the user can't so I don't want to error for them
packages/paste-core/components/sidebar/src/navigation/SidebarNavigation.tsx
Outdated
Show resolved
Hide resolved
); | ||
}); | ||
export const Topbar = React.forwardRef<HTMLDivElement, TopbarProps>( | ||
({element = 'TOPBAR', topbarSkipLinkID, children, ...props}, ref) => { |
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.
question: I was thinking the prop would just be id: string
(required), did you name it this way so people knew there was a relationship here?
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.
That was the theory, to be more explicit on why we need it. My initial fear was that if it's just id
, when we require it with typescript, there's nothing really telling the person that its anything related to the Sidebar and skip links. It's just "giev me an id"
We could TSDoc it on the property to give a VS Code hint, but requires the person to read the popup.
c32d1b3
to
55fdff1
Compare
Description and useful links to discussions / issues / tickets
Changes in this PR:
Skip links to Sidebar
Add the ability to have hidden skip links that are the first things in the DOM for navigating a complex application.
Semantics update for Sidebar
Change sidebar to
aside
and Sidebar Nav to be thenav
elementDocument the Skip links functionality
In Sidebar and Topbar docs document the skips
Topbar actions docs
Add the docs for the new Topbar Actions components.
User dialog tests
Fixed a very noisy test for user dialog
Checklist
required
checks have passedπ΅π»ββοΈ Run website visual regression
label