-
Notifications
You must be signed in to change notification settings - Fork 17
Quicknav redesign #2197
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
Quicknav redesign #2197
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8c9a855
Quicknav redesign
Jialecl 1b71845
Some minor changes based on feedback
Jialecl 09c581e
Documentation overview added to the quicknav
Jialecl 06974e3
Merge branch 'master' of https://github.com/dxc-technology/halstack-r…
Jialecl df07c54
Fixed documentation errors
Jialecl 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 QuickNavCodePage from "screens/components/quick-nav/code/QuickNavCodePage"; | ||
| import QuickNavPageLayout from "screens/components/quick-nav/QuickNavPageLayout"; | ||
|
|
||
| const Code = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Quick Nav Code — Halstack Design System</title> | ||
| </Head> | ||
| <QuickNavCodePage /> | ||
| </> | ||
| ); | ||
|
|
||
| Code.getLayout = (page: ReactElement) => <QuickNavPageLayout>{page}</QuickNavPageLayout>; | ||
|
|
||
| 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 QuickNavPageLayout from "screens/components/quick-nav/QuickNavPageLayout"; | ||
| import QuickNavCodePage from "screens/components/quick-nav/code/QuickNavCodePage"; | ||
| import QuickNavOverviewPage from "screens/components/quick-nav/overview/QuickNavOverviewsPage"; | ||
|
|
||
| const Index = () => { | ||
| return ( | ||
| <> | ||
| <Head> | ||
| <title>Quick Nav — Halstack Design System</title> | ||
| </Head> | ||
| <QuickNavCodePage></QuickNavCodePage> | ||
| </> | ||
| ); | ||
| }; | ||
| const Index = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Quick Nav — Halstack Design System</title> | ||
| </Head> | ||
| <QuickNavOverviewPage /> | ||
| </> | ||
| ); | ||
|
|
||
| Index.getLayout = function getLayout(page: ReactElement) { | ||
| return <QuickNavPageLayout>{page}</QuickNavPageLayout>; | ||
| }; | ||
| Index.getLayout = (page: ReactElement) => <QuickNavPageLayout>{page}</QuickNavPageLayout>; | ||
|
|
||
| export default Index; |
21 changes: 0 additions & 21 deletions
21
apps/website/pages/components/quick-nav/specifications.tsx
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
87 changes: 87 additions & 0 deletions
87
apps/website/screens/components/quick-nav/overview/QuickNavOverviewsPage.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,87 @@ | ||
| import { DxcBulletedList, DxcFlex, DxcParagraph } from "@dxc-technology/halstack-react"; | ||
| import Image from "@/common/Image"; | ||
| import QuickNavContainer from "@/common/QuickNavContainer"; | ||
| import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; | ||
| import DocFooter from "@/common/DocFooter"; | ||
| import anatomyImage from "./images/quickNav_anatomy.png"; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: "Introduction", | ||
| content: ( | ||
| <DxcParagraph> | ||
| Quick Nav is used to improve in-page navigation by listing content sections and subsections based on the heading | ||
| hierarchy. This helps users understand the page structure at a glance and jump directly to the content they're | ||
| interested in. It's especially useful on documentation pages, dashboards and long-form content. | ||
| </DxcParagraph> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Anatomy", | ||
| content: ( | ||
| <> | ||
| <Image src={anatomyImage} alt="Quick nav anatomy" /> | ||
| <DxcBulletedList type="number"> | ||
| <DxcBulletedList.Item> | ||
| <strong>Divider:</strong> a thin vertical line that visually separates the Quick Nav from the main content | ||
| area. Its purpose is to create a clear boundary between navigation and content, improving readability and | ||
| layout organization. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Title</strong> <em>(Optional)</em>: a short descriptive title such as "Contents" or "On this page" | ||
| that provides context for the navigation list. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Links:</strong> the main navigation items, each representing a primary section on the page. These | ||
| are generated from top-level headings and are clickable. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Sublinks</strong> <em>(Optional)</em>: secondary navigation items, generated from subheadings nested | ||
| under the main sections. These allow finer-grain navigation within a specific topic. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| </> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Best practices", | ||
| content: ( | ||
| <DxcBulletedList> | ||
| <DxcBulletedList.Item> | ||
| <strong>Provide a clear title:</strong> use a meaningful title like "On this page" to help users understand | ||
| the context of the links. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Show structure clearly:</strong> use Quick Nav to mirror the hierarchy of your content, making it | ||
| easier to follow and navigate. Keep headings descriptive and consistent so link labels are meaningful when | ||
| rendered. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Avoid clutter:</strong> avoid rendering Quick Nav on pages with very little content; it can feel | ||
| redundant. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Maintain visual separation from main content:</strong> always allow sufficient spacing between the | ||
| Quick Nav and the main content area. This helps users visually distinguish navigation from content and avoids | ||
| overwhelming the layout. Use padding or margins to ensure the Quick Nav doesn't feel cramped or interfere with | ||
| readability, especially on larger screens or dense layouts. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Pair with other navigational tools:</strong> combine Quick Nav with tabs or breadcrumbs for a | ||
| comprehensive navigation experience across and within pages. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| const QuickNavOverviewPage = () => ( | ||
| <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/quick-nav/overview/QuickNavOverviewPage.tsx" /> | ||
| </DxcFlex> | ||
| ); | ||
|
|
||
| export default QuickNavOverviewPage; |
Binary file added
BIN
+42.5 KB
apps/website/screens/components/quick-nav/overview/images/quickNav_anatomy.png
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.