@instructure/ui-motion 8.11.2-snapshot.7 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/es/Transition/BaseTransition/index.js +46 -27
- package/es/Transition/BaseTransition/props.js +12 -10
- package/es/Transition/index.js +8 -17
- package/es/Transition/props.js +4 -67
- package/es/Transition/styles.js +11 -8
- package/es/package.json +1 -0
- package/lib/Transition/BaseTransition/index.js +46 -27
- package/lib/Transition/BaseTransition/props.js +13 -10
- package/lib/Transition/index.js +8 -17
- package/lib/Transition/props.js +6 -67
- package/lib/Transition/styles.js +14 -9
- package/package.json +12 -13
- package/src/Transition/BaseTransition/index.ts +88 -79
- package/src/Transition/BaseTransition/props.ts +93 -51
- package/src/Transition/README.md +44 -47
- package/src/Transition/index.tsx +15 -32
- package/src/Transition/props.ts +32 -88
- package/src/Transition/styles.ts +10 -9
- package/types/Transition/BaseTransition/index.d.ts +27 -66
- package/types/Transition/BaseTransition/index.d.ts.map +1 -1
- package/types/Transition/BaseTransition/props.d.ts +52 -38
- package/types/Transition/BaseTransition/props.d.ts.map +1 -1
- package/types/Transition/index.d.ts +5 -55
- package/types/Transition/index.d.ts.map +1 -1
- package/types/Transition/props.d.ts +14 -18
- package/types/Transition/props.d.ts.map +1 -1
- package/types/Transition/styles.d.ts +8 -0
- package/types/Transition/styles.d.ts.map +1 -1
- package/LICENSE.md +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BaseTransitionProps } from './props';
|
|
2
|
+
import type { BaseTransitionProps, BaseTransitionState, BaseTransitionStateValue, BaseTransitionStatesType } from './props';
|
|
3
3
|
/**
|
|
4
4
|
---
|
|
5
5
|
private: true
|
|
@@ -7,94 +7,55 @@ private: true
|
|
|
7
7
|
Note: this is forked from https://github.com/react-bootstrap/react-overlays/blob/master/src/Transition.js
|
|
8
8
|
so that it works with css modules. The internals are pretty different now, but it has roughly the same api.
|
|
9
9
|
**/
|
|
10
|
-
declare class BaseTransition extends React.Component<BaseTransitionProps> {
|
|
11
|
-
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
12
|
-
in?: boolean | undefined;
|
|
13
|
-
unmountOnExit?: boolean | undefined;
|
|
14
|
-
transitionOnMount?: boolean | undefined;
|
|
15
|
-
transitionEnter?: boolean | undefined;
|
|
16
|
-
transitionExit?: boolean | undefined;
|
|
10
|
+
declare class BaseTransition extends React.Component<BaseTransitionProps, BaseTransitionState> {
|
|
11
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof import("./props").TransitionCommonProps | keyof {
|
|
17
12
|
enterDelay?: number | undefined;
|
|
18
13
|
exitDelay?: number | undefined;
|
|
19
|
-
transitionClassName
|
|
20
|
-
exitedClassName
|
|
21
|
-
exitingClassName
|
|
22
|
-
enteredClassName
|
|
23
|
-
enteringClassName
|
|
24
|
-
onTransition?: ((toState: number, fromState: number) => void) | undefined;
|
|
25
|
-
onEnter?: (() => void) | undefined;
|
|
26
|
-
onEntering?: (() => void) | undefined;
|
|
27
|
-
onEntered?: (() => void) | undefined;
|
|
28
|
-
onExit?: (() => void) | undefined;
|
|
29
|
-
onExiting?: (() => void) | undefined;
|
|
30
|
-
onExited?: (() => void) | undefined;
|
|
31
|
-
children?: React.ReactNode;
|
|
14
|
+
transitionClassName: string;
|
|
15
|
+
exitedClassName: string;
|
|
16
|
+
exitingClassName: string;
|
|
17
|
+
enteredClassName: string;
|
|
18
|
+
enteringClassName: string;
|
|
32
19
|
className?: string | undefined;
|
|
33
20
|
}>;
|
|
34
|
-
static allowedProps: readonly (keyof {
|
|
35
|
-
in?: boolean | undefined;
|
|
36
|
-
unmountOnExit?: boolean | undefined;
|
|
37
|
-
transitionOnMount?: boolean | undefined;
|
|
38
|
-
transitionEnter?: boolean | undefined;
|
|
39
|
-
transitionExit?: boolean | undefined;
|
|
21
|
+
static allowedProps: readonly (keyof import("./props").TransitionCommonProps | keyof {
|
|
40
22
|
enterDelay?: number | undefined;
|
|
41
23
|
exitDelay?: number | undefined;
|
|
42
|
-
transitionClassName
|
|
43
|
-
exitedClassName
|
|
44
|
-
exitingClassName
|
|
45
|
-
enteredClassName
|
|
46
|
-
enteringClassName
|
|
47
|
-
onTransition?: ((toState: number, fromState: number) => void) | undefined;
|
|
48
|
-
onEnter?: (() => void) | undefined;
|
|
49
|
-
onEntering?: (() => void) | undefined;
|
|
50
|
-
onEntered?: (() => void) | undefined;
|
|
51
|
-
onExit?: (() => void) | undefined;
|
|
52
|
-
onExiting?: (() => void) | undefined;
|
|
53
|
-
onExited?: (() => void) | undefined;
|
|
54
|
-
children?: React.ReactNode;
|
|
24
|
+
transitionClassName: string;
|
|
25
|
+
exitedClassName: string;
|
|
26
|
+
exitingClassName: string;
|
|
27
|
+
enteredClassName: string;
|
|
28
|
+
enteringClassName: string;
|
|
55
29
|
className?: string | undefined;
|
|
56
30
|
})[];
|
|
57
31
|
static defaultProps: {
|
|
58
32
|
in: boolean;
|
|
59
|
-
component: string;
|
|
60
33
|
unmountOnExit: boolean;
|
|
61
34
|
transitionOnMount: boolean;
|
|
62
35
|
transitionEnter: boolean;
|
|
63
36
|
transitionExit: boolean;
|
|
64
37
|
enterDelay: number;
|
|
65
38
|
exitDelay: number;
|
|
66
|
-
onEnter: () => void;
|
|
67
|
-
onEntering: () => void;
|
|
68
|
-
onEntered: () => void;
|
|
69
|
-
onExit: () => void;
|
|
70
|
-
onExiting: () => void;
|
|
71
|
-
onExited: () => void;
|
|
72
|
-
onTransition: () => void;
|
|
73
|
-
children: null;
|
|
74
39
|
};
|
|
75
|
-
static states:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ENTERING: number;
|
|
79
|
-
ENTERED: number;
|
|
80
|
-
};
|
|
81
|
-
_timeouts: never[];
|
|
40
|
+
static states: Record<BaseTransitionStateValue, BaseTransitionStatesType>;
|
|
41
|
+
_timeouts: ReturnType<typeof setTimeout>[];
|
|
42
|
+
_unmounted: boolean;
|
|
82
43
|
state: {
|
|
83
44
|
transitioning: boolean;
|
|
84
45
|
};
|
|
85
46
|
componentDidMount(): void;
|
|
86
|
-
getSnapshotBeforeUpdate(prevProps:
|
|
87
|
-
componentDidUpdate(prevProps:
|
|
47
|
+
getSnapshotBeforeUpdate(prevProps: BaseTransitionProps, prevState: BaseTransitionState): true | null;
|
|
48
|
+
componentDidUpdate(prevProps: BaseTransitionProps, _prevState: BaseTransitionState, cancelPrematurely: boolean): void;
|
|
88
49
|
componentWillUnmount(): void;
|
|
89
|
-
startTransition: (transitionIn:
|
|
90
|
-
transition: (toState:
|
|
91
|
-
clearTransition(transitionClassName:
|
|
92
|
-
enter: (initialState:
|
|
93
|
-
exit: (initialState:
|
|
94
|
-
transitionEnabled(toState:
|
|
95
|
-
getTransitionClassName(transitionState:
|
|
50
|
+
startTransition: (transitionIn: BaseTransitionProps['in'], transitionOnStart: BaseTransitionProps['transitionOnMount']) => void;
|
|
51
|
+
transition: (toState: BaseTransitionStatesType | null, fromState: BaseTransitionStatesType | null, transitionCallback?: (() => void) | undefined, transitionDuration?: number) => void;
|
|
52
|
+
clearTransition(transitionClassName: string): void;
|
|
53
|
+
enter: (initialState: BaseTransitionStatesType | null) => void;
|
|
54
|
+
exit: (initialState: BaseTransitionStatesType | null) => void;
|
|
55
|
+
transitionEnabled(toState: BaseTransitionStatesType | null): boolean | undefined;
|
|
56
|
+
getTransitionClassName(transitionState: BaseTransitionStatesType | null): string | undefined;
|
|
96
57
|
ref: React.RefObject<unknown>;
|
|
97
|
-
renderChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any
|
|
58
|
+
renderChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
98
59
|
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
99
60
|
}
|
|
100
61
|
export default BaseTransition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Transition/BaseTransition/index.ts"],"names":[],"mappings":"AAwBA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Transition/BaseTransition/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAkC,MAAM,OAAO,CAAA;AAStD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,SAAS,CAAA;AAShB;;;;;;GAMG;AACH,cAAM,cAAe,SAAQ,KAAK,CAAC,SAAS,CAC1C,mBAAmB,EACnB,mBAAmB,CACpB;IACC,MAAM,CAAC,SAAS;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;MAQlB;IAED,MAAM,CAAC,MAAM,6DAAS;IAEtB,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAK;IAC/C,UAAU,UAAQ;IAElB,KAAK;;MAEJ;IAED,iBAAiB;IAIjB,uBAAuB,CACrB,SAAS,EAAE,mBAAmB,EAC9B,SAAS,EAAE,mBAAmB;IAShC,kBAAkB,CAChB,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,mBAAmB,EAC/B,iBAAiB,EAAE,OAAO;IAe5B,oBAAoB;IAOpB,eAAe,iBACC,mBAAmB,CAAC,IAAI,CAAC,qBACpB,mBAAmB,CAAC,mBAAmB,CAAC,UAQ5D;IAED,UAAU,YACC,wBAAwB,GAAG,IAAI,aAC7B,wBAAwB,GAAG,IAAI,8BACf,IAAI,oDAwChC;IAED,eAAe,CAAC,mBAAmB,EAAE,MAAM;IAqB3C,KAAK,iBAAkB,wBAAwB,GAAG,IAAI,UA4CrD;IAED,IAAI,iBAAkB,wBAAwB,GAAG,IAAI,UAuCpD;IAED,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAe1D,sBAAsB,CAAC,eAAe,EAAE,wBAAwB,GAAG,IAAI;IAiBvE,GAAG,2BAAc;IAEjB,cAAc;IAYd,MAAM;CAWP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
-
declare type
|
|
3
|
+
declare type TransitionType = 'fade' | 'scale' | 'slide-down' | 'slide-up' | 'slide-left' | 'slide-right';
|
|
4
|
+
declare type TransitionCommonProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Show the component? Triggers the enter or exit animation.
|
|
6
7
|
*/
|
|
@@ -22,6 +23,40 @@ declare type BaseTransitionOwnProps = {
|
|
|
22
23
|
* Run the exit animation
|
|
23
24
|
*/
|
|
24
25
|
transitionExit?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Callback fired when transitioning to the next state
|
|
28
|
+
*/
|
|
29
|
+
onTransition?: (toState: BaseTransitionStatesType, fromState: BaseTransitionStatesType) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Callback fired before the "entering" classes are applied
|
|
32
|
+
*/
|
|
33
|
+
onEnter?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired after the "entering" classes are applied
|
|
36
|
+
*/
|
|
37
|
+
onEntering?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback fired after the "enter" classes are applied
|
|
40
|
+
*/
|
|
41
|
+
onEntered?: (type?: TransitionType) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired before the "exiting" classes are applied
|
|
44
|
+
*/
|
|
45
|
+
onExit?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback fired after the "exiting" classes are applied
|
|
48
|
+
*/
|
|
49
|
+
onExiting?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback fired after the "exited" classes are applied
|
|
52
|
+
*/
|
|
53
|
+
onExited?: (type?: TransitionType) => void;
|
|
54
|
+
/**
|
|
55
|
+
* A single element to animate in and out
|
|
56
|
+
*/
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
};
|
|
59
|
+
declare type OwnProps = {
|
|
25
60
|
/**
|
|
26
61
|
* A Timeout for the animation, in milliseconds, to ensure that a node doesn't
|
|
27
62
|
* transition indefinately if the browser transitionEnd events are
|
|
@@ -43,59 +78,38 @@ declare type BaseTransitionOwnProps = {
|
|
|
43
78
|
/**
|
|
44
79
|
* the base CSS class for the transition (transitions go here)
|
|
45
80
|
*/
|
|
46
|
-
transitionClassName
|
|
81
|
+
transitionClassName: string;
|
|
47
82
|
/**
|
|
48
83
|
* CSS class or classes applied when the component is exited
|
|
49
84
|
*/
|
|
50
|
-
exitedClassName
|
|
85
|
+
exitedClassName: string;
|
|
51
86
|
/**
|
|
52
87
|
* CSS class or classes applied while the component is exiting
|
|
53
88
|
*/
|
|
54
|
-
exitingClassName
|
|
89
|
+
exitingClassName: string;
|
|
55
90
|
/**
|
|
56
91
|
* CSS class or classes applied when the component is entered
|
|
57
92
|
*/
|
|
58
|
-
enteredClassName
|
|
93
|
+
enteredClassName: string;
|
|
59
94
|
/**
|
|
60
95
|
* CSS class or classes applied while the component is entering
|
|
61
96
|
*/
|
|
62
|
-
enteringClassName
|
|
63
|
-
/**
|
|
64
|
-
* Callback fired when transitioning to the next state
|
|
65
|
-
*/
|
|
66
|
-
onTransition?: (toState: number, fromState: number) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Callback fired before the "entering" classes are applied
|
|
69
|
-
*/
|
|
70
|
-
onEnter?: () => void;
|
|
71
|
-
/**
|
|
72
|
-
* Callback fired after the "entering" classes are applied
|
|
73
|
-
*/
|
|
74
|
-
onEntering?: () => void;
|
|
75
|
-
/**
|
|
76
|
-
* Callback fired after the "enter" classes are applied
|
|
77
|
-
*/
|
|
78
|
-
onEntered?: () => void;
|
|
79
|
-
/**
|
|
80
|
-
* Callback fired before the "exiting" classes are applied
|
|
81
|
-
*/
|
|
82
|
-
onExit?: () => void;
|
|
83
|
-
/**
|
|
84
|
-
* Callback fired after the "exiting" classes are applied
|
|
85
|
-
*/
|
|
86
|
-
onExiting?: () => void;
|
|
87
|
-
/**
|
|
88
|
-
* Callback fired after the "exited" classes are applied
|
|
89
|
-
*/
|
|
90
|
-
onExited?: () => void;
|
|
91
|
-
children?: React.ReactNode;
|
|
97
|
+
enteringClassName: string;
|
|
92
98
|
className?: string;
|
|
93
99
|
};
|
|
100
|
+
declare type BaseTransitionOwnProps = TransitionCommonProps & OwnProps;
|
|
101
|
+
declare type BaseTransitionProps = BaseTransitionOwnProps;
|
|
102
|
+
declare type CommonPropKeys = keyof TransitionCommonProps;
|
|
94
103
|
declare type PropKeys = keyof BaseTransitionOwnProps;
|
|
95
104
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
96
|
-
declare
|
|
105
|
+
declare const transitionCommonPropTypes: PropValidators<CommonPropKeys>;
|
|
97
106
|
declare const propTypes: PropValidators<PropKeys>;
|
|
98
107
|
declare const allowedProps: AllowedPropKeys;
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
declare type BaseTransitionState = {
|
|
109
|
+
transitioning: boolean;
|
|
110
|
+
};
|
|
111
|
+
declare type BaseTransitionStateValue = 'EXITED' | 'EXITING' | 'ENTERING' | 'ENTERED';
|
|
112
|
+
declare type BaseTransitionStatesType = -2 | -1 | 1 | 2;
|
|
113
|
+
export type { BaseTransitionProps, TransitionCommonProps, TransitionType, BaseTransitionState, BaseTransitionStateValue, BaseTransitionStatesType };
|
|
114
|
+
export { propTypes, allowedProps, transitionCommonPropTypes };
|
|
101
115
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Transition/BaseTransition/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,a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|
3
|
+
import { Component } from 'react';
|
|
4
4
|
import { jsx } from '@instructure/emotion';
|
|
5
5
|
import type { TransitionProps } from './props';
|
|
6
6
|
/**
|
|
@@ -8,41 +8,12 @@ import type { TransitionProps } from './props';
|
|
|
8
8
|
category: components/utilities
|
|
9
9
|
---
|
|
10
10
|
@module Transition
|
|
11
|
+
@tsProps
|
|
11
12
|
**/
|
|
12
13
|
declare class Transition extends Component<TransitionProps> {
|
|
13
14
|
static readonly componentId = "Transition";
|
|
14
|
-
static allowedProps: readonly (keyof
|
|
15
|
-
|
|
16
|
-
in?: boolean | undefined;
|
|
17
|
-
unmountOnExit?: boolean | undefined;
|
|
18
|
-
transitionOnMount?: boolean | undefined;
|
|
19
|
-
transitionEnter?: boolean | undefined;
|
|
20
|
-
transitionExit?: boolean | undefined;
|
|
21
|
-
onTransition?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
onEnter?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
onEntering?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
onEntered?: ((...args: any[]) => any) | undefined;
|
|
25
|
-
onExit?: ((...args: any[]) => any) | undefined;
|
|
26
|
-
onExiting?: ((...args: any[]) => any) | undefined;
|
|
27
|
-
onExited?: ((...args: any[]) => any) | undefined;
|
|
28
|
-
children?: React.ReactNode;
|
|
29
|
-
})[];
|
|
30
|
-
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
31
|
-
type?: import("./props").TransitionType | undefined;
|
|
32
|
-
in?: boolean | undefined;
|
|
33
|
-
unmountOnExit?: boolean | undefined;
|
|
34
|
-
transitionOnMount?: boolean | undefined;
|
|
35
|
-
transitionEnter?: boolean | undefined;
|
|
36
|
-
transitionExit?: boolean | undefined;
|
|
37
|
-
onTransition?: ((...args: any[]) => any) | undefined;
|
|
38
|
-
onEnter?: ((...args: any[]) => any) | undefined;
|
|
39
|
-
onEntering?: ((...args: any[]) => any) | undefined;
|
|
40
|
-
onEntered?: ((...args: any[]) => any) | undefined;
|
|
41
|
-
onExit?: ((...args: any[]) => any) | undefined;
|
|
42
|
-
onExiting?: ((...args: any[]) => any) | undefined;
|
|
43
|
-
onExited?: ((...args: any[]) => any) | undefined;
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
}>;
|
|
15
|
+
static allowedProps: readonly (keyof import("./BaseTransition/props").TransitionCommonProps | "type")[];
|
|
16
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof import("./BaseTransition/props").TransitionCommonProps | "type">;
|
|
46
17
|
static defaultProps: {
|
|
47
18
|
type: string;
|
|
48
19
|
in: boolean;
|
|
@@ -50,33 +21,12 @@ declare class Transition extends Component<TransitionProps> {
|
|
|
50
21
|
transitionOnMount: boolean;
|
|
51
22
|
transitionEnter: boolean;
|
|
52
23
|
transitionExit: boolean;
|
|
53
|
-
onEnter: () => void;
|
|
54
|
-
onEntering: () => void;
|
|
55
|
-
onEntered: () => void;
|
|
56
|
-
onExit: () => void;
|
|
57
|
-
onExiting: () => void;
|
|
58
|
-
onExited: () => void;
|
|
59
|
-
onTransition: (toState: any, fromState: any) => void;
|
|
60
|
-
children: null;
|
|
61
|
-
};
|
|
62
|
-
static states: {
|
|
63
|
-
EXITED: number;
|
|
64
|
-
EXITING: number;
|
|
65
|
-
ENTERING: number;
|
|
66
|
-
ENTERED: number;
|
|
67
24
|
};
|
|
25
|
+
static states: Record<import("./BaseTransition/props").BaseTransitionStateValue, import("./BaseTransition/props").BaseTransitionStatesType>;
|
|
68
26
|
componentDidMount(): void;
|
|
69
27
|
componentDidUpdate(): void;
|
|
70
28
|
handleExited: () => void;
|
|
71
29
|
handleEntered: () => void;
|
|
72
|
-
/**
|
|
73
|
-
* Transition helper:
|
|
74
|
-
* After emotion migration the only way to keep
|
|
75
|
-
* the old BaseTransition functionality with adding and removing
|
|
76
|
-
* classes was to add the `Global` helper of `emotion`
|
|
77
|
-
*
|
|
78
|
-
* Todo: try to refactor or replace Transition/BaseTransition component in v9.0.0. so that it is not class based
|
|
79
|
-
*/
|
|
80
30
|
renderTransitionHelper: () => jsx.JSX.Element;
|
|
81
31
|
render(): jsx.JSX.Element;
|
|
82
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Transition/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,8BAA8B;AAG9B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Transition/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,8BAA8B;AAG9B,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKxC,OAAO,EAAa,GAAG,EAAU,MAAM,sBAAsB,CAAA;AAQ7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;GAMG;AACH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY,qFAAe;IAClC,MAAM,CAAC,SAAS,+IAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;MAOlB;IAED,MAAM,CAAC,MAAM,+HAAwB;IAErC,iBAAiB;IAIjB,kBAAkB;IAIlB,YAAY,aAIX;IAED,aAAa,aAIZ;IAOD,sBAAsB,wBAIrB;IAED,MAAM;CAyBP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import type { PropValidators, TransitionTheme } from '@instructure/shared-types';
|
|
4
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
5
|
-
|
|
6
|
-
declare
|
|
4
|
+
import type { TransitionCommonProps, TransitionType } from './BaseTransition/props';
|
|
5
|
+
declare const transitionTypePropType: PropTypes.Requireable<TransitionType>;
|
|
6
|
+
declare type OwnProps = {
|
|
7
7
|
type?: TransitionType;
|
|
8
|
-
in?: boolean;
|
|
9
|
-
unmountOnExit?: boolean;
|
|
10
|
-
transitionOnMount?: boolean;
|
|
11
|
-
transitionEnter?: boolean;
|
|
12
|
-
transitionExit?: boolean;
|
|
13
|
-
onTransition?: (...args: any[]) => any;
|
|
14
|
-
onEnter?: (...args: any[]) => any;
|
|
15
|
-
onEntering?: (...args: any[]) => any;
|
|
16
|
-
onEntered?: (...args: any[]) => any;
|
|
17
|
-
onExit?: (...args: any[]) => any;
|
|
18
|
-
onExiting?: (...args: any[]) => any;
|
|
19
|
-
onExited?: (...args: any[]) => any;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
8
|
};
|
|
9
|
+
declare type TransitionOwnProps = OwnProps & TransitionCommonProps;
|
|
22
10
|
declare type PropKeys = keyof TransitionOwnProps;
|
|
23
11
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
24
12
|
declare type TransitionProps = TransitionOwnProps & WithStyleProps<TransitionTheme, TransitionStyle>;
|
|
25
|
-
declare type TransitionStyle = ComponentStyle<'
|
|
26
|
-
|
|
13
|
+
declare type TransitionStyle = ComponentStyle<'globalStyles'> & {
|
|
14
|
+
duration: TransitionTheme['duration'];
|
|
15
|
+
classNames: {
|
|
16
|
+
transitioning: string;
|
|
17
|
+
exited: string;
|
|
18
|
+
exiting: string;
|
|
19
|
+
entered: string;
|
|
20
|
+
entering: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
27
23
|
declare const propTypes: PropValidators<PropKeys>;
|
|
28
24
|
declare const allowedProps: AllowedPropKeys;
|
|
29
25
|
export type { TransitionProps, TransitionType, TransitionStyle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Transition/props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Transition/props.ts"],"names":[],"mappings":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Style } from './props';
|
|
3
|
+
declare const getClassNames: (type: TransitionProps['type']) => {
|
|
4
|
+
transitioning: string;
|
|
5
|
+
exited: string;
|
|
6
|
+
exiting: string;
|
|
7
|
+
entered: string;
|
|
8
|
+
entering: string;
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* ---
|
|
5
12
|
* private: true
|
|
@@ -11,5 +18,6 @@ import type { TransitionProps, TransitionStyle } from './props';
|
|
|
11
18
|
* @return {Object} The final style object, which will be used in the component
|
|
12
19
|
*/
|
|
13
20
|
declare const generateStyle: (componentTheme: TransitionTheme, props: TransitionProps) => TransitionStyle;
|
|
21
|
+
export { generateStyle, getClassNames };
|
|
14
22
|
export default generateStyle;
|
|
15
23
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Transition/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,eAAe,SACxB,eAAe,KACrB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Transition/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D,QAAA,MAAM,aAAa,SAAU,eAAe,CAAC,MAAM,CAAC;;;;;;CAMlD,CAAA;AAEF;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,eAAe,SACxB,eAAe,KACrB,eA6GF,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA;AACvC,eAAe,aAAa,CAAA"}
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|