+/>
`;
exports[`EuiButtonIcon props color danger is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color disabled is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color ghost is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color primary is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color subdued is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color success is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color text is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props color warning is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props href secures the rel attribute when the target is _blank 1`] = `
-
- button
-
-
+/>
`;
exports[`EuiButtonIcon props iconType is rendered 1`] = `
`;
exports[`EuiButtonIcon props isDisabled is rendered 1`] = `
+/>
`;
exports[`EuiButtonIcon props isDisabled renders a button even when href is defined 1`] = `
+/>
`;
diff --git a/src/components/button/button_icon/button_icon.test.tsx b/src/components/button/button_icon/button_icon.test.tsx
index da954b11ac66..8a6e3d5b2c98 100644
--- a/src/components/button/button_icon/button_icon.test.tsx
+++ b/src/components/button/button_icon/button_icon.test.tsx
@@ -7,7 +7,7 @@ import { EuiButtonIcon, COLORS } from './button_icon';
describe('EuiButtonIcon', () => {
test('is rendered', () => {
const component = render(
-
+
);
expect(component).toMatchSnapshot();
@@ -16,14 +16,16 @@ describe('EuiButtonIcon', () => {
describe('props', () => {
describe('isDisabled', () => {
it('is rendered', () => {
- const component = render(
);
+ const component = render(
+
+ );
expect(component).toMatchSnapshot();
});
it('renders a button even when href is defined', () => {
const component = render(
-
+
);
expect(component).toMatchSnapshot();
@@ -33,7 +35,7 @@ describe('EuiButtonIcon', () => {
describe('iconType', () => {
it('is rendered', () => {
const component = render(
-
+
);
expect(component).toMatchSnapshot();
@@ -44,7 +46,7 @@ describe('EuiButtonIcon', () => {
COLORS.forEach(color => {
test(`${color} is rendered`, () => {
const component = render(
-
+
);
expect(component).toMatchSnapshot();
@@ -55,7 +57,7 @@ describe('EuiButtonIcon', () => {
describe('href', () => {
it('secures the rel attribute when the target is _blank', () => {
const component = render(
-
+
);
expect(component).toMatchSnapshot();
@@ -66,7 +68,7 @@ describe('EuiButtonIcon', () => {
it('supports onClick and href', () => {
const handler = jest.fn();
const component = mount(
-
+
);
component.find('a').simulate('click');
expect(handler.mock.calls.length).toEqual(1);
@@ -75,7 +77,7 @@ describe('EuiButtonIcon', () => {
it('supports onClick as a button', () => {
const handler = jest.fn();
const component = mount(
-
+
);
component.find('button').simulate('click');
expect(handler.mock.calls.length).toEqual(1);
diff --git a/src/components/button/button_icon/button_icon.tsx b/src/components/button/button_icon/button_icon.tsx
index aca785d65298..88740f456a4a 100644
--- a/src/components/button/button_icon/button_icon.tsx
+++ b/src/components/button/button_icon/button_icon.tsx
@@ -3,10 +3,9 @@ import React, {
ButtonHTMLAttributes,
FunctionComponent,
Ref,
- ReactNode,
} from 'react';
import classNames from 'classnames';
-import { EuiScreenReaderOnly } from '../../accessibility/screen_reader';
+
import { getSecureRelForTarget } from '../../../services';
import {
CommonProps,
@@ -32,12 +31,14 @@ export type EuiButtonIconColor =
export type HideOrLabel = ExclusiveUnion<
{ 'aria-hidden': true },
- ExclusiveUnion<{ label: ReactNode }, { 'aria-labelledby': string }>
+ ExclusiveUnion<{ 'aria-label': string }, { 'aria-labelledby': string }>
>;
export type EuiButtonIconProps = {
iconType?: IconType;
color?: EuiButtonIconColor;
+ 'aria-label'?: string;
+ 'aria-labelledby'?: string;
isDisabled?: boolean;
size?: ButtonSize;
iconSize?: IconSize;
@@ -87,7 +88,6 @@ export const EuiButtonIcon: FunctionComponent
= ({
target,
rel,
buttonRef,
- label,
...rest
}) => {
const classes = classNames(
@@ -124,11 +124,6 @@ export const EuiButtonIcon: FunctionComponent = ({
ref={buttonRef as Ref}
{...rest as AnchorHTMLAttributes}>
{buttonIcon}
- {label && (
-
- {label}
-
- )}
);
}
@@ -142,11 +137,6 @@ export const EuiButtonIcon: FunctionComponent = ({
ref={buttonRef as Ref}
{...rest as ButtonHTMLAttributes}>
{buttonIcon}
- {label && (
-
- {label}
-
- )}
);
};
diff --git a/src/components/button/index.ts b/src/components/button/index.ts
index 3a431140e38a..a2eebfd7f093 100644
--- a/src/components/button/index.ts
+++ b/src/components/button/index.ts
@@ -5,6 +5,7 @@ export {
ButtonIconSide,
EuiButton,
EuiButtonProps,
+ colorToClassNameMap,
} from './button';
export {
diff --git a/src/components/code/__snapshots__/code_block.test.tsx.snap b/src/components/code/__snapshots__/code_block.test.tsx.snap
index 89f3a081743c..8b2bf9a15f60 100644
--- a/src/components/code/__snapshots__/code_block.test.tsx.snap
+++ b/src/components/code/__snapshots__/code_block.test.tsx.snap
@@ -101,6 +101,7 @@ console.log(some);
class="euiToolTipAnchor"
>
@@ -158,6 +154,7 @@ console.log(some);
class="euiCodeBlock__controls"
>