Skip to content

[EuiBreadcrumb] Extend HTMLElement and EuiLink.color & [EuiPageHeader] Adding breadcrumbs as an option#5634

Merged
cchaos merged 17 commits intoelastic:mainfrom
cchaos:page-header/breadcumbs
Feb 28, 2022
Merged

[EuiBreadcrumb] Extend HTMLElement and EuiLink.color & [EuiPageHeader] Adding breadcrumbs as an option#5634
cchaos merged 17 commits intoelastic:mainfrom
cchaos:page-header/breadcumbs

Conversation

@cchaos
Copy link
Contributor

@cchaos cchaos commented Feb 11, 2022

EuiBreadcrumbs

Each EuiBreadcrumb now extends a basic HTMLElement in order to customize the title for indicating things like alerts, as well as color from EuiLink (but only if rendering as an EuiLink otherwise it stays subdued).

Screen Shot 2022-02-15 at 15 26 51 PM

EuiPageHeader

I've been seeing more and more patterns of folks introducing breadcrumbs, or at the very least a "Return" link, to the top of the page header. This PR adds this ability directly into EuiPageHeader via a new breadcrumbs prop.

Screen Shot 2022-02-11 at 17 08 25 PM

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • [ ] Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

@cchaos cchaos changed the title [WIP] [EuiPageHeader] Adding breadcrumbs as an option [EuiBreadcrumb] Extend HTMLElement and EuiLink.color & [EuiPageHeader] Adding breadcrumbs as an option Feb 15, 2022
Copy link
Contributor Author

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is ready for review. I didn't point it to the EuiPageTemplate feature PR because it's not really dependent on any of that work.

Also, I do need some help in a couple of places.

@cchaos cchaos marked this pull request as ready for review February 15, 2022 20:37
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

@elizabetdev elizabetdev self-requested a review February 16, 2022 14:33
@thompsongl thompsongl self-requested a review February 16, 2022 15:49
Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

Tested in Chrome, Safari, Edge, and Firefox.

Comment on lines +5 to +34
const breadcrumbs: EuiBreadcrumb[] = [
{
text: 'Animals',
href: '#',
color: 'primary',
onClick: (e: { preventDefault: () => void }) => {
e.preventDefault();
},
},
{
text: 'Reptiles',
color: 'primary',
},
{
text: (
<>
<EuiIcon type="alert" size="s" /> Boa constrictor
</>
),
title: 'Boa constrictor has an error',
href: '#',
color: 'danger',
onClick: (e: { preventDefault: () => void }) => {
e.preventDefault();
},
},
{
text: 'Edit',
},
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can provide a better real-world example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is animal classification not real world? 🤣

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

@cchaos cchaos requested a review from thompsongl February 18, 2022 20:57
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

1 similar comment
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM!

@cchaos cchaos enabled auto-merge (squash) February 28, 2022 16:54
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/

@cchaos cchaos merged commit 1b3c479 into elastic:main Feb 28, 2022
@cchaos cchaos deleted the page-header/breadcumbs branch February 28, 2022 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants