@spaziodati/atoka-design-system 2.1.3 → 2.1.4

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.
Files changed (112) hide show
  1. package/AddableItems/index.js +2 -2
  2. package/AddableItems/index.js.map +1 -1
  3. package/Alert/index.js +2 -2
  4. package/Alert/index.js.map +1 -1
  5. package/Badge/index.js +2 -2
  6. package/Badge/index.js.map +1 -1
  7. package/Bs4V3Wrapper/index.js +2 -2
  8. package/Bs4V3Wrapper/index.js.map +1 -1
  9. package/BubbleChart/index.js +2 -2
  10. package/BubbleChart/index.js.map +1 -1
  11. package/Button/index.js +2 -2
  12. package/Button/index.js.map +1 -1
  13. package/ButtonDropdown/index.js +2 -2
  14. package/ButtonDropdown/index.js.map +1 -1
  15. package/CardsPage/index.js +2 -2
  16. package/CardsPage/index.js.map +1 -1
  17. package/CursorPagination/index.js +2 -2
  18. package/CursorPagination/index.js.map +1 -1
  19. package/DatePicker/index.js +2 -2
  20. package/DatePicker/index.js.map +1 -1
  21. package/DetailPage/index.js +581 -555
  22. package/DetailPage/index.js.map +1 -1
  23. package/Dropdown/index.js +2 -2
  24. package/Dropdown/index.js.map +1 -1
  25. package/EditableString/index.js +581 -555
  26. package/EditableString/index.js.map +1 -1
  27. package/EllipsableContent/index.js +2 -2
  28. package/EllipsableContent/index.js.map +1 -1
  29. package/EmptyState/index.js +2 -2
  30. package/EmptyState/index.js.map +1 -1
  31. package/Facet/index.js +2 -2
  32. package/Facet/index.js.map +1 -1
  33. package/FacetSection/index.js +2 -2
  34. package/FacetSection/index.js.map +1 -1
  35. package/FadeAnimation/index.js +581 -555
  36. package/FadeAnimation/index.js.map +1 -1
  37. package/FeedbackButton/index.js +2 -2
  38. package/FeedbackButton/index.js.map +1 -1
  39. package/Form/index.js +2 -2
  40. package/Form/index.js.map +1 -1
  41. package/Funnel/index.js +2 -2
  42. package/Funnel/index.js.map +1 -1
  43. package/GridCard/index.js +2 -2
  44. package/GridCard/index.js.map +1 -1
  45. package/HighlightableText/index.js +2 -2
  46. package/HighlightableText/index.js.map +1 -1
  47. package/Histogram/index.js +2 -2
  48. package/Histogram/index.js.map +1 -1
  49. package/InlineStringEditor/index.js +2 -2
  50. package/InlineStringEditor/index.js.map +1 -1
  51. package/InputGroup/index.js +2 -2
  52. package/InputGroup/index.js.map +1 -1
  53. package/Jumbotron/index.js +2 -2
  54. package/Jumbotron/index.js.map +1 -1
  55. package/Map/index.js +2 -2
  56. package/Map/index.js.map +1 -1
  57. package/Modal/index.js +2 -2
  58. package/Modal/index.js.map +1 -1
  59. package/Navbar/index.js +581 -555
  60. package/Navbar/index.js.map +1 -1
  61. package/Pagination/index.js +2 -2
  62. package/Pagination/index.js.map +1 -1
  63. package/PieChart/index.js +2 -2
  64. package/PieChart/index.js.map +1 -1
  65. package/PublicFooter/index.js +2 -2
  66. package/PublicFooter/index.js.map +1 -1
  67. package/PublicNavbar/index.js +2 -2
  68. package/PublicNavbar/index.js.map +1 -1
  69. package/README.md +5 -2
  70. package/RecordBit/index.js +2 -2
  71. package/RecordBit/index.js.map +1 -1
  72. package/ResultItemCard/index.js +2 -2
  73. package/ResultItemCard/index.js.map +1 -1
  74. package/SelectDropdown/index.js +2 -2
  75. package/SelectDropdown/index.js.map +1 -1
  76. package/Spinner/index.js +2 -2
  77. package/Spinner/index.js.map +1 -1
  78. package/StatisticsItemCard/index.js +2 -2
  79. package/StatisticsItemCard/index.js.map +1 -1
  80. package/StatisticsItemNumeric/index.js +2 -2
  81. package/StatisticsItemNumeric/index.js.map +1 -1
  82. package/StatisticsLegend/index.js +2 -2
  83. package/StatisticsLegend/index.js.map +1 -1
  84. package/StatisticsTooltip/index.js +2 -2
  85. package/StatisticsTooltip/index.js.map +1 -1
  86. package/Suggester/index.js +2 -2
  87. package/Suggester/index.js.map +1 -1
  88. package/SunBurst/index.js +2 -2
  89. package/SunBurst/index.js.map +1 -1
  90. package/TabSwitcher/index.js +2 -2
  91. package/TabSwitcher/index.js.map +1 -1
  92. package/Title/index.js +2 -2
  93. package/Title/index.js.map +1 -1
  94. package/Toasts/Toast.d.ts +41 -0
  95. package/Toasts/ToastContainer.d.ts +4 -0
  96. package/Toasts/ToastHeader.d.ts +7 -0
  97. package/Toasts/index.d.ts +2 -0
  98. package/Toasts/index.js +2236 -0
  99. package/Toasts/index.js.map +1 -0
  100. package/ToggleButtonGroup/index.js +2 -2
  101. package/ToggleButtonGroup/index.js.map +1 -1
  102. package/Tooltip/index.js +2 -2
  103. package/Tooltip/index.js.map +1 -1
  104. package/Utils/index.js +2 -2
  105. package/Utils/index.js.map +1 -1
  106. package/{atoka-design-system-2.1.3.min.css → atoka-design-system-2.1.4.min.css} +1 -1
  107. package/index.d.ts +1 -0
  108. package/index.js +1734 -755
  109. package/index.js.map +1 -1
  110. package/package.json +1 -1
  111. package/styles/atoka-bs.less +1 -1
  112. package/styles/variant-mixins.less +7 -7
@@ -301,8 +301,8 @@ __webpack_require__.d(__webpack_exports__, {
301
301
  // EXTERNAL MODULE: external "react"
302
302
  var external_react_ = __webpack_require__(8156);
303
303
  var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
304
- // EXTERNAL MODULE: ./node_modules/react-transition-group/esm/CSSTransition.js + 5 modules
305
- var CSSTransition = __webpack_require__(1750);
304
+ // EXTERNAL MODULE: ./node_modules/react-transition-group/esm/CSSTransition.js + 3 modules
305
+ var CSSTransition = __webpack_require__(9114);
306
306
  ;// CONCATENATED MODULE: ./src/components/FadeAnimation/FadeAnimation.tsx
307
307
  var __extends = (undefined && undefined.__extends) || (function () {
308
308
  var extendStatics = function (d, b) {
@@ -937,7 +937,7 @@ module.exports = ReactPropTypesSecret;
937
937
 
938
938
  /***/ }),
939
939
 
940
- /***/ 1750:
940
+ /***/ 9114:
941
941
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
942
942
 
943
943
  "use strict";
@@ -983,16 +983,9 @@ function removeClass_removeClass(element, className) {
983
983
  // EXTERNAL MODULE: external "react"
984
984
  var external_react_ = __webpack_require__(8156);
985
985
  var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
986
- // EXTERNAL MODULE: external "react-dom"
987
- var external_react_dom_ = __webpack_require__(7111);
988
- var external_react_dom_default = /*#__PURE__*/__webpack_require__.n(external_react_dom_);
989
- ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/config.js
990
- /* harmony default export */ const config = ({
991
- disabled: false
992
- });
993
- // EXTERNAL MODULE: ./node_modules/react-transition-group/esm/TransitionGroupContext.js
994
- var TransitionGroupContext = __webpack_require__(3493);
995
- ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/Transition.js
986
+ // EXTERNAL MODULE: ./node_modules/react-transition-group/esm/Transition.js + 1 modules
987
+ var Transition = __webpack_require__(6113);
988
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/CSSTransition.js
996
989
 
997
990
 
998
991
 
@@ -1001,88 +994,43 @@ var TransitionGroupContext = __webpack_require__(3493);
1001
994
 
1002
995
 
1003
996
 
1004
- var UNMOUNTED = 'unmounted';
1005
- var EXITED = 'exited';
1006
- var ENTERING = 'entering';
1007
- var ENTERED = 'entered';
1008
- var EXITING = 'exiting';
997
+
998
+
999
+ var _addClass = function addClass(node, classes) {
1000
+ return node && classes && classes.split(' ').forEach(function (c) {
1001
+ return addClass_addClass(node, c);
1002
+ });
1003
+ };
1004
+
1005
+ var removeClass = function removeClass(node, classes) {
1006
+ return node && classes && classes.split(' ').forEach(function (c) {
1007
+ return removeClass_removeClass(node, c);
1008
+ });
1009
+ };
1009
1010
  /**
1010
- * The Transition component lets you describe a transition from one component
1011
- * state to another _over time_ with a simple declarative API. Most commonly
1012
- * it's used to animate the mounting and unmounting of a component, but can also
1013
- * be used to describe in-place transition states as well.
1014
- *
1015
- * ---
1016
- *
1017
- * **Note**: `Transition` is a platform-agnostic base component. If you're using
1018
- * transitions in CSS, you'll probably want to use
1019
- * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
1020
- * instead. It inherits all the features of `Transition`, but contains
1021
- * additional features necessary to play nice with CSS transitions (hence the
1022
- * name of the component).
1023
- *
1024
- * ---
1025
- *
1026
- * By default the `Transition` component does not alter the behavior of the
1027
- * component it renders, it only tracks "enter" and "exit" states for the
1028
- * components. It's up to you to give meaning and effect to those states. For
1029
- * example we can add styles to a component when it enters or exits:
1030
- *
1031
- * ```jsx
1032
- * import { Transition } from 'react-transition-group';
1033
- *
1034
- * const duration = 300;
1035
- *
1036
- * const defaultStyle = {
1037
- * transition: `opacity ${duration}ms ease-in-out`,
1038
- * opacity: 0,
1039
- * }
1040
- *
1041
- * const transitionStyles = {
1042
- * entering: { opacity: 1 },
1043
- * entered: { opacity: 1 },
1044
- * exiting: { opacity: 0 },
1045
- * exited: { opacity: 0 },
1046
- * };
1047
- *
1048
- * const Fade = ({ in: inProp }) => (
1049
- * <Transition in={inProp} timeout={duration}>
1050
- * {state => (
1051
- * <div style={{
1052
- * ...defaultStyle,
1053
- * ...transitionStyles[state]
1054
- * }}>
1055
- * I'm a fade Transition!
1056
- * </div>
1057
- * )}
1058
- * </Transition>
1059
- * );
1060
- * ```
1061
- *
1062
- * There are 4 main states a Transition can be in:
1063
- * - `'entering'`
1064
- * - `'entered'`
1065
- * - `'exiting'`
1066
- * - `'exited'`
1011
+ * A transition component inspired by the excellent
1012
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
1013
+ * use it if you're using CSS transitions or animations. It's built upon the
1014
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
1015
+ * component, so it inherits all of its props.
1067
1016
  *
1068
- * Transition state is toggled via the `in` prop. When `true` the component
1069
- * begins the "Enter" stage. During this stage, the component will shift from
1070
- * its current transition state, to `'entering'` for the duration of the
1071
- * transition and then to the `'entered'` stage once it's complete. Let's take
1072
- * the following example (we'll use the
1073
- * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
1017
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
1018
+ * and `exit` states of the transition. The first class is applied and then a
1019
+ * second `*-active` class in order to activate the CSS transition. After the
1020
+ * transition, matching `*-done` class names are applied to persist the
1021
+ * transition state.
1074
1022
  *
1075
1023
  * ```jsx
1076
1024
  * function App() {
1077
1025
  * const [inProp, setInProp] = useState(false);
1078
1026
  * return (
1079
1027
  * <div>
1080
- * <Transition in={inProp} timeout={500}>
1081
- * {state => (
1082
- * // ...
1083
- * )}
1084
- * </Transition>
1085
- * <button onClick={() => setInProp(true)}>
1028
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
1029
+ * <div>
1030
+ * {"I'll receive my-node-* classes"}
1031
+ * </div>
1032
+ * </CSSTransition>
1033
+ * <button type="button" onClick={() => setInProp(true)}>
1086
1034
  * Click to Enter
1087
1035
  * </button>
1088
1036
  * </div>
@@ -1090,343 +1038,271 @@ var EXITING = 'exiting';
1090
1038
  * }
1091
1039
  * ```
1092
1040
  *
1093
- * When the button is clicked the component will shift to the `'entering'` state
1094
- * and stay there for 500ms (the value of `timeout`) before it finally switches
1095
- * to `'entered'`.
1041
+ * When the `in` prop is set to `true`, the child component will first receive
1042
+ * the class `example-enter`, then the `example-enter-active` will be added in
1043
+ * the next tick. `CSSTransition` [forces a
1044
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
1045
+ * between before adding the `example-enter-active`. This is an important trick
1046
+ * because it allows us to transition between `example-enter` and
1047
+ * `example-enter-active` even though they were added immediately one after
1048
+ * another. Most notably, this is what makes it possible for us to animate
1049
+ * _appearance_.
1096
1050
  *
1097
- * When `in` is `false` the same thing happens except the state moves from
1098
- * `'exiting'` to `'exited'`.
1051
+ * ```css
1052
+ * .my-node-enter {
1053
+ * opacity: 0;
1054
+ * }
1055
+ * .my-node-enter-active {
1056
+ * opacity: 1;
1057
+ * transition: opacity 200ms;
1058
+ * }
1059
+ * .my-node-exit {
1060
+ * opacity: 1;
1061
+ * }
1062
+ * .my-node-exit-active {
1063
+ * opacity: 0;
1064
+ * transition: opacity 200ms;
1065
+ * }
1066
+ * ```
1067
+ *
1068
+ * `*-active` classes represent which styles you want to animate **to**, so it's
1069
+ * important to add `transition` declaration only to them, otherwise transitions
1070
+ * might not behave as intended! This might not be obvious when the transitions
1071
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
1072
+ * the example above (minus `transition`), but it becomes apparent in more
1073
+ * complex transitions.
1074
+ *
1075
+ * **Note**: If you're using the
1076
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
1077
+ * prop, make sure to define styles for `.appear-*` classes as well.
1099
1078
  */
1100
1079
 
1101
- var Transition = /*#__PURE__*/function (_React$Component) {
1102
- (0,inheritsLoose/* default */.Z)(Transition, _React$Component);
1103
-
1104
- function Transition(props, context) {
1105
- var _this;
1106
1080
 
1107
- _this = _React$Component.call(this, props, context) || this;
1108
- var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
1081
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
1082
+ (0,inheritsLoose/* default */.Z)(CSSTransition, _React$Component);
1109
1083
 
1110
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
1111
- var initialStatus;
1112
- _this.appearStatus = null;
1084
+ function CSSTransition() {
1085
+ var _this;
1113
1086
 
1114
- if (props["in"]) {
1115
- if (appear) {
1116
- initialStatus = EXITED;
1117
- _this.appearStatus = ENTERING;
1118
- } else {
1119
- initialStatus = ENTERED;
1120
- }
1121
- } else {
1122
- if (props.unmountOnExit || props.mountOnEnter) {
1123
- initialStatus = UNMOUNTED;
1124
- } else {
1125
- initialStatus = EXITED;
1126
- }
1087
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1088
+ args[_key] = arguments[_key];
1127
1089
  }
1128
1090
 
1129
- _this.state = {
1130
- status: initialStatus
1091
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1092
+ _this.appliedClasses = {
1093
+ appear: {},
1094
+ enter: {},
1095
+ exit: {}
1131
1096
  };
1132
- _this.nextCallback = null;
1133
- return _this;
1134
- }
1135
1097
 
1136
- Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
1137
- var nextIn = _ref["in"];
1098
+ _this.onEnter = function (maybeNode, maybeAppearing) {
1099
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
1100
+ node = _this$resolveArgument[0],
1101
+ appearing = _this$resolveArgument[1];
1138
1102
 
1139
- if (nextIn && prevState.status === UNMOUNTED) {
1140
- return {
1141
- status: EXITED
1142
- };
1143
- }
1103
+ _this.removeClasses(node, 'exit');
1144
1104
 
1145
- return null;
1146
- } // getSnapshotBeforeUpdate(prevProps) {
1147
- // let nextStatus = null
1148
- // if (prevProps !== this.props) {
1149
- // const { status } = this.state
1150
- // if (this.props.in) {
1151
- // if (status !== ENTERING && status !== ENTERED) {
1152
- // nextStatus = ENTERING
1153
- // }
1154
- // } else {
1155
- // if (status === ENTERING || status === ENTERED) {
1156
- // nextStatus = EXITING
1157
- // }
1158
- // }
1159
- // }
1160
- // return { nextStatus }
1161
- // }
1162
- ;
1105
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
1163
1106
 
1164
- var _proto = Transition.prototype;
1107
+ if (_this.props.onEnter) {
1108
+ _this.props.onEnter(maybeNode, maybeAppearing);
1109
+ }
1110
+ };
1165
1111
 
1166
- _proto.componentDidMount = function componentDidMount() {
1167
- this.updateStatus(true, this.appearStatus);
1168
- };
1112
+ _this.onEntering = function (maybeNode, maybeAppearing) {
1113
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
1114
+ node = _this$resolveArgument2[0],
1115
+ appearing = _this$resolveArgument2[1];
1169
1116
 
1170
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
1171
- var nextStatus = null;
1117
+ var type = appearing ? 'appear' : 'enter';
1172
1118
 
1173
- if (prevProps !== this.props) {
1174
- var status = this.state.status;
1119
+ _this.addClass(node, type, 'active');
1175
1120
 
1176
- if (this.props["in"]) {
1177
- if (status !== ENTERING && status !== ENTERED) {
1178
- nextStatus = ENTERING;
1179
- }
1180
- } else {
1181
- if (status === ENTERING || status === ENTERED) {
1182
- nextStatus = EXITING;
1183
- }
1121
+ if (_this.props.onEntering) {
1122
+ _this.props.onEntering(maybeNode, maybeAppearing);
1184
1123
  }
1185
- }
1124
+ };
1186
1125
 
1187
- this.updateStatus(false, nextStatus);
1188
- };
1189
-
1190
- _proto.componentWillUnmount = function componentWillUnmount() {
1191
- this.cancelNextCallback();
1192
- };
1126
+ _this.onEntered = function (maybeNode, maybeAppearing) {
1127
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
1128
+ node = _this$resolveArgument3[0],
1129
+ appearing = _this$resolveArgument3[1];
1193
1130
 
1194
- _proto.getTimeouts = function getTimeouts() {
1195
- var timeout = this.props.timeout;
1196
- var exit, enter, appear;
1197
- exit = enter = appear = timeout;
1131
+ var type = appearing ? 'appear' : 'enter';
1198
1132
 
1199
- if (timeout != null && typeof timeout !== 'number') {
1200
- exit = timeout.exit;
1201
- enter = timeout.enter; // TODO: remove fallback for next major
1133
+ _this.removeClasses(node, type);
1202
1134
 
1203
- appear = timeout.appear !== undefined ? timeout.appear : enter;
1204
- }
1135
+ _this.addClass(node, type, 'done');
1205
1136
 
1206
- return {
1207
- exit: exit,
1208
- enter: enter,
1209
- appear: appear
1137
+ if (_this.props.onEntered) {
1138
+ _this.props.onEntered(maybeNode, maybeAppearing);
1139
+ }
1210
1140
  };
1211
- };
1212
1141
 
1213
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
1214
- if (mounting === void 0) {
1215
- mounting = false;
1216
- }
1142
+ _this.onExit = function (maybeNode) {
1143
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
1144
+ node = _this$resolveArgument4[0];
1217
1145
 
1218
- if (nextStatus !== null) {
1219
- // nextStatus will always be ENTERING or EXITING.
1220
- this.cancelNextCallback();
1146
+ _this.removeClasses(node, 'appear');
1221
1147
 
1222
- if (nextStatus === ENTERING) {
1223
- this.performEnter(mounting);
1224
- } else {
1225
- this.performExit();
1226
- }
1227
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
1228
- this.setState({
1229
- status: UNMOUNTED
1230
- });
1231
- }
1232
- };
1148
+ _this.removeClasses(node, 'enter');
1233
1149
 
1234
- _proto.performEnter = function performEnter(mounting) {
1235
- var _this2 = this;
1150
+ _this.addClass(node, 'exit', 'base');
1236
1151
 
1237
- var enter = this.props.enter;
1238
- var appearing = this.context ? this.context.isMounting : mounting;
1152
+ if (_this.props.onExit) {
1153
+ _this.props.onExit(maybeNode);
1154
+ }
1155
+ };
1239
1156
 
1240
- var _ref2 = this.props.nodeRef ? [appearing] : [external_react_dom_default().findDOMNode(this), appearing],
1241
- maybeNode = _ref2[0],
1242
- maybeAppearing = _ref2[1];
1157
+ _this.onExiting = function (maybeNode) {
1158
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
1159
+ node = _this$resolveArgument5[0];
1243
1160
 
1244
- var timeouts = this.getTimeouts();
1245
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
1246
- // if we are mounting and running this it means appear _must_ be set
1161
+ _this.addClass(node, 'exit', 'active');
1247
1162
 
1248
- if (!mounting && !enter || config.disabled) {
1249
- this.safeSetState({
1250
- status: ENTERED
1251
- }, function () {
1252
- _this2.props.onEntered(maybeNode);
1253
- });
1254
- return;
1255
- }
1163
+ if (_this.props.onExiting) {
1164
+ _this.props.onExiting(maybeNode);
1165
+ }
1166
+ };
1256
1167
 
1257
- this.props.onEnter(maybeNode, maybeAppearing);
1258
- this.safeSetState({
1259
- status: ENTERING
1260
- }, function () {
1261
- _this2.props.onEntering(maybeNode, maybeAppearing);
1168
+ _this.onExited = function (maybeNode) {
1169
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
1170
+ node = _this$resolveArgument6[0];
1262
1171
 
1263
- _this2.onTransitionEnd(enterTimeout, function () {
1264
- _this2.safeSetState({
1265
- status: ENTERED
1266
- }, function () {
1267
- _this2.props.onEntered(maybeNode, maybeAppearing);
1268
- });
1269
- });
1270
- });
1271
- };
1172
+ _this.removeClasses(node, 'exit');
1272
1173
 
1273
- _proto.performExit = function performExit() {
1274
- var _this3 = this;
1174
+ _this.addClass(node, 'exit', 'done');
1275
1175
 
1276
- var exit = this.props.exit;
1277
- var timeouts = this.getTimeouts();
1278
- var maybeNode = this.props.nodeRef ? undefined : external_react_dom_default().findDOMNode(this); // no exit animation skip right to EXITED
1176
+ if (_this.props.onExited) {
1177
+ _this.props.onExited(maybeNode);
1178
+ }
1179
+ };
1279
1180
 
1280
- if (!exit || config.disabled) {
1281
- this.safeSetState({
1282
- status: EXITED
1283
- }, function () {
1284
- _this3.props.onExited(maybeNode);
1285
- });
1286
- return;
1287
- }
1181
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
1182
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
1183
+ : [maybeNode, maybeAppearing];
1184
+ };
1288
1185
 
1289
- this.props.onExit(maybeNode);
1290
- this.safeSetState({
1291
- status: EXITING
1292
- }, function () {
1293
- _this3.props.onExiting(maybeNode);
1186
+ _this.getClassNames = function (type) {
1187
+ var classNames = _this.props.classNames;
1188
+ var isStringClassNames = typeof classNames === 'string';
1189
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
1190
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
1191
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
1192
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
1193
+ return {
1194
+ baseClassName: baseClassName,
1195
+ activeClassName: activeClassName,
1196
+ doneClassName: doneClassName
1197
+ };
1198
+ };
1294
1199
 
1295
- _this3.onTransitionEnd(timeouts.exit, function () {
1296
- _this3.safeSetState({
1297
- status: EXITED
1298
- }, function () {
1299
- _this3.props.onExited(maybeNode);
1300
- });
1301
- });
1302
- });
1303
- };
1200
+ return _this;
1201
+ }
1304
1202
 
1305
- _proto.cancelNextCallback = function cancelNextCallback() {
1306
- if (this.nextCallback !== null) {
1307
- this.nextCallback.cancel();
1308
- this.nextCallback = null;
1309
- }
1310
- };
1203
+ var _proto = CSSTransition.prototype;
1311
1204
 
1312
- _proto.safeSetState = function safeSetState(nextState, callback) {
1313
- // This shouldn't be necessary, but there are weird race conditions with
1314
- // setState callbacks and unmounting in testing, so always make sure that
1315
- // we can cancel any pending setState callbacks after we unmount.
1316
- callback = this.setNextCallback(callback);
1317
- this.setState(nextState, callback);
1318
- };
1205
+ _proto.addClass = function addClass(node, type, phase) {
1206
+ var className = this.getClassNames(type)[phase + "ClassName"];
1319
1207
 
1320
- _proto.setNextCallback = function setNextCallback(callback) {
1321
- var _this4 = this;
1208
+ var _this$getClassNames = this.getClassNames('enter'),
1209
+ doneClassName = _this$getClassNames.doneClassName;
1322
1210
 
1323
- var active = true;
1211
+ if (type === 'appear' && phase === 'done' && doneClassName) {
1212
+ className += " " + doneClassName;
1213
+ } // This is for to force a repaint,
1214
+ // which is necessary in order to transition styles when adding a class name.
1324
1215
 
1325
- this.nextCallback = function (event) {
1326
- if (active) {
1327
- active = false;
1328
- _this4.nextCallback = null;
1329
- callback(event);
1330
- }
1331
- };
1332
1216
 
1333
- this.nextCallback.cancel = function () {
1334
- active = false;
1335
- };
1217
+ if (phase === 'active') {
1218
+ /* eslint-disable no-unused-expressions */
1219
+ node && node.scrollTop;
1220
+ }
1336
1221
 
1337
- return this.nextCallback;
1222
+ if (className) {
1223
+ this.appliedClasses[type][phase] = className;
1224
+
1225
+ _addClass(node, className);
1226
+ }
1338
1227
  };
1339
1228
 
1340
- _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
1341
- this.setNextCallback(handler);
1342
- var node = this.props.nodeRef ? this.props.nodeRef.current : external_react_dom_default().findDOMNode(this);
1343
- var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
1229
+ _proto.removeClasses = function removeClasses(node, type) {
1230
+ var _this$appliedClasses$ = this.appliedClasses[type],
1231
+ baseClassName = _this$appliedClasses$.base,
1232
+ activeClassName = _this$appliedClasses$.active,
1233
+ doneClassName = _this$appliedClasses$.done;
1234
+ this.appliedClasses[type] = {};
1344
1235
 
1345
- if (!node || doesNotHaveTimeoutOrListener) {
1346
- setTimeout(this.nextCallback, 0);
1347
- return;
1236
+ if (baseClassName) {
1237
+ removeClass(node, baseClassName);
1348
1238
  }
1349
1239
 
1350
- if (this.props.addEndListener) {
1351
- var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
1352
- maybeNode = _ref3[0],
1353
- maybeNextCallback = _ref3[1];
1354
-
1355
- this.props.addEndListener(maybeNode, maybeNextCallback);
1240
+ if (activeClassName) {
1241
+ removeClass(node, activeClassName);
1356
1242
  }
1357
1243
 
1358
- if (timeout != null) {
1359
- setTimeout(this.nextCallback, timeout);
1244
+ if (doneClassName) {
1245
+ removeClass(node, doneClassName);
1360
1246
  }
1361
1247
  };
1362
1248
 
1363
1249
  _proto.render = function render() {
1364
- var status = this.state.status;
1365
-
1366
- if (status === UNMOUNTED) {
1367
- return null;
1368
- }
1369
-
1370
1250
  var _this$props = this.props,
1371
- children = _this$props.children,
1372
- _in = _this$props["in"],
1373
- _mountOnEnter = _this$props.mountOnEnter,
1374
- _unmountOnExit = _this$props.unmountOnExit,
1375
- _appear = _this$props.appear,
1376
- _enter = _this$props.enter,
1377
- _exit = _this$props.exit,
1378
- _timeout = _this$props.timeout,
1379
- _addEndListener = _this$props.addEndListener,
1380
- _onEnter = _this$props.onEnter,
1381
- _onEntering = _this$props.onEntering,
1382
- _onEntered = _this$props.onEntered,
1383
- _onExit = _this$props.onExit,
1384
- _onExiting = _this$props.onExiting,
1385
- _onExited = _this$props.onExited,
1386
- _nodeRef = _this$props.nodeRef,
1387
- childProps = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1251
+ _ = _this$props.classNames,
1252
+ props = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["classNames"]);
1388
1253
 
1389
- return (
1390
- /*#__PURE__*/
1391
- // allows for nested Transitions
1392
- external_react_default().createElement(TransitionGroupContext/* default.Provider */.Z.Provider, {
1393
- value: null
1394
- }, typeof children === 'function' ? children(status, childProps) : external_react_default().cloneElement(external_react_default().Children.only(children), childProps))
1395
- );
1254
+ return /*#__PURE__*/external_react_default().createElement(Transition/* default */.ZP, (0,esm_extends/* default */.Z)({}, props, {
1255
+ onEnter: this.onEnter,
1256
+ onEntered: this.onEntered,
1257
+ onEntering: this.onEntering,
1258
+ onExit: this.onExit,
1259
+ onExiting: this.onExiting,
1260
+ onExited: this.onExited
1261
+ }));
1396
1262
  };
1397
1263
 
1398
- return Transition;
1264
+ return CSSTransition;
1399
1265
  }((external_react_default()).Component);
1400
1266
 
1401
- Transition.contextType = TransitionGroupContext/* default */.Z;
1402
- Transition.propTypes = false ? 0 : {}; // Name the function so it is clearer in the documentation
1267
+ CSSTransition.defaultProps = {
1268
+ classNames: ''
1269
+ };
1270
+ CSSTransition.propTypes = false ? 0 : {};
1271
+ /* harmony default export */ const esm_CSSTransition = (CSSTransition);
1403
1272
 
1404
- function noop() {}
1273
+ /***/ }),
1405
1274
 
1406
- Transition.defaultProps = {
1407
- "in": false,
1408
- mountOnEnter: false,
1409
- unmountOnExit: false,
1410
- appear: false,
1411
- enter: true,
1412
- exit: true,
1413
- onEnter: noop,
1414
- onEntering: noop,
1415
- onEntered: noop,
1416
- onExit: noop,
1417
- onExiting: noop,
1418
- onExited: noop
1419
- };
1420
- Transition.UNMOUNTED = UNMOUNTED;
1421
- Transition.EXITED = EXITED;
1422
- Transition.ENTERING = ENTERING;
1423
- Transition.ENTERED = ENTERED;
1424
- Transition.EXITING = EXITING;
1425
- /* harmony default export */ const esm_Transition = (Transition);
1426
- ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/CSSTransition.js
1275
+ /***/ 6113:
1276
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1277
+
1278
+ "use strict";
1427
1279
 
1280
+ // EXPORTS
1281
+ __webpack_require__.d(__webpack_exports__, {
1282
+ "ZP": () => (/* binding */ esm_Transition)
1283
+ });
1428
1284
 
1285
+ // UNUSED EXPORTS: ENTERED, ENTERING, EXITED, EXITING, UNMOUNTED
1429
1286
 
1287
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1288
+ var objectWithoutPropertiesLoose = __webpack_require__(7038);
1289
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js + 1 modules
1290
+ var inheritsLoose = __webpack_require__(7581);
1291
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
1292
+ var prop_types = __webpack_require__(8691);
1293
+ // EXTERNAL MODULE: external "react"
1294
+ var external_react_ = __webpack_require__(8156);
1295
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1296
+ // EXTERNAL MODULE: external "react-dom"
1297
+ var external_react_dom_ = __webpack_require__(7111);
1298
+ var external_react_dom_default = /*#__PURE__*/__webpack_require__.n(external_react_dom_);
1299
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/config.js
1300
+ /* harmony default export */ const config = ({
1301
+ disabled: false
1302
+ });
1303
+ // EXTERNAL MODULE: ./node_modules/react-transition-group/esm/TransitionGroupContext.js
1304
+ var TransitionGroupContext = __webpack_require__(3493);
1305
+ ;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/Transition.js
1430
1306
 
1431
1307
 
1432
1308
 
@@ -1434,41 +1310,89 @@ Transition.EXITING = EXITING;
1434
1310
 
1435
1311
 
1436
1312
 
1437
- var _addClass = function addClass(node, classes) {
1438
- return node && classes && classes.split(' ').forEach(function (c) {
1439
- return addClass_addClass(node, c);
1440
- });
1441
- };
1442
1313
 
1443
- var removeClass = function removeClass(node, classes) {
1444
- return node && classes && classes.split(' ').forEach(function (c) {
1445
- return removeClass_removeClass(node, c);
1446
- });
1447
- };
1314
+ var UNMOUNTED = 'unmounted';
1315
+ var EXITED = 'exited';
1316
+ var ENTERING = 'entering';
1317
+ var ENTERED = 'entered';
1318
+ var EXITING = 'exiting';
1448
1319
  /**
1449
- * A transition component inspired by the excellent
1450
- * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
1451
- * use it if you're using CSS transitions or animations. It's built upon the
1452
- * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
1453
- * component, so it inherits all of its props.
1320
+ * The Transition component lets you describe a transition from one component
1321
+ * state to another _over time_ with a simple declarative API. Most commonly
1322
+ * it's used to animate the mounting and unmounting of a component, but can also
1323
+ * be used to describe in-place transition states as well.
1454
1324
  *
1455
- * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
1456
- * and `exit` states of the transition. The first class is applied and then a
1457
- * second `*-active` class in order to activate the CSS transition. After the
1458
- * transition, matching `*-done` class names are applied to persist the
1459
- * transition state.
1325
+ * ---
1326
+ *
1327
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
1328
+ * transitions in CSS, you'll probably want to use
1329
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
1330
+ * instead. It inherits all the features of `Transition`, but contains
1331
+ * additional features necessary to play nice with CSS transitions (hence the
1332
+ * name of the component).
1333
+ *
1334
+ * ---
1335
+ *
1336
+ * By default the `Transition` component does not alter the behavior of the
1337
+ * component it renders, it only tracks "enter" and "exit" states for the
1338
+ * components. It's up to you to give meaning and effect to those states. For
1339
+ * example we can add styles to a component when it enters or exits:
1340
+ *
1341
+ * ```jsx
1342
+ * import { Transition } from 'react-transition-group';
1343
+ *
1344
+ * const duration = 300;
1345
+ *
1346
+ * const defaultStyle = {
1347
+ * transition: `opacity ${duration}ms ease-in-out`,
1348
+ * opacity: 0,
1349
+ * }
1350
+ *
1351
+ * const transitionStyles = {
1352
+ * entering: { opacity: 1 },
1353
+ * entered: { opacity: 1 },
1354
+ * exiting: { opacity: 0 },
1355
+ * exited: { opacity: 0 },
1356
+ * };
1357
+ *
1358
+ * const Fade = ({ in: inProp }) => (
1359
+ * <Transition in={inProp} timeout={duration}>
1360
+ * {state => (
1361
+ * <div style={{
1362
+ * ...defaultStyle,
1363
+ * ...transitionStyles[state]
1364
+ * }}>
1365
+ * I'm a fade Transition!
1366
+ * </div>
1367
+ * )}
1368
+ * </Transition>
1369
+ * );
1370
+ * ```
1371
+ *
1372
+ * There are 4 main states a Transition can be in:
1373
+ * - `'entering'`
1374
+ * - `'entered'`
1375
+ * - `'exiting'`
1376
+ * - `'exited'`
1377
+ *
1378
+ * Transition state is toggled via the `in` prop. When `true` the component
1379
+ * begins the "Enter" stage. During this stage, the component will shift from
1380
+ * its current transition state, to `'entering'` for the duration of the
1381
+ * transition and then to the `'entered'` stage once it's complete. Let's take
1382
+ * the following example (we'll use the
1383
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
1460
1384
  *
1461
1385
  * ```jsx
1462
1386
  * function App() {
1463
1387
  * const [inProp, setInProp] = useState(false);
1464
1388
  * return (
1465
1389
  * <div>
1466
- * <CSSTransition in={inProp} timeout={200} classNames="my-node">
1467
- * <div>
1468
- * {"I'll receive my-node-* classes"}
1469
- * </div>
1470
- * </CSSTransition>
1471
- * <button type="button" onClick={() => setInProp(true)}>
1390
+ * <Transition in={inProp} timeout={500}>
1391
+ * {state => (
1392
+ * // ...
1393
+ * )}
1394
+ * </Transition>
1395
+ * <button onClick={() => setInProp(true)}>
1472
1396
  * Click to Enter
1473
1397
  * </button>
1474
1398
  * </div>
@@ -1476,237 +1400,339 @@ var removeClass = function removeClass(node, classes) {
1476
1400
  * }
1477
1401
  * ```
1478
1402
  *
1479
- * When the `in` prop is set to `true`, the child component will first receive
1480
- * the class `example-enter`, then the `example-enter-active` will be added in
1481
- * the next tick. `CSSTransition` [forces a
1482
- * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
1483
- * between before adding the `example-enter-active`. This is an important trick
1484
- * because it allows us to transition between `example-enter` and
1485
- * `example-enter-active` even though they were added immediately one after
1486
- * another. Most notably, this is what makes it possible for us to animate
1487
- * _appearance_.
1488
- *
1489
- * ```css
1490
- * .my-node-enter {
1491
- * opacity: 0;
1492
- * }
1493
- * .my-node-enter-active {
1494
- * opacity: 1;
1495
- * transition: opacity 200ms;
1496
- * }
1497
- * .my-node-exit {
1498
- * opacity: 1;
1499
- * }
1500
- * .my-node-exit-active {
1501
- * opacity: 0;
1502
- * transition: opacity 200ms;
1503
- * }
1504
- * ```
1505
- *
1506
- * `*-active` classes represent which styles you want to animate **to**, so it's
1507
- * important to add `transition` declaration only to them, otherwise transitions
1508
- * might not behave as intended! This might not be obvious when the transitions
1509
- * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
1510
- * the example above (minus `transition`), but it becomes apparent in more
1511
- * complex transitions.
1403
+ * When the button is clicked the component will shift to the `'entering'` state
1404
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
1405
+ * to `'entered'`.
1512
1406
  *
1513
- * **Note**: If you're using the
1514
- * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
1515
- * prop, make sure to define styles for `.appear-*` classes as well.
1407
+ * When `in` is `false` the same thing happens except the state moves from
1408
+ * `'exiting'` to `'exited'`.
1516
1409
  */
1517
1410
 
1411
+ var Transition = /*#__PURE__*/function (_React$Component) {
1412
+ (0,inheritsLoose/* default */.Z)(Transition, _React$Component);
1518
1413
 
1519
- var CSSTransition = /*#__PURE__*/function (_React$Component) {
1520
- (0,inheritsLoose/* default */.Z)(CSSTransition, _React$Component);
1521
-
1522
- function CSSTransition() {
1414
+ function Transition(props, context) {
1523
1415
  var _this;
1524
1416
 
1525
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1526
- args[_key] = arguments[_key];
1417
+ _this = _React$Component.call(this, props, context) || this;
1418
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
1419
+
1420
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
1421
+ var initialStatus;
1422
+ _this.appearStatus = null;
1423
+
1424
+ if (props["in"]) {
1425
+ if (appear) {
1426
+ initialStatus = EXITED;
1427
+ _this.appearStatus = ENTERING;
1428
+ } else {
1429
+ initialStatus = ENTERED;
1430
+ }
1431
+ } else {
1432
+ if (props.unmountOnExit || props.mountOnEnter) {
1433
+ initialStatus = UNMOUNTED;
1434
+ } else {
1435
+ initialStatus = EXITED;
1436
+ }
1527
1437
  }
1528
1438
 
1529
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1530
- _this.appliedClasses = {
1531
- appear: {},
1532
- enter: {},
1533
- exit: {}
1439
+ _this.state = {
1440
+ status: initialStatus
1534
1441
  };
1442
+ _this.nextCallback = null;
1443
+ return _this;
1444
+ }
1535
1445
 
1536
- _this.onEnter = function (maybeNode, maybeAppearing) {
1537
- var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
1538
- node = _this$resolveArgument[0],
1539
- appearing = _this$resolveArgument[1];
1446
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
1447
+ var nextIn = _ref["in"];
1540
1448
 
1541
- _this.removeClasses(node, 'exit');
1449
+ if (nextIn && prevState.status === UNMOUNTED) {
1450
+ return {
1451
+ status: EXITED
1452
+ };
1453
+ }
1542
1454
 
1543
- _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
1455
+ return null;
1456
+ } // getSnapshotBeforeUpdate(prevProps) {
1457
+ // let nextStatus = null
1458
+ // if (prevProps !== this.props) {
1459
+ // const { status } = this.state
1460
+ // if (this.props.in) {
1461
+ // if (status !== ENTERING && status !== ENTERED) {
1462
+ // nextStatus = ENTERING
1463
+ // }
1464
+ // } else {
1465
+ // if (status === ENTERING || status === ENTERED) {
1466
+ // nextStatus = EXITING
1467
+ // }
1468
+ // }
1469
+ // }
1470
+ // return { nextStatus }
1471
+ // }
1472
+ ;
1544
1473
 
1545
- if (_this.props.onEnter) {
1546
- _this.props.onEnter(maybeNode, maybeAppearing);
1547
- }
1548
- };
1474
+ var _proto = Transition.prototype;
1549
1475
 
1550
- _this.onEntering = function (maybeNode, maybeAppearing) {
1551
- var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
1552
- node = _this$resolveArgument2[0],
1553
- appearing = _this$resolveArgument2[1];
1476
+ _proto.componentDidMount = function componentDidMount() {
1477
+ this.updateStatus(true, this.appearStatus);
1478
+ };
1554
1479
 
1555
- var type = appearing ? 'appear' : 'enter';
1480
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
1481
+ var nextStatus = null;
1556
1482
 
1557
- _this.addClass(node, type, 'active');
1483
+ if (prevProps !== this.props) {
1484
+ var status = this.state.status;
1558
1485
 
1559
- if (_this.props.onEntering) {
1560
- _this.props.onEntering(maybeNode, maybeAppearing);
1486
+ if (this.props["in"]) {
1487
+ if (status !== ENTERING && status !== ENTERED) {
1488
+ nextStatus = ENTERING;
1489
+ }
1490
+ } else {
1491
+ if (status === ENTERING || status === ENTERED) {
1492
+ nextStatus = EXITING;
1493
+ }
1561
1494
  }
1495
+ }
1496
+
1497
+ this.updateStatus(false, nextStatus);
1498
+ };
1499
+
1500
+ _proto.componentWillUnmount = function componentWillUnmount() {
1501
+ this.cancelNextCallback();
1502
+ };
1503
+
1504
+ _proto.getTimeouts = function getTimeouts() {
1505
+ var timeout = this.props.timeout;
1506
+ var exit, enter, appear;
1507
+ exit = enter = appear = timeout;
1508
+
1509
+ if (timeout != null && typeof timeout !== 'number') {
1510
+ exit = timeout.exit;
1511
+ enter = timeout.enter; // TODO: remove fallback for next major
1512
+
1513
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
1514
+ }
1515
+
1516
+ return {
1517
+ exit: exit,
1518
+ enter: enter,
1519
+ appear: appear
1562
1520
  };
1521
+ };
1563
1522
 
1564
- _this.onEntered = function (maybeNode, maybeAppearing) {
1565
- var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
1566
- node = _this$resolveArgument3[0],
1567
- appearing = _this$resolveArgument3[1];
1523
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
1524
+ if (mounting === void 0) {
1525
+ mounting = false;
1526
+ }
1527
+
1528
+ if (nextStatus !== null) {
1529
+ // nextStatus will always be ENTERING or EXITING.
1530
+ this.cancelNextCallback();
1531
+
1532
+ if (nextStatus === ENTERING) {
1533
+ this.performEnter(mounting);
1534
+ } else {
1535
+ this.performExit();
1536
+ }
1537
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
1538
+ this.setState({
1539
+ status: UNMOUNTED
1540
+ });
1541
+ }
1542
+ };
1568
1543
 
1569
- var type = appearing ? 'appear' : 'enter';
1544
+ _proto.performEnter = function performEnter(mounting) {
1545
+ var _this2 = this;
1570
1546
 
1571
- _this.removeClasses(node, type);
1547
+ var enter = this.props.enter;
1548
+ var appearing = this.context ? this.context.isMounting : mounting;
1572
1549
 
1573
- _this.addClass(node, type, 'done');
1550
+ var _ref2 = this.props.nodeRef ? [appearing] : [external_react_dom_default().findDOMNode(this), appearing],
1551
+ maybeNode = _ref2[0],
1552
+ maybeAppearing = _ref2[1];
1574
1553
 
1575
- if (_this.props.onEntered) {
1576
- _this.props.onEntered(maybeNode, maybeAppearing);
1577
- }
1578
- };
1554
+ var timeouts = this.getTimeouts();
1555
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
1556
+ // if we are mounting and running this it means appear _must_ be set
1579
1557
 
1580
- _this.onExit = function (maybeNode) {
1581
- var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
1582
- node = _this$resolveArgument4[0];
1558
+ if (!mounting && !enter || config.disabled) {
1559
+ this.safeSetState({
1560
+ status: ENTERED
1561
+ }, function () {
1562
+ _this2.props.onEntered(maybeNode);
1563
+ });
1564
+ return;
1565
+ }
1583
1566
 
1584
- _this.removeClasses(node, 'appear');
1567
+ this.props.onEnter(maybeNode, maybeAppearing);
1568
+ this.safeSetState({
1569
+ status: ENTERING
1570
+ }, function () {
1571
+ _this2.props.onEntering(maybeNode, maybeAppearing);
1585
1572
 
1586
- _this.removeClasses(node, 'enter');
1573
+ _this2.onTransitionEnd(enterTimeout, function () {
1574
+ _this2.safeSetState({
1575
+ status: ENTERED
1576
+ }, function () {
1577
+ _this2.props.onEntered(maybeNode, maybeAppearing);
1578
+ });
1579
+ });
1580
+ });
1581
+ };
1587
1582
 
1588
- _this.addClass(node, 'exit', 'base');
1583
+ _proto.performExit = function performExit() {
1584
+ var _this3 = this;
1589
1585
 
1590
- if (_this.props.onExit) {
1591
- _this.props.onExit(maybeNode);
1592
- }
1593
- };
1586
+ var exit = this.props.exit;
1587
+ var timeouts = this.getTimeouts();
1588
+ var maybeNode = this.props.nodeRef ? undefined : external_react_dom_default().findDOMNode(this); // no exit animation skip right to EXITED
1594
1589
 
1595
- _this.onExiting = function (maybeNode) {
1596
- var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
1597
- node = _this$resolveArgument5[0];
1590
+ if (!exit || config.disabled) {
1591
+ this.safeSetState({
1592
+ status: EXITED
1593
+ }, function () {
1594
+ _this3.props.onExited(maybeNode);
1595
+ });
1596
+ return;
1597
+ }
1598
1598
 
1599
- _this.addClass(node, 'exit', 'active');
1599
+ this.props.onExit(maybeNode);
1600
+ this.safeSetState({
1601
+ status: EXITING
1602
+ }, function () {
1603
+ _this3.props.onExiting(maybeNode);
1600
1604
 
1601
- if (_this.props.onExiting) {
1602
- _this.props.onExiting(maybeNode);
1603
- }
1604
- };
1605
+ _this3.onTransitionEnd(timeouts.exit, function () {
1606
+ _this3.safeSetState({
1607
+ status: EXITED
1608
+ }, function () {
1609
+ _this3.props.onExited(maybeNode);
1610
+ });
1611
+ });
1612
+ });
1613
+ };
1605
1614
 
1606
- _this.onExited = function (maybeNode) {
1607
- var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
1608
- node = _this$resolveArgument6[0];
1615
+ _proto.cancelNextCallback = function cancelNextCallback() {
1616
+ if (this.nextCallback !== null) {
1617
+ this.nextCallback.cancel();
1618
+ this.nextCallback = null;
1619
+ }
1620
+ };
1609
1621
 
1610
- _this.removeClasses(node, 'exit');
1622
+ _proto.safeSetState = function safeSetState(nextState, callback) {
1623
+ // This shouldn't be necessary, but there are weird race conditions with
1624
+ // setState callbacks and unmounting in testing, so always make sure that
1625
+ // we can cancel any pending setState callbacks after we unmount.
1626
+ callback = this.setNextCallback(callback);
1627
+ this.setState(nextState, callback);
1628
+ };
1611
1629
 
1612
- _this.addClass(node, 'exit', 'done');
1630
+ _proto.setNextCallback = function setNextCallback(callback) {
1631
+ var _this4 = this;
1613
1632
 
1614
- if (_this.props.onExited) {
1615
- _this.props.onExited(maybeNode);
1616
- }
1617
- };
1633
+ var active = true;
1618
1634
 
1619
- _this.resolveArguments = function (maybeNode, maybeAppearing) {
1620
- return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
1621
- : [maybeNode, maybeAppearing];
1635
+ this.nextCallback = function (event) {
1636
+ if (active) {
1637
+ active = false;
1638
+ _this4.nextCallback = null;
1639
+ callback(event);
1640
+ }
1622
1641
  };
1623
1642
 
1624
- _this.getClassNames = function (type) {
1625
- var classNames = _this.props.classNames;
1626
- var isStringClassNames = typeof classNames === 'string';
1627
- var prefix = isStringClassNames && classNames ? classNames + "-" : '';
1628
- var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
1629
- var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
1630
- var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
1631
- return {
1632
- baseClassName: baseClassName,
1633
- activeClassName: activeClassName,
1634
- doneClassName: doneClassName
1635
- };
1643
+ this.nextCallback.cancel = function () {
1644
+ active = false;
1636
1645
  };
1637
1646
 
1638
- return _this;
1639
- }
1640
-
1641
- var _proto = CSSTransition.prototype;
1642
-
1643
- _proto.addClass = function addClass(node, type, phase) {
1644
- var className = this.getClassNames(type)[phase + "ClassName"];
1645
-
1646
- var _this$getClassNames = this.getClassNames('enter'),
1647
- doneClassName = _this$getClassNames.doneClassName;
1648
-
1649
- if (type === 'appear' && phase === 'done' && doneClassName) {
1650
- className += " " + doneClassName;
1651
- } // This is for to force a repaint,
1652
- // which is necessary in order to transition styles when adding a class name.
1647
+ return this.nextCallback;
1648
+ };
1653
1649
 
1650
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
1651
+ this.setNextCallback(handler);
1652
+ var node = this.props.nodeRef ? this.props.nodeRef.current : external_react_dom_default().findDOMNode(this);
1653
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
1654
1654
 
1655
- if (phase === 'active') {
1656
- /* eslint-disable no-unused-expressions */
1657
- node && node.scrollTop;
1655
+ if (!node || doesNotHaveTimeoutOrListener) {
1656
+ setTimeout(this.nextCallback, 0);
1657
+ return;
1658
1658
  }
1659
1659
 
1660
- if (className) {
1661
- this.appliedClasses[type][phase] = className;
1660
+ if (this.props.addEndListener) {
1661
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
1662
+ maybeNode = _ref3[0],
1663
+ maybeNextCallback = _ref3[1];
1662
1664
 
1663
- _addClass(node, className);
1665
+ this.props.addEndListener(maybeNode, maybeNextCallback);
1664
1666
  }
1665
- };
1666
-
1667
- _proto.removeClasses = function removeClasses(node, type) {
1668
- var _this$appliedClasses$ = this.appliedClasses[type],
1669
- baseClassName = _this$appliedClasses$.base,
1670
- activeClassName = _this$appliedClasses$.active,
1671
- doneClassName = _this$appliedClasses$.done;
1672
- this.appliedClasses[type] = {};
1673
1667
 
1674
- if (baseClassName) {
1675
- removeClass(node, baseClassName);
1668
+ if (timeout != null) {
1669
+ setTimeout(this.nextCallback, timeout);
1676
1670
  }
1671
+ };
1677
1672
 
1678
- if (activeClassName) {
1679
- removeClass(node, activeClassName);
1680
- }
1673
+ _proto.render = function render() {
1674
+ var status = this.state.status;
1681
1675
 
1682
- if (doneClassName) {
1683
- removeClass(node, doneClassName);
1676
+ if (status === UNMOUNTED) {
1677
+ return null;
1684
1678
  }
1685
- };
1686
1679
 
1687
- _proto.render = function render() {
1688
1680
  var _this$props = this.props,
1689
- _ = _this$props.classNames,
1690
- props = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["classNames"]);
1681
+ children = _this$props.children,
1682
+ _in = _this$props["in"],
1683
+ _mountOnEnter = _this$props.mountOnEnter,
1684
+ _unmountOnExit = _this$props.unmountOnExit,
1685
+ _appear = _this$props.appear,
1686
+ _enter = _this$props.enter,
1687
+ _exit = _this$props.exit,
1688
+ _timeout = _this$props.timeout,
1689
+ _addEndListener = _this$props.addEndListener,
1690
+ _onEnter = _this$props.onEnter,
1691
+ _onEntering = _this$props.onEntering,
1692
+ _onEntered = _this$props.onEntered,
1693
+ _onExit = _this$props.onExit,
1694
+ _onExiting = _this$props.onExiting,
1695
+ _onExited = _this$props.onExited,
1696
+ _nodeRef = _this$props.nodeRef,
1697
+ childProps = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1691
1698
 
1692
- return /*#__PURE__*/external_react_default().createElement(esm_Transition, (0,esm_extends/* default */.Z)({}, props, {
1693
- onEnter: this.onEnter,
1694
- onEntered: this.onEntered,
1695
- onEntering: this.onEntering,
1696
- onExit: this.onExit,
1697
- onExiting: this.onExiting,
1698
- onExited: this.onExited
1699
- }));
1699
+ return (
1700
+ /*#__PURE__*/
1701
+ // allows for nested Transitions
1702
+ external_react_default().createElement(TransitionGroupContext/* default.Provider */.Z.Provider, {
1703
+ value: null
1704
+ }, typeof children === 'function' ? children(status, childProps) : external_react_default().cloneElement(external_react_default().Children.only(children), childProps))
1705
+ );
1700
1706
  };
1701
1707
 
1702
- return CSSTransition;
1708
+ return Transition;
1703
1709
  }((external_react_default()).Component);
1704
1710
 
1705
- CSSTransition.defaultProps = {
1706
- classNames: ''
1711
+ Transition.contextType = TransitionGroupContext/* default */.Z;
1712
+ Transition.propTypes = false ? 0 : {}; // Name the function so it is clearer in the documentation
1713
+
1714
+ function noop() {}
1715
+
1716
+ Transition.defaultProps = {
1717
+ "in": false,
1718
+ mountOnEnter: false,
1719
+ unmountOnExit: false,
1720
+ appear: false,
1721
+ enter: true,
1722
+ exit: true,
1723
+ onEnter: noop,
1724
+ onEntering: noop,
1725
+ onEntered: noop,
1726
+ onExit: noop,
1727
+ onExiting: noop,
1728
+ onExited: noop
1707
1729
  };
1708
- CSSTransition.propTypes = false ? 0 : {};
1709
- /* harmony default export */ const esm_CSSTransition = (CSSTransition);
1730
+ Transition.UNMOUNTED = UNMOUNTED;
1731
+ Transition.EXITED = EXITED;
1732
+ Transition.ENTERING = ENTERING;
1733
+ Transition.ENTERED = ENTERED;
1734
+ Transition.EXITING = EXITING;
1735
+ /* harmony default export */ const esm_Transition = (Transition);
1710
1736
 
1711
1737
  /***/ }),
1712
1738
 
@@ -2006,7 +2032,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
2006
2032
  /******/ 4548: 0,
2007
2033
  /******/ 5853: 0,
2008
2034
  /******/ 410: 0,
2009
- /******/ 563: 0
2035
+ /******/ 3813: 0
2010
2036
  /******/ };
2011
2037
  /******/
2012
2038
  /******/ // no chunk on demand loading
@@ -2056,7 +2082,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
2056
2082
  /******/ // startup
2057
2083
  /******/ // Load entry module and return exports
2058
2084
  /******/ // This entry module depends on other loaded chunks and execution need to be delayed
2059
- /******/ var __webpack_exports__ = __webpack_require__.O(undefined, [563], () => (__webpack_require__(6635)))
2085
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, [3813], () => (__webpack_require__(6635)))
2060
2086
  /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
2061
2087
  /******/
2062
2088
  /******/ return __webpack_exports__;