@cleartrip/ct-design-transition 4.0.0-TEST.3 → 5.0.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/src/type.ts ADDED
@@ -0,0 +1,64 @@
1
+ import { TransitionProps as _TransitionProps, TransitionActions } from 'react-transition-group/Transition';
2
+ import * as React from 'react';
3
+ import { CSSProperties } from 'react';
4
+
5
+ export type TransitionHandlerKeys = 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited';
6
+ export type TransitionHandlerProps = Pick<_TransitionProps, TransitionHandlerKeys>;
7
+
8
+ export type Direction = 'left' | 'right' | 'up' | 'down';
9
+ export interface EasingProps {
10
+ easing: string | { enter?: string; exit?: string };
11
+ }
12
+
13
+ export type TransitionKeys =
14
+ | 'in'
15
+ | 'mountOnEnter'
16
+ | 'unmountOnExit'
17
+ | 'timeout'
18
+ | 'easing'
19
+ | 'addEndListener'
20
+ | TransitionHandlerKeys;
21
+ export interface TransitionProps
22
+ extends
23
+ TransitionActions,
24
+ Partial<Pick<_TransitionProps & EasingProps, TransitionKeys>>,
25
+ React.HTMLAttributes<HTMLElement> {}
26
+
27
+ export interface TransitionProps {
28
+ /**
29
+ * check if component ready for transition
30
+ * @default true
31
+ */
32
+ appear?: boolean;
33
+ /**
34
+ * A single child content element.
35
+ */
36
+ children: React.ReactElement;
37
+ /**
38
+ * If `true`, the component will transition in.
39
+ */
40
+ in?: boolean;
41
+ /**
42
+ * transition type
43
+ * @default fade
44
+ */
45
+ type: 'fade' | 'zoom' | 'slide' | 'grow' | 'collapse' | 'grow_from_container' | 'slide_fade';
46
+ /**
47
+ * add css styles
48
+ */
49
+ css?: CSSProperties;
50
+ containerRef?: React.MutableRefObject<HTMLElement | null>;
51
+ slideDirection?: Direction;
52
+ }
53
+
54
+ export interface IGrowFromContainerProps {
55
+ containerRef?: React.MutableRefObject<HTMLElement | null>;
56
+ node: HTMLElement;
57
+ transitionProps?: ITransitionProps;
58
+ }
59
+
60
+ export interface ITransitionProps {
61
+ duration?: number | string;
62
+ easing?: string;
63
+ delay?: number | string;
64
+ }