-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(types): Type definitions for Position and PositionAnimated (#…
…461)
- Loading branch information
Showing
5 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
packages/fuselage/src/components/Box/Position/Position.d.ts
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,10 @@ | ||
import { Placements, PositionOptions } from '@rocket.chat/fuselage-hooks'; | ||
import { ComponentProps, FC, RefObject } from 'react'; | ||
|
||
type PositionProps = { | ||
anchor?: RefObject<Element>; | ||
placement?: Placements; | ||
margin?: PositionOptions['margin']; | ||
} & ComponentProps<typeof Box>; | ||
|
||
declare const Position: FC<PositionProps>; |
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
9 changes: 9 additions & 0 deletions
9
packages/fuselage/src/components/Box/Position/PositionAnimated.d.ts
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,9 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
import Position from '.'; | ||
|
||
type PositionAnimatedProps = { | ||
visibility?: boolean; | ||
} & ComponentProps<typeof Position>; | ||
|
||
declare const PositionAnimated: FC<PositionAnimatedProps>; |
12 changes: 12 additions & 0 deletions
12
packages/fuselage/src/components/Box/Position/PositionAnimated.js
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,12 @@ | ||
import React from 'react'; | ||
|
||
import Position from '.'; | ||
import AnimatedVisibility from '../AnimatedVisibility'; | ||
|
||
const PositionAnimated = ({ width, visible, children, ...props }) => ( | ||
<AnimatedVisibility visibility={visible}> | ||
<Position {...props}>{children}</Position> | ||
</AnimatedVisibility> | ||
); | ||
|
||
export default PositionAnimated; |
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,3 @@ | ||
export { default } from './Position'; | ||
|
||
export { default as PositionAnimated } from './PositionAnimated'; |