-
Notifications
You must be signed in to change notification settings - Fork 17
Link component redesign #2202
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
Merged
Merged
Link component redesign #2202
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import Head from "next/head"; | ||
| import type { ReactElement } from "react"; | ||
| import LinkPageLayout from "screens/components/link/LinkPageLayout"; | ||
| import LinkCodePage from "screens/components/link/code/LinkCodePage"; | ||
|
|
||
| const Code = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Link code — Halstack Design System</title> | ||
| </Head> | ||
| <LinkCodePage /> | ||
| </> | ||
| ); | ||
|
|
||
| Code.getLayout = (page: ReactElement) => <LinkPageLayout>{page}</LinkPageLayout>; | ||
|
|
||
| export default Code; |
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 |
|---|---|---|
| @@ -1,21 +1,17 @@ | ||
| import Head from "next/head"; | ||
| import type { ReactElement } from "react"; | ||
| import LinkPageLayout from "screens/components/link/LinkPageLayout"; | ||
| import LinkCodePage from "screens/components/link/code/LinkCodePage"; | ||
| import LinkOverviewPage from "screens/components/link/overview/LinkOverviewPage"; | ||
|
|
||
| const Index = () => { | ||
| return ( | ||
| <> | ||
| <Head> | ||
| <title>Link — Halstack Design System</title> | ||
| </Head> | ||
| <LinkCodePage></LinkCodePage> | ||
| </> | ||
| ); | ||
| }; | ||
| const Index = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Link — Halstack Design System</title> | ||
| </Head> | ||
| <LinkOverviewPage /> | ||
| </> | ||
| ); | ||
|
|
||
| Index.getLayout = function getLayout(page: ReactElement) { | ||
| return <LinkPageLayout>{page}</LinkPageLayout>; | ||
| }; | ||
| Index.getLayout = (page: ReactElement) => <LinkPageLayout>{page}</LinkPageLayout>; | ||
|
|
||
| export default Index; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
81 changes: 81 additions & 0 deletions
81
apps/website/screens/components/link/overview/LinkOverviewPage.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,81 @@ | ||
| import { DxcLink, DxcBulletedList, DxcFlex, DxcTable, DxcParagraph } from "@dxc-technology/halstack-react"; | ||
| import DocFooter from "@/common/DocFooter"; | ||
| import QuickNavContainer from "@/common/QuickNavContainer"; | ||
| import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; | ||
| import Image from "@/common/Image"; | ||
| import linkAnatomy from "./images/link-anatomy.png"; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: "Introduction", | ||
| content: ( | ||
| <DxcParagraph> | ||
| Links are essential interactive elements that enable users to <strong>navigate</strong> between pages, access | ||
| external resources, or explore related content. They can be placed within text, used as standalone elements, or | ||
| positioned after sections to provide additional actions or information. Links enhance usability by clearly | ||
| indicating their purpose and destination, ensuring a seamless and intuitive browsing experience. Proper usage of | ||
| links helps maintain accessibility and improves content discoverability across digital products. | ||
| </DxcParagraph> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Anatomy", | ||
| content: ( | ||
| <> | ||
| <Image src={linkAnatomy} alt="Link's anatomy" /> | ||
| <DxcBulletedList type="number"> | ||
| <DxcBulletedList.Item> | ||
| <strong>Icon:</strong> an optional visual element that can be used to represent more graphically the purpose | ||
| of the link. It can be placed before or after the link it’s representing. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Label:</strong> displays the textual content of the link, conveying where exactly it’s going to | ||
| navigate the component. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| </> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Best practices", | ||
| content: ( | ||
| <> | ||
| <DxcBulletedList> | ||
| <DxcBulletedList.Item> | ||
| <strong>Use clear and descriptive labels:</strong> link labels should clearly indicate what users can expect | ||
| when they click. Avoid generic labels like <em>"click here"</em>. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Indicate external links appropriately:</strong> If a link directs users to an external site or opens | ||
| a new tab, provide an appropriate icon to set expectations. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Avoid excessive linking:</strong> too many links within a paragraph can overwhelm users and make | ||
| content harder to read. Use links strategically. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Use appropriate link placement:</strong> position links logically within content, either integrated | ||
| into sentences or placed at the end of a section for additional navigation. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Differentiate links from buttons:</strong> links are primarily for navigation, while buttons trigger | ||
| actions like form submissions or modal openings. Use each element correctly. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| </> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| const LinkOverviewPage = () => { | ||
| return ( | ||
| <DxcFlex direction="column" gap="4rem"> | ||
| <QuickNavContainerLayout> | ||
| <QuickNavContainer sections={sections} startHeadingLevel={2} /> | ||
| </QuickNavContainerLayout> | ||
| <DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/components/link/overview/LinkOverviewPage.tsx" /> | ||
| </DxcFlex> | ||
| ); | ||
| }; | ||
|
|
||
| export default LinkOverviewPage; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.