),
props: breadcrumpProps,
+ playground: breadcrumbsConfig,
snippet: `
@@ -116,10 +109,6 @@ export const BreadcrumbsExample = {
type: GuideSectionTypes.JS,
code: truncateSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: truncateHtml,
- },
],
text: (
<>
@@ -127,9 +116,7 @@ export const BreadcrumbsExample = {
EuiBreadcrumbs will truncate the full set by
default, forcing it to a single line and setting a max width on all
items except for the last. You can turn this off by setting{' '}
- {'truncate={false}'}. You can also
- force truncation on single breadcrumb item by
- adding {'truncate: true'}.
+ {'truncate={false}'}.
-
- Truncation on the entire set
-
-
-
-
-
- Truncation on a single item
-
-
-
-
+
);
};
diff --git a/src-docs/src/views/breadcrumbs/truncate_single.js b/src-docs/src/views/breadcrumbs/truncate_single.js
new file mode 100644
index 00000000000..5aa30b1804b
--- /dev/null
+++ b/src-docs/src/views/breadcrumbs/truncate_single.js
@@ -0,0 +1,50 @@
+import React from 'react';
+
+import { EuiBreadcrumbs } from '../../../../src/components';
+
+export default () => {
+ const breadcrumbs = [
+ {
+ text: 'Animals',
+ href: '#',
+ },
+ {
+ text:
+ 'Metazoans is a real mouthful, especially for creatures without mouths',
+ href: '#',
+ truncate: true,
+ },
+ {
+ text: 'Chordates',
+ href: '#',
+ },
+ {
+ text: 'Vertebrates',
+ href: '#',
+ },
+ {
+ text: 'Tetrapods',
+ href: '#',
+ },
+ {
+ text: 'Reptiles',
+ href: '#',
+ },
+ {
+ text: 'Boa constrictor',
+ href: '#',
+ },
+ {
+ text:
+ 'Nebulosa subspecies is also a real mouthful, especially for creatures without mouths',
+ },
+ ];
+
+ return (
+
+ );
+};
diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index ddddbce606e..2ce18ba3460 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -56,7 +56,6 @@ export type EuiBreadcrumbsProps = CommonProps & {
/**
* Hides extra (above the max) breadcrumbs under a collapsed item as the window gets smaller.
* Pass a custom #EuiBreadcrumbResponsiveMaxCount object to change the number of breadcrumbs to show at the particular breakpoints.
- * Omitting or passing a `0` value will show all breadcrumbs.
*
* Pass `false` to turn this behavior off.
*
@@ -73,7 +72,8 @@ export type EuiBreadcrumbsProps = CommonProps & {
/**
* Collapses the inner items past the maximum set here
- * into a single ellipses item
+ * into a single ellipses item.
+ * Omitting or passing a `0` value will show all breadcrumbs.
*/
max?: number | null;
From db1ef8d21d415a4b3e3399da28dd9cceb0d6e731 Mon Sep 17 00:00:00 2001
From: cchaos
Date: Thu, 12 Aug 2021 17:25:46 -0400
Subject: [PATCH 02/18] Cleanup of breadcrumbs
---
src-docs/src/views/breadcrumbs/breadcrumbs.js | 20 ++---
.../views/breadcrumbs/breadcrumbs_example.js | 74 ++++++++++++-------
2 files changed, 53 insertions(+), 41 deletions(-)
diff --git a/src-docs/src/views/breadcrumbs/breadcrumbs.js b/src-docs/src/views/breadcrumbs/breadcrumbs.js
index 118c0ae4f2d..c54e9ef9d2a 100644
--- a/src-docs/src/views/breadcrumbs/breadcrumbs.js
+++ b/src-docs/src/views/breadcrumbs/breadcrumbs.js
@@ -4,9 +4,7 @@ import {
EuiBreadcrumbs,
EuiButton,
EuiPageContent,
- EuiPageContentHeader,
- EuiPageContentHeaderSection,
- EuiTitle,
+ EuiPageHeader,
EuiSpacer,
} from '../../../../src/components';
@@ -15,6 +13,7 @@ export default () => {
{
text: 'Animals',
href: '#',
+ color: 'primary',
onClick: (e) => {
e.preventDefault();
},
@@ -47,17 +46,10 @@ export default () => {
aria-label="An example of EuiBreadcrumbs"
/>
-
-
-
-
Boa constrictor
-
-
-
-
- Cancel
-
-
+ Cancel]}
+ />
);
};
diff --git a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js
index fe3d17070b9..7d834ab6b09 100644
--- a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js
+++ b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import { GuideSectionTypes } from '../../components';
-import { EuiCode, EuiBreadcrumbs } from '../../../../src/components';
+import { EuiCode, EuiBreadcrumbs, EuiText } from '../../../../src/components';
import { BreadcrumbResponsiveMaxCount, BreadcrumbProps } from './props';
import { breadcrumbsConfig } from './playground';
@@ -22,6 +22,7 @@ import TruncateSingle from './truncate_single';
const truncateSingleSource = require('!!raw-loader!./truncate_single');
import Max from './max';
+import { EuiCallOut } from '../../../../src/components/call_out';
const maxSource = require('!!raw-loader!./max');
const breadcrumpProps = {
@@ -32,6 +33,22 @@ const breadcrumpProps = {
export const BreadcrumbsExample = {
title: 'Breadcrumbs',
+ intro: (
+
+
+ EuiBreadcrumbs let the user track their progress within
+ and back out of a UX flow and work well when used in combination with{' '}
+
+ EuiPageHeader
+
+ . They are meant to be used at lower page level flows, while{' '}
+
+ EuiHeaderBreadcrumbs
+ {' '}
+ should be used for application-wide navigation.
+
- EuiBreadcrumbs let the user track their progress
- within and back out of a UX flow. You can provide an{' '}
- href prop on any breadcrumb item that you wish to
- make clickable, including the last item, though we recommend the last
- item represent the current page and therefore the link is unnecessary.
- They work well within{' '}
-
- EuiPageContentHeader
- {' '}
- but be careful not to use them within an app that also uses{' '}
-
- EuiHeaderBreadcrumbs
-
- .
-
+ <>
+
+ EuiBreadcrumbs requires an array of{' '}
+ EuiBreadcrumb objects as{' '}
+ breadcrumbs and handles truncation, including
+ middle-truncation in the case of many items, and mobile
+ responsiveness. Each item accepts an href prop,
+ though we recommend the last item represent the current page and
+ therefore the link is unnecessary.
+
+
+ For accessibility, it is highly recommended to provide a
+ descriptive aria-label for each set of
+ breadcrumbs.
+ >
+ }
+ />
+ >
),
props: breadcrumpProps,
playground: breadcrumbsConfig,
@@ -70,11 +93,15 @@ export const BreadcrumbsExample = {
text: 'Breadcrumb 2',
href: '#',
},
+ {
+ text: 'Current',
+ href: '#',
+ },
]}
- aria-label=""
/>
`,
demo: ,
+ demoPanelProps: { color: 'subdued' },
},
{
title: 'Limit the number of breadcrumbs',
@@ -98,7 +125,6 @@ export const BreadcrumbsExample = {
snippet: ``,
demo: ,
},
@@ -126,7 +152,6 @@ export const BreadcrumbsExample = {
``,
],
},
@@ -139,11 +164,10 @@ export const BreadcrumbsExample = {
],
text: (
<>
-
Single item only
- You can also force truncation on single breadcrumb{' '}
+ Alternatively, you can force truncation on single breadcrumb{' '}
item by adding{' '}
- {'truncate: true'}.
+ {'truncate: true'} to the object.
Alternatively, you can change number of breadcrumbs that show per
breakpoint by passing a custom responsive object.
@@ -216,7 +237,6 @@ export const BreadcrumbsExample = {
}}
max={null}
breadcrumbs={breadcrumbs}
- aria-label=""
/>`,
],
demo: ,
From 129a68dd083953ede4a8304b98c8490d66c8267c Mon Sep 17 00:00:00 2001
From: cchaos
Date: Fri, 13 Aug 2021 12:29:31 -0400
Subject: [PATCH 03/18] Updating guidance on overflow usage
---
.../utility_classes_example.js | 7 ++--
.../utility_classes_overflow.js | 36 ++++++++++++++-----
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/src-docs/src/views/utility_classes/utility_classes_example.js b/src-docs/src/views/utility_classes/utility_classes_example.js
index bd8bdd5c3dd..dc360e5d937 100644
--- a/src-docs/src/views/utility_classes/utility_classes_example.js
+++ b/src-docs/src/views/utility_classes/utility_classes_example.js
@@ -54,11 +54,14 @@ export const UtilityClassesExample = {
+ title="Scrollable regions must be focusable, promoted to region and with the right aria-label">
To ensure keyboard-only users have access to the scrollable
regions, the optimal solution is to apply{' '}
- {'tabIndex="0"'} to the region.{' '}
+ {'tabIndex="0"'} to the region. Add{' '}
+ {'role="region"'} and supply an
+ accessible name by using{' '}
+ aria-label or another method.
Learn more about the{' '}
scrollable-region-focusable rule at Deque.
diff --git a/src-docs/src/views/utility_classes/utility_classes_overflow.js b/src-docs/src/views/utility_classes/utility_classes_overflow.js
index 94a529b09aa..ea573a8b34a 100644
--- a/src-docs/src/views/utility_classes/utility_classes_overflow.js
+++ b/src-docs/src/views/utility_classes/utility_classes_overflow.js
@@ -46,6 +46,8 @@ export default () => (
}}>
@@ -73,8 +75,10 @@ export default () => (
snippet={``}
/>
@@ -103,7 +107,11 @@ export default () => (
}
example={
-
+
Orbiting this at a distance of roughly ninety-two million miles
@@ -116,8 +124,10 @@ export default () => (
}
snippet={`
+ tabIndex={0}
+ role="region"
+ aria-label=""
+ className="eui-xScrollWithShadows">
`}
/>
@@ -152,7 +162,12 @@ export default () => (
gutterSize="s"
responsive={false}>
-
+
Orbiting this at a distance of roughly ninety-two million
@@ -165,7 +180,12 @@ export default () => (