diff --git a/packages/eui/changelogs/upcoming/8177.md b/packages/eui/changelogs/upcoming/8177.md new file mode 100644 index 00000000000..4aa13b77bb4 --- /dev/null +++ b/packages/eui/changelogs/upcoming/8177.md @@ -0,0 +1 @@ +- Updated `EuiBetaBadge` with a new `warning` color variant diff --git a/packages/eui/src-docs/src/views/badge/beta_badge.tsx b/packages/eui/src-docs/src/views/badge/beta_badge.tsx index 8f0c6213dec..0d72a59bb4d 100644 --- a/packages/eui/src-docs/src/views/badge/beta_badge.tsx +++ b/packages/eui/src-docs/src/views/badge/beta_badge.tsx @@ -3,7 +3,7 @@ import { css } from '@emotion/react'; import { EuiBetaBadge, EuiSpacer, EuiTitle } from '../../../../src/components'; -const colors = ['hollow', 'accent', 'subdued'] as const; +const colors = ['hollow', 'accent', 'subdued', 'warning'] as const; export default () => ( <> diff --git a/packages/eui/src/components/badge/beta_badge/__snapshots__/beta_badge.test.tsx.snap b/packages/eui/src/components/badge/beta_badge/__snapshots__/beta_badge.test.tsx.snap index 031c5216127..c50cd2d1393 100644 --- a/packages/eui/src/components/badge/beta_badge/__snapshots__/beta_badge.test.tsx.snap +++ b/packages/eui/src/components/badge/beta_badge/__snapshots__/beta_badge.test.tsx.snap @@ -68,6 +68,17 @@ exports[`EuiBetaBadge props color subdued is rendered 1`] = ` `; +exports[`EuiBetaBadge props color warning is rendered 1`] = ` + + + Beta + + +`; + exports[`EuiBetaBadge props iconType 1`] = ` { box-shadow: inset 0 0 0 ${euiTheme.border.width.thin} ${badgeColors.hollow.borderColor}; `, + warning: css(badgeColors.warning), // Font sizes m: css` font-size: ${euiFontSizeFromScale('xs', euiTheme)}; diff --git a/packages/eui/src/components/badge/beta_badge/beta_badge.tsx b/packages/eui/src/components/badge/beta_badge/beta_badge.tsx index bcaca40f742..77e3e5d4363 100644 --- a/packages/eui/src/components/badge/beta_badge/beta_badge.tsx +++ b/packages/eui/src/components/badge/beta_badge/beta_badge.tsx @@ -22,7 +22,7 @@ import { EuiIcon, IconType } from '../../icon'; import { euiBetaBadgeStyles } from './beta_badge.styles'; -export const COLORS = ['accent', 'subdued', 'hollow'] as const; +export const COLORS = ['accent', 'subdued', 'hollow', 'warning'] as const; export type BetaBadgeColor = (typeof COLORS)[number]; export const SIZES = ['s', 'm'] as const; @@ -109,7 +109,7 @@ type BadgeProps = { */ title?: string; /** - * Accepts accent, subdued and hollow. + * Accepts accent, subdued, hollow and warning. */ color?: BetaBadgeColor; size?: BetaBadgeSize; diff --git a/packages/website/docs/components/display/badge.mdx b/packages/website/docs/components/display/badge.mdx index e6491e6455f..d69c44d81b0 100644 --- a/packages/website/docs/components/display/badge.mdx +++ b/packages/website/docs/components/display/badge.mdx @@ -323,7 +323,7 @@ import React from 'react'; import { EuiBetaBadge, EuiSpacer, EuiTitle } from '@elastic/eui'; import { css } from '@emotion/react'; -const colors = ['hollow', 'accent', 'subdued'] as const; +const colors = ['hollow', 'accent', 'subdued', 'warning'] as const; export default () => ( <>