Skip to content

Commit 1118c86

Browse files
authored
[Typescript]: Fix 9.x exported members (#1633)
* fix exported members * #1633 changelog entry
1 parent 8fe6e17 commit 1118c86

File tree

12 files changed

+117
-21
lines changed

12 files changed

+117
-21
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## [`master`](https://github.com/elastic/eui/tree/master)
22

3-
No public interface changes since `9.0.0`.
3+
**Bug fixes**
4+
5+
- Fixed definition exports for converted Typescript components ([#1633](https://github.com/elastic/eui/pull/1633))
46

57
## [`9.0.0`](https://github.com/elastic/eui/tree/v9.0.0)
68

src/components/flyout/flyout_body.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classNames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiFlyoutBody: FunctionComponent<
5+
export type EuiFlyoutBodyProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ children, className, ...rest }) => {
7+
>;
8+
9+
export const EuiFlyoutBody: EuiFlyoutBodyProps = ({
10+
children,
11+
className,
12+
...rest
13+
}) => {
814
const classes = classNames('euiFlyoutBody', className);
915

1016
return (

src/components/flyout/flyout_footer.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classNames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiFlyoutFooter: FunctionComponent<
5+
export type EuiFlyoutFooterProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ children, className, ...rest }) => {
7+
>;
8+
9+
export const EuiFlyoutFooter: EuiFlyoutFooterProps = ({
10+
children,
11+
className,
12+
...rest
13+
}) => {
814
const classes = classNames('euiFlyoutFooter', className);
915

1016
return (

src/components/flyout/flyout_header.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classNames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export type EuiFlyoutHeaderProps = HTMLAttributes<HTMLDivElement> &
6-
CommonProps & {
7-
hasBorder?: boolean;
8-
};
5+
export type EuiFlyoutHeaderProps = FunctionComponent<
6+
HTMLAttributes<HTMLDivElement> &
7+
CommonProps & {
8+
hasBorder?: boolean;
9+
}
10+
>;
911

10-
export const EuiFlyoutHeader: FunctionComponent<EuiFlyoutHeaderProps> = ({
12+
export const EuiFlyoutHeader: EuiFlyoutHeaderProps = ({
1113
children,
1214
className,
1315
hasBorder = false,

src/components/flyout/index.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { CommonProps } from '../common';
22

3+
import { EuiFlyoutFooterProps } from './flyout_footer';
4+
import { EuiFlyoutHeaderProps } from './flyout_header';
5+
import { EuiFlyoutBodyProps } from './flyout_body';
6+
37
declare module '@elastic/eui' {
48
export interface EuiFlyoutProps {
59
onClose: () => void;
@@ -27,4 +31,25 @@ declare module '@elastic/eui' {
2731
}
2832

2933
export const EuiFlyout: React.FunctionComponent<CommonProps & EuiFlyoutProps>;
34+
35+
/**
36+
* Flyout body type defs
37+
*
38+
* @see './flyout_body.js'
39+
*/
40+
export const EuiFlyoutBody: EuiFlyoutBodyProps;
41+
42+
/**
43+
* Flyout footer type defs
44+
*
45+
* @see './flyout_footer.js'
46+
*/
47+
export const EuiFlyoutFooter: EuiFlyoutFooterProps;
48+
49+
/**
50+
* Flyout header type defs
51+
*
52+
* @see './flyout_header.js'
53+
*/
54+
export const EuiFlyoutHeader: EuiFlyoutHeaderProps;
3055
}

src/components/modal/index.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { CommonProps, Omit } from '../common';
44

55
import { ReactNode, FunctionComponent, HTMLAttributes } from 'react';
66

7+
import { EuiModalFooterProps } from './modal_footer';
8+
import { EuiModalHeaderProps } from './modal_header';
9+
import { EuiModalBodyProps } from './modal_body';
10+
import { EuiModalHeaderTitleProps } from './modal_header_title';
11+
712
declare module '@elastic/eui' {
813
/**
914
* Modal type defs
@@ -66,4 +71,32 @@ declare module '@elastic/eui' {
6671
Omit<HTMLAttributes<HTMLDivElement>, 'title'> &
6772
EuiConfirmModalProps
6873
>;
74+
75+
/**
76+
* Modal body type defs
77+
*
78+
* @see './modal_body.js'
79+
*/
80+
export const EuiModalBody: EuiModalBodyProps;
81+
82+
/**
83+
* Modal footer type defs
84+
*
85+
* @see './modal_footer.js'
86+
*/
87+
export const EuiModalFooter: EuiModalFooterProps;
88+
89+
/**
90+
* Modal header type defs
91+
*
92+
* @see './modal_header.js'
93+
*/
94+
export const EuiModalHeader: EuiModalHeaderProps;
95+
96+
/**
97+
* Modal header title type defs
98+
*
99+
* @see './modal_header_title.js'
100+
*/
101+
export const EuiModalHeaderTitle: EuiModalHeaderTitleProps;
69102
}

src/components/modal/modal_body.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classnames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiModalBody: FunctionComponent<
5+
export type EuiModalBodyProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ className, children, ...rest }) => {
7+
>;
8+
9+
export const EuiModalBody: EuiModalBodyProps = ({
10+
className,
11+
children,
12+
...rest
13+
}) => {
814
const classes = classnames('euiModalBody', className);
915
return (
1016
<div className={classes} {...rest}>

src/components/modal/modal_footer.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classnames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiModalFooter: FunctionComponent<
5+
export type EuiModalFooterProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ className, children, ...rest }) => {
7+
>;
8+
9+
export const EuiModalFooter: EuiModalFooterProps = ({
10+
className,
11+
children,
12+
...rest
13+
}) => {
814
const classes = classnames('euiModalFooter', className);
915
return (
1016
<div className={classes} {...rest}>

src/components/modal/modal_header.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classnames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiModalHeader: FunctionComponent<
5+
export type EuiModalHeaderProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ className, children, ...rest }) => {
7+
>;
8+
9+
export const EuiModalHeader: EuiModalHeaderProps = ({
10+
className,
11+
children,
12+
...rest
13+
}) => {
814
const classes = classnames('euiModalHeader', className);
915
return (
1016
<div className={classes} {...rest}>

src/components/modal/modal_header_title.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React, { FunctionComponent, HTMLAttributes } from 'react';
22
import classnames from 'classnames';
33
import { CommonProps } from '../common';
44

5-
export const EuiModalHeaderTitle: FunctionComponent<
5+
export type EuiModalHeaderTitleProps = FunctionComponent<
66
HTMLAttributes<HTMLDivElement> & CommonProps
7-
> = ({ className, children, ...rest }) => {
7+
>;
8+
9+
export const EuiModalHeaderTitle: EuiModalHeaderTitleProps = ({
10+
className,
11+
children,
12+
...rest
13+
}) => {
814
const classes = classnames('euiModalHeader__title', className);
915
return (
1016
<div className={classes} {...rest}>

0 commit comments

Comments
 (0)