-
Notifications
You must be signed in to change notification settings - Fork 18
Breadcrumbs Usage & Specs pages #2024
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
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
57fc9a0
Adding Usage & Specs for Breadcrumbs
GomezIvann 8249339
Updates to the specs pages of halstack
GomezIvann b2fe990
Breadcrumbs docs update
GomezIvann 71ff1db
Merge branch 'master' into gomezivann/breadcrumbs-docs
raquelarrojo bd844ad
Divider & Status light specs pages updated
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,21 @@ | ||
| import Head from "next/head"; | ||
| import type { ReactElement } from "react"; | ||
| import BreadcrumbsPageLayout from "../../../screens/components/breadcrumbs/BreadcrumbsPageLayout"; | ||
| import BreadcrumbsSpecsPage from "../../../screens/components/breadcrumbs/specs/BreadcrumbsSpecsPage"; | ||
|
|
||
| const Specifications = () => { | ||
| return ( | ||
| <> | ||
| <Head> | ||
| <title>Breadcrumbs Specs — Halstack Design System</title> | ||
| </Head> | ||
| <BreadcrumbsSpecsPage></BreadcrumbsSpecsPage> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| Specifications.getLayout = function getLayout(page: ReactElement) { | ||
| return <BreadcrumbsPageLayout>{page}</BreadcrumbsPageLayout>; | ||
| }; | ||
|
|
||
| export default Specifications; |
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 Head from "next/head"; | ||
| import type { ReactElement } from "react"; | ||
| import BreadcrumbsPageLayout from "../../../screens/components/breadcrumbs/BreadcrumbsPageLayout"; | ||
| import BreadcrumbsUsagePage from "../../../screens/components/breadcrumbs/usage/BreadcrumbsUsagePage"; | ||
|
|
||
| const Usage = () => { | ||
| return ( | ||
| <> | ||
| <Head> | ||
| <title>Breadcrumbs Usage — Halstack Design System</title> | ||
| </Head> | ||
| <BreadcrumbsUsagePage></BreadcrumbsUsagePage> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| Usage.getLayout = function getLayout(page: ReactElement) { | ||
| return <BreadcrumbsPageLayout>{page}</BreadcrumbsPageLayout>; | ||
| }; | ||
|
|
||
| export default Usage; |
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
59 changes: 59 additions & 0 deletions
59
website/screens/components/breadcrumbs/specs/BreadcrumbsSpecsPage.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,59 @@ | ||
| import { | ||
| DxcBulletedList, | ||
| DxcFlex, | ||
| DxcParagraph, | ||
| } from "@dxc-technology/halstack-react"; | ||
| import Image from "@/common/Image"; | ||
| import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; | ||
| import DocFooter from "@/common/DocFooter"; | ||
| import QuickNavContainer from "@/common/QuickNavContainer"; | ||
| import Figure from "@/common/Figure"; | ||
| import specs from "./images/breadcrumbs_specs.png"; | ||
| import anatomy from "./images/breadcrumbs_anatomy.png"; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: "Specifications", | ||
| content: ( | ||
| <Figure caption="Breadcrumbs design specifications"> | ||
| <Image src={specs} alt="Breadcrumbs design specifications" /> | ||
| </Figure> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Anatomy", | ||
| content: ( | ||
| <> | ||
| <Image src={anatomy} alt="Breadcrumbs anatomy" /> | ||
| <DxcBulletedList type="number"> | ||
| <DxcBulletedList.Item>Breadcrumbs item</DxcBulletedList.Item> | ||
| <DxcBulletedList.Item>Divider</DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| </> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Design tokens", | ||
| content: ( | ||
| <DxcParagraph> | ||
| This component currently has no design tokens. | ||
| </DxcParagraph> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| const BreadcrumbsSpecsPage = () => { | ||
| return ( | ||
| <DxcFlex direction="column" gap="4rem"> | ||
| <QuickNavContainerLayout> | ||
| <QuickNavContainer | ||
| sections={sections} | ||
| startHeadingLevel={2} | ||
| ></QuickNavContainer> | ||
| </QuickNavContainerLayout> | ||
| <DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/website/screens/components/breadcrumbs/specs/BreadcrumbsSpecsPage.tsx" /> | ||
| </DxcFlex> | ||
| ); | ||
| }; | ||
|
|
||
| export default BreadcrumbsSpecsPage; |
Binary file added
BIN
+7.1 KB
website/screens/components/breadcrumbs/specs/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.
Binary file added
BIN
+8.51 KB
website/screens/components/breadcrumbs/specs/images/breadcrumbs_specs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions
117
website/screens/components/breadcrumbs/usage/BreadcrumbsUsagePage.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,117 @@ | ||
| 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"; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: "Usage", | ||
| content: ( | ||
| <DxcParagraph> | ||
| Breadcrumbs are a navigational component used in user interfaces to | ||
| improve the user experience by providing a clear path to previous steps | ||
| or navigational levels. They typically display the user's current | ||
| location within the hierarchical structure of an application, allowing | ||
| for easy navigation and improved orientation. | ||
| </DxcParagraph> | ||
| ), | ||
| subSections: [ | ||
| { | ||
| title: "Do's", | ||
| content: ( | ||
| <DxcBulletedList> | ||
| <DxcBulletedList.Item> | ||
| Use breadcrumbs when there are more than two navigational levels | ||
| within the same hierarchy to help users easily navigate and | ||
| understand their position. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Ensure each label of the Breadcrumbs items is informative yet | ||
| brief, providing users with a clear understanding of where each | ||
| link will take them without overwhelming them with too much text. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Always position breadcrumbs in the top left corner of the | ||
| interface. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| ), | ||
| }, | ||
| { | ||
| title: "Don'ts", | ||
| content: ( | ||
| <DxcBulletedList> | ||
| <DxcBulletedList.Item> | ||
| Avoid overloading the component. Including too many items in the | ||
| breadcrumbs increases the cognitive load of the interface and can | ||
| confuse users. We recommend using the collapsed version of the | ||
| component when there are more than four items. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Don't use breadcrumbs to replace primary navigation or links, as | ||
| they are intended to serve as a supplementary navigation aid. | ||
| </DxcBulletedList.Item> | ||
| <DxcBulletedList.Item> | ||
| Refrain from using breadcrumbs to represent the sequence of steps | ||
| to complete an action. Remember that it is a navigation component | ||
| through levels with an established hierarchy. | ||
| </DxcBulletedList.Item> | ||
| </DxcBulletedList> | ||
| ), | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| title: "Collapsed Breadcrumbs", | ||
| content: ( | ||
| <> | ||
| <DxcParagraph> | ||
| When there are more than four items in the breadcrumbs, the component | ||
| will collapse the items in a dropdown menu to avoid overloading the | ||
| interface. Users can click on the dropdown to view the hidden items | ||
| and navigate to the desired level. | ||
| </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 breadcrumbs | ||
| can be synthesized more by removing the root element and displaying | ||
| only the collapsed dropdown and the current page. | ||
| </DxcParagraph> | ||
| <Example example={noRoot} /> | ||
| <DxcParagraph> | ||
| Be mindful of your user's cognitive load and collapse breadcrumbs | ||
| appropriately. | ||
| </DxcParagraph> | ||
| </> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| const BreadcrumbsUsagePage = () => { | ||
| return ( | ||
| <DxcFlex direction="column" gap="4rem"> | ||
| <QuickNavContainerLayout> | ||
| <QuickNavContainer | ||
| sections={sections} | ||
| startHeadingLevel={2} | ||
| ></QuickNavContainer> | ||
| </QuickNavContainerLayout> | ||
| <DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/website/screens/components/breadcrumbs/usage/BreadcrumbsUsagePage.tsx" /> | ||
| </DxcFlex> | ||
| ); | ||
| }; | ||
|
|
||
| export default BreadcrumbsUsagePage; |
24 changes: 24 additions & 0 deletions
24
website/screens/components/breadcrumbs/usage/examples/collapsed.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,24 @@ | ||
| import { DxcBreadcrumbs, DxcInset } from "@dxc-technology/halstack-react"; | ||
|
|
||
| const code = `() => { | ||
| const items = [ | ||
| { label: "Components" }, | ||
| { label: "Select" }, | ||
| { label: "Specifications" }, | ||
| { label: "Design Tokens" }, | ||
| { label: "Typography" } | ||
| ]; | ||
|
|
||
| return ( | ||
| <DxcInset space="2rem"> | ||
| <DxcBreadcrumbs items={items} /> | ||
| </DxcInset> | ||
| ); | ||
| }`; | ||
|
|
||
| const scope = { | ||
| DxcBreadcrumbs, | ||
| DxcInset, | ||
| }; | ||
|
|
||
| export default { code, scope }; |
24 changes: 24 additions & 0 deletions
24
website/screens/components/breadcrumbs/usage/examples/noRoot.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,24 @@ | ||
| import { DxcBreadcrumbs, DxcInset } from "@dxc-technology/halstack-react"; | ||
|
|
||
| const code = `() => { | ||
| const items = [ | ||
| { label: "Components" }, | ||
| { label: "Select" }, | ||
| { label: "Specifications" }, | ||
| { label: "Design Tokens" }, | ||
| { label: "Color" } | ||
| ]; | ||
|
|
||
| return ( | ||
| <DxcInset space="2rem"> | ||
| <DxcBreadcrumbs items={items} showRoot={false} /> | ||
| </DxcInset> | ||
| ); | ||
| }`; | ||
|
|
||
| const scope = { | ||
| DxcBreadcrumbs, | ||
| DxcInset, | ||
| }; | ||
|
|
||
| export default { code, scope }; |
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.