Skip to content

Commit cbbeb81

Browse files
oliviertassinarithe-noob
authored andcommitted
[transition] Improve interoperability with react-transition-group (mui#8830)
1 parent 3b6bce5 commit cbbeb81

29 files changed

+122
-148
lines changed

pages/api/collapse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ filename: /src/transitions/Collapse.js
1616
| classes | Object | | Useful to extend the style applied to components. |
1717
| collapsedHeight | string | '0px' | The height of the container when collapsed. |
1818
| <span style="color: #31a148">in *</span> | boolean | | If `true`, the component will transition in. |
19-
| transitionDuration | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | duration.standard | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.<br>Set to 'auto' to automatically calculate transition time based on height. |
19+
| timeout | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | duration.standard | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.<br>Set to 'auto' to automatically calculate transition time based on height. |
2020

2121
Any other properties supplied will be [spread to the root element](/customization/api#spread).
2222

pages/api/fade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It's using [react-transition-group](https://github.com/reactjs/react-transition-
1515
|:-----|:-----|:--------|:------------|
1616
| <span style="color: #31a148">children *</span> | Element | | A single child content element. |
1717
| <span style="color: #31a148">in *</span> | boolean | | If `true`, the component will transition in. |
18-
| transitionDuration | TransitionDuration | { enter: duration.enteringScreen, exit: duration.leavingScreen,} | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |
18+
| timeout | TransitionDuration | { enter: duration.enteringScreen, exit: duration.leavingScreen,} | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |
1919

2020
Any other properties supplied will be [spread to the root element](/customization/api#spread).
2121

pages/api/grow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ It's using [react-transition-group](https://github.com/reactjs/react-transition-
1616
| <span style="color: #31a148">children *</span> | Element | | A single child content element. |
1717
| <span style="color: #31a148">in *</span> | boolean | | If `true`, show the component; triggers the enter or exit animation. |
1818
| rootRef | Function | | Use that property to pass a ref callback to the root component. |
19+
| timeout | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | 'auto' | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.<br>Set to 'auto' to automatically calculate transition time based on height. |
1920
| transitionClasses | TransitionClasses | {} | The animation classNames applied to the component as it enters or exits. This property is a direct binding to [`CSSTransition.classNames`](https://reactcommunity.org/react-transition-group/#CSSTransition-prop-classNames). |
20-
| transitionDuration | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | 'auto' | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.<br>Set to 'auto' to automatically calculate transition time based on height. |
2121

2222
Any other properties supplied will be [spread to the root element](/customization/api#spread).
2323

pages/api/menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ filename: /src/Menu/Menu.js
2424
| onExiting | TransitionCallback | | Callback fired when the Menu is exiting. |
2525
| onRequestClose | Function | | Callback fired when the component requests to be closed.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback |
2626
| open | boolean | false | If `true`, the menu is visible. |
27-
| transitionDuration | union:&nbsp;number<br>&nbsp;'auto'<br> | 'auto' | The length of the transition in `ms`, or 'auto' |
27+
| transitionDuration | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | 'auto' | The length of the transition in `ms`, or 'auto' |
2828

2929
Any other properties supplied will be [spread to the root element](/customization/api#spread).
3030

pages/api/popover.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ filename: /src/Popover/Popover.js
2929
| <span style="color: #31a148">open *</span> | boolean | | If `true`, the popover is visible. |
3030
| transformOrigin | signature | { vertical: 'top', horizontal: 'left',} | This is the point on the popover which will attach to the anchor's origin.<br>Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)]. |
3131
| transitionClasses | TransitionClasses | | The animation classNames applied to the component as it enters or exits. This property is a direct binding to [`CSSTransition.classNames`](https://reactcommunity.org/react-transition-group/#CSSTransition-prop-classNames). |
32-
| transitionDuration | union:&nbsp;number<br>&nbsp;'auto'<br> | 'auto' | Set to 'auto' to automatically calculate transition time based on height. |
32+
| transitionDuration | union:&nbsp;number<br>&nbsp;{ enter?: number, exit?: number }<br>&nbsp;'auto'<br> | 'auto' | Set to 'auto' to automatically calculate transition time based on height. |
3333

3434
Any other properties supplied will be [spread to the root element](/customization/api#spread).
3535

pages/api/slide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ filename: /src/transitions/Slide.js
1515
| <span style="color: #31a148">children *</span> | Element | | A single child content element. |
1616
| direction | union:&nbsp;'left'<br>&nbsp;'right'<br>&nbsp;'up'<br>&nbsp;'down'<br> | 'down' | Direction the child node will enter from. |
1717
| <span style="color: #31a148">in *</span> | boolean | | If `true`, show the component; triggers the enter or exit animation. |
18-
| transitionDuration | TransitionDuration | { enter: duration.enteringScreen, exit: duration.leavingScreen,} | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |
18+
| timeout | TransitionDuration | { enter: duration.enteringScreen, exit: duration.leavingScreen,} | The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. |
1919

2020
Any other properties supplied will be [spread to the root element](/customization/api#spread).
2121

src/Dialog/Dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function Dialog(props: ProvidedProps & Props) {
191191
{
192192
appear: true,
193193
in: open,
194-
transitionDuration,
194+
timeout: transitionDuration,
195195
onEnter,
196196
onEntering,
197197
onEntered,

src/Drawer/Drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class Drawer extends React.Component<ProvidedProps & Props, State> {
219219
<Slide
220220
in={open}
221221
direction={getSlideDirection(anchor)}
222-
transitionDuration={transitionDuration}
222+
timeout={transitionDuration}
223223
appear={!this.state.firstMount}
224224
{...SlideProps}
225225
>

src/Drawer/Drawer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('<Drawer />', () => {
6464
<div />
6565
</Drawer>,
6666
);
67-
assert.strictEqual(wrapper.find(Slide).props().transitionDuration, transitionDuration);
67+
assert.strictEqual(wrapper.find(Slide).props().timeout, transitionDuration);
6868
});
6969

7070
it("should be passed to to Modal's BackdropTransitionDuration when open=true", () => {

src/Input/InputLabel.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('<InputLabel />', () => {
3636
assert.strictEqual(wrapper.hasClass(classes.disabled), true);
3737
});
3838

39-
describe('props: FormControlClasses', () => {
39+
describe('prop: FormControlClasses', () => {
4040
it('should be able to change the FormLabel style', () => {
4141
const wrapper = shallow(<InputLabel FormControlClasses={{ foo: 'bar' }}>Foo</InputLabel>);
4242
assert.strictEqual(wrapper.props().classes.foo, 'bar');

0 commit comments

Comments
 (0)