Skip to content

Commit

Permalink
Add typings for EuiBadge (#1034)
Browse files Browse the repository at this point in the history
* Add typings for EuiBadge.

* Add PR info to CHANGELOG.md

* Fix typo in changelog.

* Update EuiBadge SFC annotation based on PR feedback.
  • Loading branch information
justinkambic authored Jul 20, 2018
1 parent eaec046 commit f3a5ec5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added typings for 'EuiBadge' ([#1034](https://github.com/elastic/eui/pull/1034))
- Added a visual pattern for Kibana's Global Date Picker ([#1026](https://github.com/elastic/eui/pull/1026))
- Added `responsive` prop to `EuiFlexGrid` ([#1026](https://github.com/elastic/eui/pull/1026))
- Added `expand` prop to `EuiTabs` and `EuiTabbedContent` ([#1026](https://github.com/elastic/eui/pull/1026))
Expand All @@ -13,7 +14,6 @@

- To make it more accessible, added a random id to `EuiSwitch`'s id prop if none is passed. ([#779](https://github.com/elastic/eui/pull/779))


## [`3.1.0`](https://github.com/elastic/eui/tree/v3.1.0)

- Added `EuiMutationObserver` to expose Mutation Observer API to React components ([#966](https://github.com/elastic/eui/pull/966))
Expand Down
23 changes: 23 additions & 0 deletions src/components/badge/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference path="../icon/index.d.ts" />

import { HTMLAttributes, MouseEventHandler } from 'react';

declare module '@elastic/eui' {

type IconSide = 'left';

export interface EuiBadgeProps {
iconType?: IconType;
iconSide?: IconSide;
iconOnClick?: MouseEventHandler<HTMLButtonElement>;
iconOnClickAriaLabel?: string;
onClick?: MouseEventHandler<HTMLButtonElement>;
onClickAriaLabel?: string;
color?: string;
closeButtonProps?: Object;
}

export const EuiBadge: SFC<
CommonProps & HTMLAttributes<HTMLSpanElement> & HTMLAttributes<HTMLButtonElement> & EuiBadgeProps
>;
}
1 change: 1 addition & 0 deletions src/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
/// <reference path="./empty_prompt/index.d.ts" />
/// <reference path="./code/index.d.ts" />
/// <reference path="./call_out/index.d.ts" />
/// <reference path="./badge/index.d.ts" />

0 comments on commit f3a5ec5

Please sign in to comment.