Skip to content

Commit

Permalink
Add typings for EuiToolTip and EuiIconTip (#1087)
Browse files Browse the repository at this point in the history
* Add typings to EuiToolTip and EuiIconTip, and fix docs typo.

* Add PR info to changelog.

* Rename type for PropTypes.

* Update type name to correspond with associated types.
  • Loading branch information
justinkambic authored Aug 7, 2018
1 parent 70f0af5 commit bf0a6ce
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions 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 `EuiToolTip` and `EuiIconTip` ([#1087](https://github.com/elastic/eui/pull/1087))
- Added `spacesApp` logo to `EuiIcon` set ([#1065](https://github.com/elastic/eui/pull/1065))
- Added `!default` to border SASS props ([#1079](https://github.com/elastic/eui/pull/1079))
- Added `repositionOnScroll` prop to `EuiPopover` which enables repositioning the popover when the window is scrolled. ([#1064](https://github.com/elastic/eui/pull/1064))
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/tool_tip/tool_tip_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ToolTipExample = {
The <EuiCode>position</EuiCode> prop will take a suggested position, but will
change it if the tool tip gets too close to the edge of the screen. You can use
the <EuiCode>clickOnly</EuiCode> prop to tell the too tip to only appear on click
wrather than on hover.
rather than on hover.
</EuiText>

<EuiSpacer size="l" />
Expand Down
1 change: 1 addition & 0 deletions src/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
/// <reference path="./call_out/index.d.ts" />
/// <reference path="./badge/index.d.ts" />
/// <reference path="./toast/index.d.ts" />
/// <reference path="./tool_tip/index.d.ts" />
27 changes: 27 additions & 0 deletions src/components/tool_tip/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ReactElement, ReactNode, SFC } from 'react';

declare module '@elastic/eui' {
export type ToolTipPositions =
| 'top'
| 'right'
| 'bottom'
| 'left';

export interface EuiToolTipProps {
children: ReactElement<any>;
className?: string;
content: ReactNode;
title?: ReactNode;
id?: string;
position?: ToolTipPositions;
}
export const EuiToolTip: SFC<EuiToolTipProps>;

export interface EuiIconTipProps {
color?: string;
type?: string;
size?: string;
'aria-label'?: string;
}
export const EuiIconTip: SFC<EuiIconTipProps>;
}

0 comments on commit bf0a6ce

Please sign in to comment.