-
Notifications
You must be signed in to change notification settings - Fork 17
Breadcrumbs redesign #2207
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
Breadcrumbs redesign #2207
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5edf944
Breadcrumbs component redesign
GomezIvann 216cdbe
Correct z-index issue
GomezIvann 4f9e39d
Breadcrumbs visual adjustments
GomezIvann 1bd86db
Merge branch 'gomezivann/breadcrumbs-redesign' of https://github.com/…
GomezIvann b84170e
Updates based on feedback
GomezIvann fd8ba31
Breadcrumbs documentation
GomezIvann 76db9b4
Breadcrumbs anatomy alt fix
GomezIvann 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 BreadcrumbsPageLayout from "screens/components/breadcrumbs/BreadcrumbsPageLayout"; | ||
| import BreadcrumbsCodePage from "screens/components/breadcrumbs/code/BreadcrumbsCodePage"; | ||
|
|
||
| const Code = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Breadcrumbs code — Halstack Design System</title> | ||
| </Head> | ||
| <BreadcrumbsCodePage /> | ||
| </> | ||
| ); | ||
|
|
||
| Code.getLayout = (page: ReactElement) => <BreadcrumbsPageLayout>{page}</BreadcrumbsPageLayout>; | ||
|
|
||
| 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 BreadcrumbsCodePage from "screens/components/breadcrumbs/code/BreadcrumbsCodePage"; | ||
| import BreadcrumbsPageLayout from "screens/components/breadcrumbs/BreadcrumbsPageLayout"; | ||
| import BreadcrumbsOverviewPage from "screens/components/breadcrumbs/overview/BreadcrumbsOverviewPage"; | ||
|
|
||
| const Usage = () => { | ||
| return ( | ||
| <> | ||
| <Head> | ||
| <title>Breadcrumbs — Halstack Design System</title> | ||
| </Head> | ||
| <BreadcrumbsCodePage></BreadcrumbsCodePage> | ||
| </> | ||
| ); | ||
| }; | ||
| const Index = () => ( | ||
| <> | ||
| <Head> | ||
| <title>Breadcrumbs — Halstack Design System</title> | ||
| </Head> | ||
| <BreadcrumbsOverviewPage /> | ||
| </> | ||
| ); | ||
|
|
||
| Usage.getLayout = function getLayout(page: ReactElement) { | ||
| return <BreadcrumbsPageLayout>{page}</BreadcrumbsPageLayout>; | ||
| }; | ||
| Index.getLayout = (page: ReactElement) => <BreadcrumbsPageLayout>{page}</BreadcrumbsPageLayout>; | ||
|
|
||
| export default Usage; | ||
| export default Index; |
21 changes: 0 additions & 21 deletions
21
apps/website/pages/components/breadcrumbs/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
118 changes: 118 additions & 0 deletions
118
apps/website/screens/components/breadcrumbs/overview/BreadcrumbsOverviewPage.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,118 @@ | ||
| import { DxcBulletedList, DxcFlex, DxcParagraph } from "@dxc-technology/halstack-react"; | ||
| import QuickNavContainer from "@/common/QuickNavContainer"; | ||
| import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; | ||
| import DocFooter from "@/common/DocFooter"; | ||
| import Example from "@/common/example/Example"; | ||
| import collapsed from "./examples/collapsed"; | ||
| import noRoot from "./examples/noRoot"; | ||
| import Image from "@/common/Image"; | ||
| import anatomy from "./images/breadcrumbs_anatomy.png"; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: "Introduction", | ||
| content: ( | ||
| <DxcParagraph> | ||
| Breadcrumbs are a navigational component used in user interfaces to improve the user experience by providing a{" "} | ||
| <strong>clear path to previous steps or navigational levels</strong>. They typically display the user's current | ||
| location within the hierarchical structure of an application, allowing for easy navigation and improved | ||
| orientation. | ||
| </DxcParagraph> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Anatomy", | ||
| content: ( | ||
| <> | ||
| <Image src={anatomy} alt="Breadcrumbs's anatomy" /> | ||
| <DxcBulletedList type="number"> | ||
| <DxcBulletedList.Item> | ||
| <strong>Unvisited item:</strong> these are links that represent the navigational path taken by the user but | ||
| are not the current page | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Divider:</strong> a visual element that complements the label, providing additional meaning or | ||
| enhancing recognition. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Visited item:</strong> displays the textual action that the button is going to carry out. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| </> | ||
| ), | ||
| }, | ||
| { | ||
Mil4n0r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| title: "Collapsed breadcrumbs", | ||
| content: ( | ||
| <> | ||
| <DxcParagraph> | ||
| When there are more than four items in the breadcrumbs, the component will{" "} | ||
| <strong>collapse the items in a dropdown menu</strong> to avoid overloading the interface. Users can click on | ||
| the dropdown to view the hidden items and navigate to the desired level. | ||
Mil4n0r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </DxcParagraph> | ||
| <DxcParagraph> | ||
| Although this can be configurable, we highly encourage our users to stick with the collapsing at five or more | ||
| items. This was not a random decision, we carefully selected it to ensure the component does not overload the | ||
| interface and remains an effective navigational aid. | ||
| </DxcParagraph> | ||
| <Example example={collapsed} /> | ||
| <DxcParagraph> | ||
| Depending on the amount of available space, the collapsed <strong>breadcrumbs can be synthesized more</strong>{" "} | ||
| by removing the root element and displaying only the collapsed dropdown and the current page. | ||
Mil4n0r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </DxcParagraph> | ||
| <Example example={noRoot} /> | ||
| <DxcParagraph>Be mindful of your user's cognitive load and collapse breadcrumbs appropriately.</DxcParagraph> | ||
| </> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Best practices", | ||
| content: ( | ||
| <DxcBulletedList> | ||
| <DxcBulletedList.Item> | ||
| Use breadcrumbs to <strong>support secondary navigation in hierarchical structures</strong>, helping users | ||
| understand where they are and how they got there. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Always include the full path from the homepage or root section to the current page to provide meaningful | ||
| context. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Display <strong>only one breadcrumb trail per page</strong> to avoid confusion and maintain a clear navigation | ||
| hierarchy. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Make all breadcrumb items navigable except for the last one, which should reflect the current page and remain | ||
| non-interactive. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Keep labels concise</strong> and consistent with the destination page titles to avoid ambiguity. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| <strong>Place breadcrumbs at the top of the page</strong>, just below the main navigation or header, to follow | ||
| common UI patterns and user expectations. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Avoid using breadcrumbs as a replacement for primary navigation—they are meant to complement it, not replace | ||
| menus or sidebars. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| When truncating breadcrumbs due to space constraints,{" "} | ||
| <strong>prioritize showing the first and last items</strong> while collapsing the middle items with a clear | ||
| overflow mechanism. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
Mil4n0r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| const BreadcrumbsOverviewPage = () => ( | ||
| <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/breadcrumbs/overview/BreadcrumbsOverviewPage.tsx" /> | ||
| </DxcFlex> | ||
| ); | ||
|
|
||
| export default BreadcrumbsOverviewPage; | ||
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+17.7 KB
.../website/screens/components/breadcrumbs/overview/images/breadcrumbs_anatomy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 0 additions & 48 deletions
48
apps/website/screens/components/breadcrumbs/specs/BreadcrumbsSpecsPage.tsx
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-7.1 KB
apps/website/screens/components/breadcrumbs/specs/images/breadcrumbs_anatomy.png
Binary file not shown.
Binary file removed
BIN
-8.51 KB
apps/website/screens/components/breadcrumbs/specs/images/breadcrumbs_specs.png
Binary file not shown.
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.