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

Convert EuiDescribedFormGroup to typeScript #2810

Merged
merged 7 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `tableCaption` prop to `EuiBasicTable` and improved the default one ([#2782](https://github.com/elastic/eui/pull/2782))
- Converted `EuiDescribedFormGroup` to TypeScript ([#2810](https://github.com/elastic/eui/pull/2810))
- Changed SASS comments to non-compiled comments in invisibles files ([#2807](https://github.com/elastic/eui/pull/2807))

## [`18.3.0`](https://github.com/elastic/eui/tree/v18.3.0)
Expand Down
1 change: 1 addition & 0 deletions src/components/flex/flex_group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const gutterSizeToClassNameMap = {
};

export const GUTTER_SIZES = keysOf(gutterSizeToClassNameMap);
export type EuiFlexGroupGutterSize = keyof typeof gutterSizeToClassNameMap;

const alignItemsToClassNameMap = {
stretch: null,
Expand Down
2 changes: 1 addition & 1 deletion src/components/flex/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { EuiFlexGroup } from './flex_group';
export { EuiFlexGroup, EuiFlexGroupGutterSize } from './flex_group';

export { EuiFlexGrid } from './flex_grid';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ exports[`EuiDescribedFormGroup is rendered 1`] = `
className="testClass1 testClass2"
data-test-subj="test subject string"
description="Test description"
fullWidth={false}
gutterSize="l"
title={
<h3>
Title
</h3>
}
titleSize="xs"
>
<EuiInnerText>
<fieldset
Expand All @@ -38,9 +35,7 @@ exports[`EuiDescribedFormGroup is rendered 1`] = `
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down Expand Up @@ -119,14 +114,11 @@ exports[`EuiDescribedFormGroup props description is not rendered when it's not p
aria-label="aria-label"
className="testClass1 testClass2"
data-test-subj="test subject string"
fullWidth={false}
gutterSize="l"
title={
<h3>
Title
</h3>
}
titleSize="xs"
>
<EuiInnerText>
<fieldset
Expand All @@ -151,9 +143,7 @@ exports[`EuiDescribedFormGroup props description is not rendered when it's not p
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down Expand Up @@ -214,13 +204,11 @@ exports[`EuiDescribedFormGroup props fullWidth is rendered 1`] = `
data-test-subj="test subject string"
description="Test description"
fullWidth={true}
gutterSize="l"
title={
<h3>
Title
</h3>
}
titleSize="xs"
>
<EuiInnerText>
<fieldset
Expand All @@ -245,9 +233,7 @@ exports[`EuiDescribedFormGroup props fullWidth is rendered 1`] = `
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down Expand Up @@ -327,14 +313,12 @@ exports[`EuiDescribedFormGroup props gutterSize is rendered 1`] = `
className="testClass1 testClass2"
data-test-subj="test subject string"
description="Test description"
fullWidth={false}
gutterSize="s"
title={
<h3>
Title
</h3>
}
titleSize="xs"
>
<EuiInnerText>
<fieldset
Expand All @@ -359,9 +343,7 @@ exports[`EuiDescribedFormGroup props gutterSize is rendered 1`] = `
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down Expand Up @@ -441,8 +423,6 @@ exports[`EuiDescribedFormGroup props titleSize is rendered 1`] = `
className="testClass1 testClass2"
data-test-subj="test subject string"
description="Test description"
fullWidth={false}
gutterSize="l"
title={
<h3>
Title
Expand Down Expand Up @@ -473,9 +453,7 @@ exports[`EuiDescribedFormGroup props titleSize is rendered 1`] = `
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down Expand Up @@ -555,14 +533,11 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
className="testClass1 testClass2"
data-test-subj="test subject string"
description="Test description"
fullWidth={false}
gutterSize="l"
title={
<h3>
Title
</h3>
}
titleSize="xs"
>
<EuiInnerText>
<fieldset
Expand All @@ -587,9 +562,7 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
<div
className="euiFlexItem"
>
<span
title="Title"
>
<span>
<EuiTitle
aria-hidden="true"
className="euiDescribedFormGroup__title"
Expand Down
115 changes: 0 additions & 115 deletions src/components/form/described_form_group/described_form_group.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,8 @@ describe('EuiDescribedFormGroup', () => {
});

test('gutterSize is rendered', () => {
const describedFormGroupProps = {
gutterSize: 's',
};

const component = mount(
<EuiDescribedFormGroup
{...requiredProps}
{...props}
{...describedFormGroupProps}>
<EuiDescribedFormGroup gutterSize="s" {...requiredProps} {...props}>
<EuiFormRow>
<input />
</EuiFormRow>
Expand All @@ -84,15 +77,8 @@ describe('EuiDescribedFormGroup', () => {
});

test('titleSize is rendered', () => {
const describedFormGroupProps = {
titleSize: 'l',
};

const component = mount(
<EuiDescribedFormGroup
{...requiredProps}
{...props}
{...describedFormGroupProps}>
<EuiDescribedFormGroup titleSize="l" {...requiredProps} {...props}>
<EuiFormRow>
<input />
</EuiFormRow>
Expand Down
Loading