diff --git a/src/components/beacon/__snapshots__/beacon.test.tsx.snap b/src/components/beacon/__snapshots__/beacon.test.tsx.snap index b09e564e8dd..7d024a41478 100644 --- a/src/components/beacon/__snapshots__/beacon.test.tsx.snap +++ b/src/components/beacon/__snapshots__/beacon.test.tsx.snap @@ -1,19 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`EuiBeacon accepts size 1`] = ` +exports[`EuiBeacon is rendered 1`] = `
`; -exports[`EuiBeacon is rendered 1`] = ` +exports[`EuiBeacon props color accent is rendered 1`] = ` + +`; + +exports[`EuiBeacon props color danger is rendered 1`] = ` + +`; + +exports[`EuiBeacon props color primary is rendered 1`] = ` + +`; + +exports[`EuiBeacon props color subdued is rendered 1`] = ` + +`; + +exports[`EuiBeacon props color success is rendered 1`] = ` `; + +exports[`EuiBeacon props color warning is rendered 1`] = ` + +`; + +exports[`EuiBeacon props size accepts size 1`] = ` + +`; diff --git a/src/components/beacon/beacon.styles.ts b/src/components/beacon/beacon.styles.ts index d91e3e34af8..f2c36c7fec9 100644 --- a/src/components/beacon/beacon.styles.ts +++ b/src/components/beacon/beacon.styles.ts @@ -7,14 +7,22 @@ */ import { keyframes, css } from '@emotion/react'; -import { euiPaletteColorBlind } from '../../services'; +import { UseEuiTheme } from '../../services'; import { euiCanAnimate, logicalCSS, logicalSizeCSS, } from '../../global_styling'; -const visColors = euiPaletteColorBlind(); +const _colorCSS = (color: string) => { + return ` + background-color: ${color}; + &:before, + &:after { + box-shadow: 0 0 1px 1px ${color}; + } + `; +}; const euiBeaconPulseLarge = keyframes` 0% { @@ -48,11 +56,10 @@ const euiBeaconPulseSmall = keyframes` } `; -export const euiBeaconStyles = () => ({ +export const euiBeaconStyles = ({ euiTheme }: UseEuiTheme) => ({ // Base euiBeacon: css` position: relative; - background-color: ${visColors[0]}; border-radius: 50%; &:before, @@ -64,7 +71,6 @@ export const euiBeaconStyles = () => ({ ${logicalCSS('top', 0)} background-color: transparent; border-radius: 50%; - box-shadow: 0 0 1px 1px ${visColors[0]}; } // Without the animation, we only display one ring around the circle @@ -88,4 +94,10 @@ export const euiBeaconStyles = () => ({ } } `, + subdued: css(_colorCSS(euiTheme.colors.subduedText)), + primary: css(_colorCSS(euiTheme.colors.primary)), + success: css(_colorCSS(euiTheme.colors.success)), + warning: css(_colorCSS(euiTheme.colors.warning)), + danger: css(_colorCSS(euiTheme.colors.danger)), + accent: css(_colorCSS(euiTheme.colors.accent)), }); diff --git a/src/components/beacon/beacon.test.tsx b/src/components/beacon/beacon.test.tsx index 7cf40e15166..2ad7f2f53a4 100644 --- a/src/components/beacon/beacon.test.tsx +++ b/src/components/beacon/beacon.test.tsx @@ -11,7 +11,7 @@ import { render } from 'enzyme'; import { requiredProps } from '../../test/required_props'; import { shouldRenderCustomStyles } from '../../test/internal'; -import { EuiBeacon } from './beacon'; +import { EuiBeacon, COLORS } from './beacon'; describe('EuiBeacon', () => { shouldRenderCustomStyles(