Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(beta_badge): support warning color value #8177

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/eui/changelogs/upcoming/8177.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated `EuiBetaBadge` with a new `warning` color variant
2 changes: 1 addition & 1 deletion packages/eui/src-docs/src/views/badge/beta_badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ exports[`EuiBetaBadge props color subdued is rendered 1`] = `
</span>
`;

exports[`EuiBetaBadge props color warning is rendered 1`] = `
<span>
<span
class="euiBetaBadge emotion-euiBetaBadge-warning-m-baseline"
title="Beta"
>
Beta
</span>
</span>
`;

exports[`EuiBetaBadge props iconType 1`] = `
<span>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const euiBetaBadgeStyles = (euiThemeContext: UseEuiTheme) => {
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)};
Expand Down
4 changes: 2 additions & 2 deletions packages/eui/src/components/badge/beta_badge/beta_badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -109,7 +109,7 @@ type BadgeProps = {
*/
title?: string;
/**
* Accepts accent, subdued and hollow.
* Accepts accent, subdued, hollow and warning.
*/
color?: BetaBadgeColor;
size?: BetaBadgeSize;
Expand Down
2 changes: 1 addition & 1 deletion packages/website/docs/components/display/badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => (
<>
Expand Down
Loading