Skip to content

Commit

Permalink
Merge pull request #1002 from international-labour-organization/feat/…
Browse files Browse the repository at this point in the history
…react/972

React: Align Breadcrumb with Twig
  • Loading branch information
justintemps committed May 9, 2024
2 parents 7a93f6f + 9b247f7 commit 31207da
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 101 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-coats-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ilo-org/react": minor
---

Aligns the Breadcrumb component with the Twig implementation which also fixes several accessibility issues.
12 changes: 2 additions & 10 deletions packages/react/src/components/Breadcrumb/Breadcrumb.args.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { BreadcrumbProps } from "./Breadcrumb.props";

const basic: BreadcrumbProps = {
home: {
indented: false,
label: "Home",
url: "/",
},
buttonLabel: "More Links",
links: [
{
label: "Link One",
Expand All @@ -27,11 +23,7 @@ const basic: BreadcrumbProps = {
};

const fiveLinks: BreadcrumbProps = {
home: {
indented: false,
label: "Home",
url: "/",
},
buttonLabel: "More Links",
links: [
{
label: "Link One",
Expand Down
33 changes: 29 additions & 4 deletions packages/react/src/components/Breadcrumb/Breadcrumb.props.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
import { LinkProps } from "../LinkList/LinkList.props";
export interface BreadcrumbItemProps {
/**
* Optional additional className of the BreadcrumbLink
*/
className?: string;

/**
* Specify the label for this link
*/
label: string;

/**
* Should the label appear as readable text on the screen or an aria-label
*/
labelShown?: boolean;

/**
* Specify the url for this link
*/
url: string;
}

export interface BreadcrumbProps {
/**
* Specify the HOME link in the Breadcrumb
* An additional classname to add to the outer most element of the component
*/
className?: string;

/**
* The accessible label to apply to the ellipsis button that appears when the Breadcrumb is collapsed
*/
home: Required<LinkProps>;
buttonLabel: string;

/**
* Specify the links to be displayed in the Breadcrumb
*/
links: Required<Array<LinkProps>>;
links: BreadcrumbItemProps[];
}

0 comments on commit 31207da

Please sign in to comment.