From 0f3609ae4ae78fcbd3798a671d1994f0ac66e130 Mon Sep 17 00:00:00 2001
From: Cee Chen <549407+cee-chen@users.noreply.github.com>
Date: Mon, 18 Mar 2024 09:04:11 -0700
Subject: [PATCH] [EuiBreadcrumb] Fix styling on `application` types with
popovers + perf improvements (#7580)
---
changelogs/upcoming/7580.md | 3 +
.../_breadcrumb_content.test.tsx.snap | 104 ++++++++
.../__snapshots__/breadcrumb.test.tsx.snap | 100 ++++----
.../__snapshots__/breadcrumbs.test.tsx.snap | 36 +--
.../breadcrumbs/_breadcrumb_content.styles.ts | 143 +++++++++++
.../breadcrumbs/_breadcrumb_content.test.tsx | 124 ++++++++++
.../breadcrumbs/_breadcrumb_content.tsx | 222 ++++++++++++++++++
.../breadcrumbs/breadcrumb.styles.ts | 126 +---------
.../breadcrumbs/breadcrumb.test.tsx | 128 ++--------
src/components/breadcrumbs/breadcrumb.tsx | 206 +---------------
.../breadcrumbs/breadcrumbs.stories.tsx | 3 +-
src/components/breadcrumbs/breadcrumbs.tsx | 75 +-----
src/components/breadcrumbs/index.ts | 4 +-
src/components/breadcrumbs/types.ts | 126 ++++++++++
.../header/__snapshots__/header.test.tsx.snap | 2 +-
.../header_breadcrumbs.test.tsx.snap | 6 +-
.../header_breadcrumbs/header_breadcrumbs.tsx | 8 +-
17 files changed, 839 insertions(+), 577 deletions(-)
create mode 100644 changelogs/upcoming/7580.md
create mode 100644 src/components/breadcrumbs/__snapshots__/_breadcrumb_content.test.tsx.snap
create mode 100644 src/components/breadcrumbs/_breadcrumb_content.styles.ts
create mode 100644 src/components/breadcrumbs/_breadcrumb_content.test.tsx
create mode 100644 src/components/breadcrumbs/_breadcrumb_content.tsx
create mode 100644 src/components/breadcrumbs/types.ts
diff --git a/changelogs/upcoming/7580.md b/changelogs/upcoming/7580.md
new file mode 100644
index 00000000000..5423aedd343
--- /dev/null
+++ b/changelogs/upcoming/7580.md
@@ -0,0 +1,3 @@
+**Bug fixes**
+
+- Fixed a visual bug with `EuiHeaderBreadcrumbs` with popovers
diff --git a/src/components/breadcrumbs/__snapshots__/_breadcrumb_content.test.tsx.snap b/src/components/breadcrumbs/__snapshots__/_breadcrumb_content.test.tsx.snap
new file mode 100644
index 00000000000..002da4ac433
--- /dev/null
+++ b/src/components/breadcrumbs/__snapshots__/_breadcrumb_content.test.tsx.snap
@@ -0,0 +1,104 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`EuiBreadcrumbContent breadcrumbs with popovers renders with \`popoverContent\` 1`] = `
+
+
+
+
+
+
+
+
+`;
+
+exports[`EuiBreadcrumbContent renders interactive breadcrumbs with href or onClick 1`] = `
+
+`;
+
+exports[`EuiBreadcrumbContent renders plain uninteractive breadcrumb text 1`] = `
+
+ Text
+
+`;
diff --git a/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap b/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap
index 116e054b27e..aae72d83cd5 100644
--- a/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap
+++ b/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap
@@ -1,30 +1,46 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`EuiBreadcrumbContent breadcrumbs with popovers renders with \`popoverContent\` 1`] = `
+exports[`EuiBreadcrumb is a light wrapper around the content 1`] = `
+
+ Hello world
+
+`;
+
+exports[`EuiBreadcrumbCollapsed renders a ... breadcrumb with collapsed content in a popover 1`] = `
-
-
-
+
+
+ …
+
+
+
+ - Clicking this button will toggle a popover dialog.
+
+
+
+
`;
-
-exports[`EuiBreadcrumbContent renders interactive breadcrumbs with href or onClick 1`] = `
-
-`;
-
-exports[`EuiBreadcrumbContent renders plain uninteractive breadcrumb text 1`] = `
-
-
- Text
-
-
-`;
diff --git a/src/components/breadcrumbs/__snapshots__/breadcrumbs.test.tsx.snap b/src/components/breadcrumbs/__snapshots__/breadcrumbs.test.tsx.snap
index 27252750a54..8be50405a28 100644
--- a/src/components/breadcrumbs/__snapshots__/breadcrumbs.test.tsx.snap
+++ b/src/components/breadcrumbs/__snapshots__/breadcrumbs.test.tsx.snap
@@ -39,15 +39,15 @@ exports[`EuiBreadcrumbs is rendered 1`] = `
data-test-subj="euiBreadcrumb"
>