Skip to content

Commit

Permalink
[PR feedback] Restore TEXT_SIZES
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Apr 26, 2022
1 parent 9244401 commit 882da2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/health/health.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';
import { shouldRenderCustomStyles } from '../../test/internal';
import { COLORS } from '../icon/icon';
import { EuiHealth } from './health';
import { EuiHealth, TEXT_SIZES } from './health';

describe('EuiHealth', () => {
test('is rendered', () => {
Expand All @@ -24,7 +24,7 @@ describe('EuiHealth', () => {

describe('props', () => {
describe('textSize', () => {
['xs', 's', 'm', 'inherit'].forEach((textSize: any) => {
TEXT_SIZES.forEach((textSize: any) => {
test(`${textSize} is rendered`, () => {
const component = render(
<EuiHealth textSize={textSize} color="success" />
Expand Down
4 changes: 3 additions & 1 deletion src/components/health/health.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { CommonProps } from '../common';
import { EuiIcon, IconColor } from '../icon';
import { EuiFlexGroup, EuiFlexItem } from '../flex';

export const TEXT_SIZES = ['xs', 's', 'm', 'inherit'] as const;

export type EuiHealthProps = CommonProps &
Omit<HTMLAttributes<HTMLDivElement>, 'color'> & {
/**
Expand All @@ -27,7 +29,7 @@ export type EuiHealthProps = CommonProps &
* Matches the text scales of EuiText.
* The `inherit` style will get its font size from the parent element
*/
textSize?: 'xs' | 's' | 'm' | 'inherit';
textSize?: typeof TEXT_SIZES[number];
};

export const EuiHealth: FunctionComponent<EuiHealthProps> = ({
Expand Down

0 comments on commit 882da2a

Please sign in to comment.