This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These types may be useful to consumers to better type their own code. This commit aims to get on pair with #153
- Loading branch information
Federico Zivolo
committed
May 1, 2018
1 parent
c8c9cb9
commit cf6c558
Showing
8 changed files
with
101 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
[lints] | ||
|
||
[options] | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectError | ||
|
||
[strict] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// @flow | ||
|
||
// Please remember to update also the TypeScript test files that can | ||
// be found under `/typings/tests` please. Thanks! 🤗 | ||
|
||
import React from 'react'; | ||
import { Manager, Reference, Popper } from '..'; | ||
|
||
export const Test = () => ( | ||
<Manager> | ||
{/* $FlowExpectError: empty children */} | ||
<Reference /> | ||
<Reference>{({ ref }) => <div ref={ref} />}</Reference> | ||
<Popper | ||
// $FlowExpectError: should be boolean | ||
eventsEnabled="foo" | ||
eventsEnabled | ||
// $FlowExpectError: should be boolean | ||
positionFixed={2} | ||
positionFixed | ||
// $FlowExpectError: enabled should be boolean, order number | ||
modifiers={{ flip: { enabled: 'bar', order: 'foo' } }} | ||
modifiers={{ flip: { enabled: false } }} | ||
> | ||
{({ | ||
ref, | ||
style, | ||
placement, | ||
outOfBoundaries, | ||
scheduleUpdate, | ||
arrowProps, | ||
}) => ( | ||
<div | ||
ref={ref} | ||
style={{ ...style, opacity: outOfBoundaries ? 0 : 1 }} | ||
data-placement={placement} | ||
onClick={() => scheduleUpdate()} | ||
> | ||
Popper | ||
<div ref={arrowProps.ref} style={arrowProps.style} /> | ||
</div> | ||
)} | ||
</Popper> | ||
<Popper> | ||
{({ ref, style, placement }) => ( | ||
<div ref={ref} style={style} data-placement={placement}> | ||
Popper | ||
</div> | ||
)} | ||
</Popper> | ||
</Manager> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
// @flow | ||
|
||
// Public components | ||
import Popper, { placements } from './Popper'; | ||
import Manager from './Manager'; | ||
import Reference from './Reference'; | ||
|
||
export { Popper, placements, Manager, Reference }; | ||
|
||
// Public types | ||
import type { Placement } from 'popper.js'; | ||
import type { ManagerProps } from './Manager'; | ||
import type { ReferenceProps, ReferenceChildrenProps } from './Reference'; | ||
import type { | ||
PopperChildrenProps, | ||
PopperArrowProps, | ||
PopperProps, | ||
} from './Popper'; | ||
export type { | ||
Placement, | ||
ManagerProps, | ||
ReferenceProps, | ||
ReferenceChildrenProps, | ||
PopperChildrenProps, | ||
PopperArrowProps, | ||
PopperProps, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters