-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(ui): Added Skip To Content #8514
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
Open
malav2110
wants to merge
5
commits into
nodejs:main
Choose a base branch
from
malav2110:feat-skip-to-content
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e02cdef
feat(ui): Added Skip To Content
malav2110 d6c8016
feat(ui): moved Skip to Content as a component, added test and storyb…
malav2110 8e83b4e
feat(tests): remove SkipToContentButton test file
malav2110 37aa948
feat(ui): refactor SkipToContentButton to use children prop instead o…
malav2110 1e671ba
feat(ui): update WithNavBar component structure for improved accessib…
malav2110 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/ui-components/src/Common/SkipToContentButton/index.module.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| @reference "../../styles/index.css"; | ||
|
|
||
| .skipToContent { | ||
| @apply sr-only | ||
| focus:not-sr-only | ||
| focus:absolute | ||
| focus:top-4 | ||
| focus:left-4 | ||
| focus:z-50 | ||
| focus:rounded | ||
| focus:bg-green-600 | ||
| focus:px-4 | ||
| focus:py-2 | ||
| focus:text-white | ||
| focus:ring-2 | ||
| focus:ring-green-500 | ||
| focus:outline-none | ||
| dark:focus:ring-green-400; | ||
| } |
14 changes: 14 additions & 0 deletions
14
packages/ui-components/src/Common/SkipToContentButton/index.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import SkipToContentButton from '#ui/Common/SkipToContentButton'; | ||
|
|
||
| import type { Meta as MetaObj, StoryObj } from '@storybook/react-webpack5'; | ||
|
|
||
| type Story = StoryObj<typeof SkipToContentButton>; | ||
| type Meta = MetaObj<typeof SkipToContentButton>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| children: 'Skip to content', | ||
| }, | ||
| }; | ||
|
|
||
| export default { component: SkipToContentButton } as Meta; |
21 changes: 21 additions & 0 deletions
21
packages/ui-components/src/Common/SkipToContentButton/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { FC, AnchorHTMLAttributes, PropsWithChildren } from 'react'; | ||
|
|
||
| import styles from './index.module.css'; | ||
|
|
||
| type SkipToContentButtonProps = PropsWithChildren< | ||
| AnchorHTMLAttributes<HTMLAnchorElement> | ||
| >; | ||
|
|
||
| const SkipToContentButton: FC<SkipToContentButtonProps> = ({ | ||
| children, | ||
| href = '#main', | ||
| ...props | ||
| }) => { | ||
| return ( | ||
| <a href={href} className={styles.skipToContent} {...props}> | ||
| {children} | ||
| </a> | ||
| ); | ||
| }; | ||
malav2110 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export default SkipToContentButton; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.