@coorpacademy/components 11.11.16-testing-freetext.2 → 11.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.
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const propTypes: {
4
+ name: PropTypes.Validator<string>;
5
+ onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
6
+ animated: PropTypes.Requireable<boolean>;
7
+ className: PropTypes.Requireable<string>;
8
+ };
9
+ export declare type ChildProps = {
10
+ child: React.ReactElement;
11
+ onAnimationEnd: (name: string) => void;
12
+ className: string;
13
+ name: string;
14
+ };
15
+ export default propTypes;
16
+ //# sourceMappingURL=child-prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-prop-types.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/child-prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;CAKd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import PropTypes from 'prop-types';
2
+ const propTypes = {
3
+ name: PropTypes.string.isRequired,
4
+ onAnimationEnd: PropTypes.func,
5
+ animated: PropTypes.bool,
6
+ className: PropTypes.string
7
+ };
8
+ export default propTypes;
9
+ //# sourceMappingURL=child-prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-prop-types.js","names":["PropTypes","propTypes","name","string","isRequired","onAnimationEnd","func","animated","bool","className"],"sources":["../../../src/hoc/transition/child-prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport type ChildProps = {\n child: React.ReactElement;\n onAnimationEnd: (name: string) => void;\n className: string;\n name: string;\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,IAAI,EAAEF,SAAS,CAACG,MAAV,CAAiBC,UADP;EAEhBC,cAAc,EAAEL,SAAS,CAACM,IAFV;EAGhBC,QAAQ,EAAEP,SAAS,CAACQ,IAHJ;EAIhBC,SAAS,EAAET,SAAS,CAACG;AAJL,CAAlB;AAcA,eAAeF,SAAf"}
@@ -1,11 +1,16 @@
1
+ import React from 'react';
2
+ import { TransitionProps } from './transition-prop-types';
3
+ declare const Transition: {
4
+ (props: TransitionProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | JSX.Element[];
5
+ propTypes: {
6
+ isAlreadyEngaged: import("prop-types").Requireable<boolean>;
7
+ isRandom: import("prop-types").Requireable<boolean>;
8
+ userAvatarSrc: import("prop-types").Requireable<string>;
9
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
10
+ displayName: import("prop-types").Requireable<string>;
11
+ tooltipText: import("prop-types").Requireable<string>;
12
+ 'aria-label': import("prop-types").Requireable<string>;
13
+ };
14
+ };
1
15
  export default Transition;
2
- declare function Transition(props: any): any;
3
- declare namespace Transition {
4
- namespace propTypes {
5
- const name: PropTypes.Validator<string>;
6
- const onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
7
- const animated: PropTypes.Requireable<boolean>;
8
- }
9
- }
10
- import PropTypes from "prop-types";
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/index.js"],"names":[],"mappings":";AAKA,6CAyBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAIlD,OAA4B,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAoB7E,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;CAYzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -1,7 +1,31 @@
1
1
  import _noop from "lodash/fp/noop";
2
- import React, { useMemo } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import React, { useMemo, useCallback } from 'react';
4
3
  import classnames from 'classnames';
4
+ import childPropTypes from './child-prop-types';
5
+ import transitionPropTypes from './transition-prop-types';
6
+
7
+ const Child = ({
8
+ child,
9
+ onAnimationEnd,
10
+ className,
11
+ name
12
+ }) => {
13
+ const {
14
+ props: {
15
+ className: propClassName
16
+ }
17
+ } = child;
18
+ const handleAnimationEnd = useCallback(() => {
19
+ return onAnimationEnd(name);
20
+ }, [onAnimationEnd, name]);
21
+ return /*#__PURE__*/React.cloneElement(child, {
22
+ className: classnames(propClassName, className),
23
+ onTransitionEnd: handleAnimationEnd,
24
+ onAnimationEnd: handleAnimationEnd
25
+ });
26
+ };
27
+
28
+ Child.propTypes = process.env.NODE_ENV !== "production" ? childPropTypes : {};
5
29
 
6
30
  const Transition = props => {
7
31
  const {
@@ -11,35 +35,15 @@ const Transition = props => {
11
35
  animated,
12
36
  onAnimationEnd = _noop
13
37
  } = props;
14
- if (!animated) return children;
15
-
16
- const Child = ({
17
- child
18
- }) => {
19
- const {
20
- props: {
21
- className: propClassName
22
- }
23
- } = child;
24
- const handlerAnimationEnd = useMemo(() => () => {
25
- return onAnimationEnd(name);
26
- }, []);
27
- return /*#__PURE__*/React.cloneElement(child, {
28
- className: classnames(propClassName, className),
29
- onTransitionEnd: handlerAnimationEnd,
30
- onAnimationEnd: handlerAnimationEnd
31
- });
32
- };
33
-
34
- return React.Children.map(children, child => /*#__PURE__*/React.createElement(Child, {
35
- child: child
36
- }));
38
+ const animatedChildren = useMemo(() => React.Children.map(children, child => /*#__PURE__*/React.createElement(Child, {
39
+ child: child,
40
+ onAnimationEnd: onAnimationEnd,
41
+ className: className,
42
+ name: name
43
+ })), [children, className, name, onAnimationEnd]);
44
+ return animated ? animatedChildren : children;
37
45
  };
38
46
 
39
- Transition.propTypes = process.env.NODE_ENV !== "production" ? {
40
- name: PropTypes.string.isRequired,
41
- onAnimationEnd: PropTypes.func,
42
- animated: PropTypes.bool
43
- } : {};
47
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? transitionPropTypes : {};
44
48
  export default Transition;
45
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","cloneElement","onTransitionEnd","Children","map","propTypes","string","isRequired","func","bool"],"sources":["../../../src/hoc/transition/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Transition = props => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n if (!animated) return children;\n\n const Child = ({child}) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handlerAnimationEnd = useMemo(\n () => () => {\n return onAnimationEnd(name);\n },\n []\n );\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handlerAnimationEnd,\n onAnimationEnd: handlerAnimationEnd\n });\n };\n\n return React.Children.map(children, child => <Child child={child} />);\n};\n\nTransition.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nexport default Transition;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAEA,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC,IAAD;IAAOC,QAAP;IAAiBC,SAAjB;IAA4BC,QAA5B;IAAsCC,cAAc;EAApD,IAA+DL,KAArE;EAEA,IAAI,CAACI,QAAL,EAAe,OAAOF,QAAP;;EAEf,MAAMI,KAAK,GAAG,CAAC;IAACC;EAAD,CAAD,KAAa;IACzB,MAAM;MACJP,KAAK,EAAE;QAACG,SAAS,EAAEK;MAAZ;IADH,IAEFD,KAFJ;IAIA,MAAME,mBAAmB,GAAGb,OAAO,CACjC,MAAM,MAAM;MACV,OAAOS,cAAc,CAACJ,IAAD,CAArB;IACD,CAHgC,EAIjC,EAJiC,CAAnC;IAOA,oBAAON,KAAK,CAACe,YAAN,CAAmBH,KAAnB,EAA0B;MAC/BJ,SAAS,EAAEL,UAAU,CAACU,aAAD,EAAgBL,SAAhB,CADU;MAE/BQ,eAAe,EAAEF,mBAFc;MAG/BJ,cAAc,EAAEI;IAHe,CAA1B,CAAP;EAKD,CAjBD;;EAmBA,OAAOd,KAAK,CAACiB,QAAN,CAAeC,GAAf,CAAmBX,QAAnB,EAA6BK,KAAK,iBAAI,oBAAC,KAAD;IAAO,KAAK,EAAEA;EAAd,EAAtC,CAAP;AACD,CAzBD;;AA2BAR,UAAU,CAACe,SAAX,2CAAuB;EACrBb,IAAI,EAAEJ,SAAS,CAACkB,MAAV,CAAiBC,UADF;EAErBX,cAAc,EAAER,SAAS,CAACoB,IAFL;EAGrBb,QAAQ,EAAEP,SAAS,CAACqB;AAHC,CAAvB;AAMA,eAAenB,UAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","useCallback","classnames","childPropTypes","transitionPropTypes","Child","child","onAnimationEnd","className","name","props","propClassName","handleAnimationEnd","cloneElement","onTransitionEnd","propTypes","Transition","children","animated","animatedChildren","Children","map"],"sources":["../../../src/hoc/transition/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport childPropTypes, {ChildProps} from './child-prop-types';\nimport transitionPropTypes, {TransitionProps} from './transition-prop-types';\n\nconst Child = ({child, onAnimationEnd, className, name}: ChildProps) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handleAnimationEnd = useCallback(() => {\n return onAnimationEnd(name);\n }, [onAnimationEnd, name]);\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handleAnimationEnd,\n onAnimationEnd: handleAnimationEnd\n });\n};\n\nChild.propTypes = childPropTypes;\n\nconst Transition = (props: TransitionProps) => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n const animatedChildren = useMemo(\n () =>\n React.Children.map(children, child => (\n <Child child={child} onAnimationEnd={onAnimationEnd} className={className} name={name} />\n )),\n [children, className, name, onAnimationEnd]\n );\n\n return animated ? animatedChildren : children;\n};\n\nTransition.propTypes = transitionPropTypes;\n\nexport default Transition;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,WAAxB,QAA0C,OAA1C;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,cAAP,MAAyC,oBAAzC;AACA,OAAOC,mBAAP,MAAmD,yBAAnD;;AAEA,MAAMC,KAAK,GAAG,CAAC;EAACC,KAAD;EAAQC,cAAR;EAAwBC,SAAxB;EAAmCC;AAAnC,CAAD,KAA0D;EACtE,MAAM;IACJC,KAAK,EAAE;MAACF,SAAS,EAAEG;IAAZ;EADH,IAEFL,KAFJ;EAIA,MAAMM,kBAAkB,GAAGX,WAAW,CAAC,MAAM;IAC3C,OAAOM,cAAc,CAACE,IAAD,CAArB;EACD,CAFqC,EAEnC,CAACF,cAAD,EAAiBE,IAAjB,CAFmC,CAAtC;EAIA,oBAAOV,KAAK,CAACc,YAAN,CAAmBP,KAAnB,EAA0B;IAC/BE,SAAS,EAAEN,UAAU,CAACS,aAAD,EAAgBH,SAAhB,CADU;IAE/BM,eAAe,EAAEF,kBAFc;IAG/BL,cAAc,EAAEK;EAHe,CAA1B,CAAP;AAKD,CAdD;;AAgBAP,KAAK,CAACU,SAAN,2CAAkBZ,cAAlB;;AAEA,MAAMa,UAAU,GAAIN,KAAD,IAA4B;EAC7C,MAAM;IAACD,IAAD;IAAOQ,QAAP;IAAiBT,SAAjB;IAA4BU,QAA5B;IAAsCX,cAAc;EAApD,IAA+DG,KAArE;EAEA,MAAMS,gBAAgB,GAAGnB,OAAO,CAC9B,MACED,KAAK,CAACqB,QAAN,CAAeC,GAAf,CAAmBJ,QAAnB,EAA6BX,KAAK,iBAChC,oBAAC,KAAD;IAAO,KAAK,EAAEA,KAAd;IAAqB,cAAc,EAAEC,cAArC;IAAqD,SAAS,EAAEC,SAAhE;IAA2E,IAAI,EAAEC;EAAjF,EADF,CAF4B,EAK9B,CAACQ,QAAD,EAAWT,SAAX,EAAsBC,IAAtB,EAA4BF,cAA5B,CAL8B,CAAhC;EAQA,OAAOW,QAAQ,GAAGC,gBAAH,GAAsBF,QAArC;AACD,CAZD;;AAcAD,UAAU,CAACD,SAAX,2CAAuBX,mBAAvB;AAEA,eAAeY,UAAf"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const propTypes: {
4
+ isAlreadyEngaged: PropTypes.Requireable<boolean>;
5
+ isRandom: PropTypes.Requireable<boolean>;
6
+ userAvatarSrc: PropTypes.Requireable<string>;
7
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
8
+ displayName: PropTypes.Requireable<string>;
9
+ tooltipText: PropTypes.Requireable<string>;
10
+ 'aria-label': PropTypes.Requireable<string>;
11
+ };
12
+ export declare type TransitionProps = {
13
+ name: string;
14
+ children: React.ReactElement;
15
+ className: string;
16
+ animated: boolean;
17
+ onAnimationEnd: () => void;
18
+ };
19
+ export default propTypes;
20
+ //# sourceMappingURL=transition-prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-prop-types.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/transition-prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;CAQd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ import PropTypes from 'prop-types';
2
+ const propTypes = {
3
+ isAlreadyEngaged: PropTypes.bool,
4
+ isRandom: PropTypes.bool,
5
+ userAvatarSrc: PropTypes.string,
6
+ onClick: PropTypes.func,
7
+ displayName: PropTypes.string,
8
+ tooltipText: PropTypes.string,
9
+ 'aria-label': PropTypes.string
10
+ };
11
+ export default propTypes;
12
+ //# sourceMappingURL=transition-prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-prop-types.js","names":["PropTypes","propTypes","isAlreadyEngaged","bool","isRandom","userAvatarSrc","string","onClick","func","displayName","tooltipText"],"sources":["../../../src/hoc/transition/transition-prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n userAvatarSrc: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport type TransitionProps = {\n name: string;\n children: React.ReactElement;\n className: string;\n animated: boolean;\n onAnimationEnd: () => void;\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,gBAAgB,EAAEF,SAAS,CAACG,IADZ;EAEhBC,QAAQ,EAAEJ,SAAS,CAACG,IAFJ;EAGhBE,aAAa,EAAEL,SAAS,CAACM,MAHT;EAIhBC,OAAO,EAAEP,SAAS,CAACQ,IAJH;EAKhBC,WAAW,EAAET,SAAS,CAACM,MALP;EAMhBI,WAAW,EAAEV,SAAS,CAACM,MANP;EAOhB,cAAcN,SAAS,CAACM;AAPR,CAAlB;AAkBA,eAAeL,SAAf"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const propTypes: {
4
+ name: PropTypes.Validator<string>;
5
+ onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
6
+ animated: PropTypes.Requireable<boolean>;
7
+ className: PropTypes.Requireable<string>;
8
+ };
9
+ export declare type ChildProps = {
10
+ child: React.ReactElement;
11
+ onAnimationEnd: (name: string) => void;
12
+ className: string;
13
+ name: string;
14
+ };
15
+ export default propTypes;
16
+ //# sourceMappingURL=child-prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-prop-types.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/child-prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;CAKd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ const propTypes = {
11
+ name: _propTypes.default.string.isRequired,
12
+ onAnimationEnd: _propTypes.default.func,
13
+ animated: _propTypes.default.bool,
14
+ className: _propTypes.default.string
15
+ };
16
+ var _default = propTypes;
17
+ exports.default = _default;
18
+ //# sourceMappingURL=child-prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-prop-types.js","names":["propTypes","name","PropTypes","string","isRequired","onAnimationEnd","func","animated","bool","className"],"sources":["../../../src/hoc/transition/child-prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport type ChildProps = {\n child: React.ReactElement;\n onAnimationEnd: (name: string) => void;\n className: string;\n name: string;\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAA,CAAUC,MAAV,CAAiBC,UADP;EAEhBC,cAAc,EAAEH,kBAAA,CAAUI,IAFV;EAGhBC,QAAQ,EAAEL,kBAAA,CAAUM,IAHJ;EAIhBC,SAAS,EAAEP,kBAAA,CAAUC;AAJL,CAAlB;eAceH,S"}
@@ -1,11 +1,16 @@
1
+ import React from 'react';
2
+ import { TransitionProps } from './transition-prop-types';
3
+ declare const Transition: {
4
+ (props: TransitionProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | JSX.Element[];
5
+ propTypes: {
6
+ isAlreadyEngaged: import("prop-types").Requireable<boolean>;
7
+ isRandom: import("prop-types").Requireable<boolean>;
8
+ userAvatarSrc: import("prop-types").Requireable<string>;
9
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
10
+ displayName: import("prop-types").Requireable<string>;
11
+ tooltipText: import("prop-types").Requireable<string>;
12
+ 'aria-label': import("prop-types").Requireable<string>;
13
+ };
14
+ };
1
15
  export default Transition;
2
- declare function Transition(props: any): any;
3
- declare namespace Transition {
4
- namespace propTypes {
5
- const name: PropTypes.Validator<string>;
6
- const onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
7
- const animated: PropTypes.Requireable<boolean>;
8
- }
9
- }
10
- import PropTypes from "prop-types";
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/index.js"],"names":[],"mappings":";AAKA,6CAyBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAIlD,OAA4B,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAoB7E,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;CAYzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -7,16 +7,41 @@ var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
10
  var _classnames = _interopRequireDefault(require("classnames"));
13
11
 
12
+ var _childPropTypes = _interopRequireDefault(require("./child-prop-types"));
13
+
14
+ var _transitionPropTypes = _interopRequireDefault(require("./transition-prop-types"));
15
+
14
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
17
 
16
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
22
+ const Child = ({
23
+ child,
24
+ onAnimationEnd,
25
+ className,
26
+ name
27
+ }) => {
28
+ const {
29
+ props: {
30
+ className: propClassName
31
+ }
32
+ } = child;
33
+ const handleAnimationEnd = (0, _react.useCallback)(() => {
34
+ return onAnimationEnd(name);
35
+ }, [onAnimationEnd, name]);
36
+ return /*#__PURE__*/_react.default.cloneElement(child, {
37
+ className: (0, _classnames.default)(propClassName, className),
38
+ onTransitionEnd: handleAnimationEnd,
39
+ onAnimationEnd: handleAnimationEnd
40
+ });
41
+ };
42
+
43
+ Child.propTypes = process.env.NODE_ENV !== "production" ? _childPropTypes.default : {};
44
+
20
45
  const Transition = props => {
21
46
  const {
22
47
  name,
@@ -25,36 +50,16 @@ const Transition = props => {
25
50
  animated,
26
51
  onAnimationEnd = _noop2.default
27
52
  } = props;
28
- if (!animated) return children;
29
-
30
- const Child = ({
31
- child
32
- }) => {
33
- const {
34
- props: {
35
- className: propClassName
36
- }
37
- } = child;
38
- const handlerAnimationEnd = (0, _react.useMemo)(() => () => {
39
- return onAnimationEnd(name);
40
- }, []);
41
- return /*#__PURE__*/_react.default.cloneElement(child, {
42
- className: (0, _classnames.default)(propClassName, className),
43
- onTransitionEnd: handlerAnimationEnd,
44
- onAnimationEnd: handlerAnimationEnd
45
- });
46
- };
47
-
48
- return _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Child, {
49
- child: child
50
- }));
53
+ const animatedChildren = (0, _react.useMemo)(() => _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Child, {
54
+ child: child,
55
+ onAnimationEnd: onAnimationEnd,
56
+ className: className,
57
+ name: name
58
+ })), [children, className, name, onAnimationEnd]);
59
+ return animated ? animatedChildren : children;
51
60
  };
52
61
 
53
- Transition.propTypes = process.env.NODE_ENV !== "production" ? {
54
- name: _propTypes.default.string.isRequired,
55
- onAnimationEnd: _propTypes.default.func,
56
- animated: _propTypes.default.bool
57
- } : {};
62
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? _transitionPropTypes.default : {};
58
63
  var _default = Transition;
59
64
  exports.default = _default;
60
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","useMemo","React","cloneElement","classnames","onTransitionEnd","Children","map","propTypes","PropTypes","string","isRequired","func","bool"],"sources":["../../../src/hoc/transition/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Transition = props => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n if (!animated) return children;\n\n const Child = ({child}) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handlerAnimationEnd = useMemo(\n () => () => {\n return onAnimationEnd(name);\n },\n []\n );\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handlerAnimationEnd,\n onAnimationEnd: handlerAnimationEnd\n });\n };\n\n return React.Children.map(children, child => <Child child={child} />);\n};\n\nTransition.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nexport default Transition;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC,IAAD;IAAOC,QAAP;IAAiBC,SAAjB;IAA4BC,QAA5B;IAAsCC,cAAc;EAApD,IAA+DL,KAArE;EAEA,IAAI,CAACI,QAAL,EAAe,OAAOF,QAAP;;EAEf,MAAMI,KAAK,GAAG,CAAC;IAACC;EAAD,CAAD,KAAa;IACzB,MAAM;MACJP,KAAK,EAAE;QAACG,SAAS,EAAEK;MAAZ;IADH,IAEFD,KAFJ;IAIA,MAAME,mBAAmB,GAAG,IAAAC,cAAA,EAC1B,MAAM,MAAM;MACV,OAAOL,cAAc,CAACJ,IAAD,CAArB;IACD,CAHyB,EAI1B,EAJ0B,CAA5B;IAOA,oBAAOU,cAAA,CAAMC,YAAN,CAAmBL,KAAnB,EAA0B;MAC/BJ,SAAS,EAAE,IAAAU,mBAAA,EAAWL,aAAX,EAA0BL,SAA1B,CADoB;MAE/BW,eAAe,EAAEL,mBAFc;MAG/BJ,cAAc,EAAEI;IAHe,CAA1B,CAAP;EAKD,CAjBD;;EAmBA,OAAOE,cAAA,CAAMI,QAAN,CAAeC,GAAf,CAAmBd,QAAnB,EAA6BK,KAAK,iBAAI,6BAAC,KAAD;IAAO,KAAK,EAAEA;EAAd,EAAtC,CAAP;AACD,CAzBD;;AA2BAR,UAAU,CAACkB,SAAX,2CAAuB;EACrBhB,IAAI,EAAEiB,kBAAA,CAAUC,MAAV,CAAiBC,UADF;EAErBf,cAAc,EAAEa,kBAAA,CAAUG,IAFL;EAGrBjB,QAAQ,EAAEc,kBAAA,CAAUI;AAHC,CAAvB;eAMevB,U"}
1
+ {"version":3,"file":"index.js","names":["Child","child","onAnimationEnd","className","name","props","propClassName","handleAnimationEnd","useCallback","React","cloneElement","classnames","onTransitionEnd","propTypes","childPropTypes","Transition","children","animated","animatedChildren","useMemo","Children","map","transitionPropTypes"],"sources":["../../../src/hoc/transition/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport childPropTypes, {ChildProps} from './child-prop-types';\nimport transitionPropTypes, {TransitionProps} from './transition-prop-types';\n\nconst Child = ({child, onAnimationEnd, className, name}: ChildProps) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handleAnimationEnd = useCallback(() => {\n return onAnimationEnd(name);\n }, [onAnimationEnd, name]);\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handleAnimationEnd,\n onAnimationEnd: handleAnimationEnd\n });\n};\n\nChild.propTypes = childPropTypes;\n\nconst Transition = (props: TransitionProps) => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n const animatedChildren = useMemo(\n () =>\n React.Children.map(children, child => (\n <Child child={child} onAnimationEnd={onAnimationEnd} className={className} name={name} />\n )),\n [children, className, name, onAnimationEnd]\n );\n\n return animated ? animatedChildren : children;\n};\n\nTransition.propTypes = transitionPropTypes;\n\nexport default Transition;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,KAAK,GAAG,CAAC;EAACC,KAAD;EAAQC,cAAR;EAAwBC,SAAxB;EAAmCC;AAAnC,CAAD,KAA0D;EACtE,MAAM;IACJC,KAAK,EAAE;MAACF,SAAS,EAAEG;IAAZ;EADH,IAEFL,KAFJ;EAIA,MAAMM,kBAAkB,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAC3C,OAAON,cAAc,CAACE,IAAD,CAArB;EACD,CAF0B,EAExB,CAACF,cAAD,EAAiBE,IAAjB,CAFwB,CAA3B;EAIA,oBAAOK,cAAA,CAAMC,YAAN,CAAmBT,KAAnB,EAA0B;IAC/BE,SAAS,EAAE,IAAAQ,mBAAA,EAAWL,aAAX,EAA0BH,SAA1B,CADoB;IAE/BS,eAAe,EAAEL,kBAFc;IAG/BL,cAAc,EAAEK;EAHe,CAA1B,CAAP;AAKD,CAdD;;AAgBAP,KAAK,CAACa,SAAN,2CAAkBC,uBAAlB;;AAEA,MAAMC,UAAU,GAAIV,KAAD,IAA4B;EAC7C,MAAM;IAACD,IAAD;IAAOY,QAAP;IAAiBb,SAAjB;IAA4Bc,QAA5B;IAAsCf,cAAc;EAApD,IAA+DG,KAArE;EAEA,MAAMa,gBAAgB,GAAG,IAAAC,cAAA,EACvB,MACEV,cAAA,CAAMW,QAAN,CAAeC,GAAf,CAAmBL,QAAnB,EAA6Bf,KAAK,iBAChC,6BAAC,KAAD;IAAO,KAAK,EAAEA,KAAd;IAAqB,cAAc,EAAEC,cAArC;IAAqD,SAAS,EAAEC,SAAhE;IAA2E,IAAI,EAAEC;EAAjF,EADF,CAFqB,EAKvB,CAACY,QAAD,EAAWb,SAAX,EAAsBC,IAAtB,EAA4BF,cAA5B,CALuB,CAAzB;EAQA,OAAOe,QAAQ,GAAGC,gBAAH,GAAsBF,QAArC;AACD,CAZD;;AAcAD,UAAU,CAACF,SAAX,2CAAuBS,4BAAvB;eAEeP,U"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const propTypes: {
4
+ isAlreadyEngaged: PropTypes.Requireable<boolean>;
5
+ isRandom: PropTypes.Requireable<boolean>;
6
+ userAvatarSrc: PropTypes.Requireable<string>;
7
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
8
+ displayName: PropTypes.Requireable<string>;
9
+ tooltipText: PropTypes.Requireable<string>;
10
+ 'aria-label': PropTypes.Requireable<string>;
11
+ };
12
+ export declare type TransitionProps = {
13
+ name: string;
14
+ children: React.ReactElement;
15
+ className: string;
16
+ animated: boolean;
17
+ onAnimationEnd: () => void;
18
+ };
19
+ export default propTypes;
20
+ //# sourceMappingURL=transition-prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-prop-types.d.ts","sourceRoot":"","sources":["../../../src/hoc/transition/transition-prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;CAQd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ const propTypes = {
11
+ isAlreadyEngaged: _propTypes.default.bool,
12
+ isRandom: _propTypes.default.bool,
13
+ userAvatarSrc: _propTypes.default.string,
14
+ onClick: _propTypes.default.func,
15
+ displayName: _propTypes.default.string,
16
+ tooltipText: _propTypes.default.string,
17
+ 'aria-label': _propTypes.default.string
18
+ };
19
+ var _default = propTypes;
20
+ exports.default = _default;
21
+ //# sourceMappingURL=transition-prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-prop-types.js","names":["propTypes","isAlreadyEngaged","PropTypes","bool","isRandom","userAvatarSrc","string","onClick","func","displayName","tooltipText"],"sources":["../../../src/hoc/transition/transition-prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n userAvatarSrc: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport type TransitionProps = {\n name: string;\n children: React.ReactElement;\n className: string;\n animated: boolean;\n onAnimationEnd: () => void;\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,gBAAgB,EAAEC,kBAAA,CAAUC,IADZ;EAEhBC,QAAQ,EAAEF,kBAAA,CAAUC,IAFJ;EAGhBE,aAAa,EAAEH,kBAAA,CAAUI,MAHT;EAIhBC,OAAO,EAAEL,kBAAA,CAAUM,IAJH;EAKhBC,WAAW,EAAEP,kBAAA,CAAUI,MALP;EAMhBI,WAAW,EAAER,kBAAA,CAAUI,MANP;EAOhB,cAAcJ,kBAAA,CAAUI;AAPR,CAAlB;eAkBeN,S"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.11.16-testing-freetext.2+49eaa8774",
3
+ "version": "11.12.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -119,6 +119,7 @@
119
119
  "@storybook/react": "^6.5.12",
120
120
  "@testing-library/react": "12.1.5",
121
121
  "@testing-library/react-native": "^10.1.1",
122
+ "@testing-library/user-event": "^14.4.3",
122
123
  "@types/react-native": "~0.68.7",
123
124
  "@types/uuid": "^9.0.0",
124
125
  "@typescript-eslint/eslint-plugin": "^5.39.0",
@@ -165,5 +166,5 @@
165
166
  "last 2 versions",
166
167
  "IE 11"
167
168
  ],
168
- "gitHead": "49eaa8774e1ca5d4e657935237d7ef47a7244acc"
169
+ "gitHead": "1b49fffd746ffcffdbce023d048e8c4176bb89f3"
169
170
  }
@@ -1 +0,0 @@
1
- {"ignore_dirs":[]}