@bigbinary/neeto-molecules 3.2.2 → 3.2.3

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 (61) hide show
  1. package/dist/BrowserSupport.js +2 -1
  2. package/dist/BrowserSupport.js.map +1 -1
  3. package/dist/DownloadMobileAppCallout.js +2 -1
  4. package/dist/DownloadMobileAppCallout.js.map +1 -1
  5. package/dist/EmailForm.js +2 -1
  6. package/dist/EmailForm.js.map +1 -1
  7. package/dist/FloatingActionMenu.js +2 -1
  8. package/dist/FloatingActionMenu.js.map +1 -1
  9. package/dist/IconPicker.js +916 -4
  10. package/dist/IconPicker.js.map +1 -1
  11. package/dist/IpRestriction.js +3093 -7
  12. package/dist/IpRestriction.js.map +1 -1
  13. package/dist/KeyboardShortcuts.js +2 -1
  14. package/dist/KeyboardShortcuts.js.map +1 -1
  15. package/dist/MenuBar.js +1804 -12
  16. package/dist/MenuBar.js.map +1 -1
  17. package/dist/NeetoWidget.js +1957 -3
  18. package/dist/NeetoWidget.js.map +1 -1
  19. package/dist/PhoneNumber.js +12 -4
  20. package/dist/PhoneNumber.js.map +1 -1
  21. package/dist/SendToFields.js +1919 -1
  22. package/dist/SendToFields.js.map +1 -1
  23. package/dist/ShareViaEmail.js +2 -1
  24. package/dist/ShareViaEmail.js.map +1 -1
  25. package/dist/ShareViaLink.js +860 -2
  26. package/dist/ShareViaLink.js.map +1 -1
  27. package/dist/_commonjsHelpers-1c8beb5f.js +4 -0
  28. package/dist/_commonjsHelpers-1c8beb5f.js.map +1 -0
  29. package/dist/cjs/BrowserSupport.js +3 -3
  30. package/dist/cjs/BrowserSupport.js.map +1 -1
  31. package/dist/cjs/DownloadMobileAppCallout.js +3 -3
  32. package/dist/cjs/DownloadMobileAppCallout.js.map +1 -1
  33. package/dist/cjs/EmailForm.js +2 -1
  34. package/dist/cjs/EmailForm.js.map +1 -1
  35. package/dist/cjs/FloatingActionMenu.js +2 -1
  36. package/dist/cjs/FloatingActionMenu.js.map +1 -1
  37. package/dist/cjs/IconPicker.js +920 -5
  38. package/dist/cjs/IconPicker.js.map +1 -1
  39. package/dist/cjs/IpRestriction.js +3101 -15
  40. package/dist/cjs/IpRestriction.js.map +1 -1
  41. package/dist/cjs/KeyboardShortcuts.js +3 -3
  42. package/dist/cjs/KeyboardShortcuts.js.map +1 -1
  43. package/dist/cjs/MenuBar.js +1807 -10
  44. package/dist/cjs/MenuBar.js.map +1 -1
  45. package/dist/cjs/NeetoWidget.js +1958 -5
  46. package/dist/cjs/NeetoWidget.js.map +1 -1
  47. package/dist/cjs/PhoneNumber.js +12 -4
  48. package/dist/cjs/PhoneNumber.js.map +1 -1
  49. package/dist/cjs/SendToFields.js +1921 -3
  50. package/dist/cjs/SendToFields.js.map +1 -1
  51. package/dist/cjs/ShareViaEmail.js +2 -1
  52. package/dist/cjs/ShareViaEmail.js.map +1 -1
  53. package/dist/cjs/ShareViaLink.js +860 -3
  54. package/dist/cjs/ShareViaLink.js.map +1 -1
  55. package/dist/cjs/_commonjsHelpers-68cdf74f.js +6 -0
  56. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +1 -0
  57. package/dist/cjs/platform-628b3bd8.js +1252 -0
  58. package/dist/cjs/platform-628b3bd8.js.map +1 -0
  59. package/dist/platform-e221afea.js +1250 -0
  60. package/dist/platform-e221afea.js.map +1 -0
  61. package/package.json +14 -16
package/dist/MenuBar.js CHANGED
@@ -1,23 +1,1815 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import React__default from 'react';
3
+ import React__default, { Children, isValidElement, cloneElement } from 'react';
4
4
  import classnames from 'classnames';
5
5
  import Typography from '@bigbinary/neetoui/Typography';
6
- import { CSSTransition } from 'react-transition-group';
7
- import _extends from '@babel/runtime/helpers/extends';
6
+ import _extends from '@babel/runtime/helpers/esm/extends';
7
+ import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
8
+ import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
9
+ import { p as propTypes } from './index-e5588516.js';
10
+ import ReactDOM from 'react-dom';
11
+ import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
12
+ import _extends$1 from '@babel/runtime/helpers/extends';
8
13
  import Plus from '@bigbinary/neeto-icons/Plus';
9
14
  import Button from '@bigbinary/neetoui/Button';
10
15
  import { n } from './inject-css-c86de496.js';
11
- import { noop } from '@bigbinary/neeto-cist';
16
+ import { noop as noop$1 } from '@bigbinary/neeto-cist';
12
17
  import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils/general';
13
18
  import { Link } from 'react-router-dom';
14
19
  import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
15
20
  import Search$1 from '@bigbinary/neeto-icons/Search';
16
21
  import Close from '@bigbinary/neeto-icons/Close';
17
22
  import Input from '@bigbinary/neetoui/Input';
18
- import { p as propTypes } from './index-e5588516.js';
19
23
  import { omit } from 'ramda';
20
24
 
25
+ /**
26
+ * Checks if a given element has a CSS class.
27
+ *
28
+ * @param element the element
29
+ * @param className the CSS class name
30
+ */
31
+ function hasClass(element, className) {
32
+ if (element.classList) return !!className && element.classList.contains(className);
33
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
34
+ }
35
+
36
+ /**
37
+ * Adds a CSS class to a given element.
38
+ *
39
+ * @param element the element
40
+ * @param className the CSS class name
41
+ */
42
+
43
+ function addClass(element, className) {
44
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
45
+ }
46
+
47
+ function replaceClassName(origClass, classToRemove) {
48
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
49
+ }
50
+ /**
51
+ * Removes a CSS class from a given element.
52
+ *
53
+ * @param element the element
54
+ * @param className the CSS class name
55
+ */
56
+
57
+
58
+ function removeClass$1(element, className) {
59
+ if (element.classList) {
60
+ element.classList.remove(className);
61
+ } else if (typeof element.className === 'string') {
62
+ element.className = replaceClassName(element.className, className);
63
+ } else {
64
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
65
+ }
66
+ }
67
+
68
+ var config = {
69
+ disabled: false
70
+ };
71
+
72
+ var timeoutsShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.shape({
73
+ enter: propTypes.exports.number,
74
+ exit: propTypes.exports.number,
75
+ appear: propTypes.exports.number
76
+ }).isRequired]) : null;
77
+ var classNamesShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.shape({
78
+ enter: propTypes.exports.string,
79
+ exit: propTypes.exports.string,
80
+ active: propTypes.exports.string
81
+ }), propTypes.exports.shape({
82
+ enter: propTypes.exports.string,
83
+ enterDone: propTypes.exports.string,
84
+ enterActive: propTypes.exports.string,
85
+ exit: propTypes.exports.string,
86
+ exitDone: propTypes.exports.string,
87
+ exitActive: propTypes.exports.string
88
+ })]) : null;
89
+
90
+ var TransitionGroupContext = React__default.createContext(null);
91
+
92
+ var forceReflow = function forceReflow(node) {
93
+ return node.scrollTop;
94
+ };
95
+
96
+ var UNMOUNTED = 'unmounted';
97
+ var EXITED = 'exited';
98
+ var ENTERING = 'entering';
99
+ var ENTERED = 'entered';
100
+ var EXITING = 'exiting';
101
+ /**
102
+ * The Transition component lets you describe a transition from one component
103
+ * state to another _over time_ with a simple declarative API. Most commonly
104
+ * it's used to animate the mounting and unmounting of a component, but can also
105
+ * be used to describe in-place transition states as well.
106
+ *
107
+ * ---
108
+ *
109
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
110
+ * transitions in CSS, you'll probably want to use
111
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
112
+ * instead. It inherits all the features of `Transition`, but contains
113
+ * additional features necessary to play nice with CSS transitions (hence the
114
+ * name of the component).
115
+ *
116
+ * ---
117
+ *
118
+ * By default the `Transition` component does not alter the behavior of the
119
+ * component it renders, it only tracks "enter" and "exit" states for the
120
+ * components. It's up to you to give meaning and effect to those states. For
121
+ * example we can add styles to a component when it enters or exits:
122
+ *
123
+ * ```jsx
124
+ * import { Transition } from 'react-transition-group';
125
+ *
126
+ * const duration = 300;
127
+ *
128
+ * const defaultStyle = {
129
+ * transition: `opacity ${duration}ms ease-in-out`,
130
+ * opacity: 0,
131
+ * }
132
+ *
133
+ * const transitionStyles = {
134
+ * entering: { opacity: 1 },
135
+ * entered: { opacity: 1 },
136
+ * exiting: { opacity: 0 },
137
+ * exited: { opacity: 0 },
138
+ * };
139
+ *
140
+ * const Fade = ({ in: inProp }) => (
141
+ * <Transition in={inProp} timeout={duration}>
142
+ * {state => (
143
+ * <div style={{
144
+ * ...defaultStyle,
145
+ * ...transitionStyles[state]
146
+ * }}>
147
+ * I'm a fade Transition!
148
+ * </div>
149
+ * )}
150
+ * </Transition>
151
+ * );
152
+ * ```
153
+ *
154
+ * There are 4 main states a Transition can be in:
155
+ * - `'entering'`
156
+ * - `'entered'`
157
+ * - `'exiting'`
158
+ * - `'exited'`
159
+ *
160
+ * Transition state is toggled via the `in` prop. When `true` the component
161
+ * begins the "Enter" stage. During this stage, the component will shift from
162
+ * its current transition state, to `'entering'` for the duration of the
163
+ * transition and then to the `'entered'` stage once it's complete. Let's take
164
+ * the following example (we'll use the
165
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
166
+ *
167
+ * ```jsx
168
+ * function App() {
169
+ * const [inProp, setInProp] = useState(false);
170
+ * return (
171
+ * <div>
172
+ * <Transition in={inProp} timeout={500}>
173
+ * {state => (
174
+ * // ...
175
+ * )}
176
+ * </Transition>
177
+ * <button onClick={() => setInProp(true)}>
178
+ * Click to Enter
179
+ * </button>
180
+ * </div>
181
+ * );
182
+ * }
183
+ * ```
184
+ *
185
+ * When the button is clicked the component will shift to the `'entering'` state
186
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
187
+ * to `'entered'`.
188
+ *
189
+ * When `in` is `false` the same thing happens except the state moves from
190
+ * `'exiting'` to `'exited'`.
191
+ */
192
+
193
+ var Transition = /*#__PURE__*/function (_React$Component) {
194
+ _inheritsLoose(Transition, _React$Component);
195
+
196
+ function Transition(props, context) {
197
+ var _this;
198
+
199
+ _this = _React$Component.call(this, props, context) || this;
200
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
201
+
202
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
203
+ var initialStatus;
204
+ _this.appearStatus = null;
205
+
206
+ if (props.in) {
207
+ if (appear) {
208
+ initialStatus = EXITED;
209
+ _this.appearStatus = ENTERING;
210
+ } else {
211
+ initialStatus = ENTERED;
212
+ }
213
+ } else {
214
+ if (props.unmountOnExit || props.mountOnEnter) {
215
+ initialStatus = UNMOUNTED;
216
+ } else {
217
+ initialStatus = EXITED;
218
+ }
219
+ }
220
+
221
+ _this.state = {
222
+ status: initialStatus
223
+ };
224
+ _this.nextCallback = null;
225
+ return _this;
226
+ }
227
+
228
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
229
+ var nextIn = _ref.in;
230
+
231
+ if (nextIn && prevState.status === UNMOUNTED) {
232
+ return {
233
+ status: EXITED
234
+ };
235
+ }
236
+
237
+ return null;
238
+ } // getSnapshotBeforeUpdate(prevProps) {
239
+ // let nextStatus = null
240
+ // if (prevProps !== this.props) {
241
+ // const { status } = this.state
242
+ // if (this.props.in) {
243
+ // if (status !== ENTERING && status !== ENTERED) {
244
+ // nextStatus = ENTERING
245
+ // }
246
+ // } else {
247
+ // if (status === ENTERING || status === ENTERED) {
248
+ // nextStatus = EXITING
249
+ // }
250
+ // }
251
+ // }
252
+ // return { nextStatus }
253
+ // }
254
+ ;
255
+
256
+ var _proto = Transition.prototype;
257
+
258
+ _proto.componentDidMount = function componentDidMount() {
259
+ this.updateStatus(true, this.appearStatus);
260
+ };
261
+
262
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
263
+ var nextStatus = null;
264
+
265
+ if (prevProps !== this.props) {
266
+ var status = this.state.status;
267
+
268
+ if (this.props.in) {
269
+ if (status !== ENTERING && status !== ENTERED) {
270
+ nextStatus = ENTERING;
271
+ }
272
+ } else {
273
+ if (status === ENTERING || status === ENTERED) {
274
+ nextStatus = EXITING;
275
+ }
276
+ }
277
+ }
278
+
279
+ this.updateStatus(false, nextStatus);
280
+ };
281
+
282
+ _proto.componentWillUnmount = function componentWillUnmount() {
283
+ this.cancelNextCallback();
284
+ };
285
+
286
+ _proto.getTimeouts = function getTimeouts() {
287
+ var timeout = this.props.timeout;
288
+ var exit, enter, appear;
289
+ exit = enter = appear = timeout;
290
+
291
+ if (timeout != null && typeof timeout !== 'number') {
292
+ exit = timeout.exit;
293
+ enter = timeout.enter; // TODO: remove fallback for next major
294
+
295
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
296
+ }
297
+
298
+ return {
299
+ exit: exit,
300
+ enter: enter,
301
+ appear: appear
302
+ };
303
+ };
304
+
305
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
306
+ if (mounting === void 0) {
307
+ mounting = false;
308
+ }
309
+
310
+ if (nextStatus !== null) {
311
+ // nextStatus will always be ENTERING or EXITING.
312
+ this.cancelNextCallback();
313
+
314
+ if (nextStatus === ENTERING) {
315
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
316
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
317
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
318
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
319
+
320
+ if (node) forceReflow(node);
321
+ }
322
+
323
+ this.performEnter(mounting);
324
+ } else {
325
+ this.performExit();
326
+ }
327
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
328
+ this.setState({
329
+ status: UNMOUNTED
330
+ });
331
+ }
332
+ };
333
+
334
+ _proto.performEnter = function performEnter(mounting) {
335
+ var _this2 = this;
336
+
337
+ var enter = this.props.enter;
338
+ var appearing = this.context ? this.context.isMounting : mounting;
339
+
340
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],
341
+ maybeNode = _ref2[0],
342
+ maybeAppearing = _ref2[1];
343
+
344
+ var timeouts = this.getTimeouts();
345
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
346
+ // if we are mounting and running this it means appear _must_ be set
347
+
348
+ if (!mounting && !enter || config.disabled) {
349
+ this.safeSetState({
350
+ status: ENTERED
351
+ }, function () {
352
+ _this2.props.onEntered(maybeNode);
353
+ });
354
+ return;
355
+ }
356
+
357
+ this.props.onEnter(maybeNode, maybeAppearing);
358
+ this.safeSetState({
359
+ status: ENTERING
360
+ }, function () {
361
+ _this2.props.onEntering(maybeNode, maybeAppearing);
362
+
363
+ _this2.onTransitionEnd(enterTimeout, function () {
364
+ _this2.safeSetState({
365
+ status: ENTERED
366
+ }, function () {
367
+ _this2.props.onEntered(maybeNode, maybeAppearing);
368
+ });
369
+ });
370
+ });
371
+ };
372
+
373
+ _proto.performExit = function performExit() {
374
+ var _this3 = this;
375
+
376
+ var exit = this.props.exit;
377
+ var timeouts = this.getTimeouts();
378
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED
379
+
380
+ if (!exit || config.disabled) {
381
+ this.safeSetState({
382
+ status: EXITED
383
+ }, function () {
384
+ _this3.props.onExited(maybeNode);
385
+ });
386
+ return;
387
+ }
388
+
389
+ this.props.onExit(maybeNode);
390
+ this.safeSetState({
391
+ status: EXITING
392
+ }, function () {
393
+ _this3.props.onExiting(maybeNode);
394
+
395
+ _this3.onTransitionEnd(timeouts.exit, function () {
396
+ _this3.safeSetState({
397
+ status: EXITED
398
+ }, function () {
399
+ _this3.props.onExited(maybeNode);
400
+ });
401
+ });
402
+ });
403
+ };
404
+
405
+ _proto.cancelNextCallback = function cancelNextCallback() {
406
+ if (this.nextCallback !== null) {
407
+ this.nextCallback.cancel();
408
+ this.nextCallback = null;
409
+ }
410
+ };
411
+
412
+ _proto.safeSetState = function safeSetState(nextState, callback) {
413
+ // This shouldn't be necessary, but there are weird race conditions with
414
+ // setState callbacks and unmounting in testing, so always make sure that
415
+ // we can cancel any pending setState callbacks after we unmount.
416
+ callback = this.setNextCallback(callback);
417
+ this.setState(nextState, callback);
418
+ };
419
+
420
+ _proto.setNextCallback = function setNextCallback(callback) {
421
+ var _this4 = this;
422
+
423
+ var active = true;
424
+
425
+ this.nextCallback = function (event) {
426
+ if (active) {
427
+ active = false;
428
+ _this4.nextCallback = null;
429
+ callback(event);
430
+ }
431
+ };
432
+
433
+ this.nextCallback.cancel = function () {
434
+ active = false;
435
+ };
436
+
437
+ return this.nextCallback;
438
+ };
439
+
440
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
441
+ this.setNextCallback(handler);
442
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
443
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
444
+
445
+ if (!node || doesNotHaveTimeoutOrListener) {
446
+ setTimeout(this.nextCallback, 0);
447
+ return;
448
+ }
449
+
450
+ if (this.props.addEndListener) {
451
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
452
+ maybeNode = _ref3[0],
453
+ maybeNextCallback = _ref3[1];
454
+
455
+ this.props.addEndListener(maybeNode, maybeNextCallback);
456
+ }
457
+
458
+ if (timeout != null) {
459
+ setTimeout(this.nextCallback, timeout);
460
+ }
461
+ };
462
+
463
+ _proto.render = function render() {
464
+ var status = this.state.status;
465
+
466
+ if (status === UNMOUNTED) {
467
+ return null;
468
+ }
469
+
470
+ var _this$props = this.props,
471
+ children = _this$props.children;
472
+ _this$props.in;
473
+ _this$props.mountOnEnter;
474
+ _this$props.unmountOnExit;
475
+ _this$props.appear;
476
+ _this$props.enter;
477
+ _this$props.exit;
478
+ _this$props.timeout;
479
+ _this$props.addEndListener;
480
+ _this$props.onEnter;
481
+ _this$props.onEntering;
482
+ _this$props.onEntered;
483
+ _this$props.onExit;
484
+ _this$props.onExiting;
485
+ _this$props.onExited;
486
+ _this$props.nodeRef;
487
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
488
+
489
+ return (
490
+ /*#__PURE__*/
491
+ // allows for nested Transitions
492
+ React__default.createElement(TransitionGroupContext.Provider, {
493
+ value: null
494
+ }, typeof children === 'function' ? children(status, childProps) : React__default.cloneElement(React__default.Children.only(children), childProps))
495
+ );
496
+ };
497
+
498
+ return Transition;
499
+ }(React__default.Component);
500
+
501
+ Transition.contextType = TransitionGroupContext;
502
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
503
+ /**
504
+ * A React reference to DOM element that need to transition:
505
+ * https://stackoverflow.com/a/51127130/4671932
506
+ *
507
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
508
+ * (e.g. `onEnter`) because user already has direct access to the node.
509
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
510
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
511
+ * (see
512
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
513
+ */
514
+ nodeRef: propTypes.exports.shape({
515
+ current: typeof Element === 'undefined' ? propTypes.exports.any : function (propValue, key, componentName, location, propFullName, secret) {
516
+ var value = propValue[key];
517
+ return propTypes.exports.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
518
+ }
519
+ }),
520
+
521
+ /**
522
+ * A `function` child can be used instead of a React element. This function is
523
+ * called with the current transition status (`'entering'`, `'entered'`,
524
+ * `'exiting'`, `'exited'`), which can be used to apply context
525
+ * specific props to a component.
526
+ *
527
+ * ```jsx
528
+ * <Transition in={this.state.in} timeout={150}>
529
+ * {state => (
530
+ * <MyComponent className={`fade fade-${state}`} />
531
+ * )}
532
+ * </Transition>
533
+ * ```
534
+ */
535
+ children: propTypes.exports.oneOfType([propTypes.exports.func.isRequired, propTypes.exports.element.isRequired]).isRequired,
536
+
537
+ /**
538
+ * Show the component; triggers the enter or exit states
539
+ */
540
+ in: propTypes.exports.bool,
541
+
542
+ /**
543
+ * By default the child component is mounted immediately along with
544
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
545
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
546
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
547
+ */
548
+ mountOnEnter: propTypes.exports.bool,
549
+
550
+ /**
551
+ * By default the child component stays mounted after it reaches the `'exited'` state.
552
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
553
+ */
554
+ unmountOnExit: propTypes.exports.bool,
555
+
556
+ /**
557
+ * By default the child component does not perform the enter transition when
558
+ * it first mounts, regardless of the value of `in`. If you want this
559
+ * behavior, set both `appear` and `in` to `true`.
560
+ *
561
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
562
+ * > only adds an additional enter transition. However, in the
563
+ * > `<CSSTransition>` component that first enter transition does result in
564
+ * > additional `.appear-*` classes, that way you can choose to style it
565
+ * > differently.
566
+ */
567
+ appear: propTypes.exports.bool,
568
+
569
+ /**
570
+ * Enable or disable enter transitions.
571
+ */
572
+ enter: propTypes.exports.bool,
573
+
574
+ /**
575
+ * Enable or disable exit transitions.
576
+ */
577
+ exit: propTypes.exports.bool,
578
+
579
+ /**
580
+ * The duration of the transition, in milliseconds.
581
+ * Required unless `addEndListener` is provided.
582
+ *
583
+ * You may specify a single timeout for all transitions:
584
+ *
585
+ * ```jsx
586
+ * timeout={500}
587
+ * ```
588
+ *
589
+ * or individually:
590
+ *
591
+ * ```jsx
592
+ * timeout={{
593
+ * appear: 500,
594
+ * enter: 300,
595
+ * exit: 500,
596
+ * }}
597
+ * ```
598
+ *
599
+ * - `appear` defaults to the value of `enter`
600
+ * - `enter` defaults to `0`
601
+ * - `exit` defaults to `0`
602
+ *
603
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
604
+ */
605
+ timeout: function timeout(props) {
606
+ var pt = timeoutsShape;
607
+ if (!props.addEndListener) pt = pt.isRequired;
608
+
609
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
610
+ args[_key - 1] = arguments[_key];
611
+ }
612
+
613
+ return pt.apply(void 0, [props].concat(args));
614
+ },
615
+
616
+ /**
617
+ * Add a custom transition end trigger. Called with the transitioning
618
+ * DOM node and a `done` callback. Allows for more fine grained transition end
619
+ * logic. Timeouts are still used as a fallback if provided.
620
+ *
621
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
622
+ *
623
+ * ```jsx
624
+ * addEndListener={(node, done) => {
625
+ * // use the css transitionend event to mark the finish of a transition
626
+ * node.addEventListener('transitionend', done, false);
627
+ * }}
628
+ * ```
629
+ */
630
+ addEndListener: propTypes.exports.func,
631
+
632
+ /**
633
+ * Callback fired before the "entering" status is applied. An extra parameter
634
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
635
+ *
636
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
637
+ *
638
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
639
+ */
640
+ onEnter: propTypes.exports.func,
641
+
642
+ /**
643
+ * Callback fired after the "entering" status is applied. An extra parameter
644
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
645
+ *
646
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
647
+ *
648
+ * @type Function(node: HtmlElement, isAppearing: bool)
649
+ */
650
+ onEntering: propTypes.exports.func,
651
+
652
+ /**
653
+ * Callback fired after the "entered" status is applied. An extra parameter
654
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
655
+ *
656
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
657
+ *
658
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
659
+ */
660
+ onEntered: propTypes.exports.func,
661
+
662
+ /**
663
+ * Callback fired before the "exiting" status is applied.
664
+ *
665
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
666
+ *
667
+ * @type Function(node: HtmlElement) -> void
668
+ */
669
+ onExit: propTypes.exports.func,
670
+
671
+ /**
672
+ * Callback fired after the "exiting" status is applied.
673
+ *
674
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
675
+ *
676
+ * @type Function(node: HtmlElement) -> void
677
+ */
678
+ onExiting: propTypes.exports.func,
679
+
680
+ /**
681
+ * Callback fired after the "exited" status is applied.
682
+ *
683
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
684
+ *
685
+ * @type Function(node: HtmlElement) -> void
686
+ */
687
+ onExited: propTypes.exports.func
688
+ } : {}; // Name the function so it is clearer in the documentation
689
+
690
+ function noop() {}
691
+
692
+ Transition.defaultProps = {
693
+ in: false,
694
+ mountOnEnter: false,
695
+ unmountOnExit: false,
696
+ appear: false,
697
+ enter: true,
698
+ exit: true,
699
+ onEnter: noop,
700
+ onEntering: noop,
701
+ onEntered: noop,
702
+ onExit: noop,
703
+ onExiting: noop,
704
+ onExited: noop
705
+ };
706
+ Transition.UNMOUNTED = UNMOUNTED;
707
+ Transition.EXITED = EXITED;
708
+ Transition.ENTERING = ENTERING;
709
+ Transition.ENTERED = ENTERED;
710
+ Transition.EXITING = EXITING;
711
+
712
+ var _addClass = function addClass$1(node, classes) {
713
+ return node && classes && classes.split(' ').forEach(function (c) {
714
+ return addClass(node, c);
715
+ });
716
+ };
717
+
718
+ var removeClass = function removeClass(node, classes) {
719
+ return node && classes && classes.split(' ').forEach(function (c) {
720
+ return removeClass$1(node, c);
721
+ });
722
+ };
723
+ /**
724
+ * A transition component inspired by the excellent
725
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
726
+ * use it if you're using CSS transitions or animations. It's built upon the
727
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
728
+ * component, so it inherits all of its props.
729
+ *
730
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
731
+ * and `exit` states of the transition. The first class is applied and then a
732
+ * second `*-active` class in order to activate the CSS transition. After the
733
+ * transition, matching `*-done` class names are applied to persist the
734
+ * transition state.
735
+ *
736
+ * ```jsx
737
+ * function App() {
738
+ * const [inProp, setInProp] = useState(false);
739
+ * return (
740
+ * <div>
741
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
742
+ * <div>
743
+ * {"I'll receive my-node-* classes"}
744
+ * </div>
745
+ * </CSSTransition>
746
+ * <button type="button" onClick={() => setInProp(true)}>
747
+ * Click to Enter
748
+ * </button>
749
+ * </div>
750
+ * );
751
+ * }
752
+ * ```
753
+ *
754
+ * When the `in` prop is set to `true`, the child component will first receive
755
+ * the class `example-enter`, then the `example-enter-active` will be added in
756
+ * the next tick. `CSSTransition` [forces a
757
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
758
+ * between before adding the `example-enter-active`. This is an important trick
759
+ * because it allows us to transition between `example-enter` and
760
+ * `example-enter-active` even though they were added immediately one after
761
+ * another. Most notably, this is what makes it possible for us to animate
762
+ * _appearance_.
763
+ *
764
+ * ```css
765
+ * .my-node-enter {
766
+ * opacity: 0;
767
+ * }
768
+ * .my-node-enter-active {
769
+ * opacity: 1;
770
+ * transition: opacity 200ms;
771
+ * }
772
+ * .my-node-exit {
773
+ * opacity: 1;
774
+ * }
775
+ * .my-node-exit-active {
776
+ * opacity: 0;
777
+ * transition: opacity 200ms;
778
+ * }
779
+ * ```
780
+ *
781
+ * `*-active` classes represent which styles you want to animate **to**, so it's
782
+ * important to add `transition` declaration only to them, otherwise transitions
783
+ * might not behave as intended! This might not be obvious when the transitions
784
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
785
+ * the example above (minus `transition`), but it becomes apparent in more
786
+ * complex transitions.
787
+ *
788
+ * **Note**: If you're using the
789
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
790
+ * prop, make sure to define styles for `.appear-*` classes as well.
791
+ */
792
+
793
+
794
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
795
+ _inheritsLoose(CSSTransition, _React$Component);
796
+
797
+ function CSSTransition() {
798
+ var _this;
799
+
800
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
801
+ args[_key] = arguments[_key];
802
+ }
803
+
804
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
805
+ _this.appliedClasses = {
806
+ appear: {},
807
+ enter: {},
808
+ exit: {}
809
+ };
810
+
811
+ _this.onEnter = function (maybeNode, maybeAppearing) {
812
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
813
+ node = _this$resolveArgument[0],
814
+ appearing = _this$resolveArgument[1];
815
+
816
+ _this.removeClasses(node, 'exit');
817
+
818
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
819
+
820
+ if (_this.props.onEnter) {
821
+ _this.props.onEnter(maybeNode, maybeAppearing);
822
+ }
823
+ };
824
+
825
+ _this.onEntering = function (maybeNode, maybeAppearing) {
826
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
827
+ node = _this$resolveArgument2[0],
828
+ appearing = _this$resolveArgument2[1];
829
+
830
+ var type = appearing ? 'appear' : 'enter';
831
+
832
+ _this.addClass(node, type, 'active');
833
+
834
+ if (_this.props.onEntering) {
835
+ _this.props.onEntering(maybeNode, maybeAppearing);
836
+ }
837
+ };
838
+
839
+ _this.onEntered = function (maybeNode, maybeAppearing) {
840
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
841
+ node = _this$resolveArgument3[0],
842
+ appearing = _this$resolveArgument3[1];
843
+
844
+ var type = appearing ? 'appear' : 'enter';
845
+
846
+ _this.removeClasses(node, type);
847
+
848
+ _this.addClass(node, type, 'done');
849
+
850
+ if (_this.props.onEntered) {
851
+ _this.props.onEntered(maybeNode, maybeAppearing);
852
+ }
853
+ };
854
+
855
+ _this.onExit = function (maybeNode) {
856
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
857
+ node = _this$resolveArgument4[0];
858
+
859
+ _this.removeClasses(node, 'appear');
860
+
861
+ _this.removeClasses(node, 'enter');
862
+
863
+ _this.addClass(node, 'exit', 'base');
864
+
865
+ if (_this.props.onExit) {
866
+ _this.props.onExit(maybeNode);
867
+ }
868
+ };
869
+
870
+ _this.onExiting = function (maybeNode) {
871
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
872
+ node = _this$resolveArgument5[0];
873
+
874
+ _this.addClass(node, 'exit', 'active');
875
+
876
+ if (_this.props.onExiting) {
877
+ _this.props.onExiting(maybeNode);
878
+ }
879
+ };
880
+
881
+ _this.onExited = function (maybeNode) {
882
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
883
+ node = _this$resolveArgument6[0];
884
+
885
+ _this.removeClasses(node, 'exit');
886
+
887
+ _this.addClass(node, 'exit', 'done');
888
+
889
+ if (_this.props.onExited) {
890
+ _this.props.onExited(maybeNode);
891
+ }
892
+ };
893
+
894
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
895
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
896
+ : [maybeNode, maybeAppearing];
897
+ };
898
+
899
+ _this.getClassNames = function (type) {
900
+ var classNames = _this.props.classNames;
901
+ var isStringClassNames = typeof classNames === 'string';
902
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
903
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
904
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
905
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
906
+ return {
907
+ baseClassName: baseClassName,
908
+ activeClassName: activeClassName,
909
+ doneClassName: doneClassName
910
+ };
911
+ };
912
+
913
+ return _this;
914
+ }
915
+
916
+ var _proto = CSSTransition.prototype;
917
+
918
+ _proto.addClass = function addClass(node, type, phase) {
919
+ var className = this.getClassNames(type)[phase + "ClassName"];
920
+
921
+ var _this$getClassNames = this.getClassNames('enter'),
922
+ doneClassName = _this$getClassNames.doneClassName;
923
+
924
+ if (type === 'appear' && phase === 'done' && doneClassName) {
925
+ className += " " + doneClassName;
926
+ } // This is to force a repaint,
927
+ // which is necessary in order to transition styles when adding a class name.
928
+
929
+
930
+ if (phase === 'active') {
931
+ if (node) forceReflow(node);
932
+ }
933
+
934
+ if (className) {
935
+ this.appliedClasses[type][phase] = className;
936
+
937
+ _addClass(node, className);
938
+ }
939
+ };
940
+
941
+ _proto.removeClasses = function removeClasses(node, type) {
942
+ var _this$appliedClasses$ = this.appliedClasses[type],
943
+ baseClassName = _this$appliedClasses$.base,
944
+ activeClassName = _this$appliedClasses$.active,
945
+ doneClassName = _this$appliedClasses$.done;
946
+ this.appliedClasses[type] = {};
947
+
948
+ if (baseClassName) {
949
+ removeClass(node, baseClassName);
950
+ }
951
+
952
+ if (activeClassName) {
953
+ removeClass(node, activeClassName);
954
+ }
955
+
956
+ if (doneClassName) {
957
+ removeClass(node, doneClassName);
958
+ }
959
+ };
960
+
961
+ _proto.render = function render() {
962
+ var _this$props = this.props;
963
+ _this$props.classNames;
964
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
965
+
966
+ return /*#__PURE__*/React__default.createElement(Transition, _extends({}, props, {
967
+ onEnter: this.onEnter,
968
+ onEntered: this.onEntered,
969
+ onEntering: this.onEntering,
970
+ onExit: this.onExit,
971
+ onExiting: this.onExiting,
972
+ onExited: this.onExited
973
+ }));
974
+ };
975
+
976
+ return CSSTransition;
977
+ }(React__default.Component);
978
+
979
+ CSSTransition.defaultProps = {
980
+ classNames: ''
981
+ };
982
+ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
983
+ /**
984
+ * The animation classNames applied to the component as it appears, enters,
985
+ * exits or has finished the transition. A single name can be provided, which
986
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
987
+ *
988
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
989
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
990
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
991
+ *
992
+ * A few details to note about how these classes are applied:
993
+ *
994
+ * 1. They are _joined_ with the ones that are already defined on the child
995
+ * component, so if you want to add some base styles, you can use
996
+ * `className` without worrying that it will be overridden.
997
+ *
998
+ * 2. If the transition component mounts with `in={false}`, no classes are
999
+ * applied yet. You might be expecting `*-exit-done`, but if you think
1000
+ * about it, a component cannot finish exiting if it hasn't entered yet.
1001
+ *
1002
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
1003
+ * allows you to define different behavior for when appearing is done and
1004
+ * when regular entering is done, using selectors like
1005
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
1006
+ * an epic entrance animation when element first appears in the DOM using
1007
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
1008
+ * simply use `fade-enter-done` for defining both cases.
1009
+ *
1010
+ * Each individual classNames can also be specified independently like:
1011
+ *
1012
+ * ```js
1013
+ * classNames={{
1014
+ * appear: 'my-appear',
1015
+ * appearActive: 'my-active-appear',
1016
+ * appearDone: 'my-done-appear',
1017
+ * enter: 'my-enter',
1018
+ * enterActive: 'my-active-enter',
1019
+ * enterDone: 'my-done-enter',
1020
+ * exit: 'my-exit',
1021
+ * exitActive: 'my-active-exit',
1022
+ * exitDone: 'my-done-exit',
1023
+ * }}
1024
+ * ```
1025
+ *
1026
+ * If you want to set these classes using CSS Modules:
1027
+ *
1028
+ * ```js
1029
+ * import styles from './styles.css';
1030
+ * ```
1031
+ *
1032
+ * you might want to use camelCase in your CSS file, that way could simply
1033
+ * spread them instead of listing them one by one:
1034
+ *
1035
+ * ```js
1036
+ * classNames={{ ...styles }}
1037
+ * ```
1038
+ *
1039
+ * @type {string | {
1040
+ * appear?: string,
1041
+ * appearActive?: string,
1042
+ * appearDone?: string,
1043
+ * enter?: string,
1044
+ * enterActive?: string,
1045
+ * enterDone?: string,
1046
+ * exit?: string,
1047
+ * exitActive?: string,
1048
+ * exitDone?: string,
1049
+ * }}
1050
+ */
1051
+ classNames: classNamesShape,
1052
+
1053
+ /**
1054
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
1055
+ * applied.
1056
+ *
1057
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1058
+ *
1059
+ * @type Function(node: HtmlElement, isAppearing: bool)
1060
+ */
1061
+ onEnter: propTypes.exports.func,
1062
+
1063
+ /**
1064
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
1065
+ * 'appear-active' class is applied.
1066
+ *
1067
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1068
+ *
1069
+ * @type Function(node: HtmlElement, isAppearing: bool)
1070
+ */
1071
+ onEntering: propTypes.exports.func,
1072
+
1073
+ /**
1074
+ * A `<Transition>` callback fired immediately after the 'enter' or
1075
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
1076
+ *
1077
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1078
+ *
1079
+ * @type Function(node: HtmlElement, isAppearing: bool)
1080
+ */
1081
+ onEntered: propTypes.exports.func,
1082
+
1083
+ /**
1084
+ * A `<Transition>` callback fired immediately after the 'exit' class is
1085
+ * applied.
1086
+ *
1087
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1088
+ *
1089
+ * @type Function(node: HtmlElement)
1090
+ */
1091
+ onExit: propTypes.exports.func,
1092
+
1093
+ /**
1094
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
1095
+ *
1096
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1097
+ *
1098
+ * @type Function(node: HtmlElement)
1099
+ */
1100
+ onExiting: propTypes.exports.func,
1101
+
1102
+ /**
1103
+ * A `<Transition>` callback fired immediately after the 'exit' classes
1104
+ * are **removed** and the `exit-done` class is added to the DOM node.
1105
+ *
1106
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1107
+ *
1108
+ * @type Function(node: HtmlElement)
1109
+ */
1110
+ onExited: propTypes.exports.func
1111
+ }) : {};
1112
+
1113
+ /**
1114
+ * Given `this.props.children`, return an object mapping key to child.
1115
+ *
1116
+ * @param {*} children `this.props.children`
1117
+ * @return {object} Mapping of key to child
1118
+ */
1119
+
1120
+ function getChildMapping(children, mapFn) {
1121
+ var mapper = function mapper(child) {
1122
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
1123
+ };
1124
+
1125
+ var result = Object.create(null);
1126
+ if (children) Children.map(children, function (c) {
1127
+ return c;
1128
+ }).forEach(function (child) {
1129
+ // run the map function here instead so that the key is the computed one
1130
+ result[child.key] = mapper(child);
1131
+ });
1132
+ return result;
1133
+ }
1134
+ /**
1135
+ * When you're adding or removing children some may be added or removed in the
1136
+ * same render pass. We want to show *both* since we want to simultaneously
1137
+ * animate elements in and out. This function takes a previous set of keys
1138
+ * and a new set of keys and merges them with its best guess of the correct
1139
+ * ordering. In the future we may expose some of the utilities in
1140
+ * ReactMultiChild to make this easy, but for now React itself does not
1141
+ * directly have this concept of the union of prevChildren and nextChildren
1142
+ * so we implement it here.
1143
+ *
1144
+ * @param {object} prev prev children as returned from
1145
+ * `ReactTransitionChildMapping.getChildMapping()`.
1146
+ * @param {object} next next children as returned from
1147
+ * `ReactTransitionChildMapping.getChildMapping()`.
1148
+ * @return {object} a key set that contains all keys in `prev` and all keys
1149
+ * in `next` in a reasonable order.
1150
+ */
1151
+
1152
+ function mergeChildMappings(prev, next) {
1153
+ prev = prev || {};
1154
+ next = next || {};
1155
+
1156
+ function getValueForKey(key) {
1157
+ return key in next ? next[key] : prev[key];
1158
+ } // For each key of `next`, the list of keys to insert before that key in
1159
+ // the combined list
1160
+
1161
+
1162
+ var nextKeysPending = Object.create(null);
1163
+ var pendingKeys = [];
1164
+
1165
+ for (var prevKey in prev) {
1166
+ if (prevKey in next) {
1167
+ if (pendingKeys.length) {
1168
+ nextKeysPending[prevKey] = pendingKeys;
1169
+ pendingKeys = [];
1170
+ }
1171
+ } else {
1172
+ pendingKeys.push(prevKey);
1173
+ }
1174
+ }
1175
+
1176
+ var i;
1177
+ var childMapping = {};
1178
+
1179
+ for (var nextKey in next) {
1180
+ if (nextKeysPending[nextKey]) {
1181
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
1182
+ var pendingNextKey = nextKeysPending[nextKey][i];
1183
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
1184
+ }
1185
+ }
1186
+
1187
+ childMapping[nextKey] = getValueForKey(nextKey);
1188
+ } // Finally, add the keys which didn't appear before any key in `next`
1189
+
1190
+
1191
+ for (i = 0; i < pendingKeys.length; i++) {
1192
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
1193
+ }
1194
+
1195
+ return childMapping;
1196
+ }
1197
+
1198
+ function getProp(child, prop, props) {
1199
+ return props[prop] != null ? props[prop] : child.props[prop];
1200
+ }
1201
+
1202
+ function getInitialChildMapping(props, onExited) {
1203
+ return getChildMapping(props.children, function (child) {
1204
+ return cloneElement(child, {
1205
+ onExited: onExited.bind(null, child),
1206
+ in: true,
1207
+ appear: getProp(child, 'appear', props),
1208
+ enter: getProp(child, 'enter', props),
1209
+ exit: getProp(child, 'exit', props)
1210
+ });
1211
+ });
1212
+ }
1213
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
1214
+ var nextChildMapping = getChildMapping(nextProps.children);
1215
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
1216
+ Object.keys(children).forEach(function (key) {
1217
+ var child = children[key];
1218
+ if (!isValidElement(child)) return;
1219
+ var hasPrev = (key in prevChildMapping);
1220
+ var hasNext = (key in nextChildMapping);
1221
+ var prevChild = prevChildMapping[key];
1222
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
1223
+
1224
+ if (hasNext && (!hasPrev || isLeaving)) {
1225
+ // console.log('entering', key)
1226
+ children[key] = cloneElement(child, {
1227
+ onExited: onExited.bind(null, child),
1228
+ in: true,
1229
+ exit: getProp(child, 'exit', nextProps),
1230
+ enter: getProp(child, 'enter', nextProps)
1231
+ });
1232
+ } else if (!hasNext && hasPrev && !isLeaving) {
1233
+ // item is old (exiting)
1234
+ // console.log('leaving', key)
1235
+ children[key] = cloneElement(child, {
1236
+ in: false
1237
+ });
1238
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
1239
+ // item hasn't changed transition states
1240
+ // copy over the last transition props;
1241
+ // console.log('unchanged', key)
1242
+ children[key] = cloneElement(child, {
1243
+ onExited: onExited.bind(null, child),
1244
+ in: prevChild.props.in,
1245
+ exit: getProp(child, 'exit', nextProps),
1246
+ enter: getProp(child, 'enter', nextProps)
1247
+ });
1248
+ }
1249
+ });
1250
+ return children;
1251
+ }
1252
+
1253
+ var values = Object.values || function (obj) {
1254
+ return Object.keys(obj).map(function (k) {
1255
+ return obj[k];
1256
+ });
1257
+ };
1258
+
1259
+ var defaultProps = {
1260
+ component: 'div',
1261
+ childFactory: function childFactory(child) {
1262
+ return child;
1263
+ }
1264
+ };
1265
+ /**
1266
+ * The `<TransitionGroup>` component manages a set of transition components
1267
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
1268
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
1269
+ * and unmounting of components over time.
1270
+ *
1271
+ * Consider the example below. As items are removed or added to the TodoList the
1272
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
1273
+ *
1274
+ * Note that `<TransitionGroup>` does not define any animation behavior!
1275
+ * Exactly _how_ a list item animates is up to the individual transition
1276
+ * component. This means you can mix and match animations across different list
1277
+ * items.
1278
+ */
1279
+
1280
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
1281
+ _inheritsLoose(TransitionGroup, _React$Component);
1282
+
1283
+ function TransitionGroup(props, context) {
1284
+ var _this;
1285
+
1286
+ _this = _React$Component.call(this, props, context) || this;
1287
+
1288
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
1289
+
1290
+
1291
+ _this.state = {
1292
+ contextValue: {
1293
+ isMounting: true
1294
+ },
1295
+ handleExited: handleExited,
1296
+ firstRender: true
1297
+ };
1298
+ return _this;
1299
+ }
1300
+
1301
+ var _proto = TransitionGroup.prototype;
1302
+
1303
+ _proto.componentDidMount = function componentDidMount() {
1304
+ this.mounted = true;
1305
+ this.setState({
1306
+ contextValue: {
1307
+ isMounting: false
1308
+ }
1309
+ });
1310
+ };
1311
+
1312
+ _proto.componentWillUnmount = function componentWillUnmount() {
1313
+ this.mounted = false;
1314
+ };
1315
+
1316
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
1317
+ var prevChildMapping = _ref.children,
1318
+ handleExited = _ref.handleExited,
1319
+ firstRender = _ref.firstRender;
1320
+ return {
1321
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
1322
+ firstRender: false
1323
+ };
1324
+ } // node is `undefined` when user provided `nodeRef` prop
1325
+ ;
1326
+
1327
+ _proto.handleExited = function handleExited(child, node) {
1328
+ var currentChildMapping = getChildMapping(this.props.children);
1329
+ if (child.key in currentChildMapping) return;
1330
+
1331
+ if (child.props.onExited) {
1332
+ child.props.onExited(node);
1333
+ }
1334
+
1335
+ if (this.mounted) {
1336
+ this.setState(function (state) {
1337
+ var children = _extends({}, state.children);
1338
+
1339
+ delete children[child.key];
1340
+ return {
1341
+ children: children
1342
+ };
1343
+ });
1344
+ }
1345
+ };
1346
+
1347
+ _proto.render = function render() {
1348
+ var _this$props = this.props,
1349
+ Component = _this$props.component,
1350
+ childFactory = _this$props.childFactory,
1351
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
1352
+
1353
+ var contextValue = this.state.contextValue;
1354
+ var children = values(this.state.children).map(childFactory);
1355
+ delete props.appear;
1356
+ delete props.enter;
1357
+ delete props.exit;
1358
+
1359
+ if (Component === null) {
1360
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1361
+ value: contextValue
1362
+ }, children);
1363
+ }
1364
+
1365
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1366
+ value: contextValue
1367
+ }, /*#__PURE__*/React__default.createElement(Component, props, children));
1368
+ };
1369
+
1370
+ return TransitionGroup;
1371
+ }(React__default.Component);
1372
+
1373
+ TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
1374
+ /**
1375
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
1376
+ * behavior by providing a `component` prop.
1377
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
1378
+ * you can pass in `component={null}`. This is useful if the wrapping div
1379
+ * borks your css styles.
1380
+ */
1381
+ component: propTypes.exports.any,
1382
+
1383
+ /**
1384
+ * A set of `<Transition>` components, that are toggled `in` and out as they
1385
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
1386
+ * remember to spread them through if you are wrapping the `<Transition>` as
1387
+ * with our `<Fade>` example.
1388
+ *
1389
+ * While this component is meant for multiple `Transition` or `CSSTransition`
1390
+ * children, sometimes you may want to have a single transition child with
1391
+ * content that you want to be transitioned out and in when you change it
1392
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
1393
+ * the transition child as you change its content, this will cause
1394
+ * `TransitionGroup` to transition the child out and back in.
1395
+ */
1396
+ children: propTypes.exports.node,
1397
+
1398
+ /**
1399
+ * A convenience prop that enables or disables appear animations
1400
+ * for all children. Note that specifying this will override any defaults set
1401
+ * on individual children Transitions.
1402
+ */
1403
+ appear: propTypes.exports.bool,
1404
+
1405
+ /**
1406
+ * A convenience prop that enables or disables enter animations
1407
+ * for all children. Note that specifying this will override any defaults set
1408
+ * on individual children Transitions.
1409
+ */
1410
+ enter: propTypes.exports.bool,
1411
+
1412
+ /**
1413
+ * A convenience prop that enables or disables exit animations
1414
+ * for all children. Note that specifying this will override any defaults set
1415
+ * on individual children Transitions.
1416
+ */
1417
+ exit: propTypes.exports.bool,
1418
+
1419
+ /**
1420
+ * You may need to apply reactive updates to a child as it is exiting.
1421
+ * This is generally done by using `cloneElement` however in the case of an exiting
1422
+ * child the element has already been removed and not accessible to the consumer.
1423
+ *
1424
+ * If you do need to update a child as it leaves you can provide a `childFactory`
1425
+ * to wrap every child, even the ones that are leaving.
1426
+ *
1427
+ * @type Function(child: ReactElement) -> ReactElement
1428
+ */
1429
+ childFactory: propTypes.exports.func
1430
+ } : {};
1431
+ TransitionGroup.defaultProps = defaultProps;
1432
+
1433
+ /**
1434
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
1435
+ * that animates between two children.
1436
+ *
1437
+ * ```jsx
1438
+ * <ReplaceTransition in>
1439
+ * <Fade><div>I appear first</div></Fade>
1440
+ * <Fade><div>I replace the above</div></Fade>
1441
+ * </ReplaceTransition>
1442
+ * ```
1443
+ */
1444
+
1445
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
1446
+ _inheritsLoose(ReplaceTransition, _React$Component);
1447
+
1448
+ function ReplaceTransition() {
1449
+ var _this;
1450
+
1451
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
1452
+ _args[_key] = arguments[_key];
1453
+ }
1454
+
1455
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
1456
+
1457
+ _this.handleEnter = function () {
1458
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1459
+ args[_key2] = arguments[_key2];
1460
+ }
1461
+
1462
+ return _this.handleLifecycle('onEnter', 0, args);
1463
+ };
1464
+
1465
+ _this.handleEntering = function () {
1466
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1467
+ args[_key3] = arguments[_key3];
1468
+ }
1469
+
1470
+ return _this.handleLifecycle('onEntering', 0, args);
1471
+ };
1472
+
1473
+ _this.handleEntered = function () {
1474
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1475
+ args[_key4] = arguments[_key4];
1476
+ }
1477
+
1478
+ return _this.handleLifecycle('onEntered', 0, args);
1479
+ };
1480
+
1481
+ _this.handleExit = function () {
1482
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1483
+ args[_key5] = arguments[_key5];
1484
+ }
1485
+
1486
+ return _this.handleLifecycle('onExit', 1, args);
1487
+ };
1488
+
1489
+ _this.handleExiting = function () {
1490
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
1491
+ args[_key6] = arguments[_key6];
1492
+ }
1493
+
1494
+ return _this.handleLifecycle('onExiting', 1, args);
1495
+ };
1496
+
1497
+ _this.handleExited = function () {
1498
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1499
+ args[_key7] = arguments[_key7];
1500
+ }
1501
+
1502
+ return _this.handleLifecycle('onExited', 1, args);
1503
+ };
1504
+
1505
+ return _this;
1506
+ }
1507
+
1508
+ var _proto = ReplaceTransition.prototype;
1509
+
1510
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
1511
+ var _child$props;
1512
+
1513
+ var children = this.props.children;
1514
+ var child = React__default.Children.toArray(children)[idx];
1515
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
1516
+
1517
+ if (this.props[handler]) {
1518
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);
1519
+ this.props[handler](maybeNode);
1520
+ }
1521
+ };
1522
+
1523
+ _proto.render = function render() {
1524
+ var _this$props = this.props,
1525
+ children = _this$props.children,
1526
+ inProp = _this$props.in,
1527
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
1528
+
1529
+ var _React$Children$toArr = React__default.Children.toArray(children),
1530
+ first = _React$Children$toArr[0],
1531
+ second = _React$Children$toArr[1];
1532
+
1533
+ delete props.onEnter;
1534
+ delete props.onEntering;
1535
+ delete props.onEntered;
1536
+ delete props.onExit;
1537
+ delete props.onExiting;
1538
+ delete props.onExited;
1539
+ return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
1540
+ key: 'first',
1541
+ onEnter: this.handleEnter,
1542
+ onEntering: this.handleEntering,
1543
+ onEntered: this.handleEntered
1544
+ }) : React__default.cloneElement(second, {
1545
+ key: 'second',
1546
+ onEnter: this.handleExit,
1547
+ onEntering: this.handleExiting,
1548
+ onEntered: this.handleExited
1549
+ }));
1550
+ };
1551
+
1552
+ return ReplaceTransition;
1553
+ }(React__default.Component);
1554
+
1555
+ ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
1556
+ in: propTypes.exports.bool.isRequired,
1557
+ children: function children(props, propName) {
1558
+ if (React__default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
1559
+ return null;
1560
+ }
1561
+ } : {};
1562
+
1563
+ var _leaveRenders, _enterRenders;
1564
+
1565
+ function areChildrenDifferent(oldChildren, newChildren) {
1566
+ if (oldChildren === newChildren) return false;
1567
+
1568
+ if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
1569
+ return false;
1570
+ }
1571
+
1572
+ return true;
1573
+ }
1574
+ /**
1575
+ * Enum of modes for SwitchTransition component
1576
+ * @enum { string }
1577
+ */
1578
+
1579
+
1580
+ var modes = {
1581
+ out: 'out-in',
1582
+ in: 'in-out'
1583
+ };
1584
+
1585
+ var callHook = function callHook(element, name, cb) {
1586
+ return function () {
1587
+ var _element$props;
1588
+
1589
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
1590
+ cb();
1591
+ };
1592
+ };
1593
+
1594
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
1595
+ var current = _ref.current,
1596
+ changeState = _ref.changeState;
1597
+ return React__default.cloneElement(current, {
1598
+ in: false,
1599
+ onExited: callHook(current, 'onExited', function () {
1600
+ changeState(ENTERING, null);
1601
+ })
1602
+ });
1603
+ }, _leaveRenders[modes.in] = function (_ref2) {
1604
+ var current = _ref2.current,
1605
+ changeState = _ref2.changeState,
1606
+ children = _ref2.children;
1607
+ return [current, React__default.cloneElement(children, {
1608
+ in: true,
1609
+ onEntered: callHook(children, 'onEntered', function () {
1610
+ changeState(ENTERING);
1611
+ })
1612
+ })];
1613
+ }, _leaveRenders);
1614
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
1615
+ var children = _ref3.children,
1616
+ changeState = _ref3.changeState;
1617
+ return React__default.cloneElement(children, {
1618
+ in: true,
1619
+ onEntered: callHook(children, 'onEntered', function () {
1620
+ changeState(ENTERED, React__default.cloneElement(children, {
1621
+ in: true
1622
+ }));
1623
+ })
1624
+ });
1625
+ }, _enterRenders[modes.in] = function (_ref4) {
1626
+ var current = _ref4.current,
1627
+ children = _ref4.children,
1628
+ changeState = _ref4.changeState;
1629
+ return [React__default.cloneElement(current, {
1630
+ in: false,
1631
+ onExited: callHook(current, 'onExited', function () {
1632
+ changeState(ENTERED, React__default.cloneElement(children, {
1633
+ in: true
1634
+ }));
1635
+ })
1636
+ }), React__default.cloneElement(children, {
1637
+ in: true
1638
+ })];
1639
+ }, _enterRenders);
1640
+ /**
1641
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
1642
+ * You can use it when you want to control the render between state transitions.
1643
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
1644
+ *
1645
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
1646
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
1647
+ *
1648
+ * **Note**: If you want the animation to happen simultaneously
1649
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
1650
+ * you should use
1651
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
1652
+ * instead.
1653
+ *
1654
+ * ```jsx
1655
+ * function App() {
1656
+ * const [state, setState] = useState(false);
1657
+ * return (
1658
+ * <SwitchTransition>
1659
+ * <CSSTransition
1660
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
1661
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
1662
+ * classNames='fade'
1663
+ * >
1664
+ * <button onClick={() => setState(state => !state)}>
1665
+ * {state ? "Goodbye, world!" : "Hello, world!"}
1666
+ * </button>
1667
+ * </CSSTransition>
1668
+ * </SwitchTransition>
1669
+ * );
1670
+ * }
1671
+ * ```
1672
+ *
1673
+ * ```css
1674
+ * .fade-enter{
1675
+ * opacity: 0;
1676
+ * }
1677
+ * .fade-exit{
1678
+ * opacity: 1;
1679
+ * }
1680
+ * .fade-enter-active{
1681
+ * opacity: 1;
1682
+ * }
1683
+ * .fade-exit-active{
1684
+ * opacity: 0;
1685
+ * }
1686
+ * .fade-enter-active,
1687
+ * .fade-exit-active{
1688
+ * transition: opacity 500ms;
1689
+ * }
1690
+ * ```
1691
+ */
1692
+
1693
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
1694
+ _inheritsLoose(SwitchTransition, _React$Component);
1695
+
1696
+ function SwitchTransition() {
1697
+ var _this;
1698
+
1699
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1700
+ args[_key] = arguments[_key];
1701
+ }
1702
+
1703
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1704
+ _this.state = {
1705
+ status: ENTERED,
1706
+ current: null
1707
+ };
1708
+ _this.appeared = false;
1709
+
1710
+ _this.changeState = function (status, current) {
1711
+ if (current === void 0) {
1712
+ current = _this.state.current;
1713
+ }
1714
+
1715
+ _this.setState({
1716
+ status: status,
1717
+ current: current
1718
+ });
1719
+ };
1720
+
1721
+ return _this;
1722
+ }
1723
+
1724
+ var _proto = SwitchTransition.prototype;
1725
+
1726
+ _proto.componentDidMount = function componentDidMount() {
1727
+ this.appeared = true;
1728
+ };
1729
+
1730
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
1731
+ if (props.children == null) {
1732
+ return {
1733
+ current: null
1734
+ };
1735
+ }
1736
+
1737
+ if (state.status === ENTERING && props.mode === modes.in) {
1738
+ return {
1739
+ status: ENTERING
1740
+ };
1741
+ }
1742
+
1743
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
1744
+ return {
1745
+ status: EXITING
1746
+ };
1747
+ }
1748
+
1749
+ return {
1750
+ current: React__default.cloneElement(props.children, {
1751
+ in: true
1752
+ })
1753
+ };
1754
+ };
1755
+
1756
+ _proto.render = function render() {
1757
+ var _this$props = this.props,
1758
+ children = _this$props.children,
1759
+ mode = _this$props.mode,
1760
+ _this$state = this.state,
1761
+ status = _this$state.status,
1762
+ current = _this$state.current;
1763
+ var data = {
1764
+ children: children,
1765
+ current: current,
1766
+ changeState: this.changeState,
1767
+ status: status
1768
+ };
1769
+ var component;
1770
+
1771
+ switch (status) {
1772
+ case ENTERING:
1773
+ component = enterRenders[mode](data);
1774
+ break;
1775
+
1776
+ case EXITING:
1777
+ component = leaveRenders[mode](data);
1778
+ break;
1779
+
1780
+ case ENTERED:
1781
+ component = current;
1782
+ }
1783
+
1784
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1785
+ value: {
1786
+ isMounting: !this.appeared
1787
+ }
1788
+ }, component);
1789
+ };
1790
+
1791
+ return SwitchTransition;
1792
+ }(React__default.Component);
1793
+
1794
+ SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
1795
+ /**
1796
+ * Transition modes.
1797
+ * `out-in`: Current element transitions out first, then when complete, the new element transitions in.
1798
+ * `in-out`: New element transitions in first, then when complete, the current element transitions out.
1799
+ *
1800
+ * @type {'out-in'|'in-out'}
1801
+ */
1802
+ mode: propTypes.exports.oneOf([modes.in, modes.out]),
1803
+
1804
+ /**
1805
+ * Any `Transition` or `CSSTransition` component.
1806
+ */
1807
+ children: propTypes.exports.oneOfType([propTypes.exports.element.isRequired])
1808
+ } : {};
1809
+ SwitchTransition.defaultProps = {
1810
+ mode: modes.out
1811
+ };
1812
+
21
1813
  var css = ".neeto-molecules-menubar__wrapper{background-color:rgb(var(--neeto-ui-white))!important;border-right:1px solid rgb(var(--neeto-ui-gray-200));flex-shrink:0;overflow:hidden;transition:all .3s}.neeto-molecules-menubar__container{height:100vh;overflow-y:auto;padding:32px!important;width:324px}@media screen and (max-width:1024px){.neeto-molecules-menubar__container{padding:40px 24px 24px!important;width:280px}}@media screen and (max-width:768px){.neeto-molecules-menubar__container{padding:40px 20px 24px!important;width:240px}}.neeto-molecules-menubar__title{margin-bottom:16px}.neeto-molecules-menubar__search{align-items:center;display:flex;gap:4px;margin-bottom:20px}.neeto-molecules-menubar__subtitle{align-items:center;display:flex;justify-content:space-between;margin-bottom:20px;margin-top:20px}.neeto-molecules-menubar__subtitle-actions{align-items:center;display:flex;gap:4px}.neeto-molecules-menubar__add-new-wrap,.neeto-molecules-menubar__block{margin-bottom:8px;padding:7px 8px}.neeto-molecules-menubar__block{align-items:center;border:thin solid transparent;border-radius:var(--neeto-ui-rounded);cursor:pointer;display:flex;justify-content:space-between;text-align:left;transition:all .3s;width:100%}.neeto-molecules-menubar__block:active,.neeto-molecules-menubar__block:focus,.neeto-molecules-menubar__block:focus-visible,.neeto-molecules-menubar__block:hover{background-color:rgb(var(--neeto-ui-gray-200));outline:none;text-decoration:none}.neeto-molecules-menubar__block--active{background-color:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-100));box-shadow:none;position:relative}.neeto-molecules-menubar__block--active:after{background-color:rgb(var(--neeto-ui-primary-500));border-bottom-left-radius:var(--neeto-ui-rounded);border-top-left-radius:var(--neeto-ui-rounded);content:\"\";height:100%;left:-1px;position:absolute;top:0;width:3px}.neeto-molecules-menubar__block--active:active,.neeto-molecules-menubar__block--active:focus,.neeto-molecules-menubar__block--active:focus-visible,.neeto-molecules-menubar__block--active:hover{background-color:rgb(var(--neeto-ui-primary-100))}.neeto-molecules-menubar__block .neeto-molecules-menubar__block-label{align-items:center;display:flex}.neeto-molecules-menubar__block .neeto-molecules-menubar__block-icon{margin-right:4px}.neeto-molecules-menubar__item{border:thin solid transparent;border-radius:var(--neeto-ui-rounded);cursor:pointer;margin-bottom:8px;padding:12px;text-align:left;transition:all .3s;width:100%}@media screen and (max-width:1024px){.neeto-molecules-menubar__item{padding:10px}}@media screen and (max-width:768px){.neeto-molecules-menubar__item{padding:8px}}.neeto-molecules-menubar__item:active,.neeto-molecules-menubar__item:focus,.neeto-molecules-menubar__item:focus-visible,.neeto-molecules-menubar__item:hover{background-color:rgb(var(--neeto-ui-gray-200));outline:none}.neeto-molecules-menubar__item--active{background-color:rgb(var(--neeto-ui-white));border-color:rgb(var(--neeto-ui-gray-300));box-shadow:var(--neeto-ui-shadow-xs);color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-menubar__item--active:active,.neeto-molecules-menubar__item--active:focus,.neeto-molecules-menubar__item--active:focus-visible,.neeto-molecules-menubar__item--active:hover{background-color:rgb(var(--neeto-ui-white))}.neeto-molecules-menubar-enter.neeto-molecules-menubar__wrapper{width:0}.neeto-molecules-menubar-enter-active.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-enter-done.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-exit.neeto-molecules-menubar__wrapper{width:324px}.neeto-molecules-menubar-exit-active.neeto-molecules-menubar__wrapper{width:0}";
22
1814
  n(css,{});
23
1815
 
@@ -27,7 +1819,7 @@ var AddNew = function AddNew(_ref) {
27
1819
  label = _ref$label === void 0 ? "" : _ref$label,
28
1820
  onClick = _ref.onClick,
29
1821
  otherProps = _objectWithoutProperties(_ref, _excluded$5);
30
- return /*#__PURE__*/React__default.createElement("div", _extends({
1822
+ return /*#__PURE__*/React__default.createElement("div", _extends$1({
31
1823
  className: "neeto-molecules-menubar__add-new-wrap"
32
1824
  }, otherProps), /*#__PURE__*/React__default.createElement(Button, {
33
1825
  icon: Plus,
@@ -52,7 +1844,7 @@ var Block = function Block(_ref) {
52
1844
  active = _ref$active === void 0 ? false : _ref$active,
53
1845
  onEdit = _ref.onEdit,
54
1846
  _ref$onClick = _ref.onClick,
55
- onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
1847
+ onClick = _ref$onClick === void 0 ? noop$1 : _ref$onClick,
56
1848
  className = _ref.className,
57
1849
  otherProps = _objectWithoutProperties(_ref, _excluded$4);
58
1850
  var handleEdit = function handleEdit(e) {
@@ -62,7 +1854,7 @@ var Block = function Block(_ref) {
62
1854
  var Parent = url ? Link : function (props) {
63
1855
  return /*#__PURE__*/React__default.createElement("button", props);
64
1856
  };
65
- return /*#__PURE__*/React__default.createElement(Parent, _extends({
1857
+ return /*#__PURE__*/React__default.createElement(Parent, _extends$1({
66
1858
  "data-cy": otherProps["data-cy"] || "menubar-block",
67
1859
  to: url,
68
1860
  className: classnames("neeto-molecules-menubar__block", _defineProperty({
@@ -101,7 +1893,7 @@ var Item = function Item(_ref) {
101
1893
  _ref$className = _ref.className,
102
1894
  className = _ref$className === void 0 ? "" : _ref$className,
103
1895
  otherProps = _objectWithoutProperties(_ref, _excluded$3);
104
- return /*#__PURE__*/React__default.createElement("button", _extends({
1896
+ return /*#__PURE__*/React__default.createElement("button", _extends$1({
105
1897
  className: classnames("neeto-molecules-menubar__item", _defineProperty({
106
1898
  "neeto-molecules-menubar__item--active": active
107
1899
  }, className, className))
@@ -126,7 +1918,7 @@ var Search = withT(function (_ref) {
126
1918
  props = _objectWithoutProperties(_ref, _excluded$2);
127
1919
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isCollapsed && /*#__PURE__*/React__default.createElement("div", {
128
1920
  className: "neeto-molecules-menubar__search"
129
- }, /*#__PURE__*/React__default.createElement(Input, _extends({
1921
+ }, /*#__PURE__*/React__default.createElement(Input, _extends$1({
130
1922
  placeholder: t("neetoMolecules.common.actions.search"),
131
1923
  prefix: /*#__PURE__*/React__default.createElement(Search$1, null),
132
1924
  type: "search"
@@ -153,13 +1945,13 @@ var SubTitle = function SubTitle(_ref) {
153
1945
  var children = _ref.children,
154
1946
  iconProps = _ref.iconProps,
155
1947
  otherProps = _objectWithoutProperties(_ref, _excluded$1);
156
- return /*#__PURE__*/React__default.createElement("div", _extends({
1948
+ return /*#__PURE__*/React__default.createElement("div", _extends$1({
157
1949
  className: "neeto-molecules-menubar__subtitle",
158
1950
  "data-cy": otherProps["data-cy"] || "menubar-subtitle-heading"
159
1951
  }, otherProps), children, /*#__PURE__*/React__default.createElement("div", {
160
1952
  className: "neeto-molecules-menubar__subtitle-actions"
161
1953
  }, iconProps === null || iconProps === void 0 ? void 0 : iconProps.map(function (iconProp, index) {
162
- return /*#__PURE__*/React__default.createElement(Button, _extends({
1954
+ return /*#__PURE__*/React__default.createElement(Button, _extends$1({
163
1955
  key: index,
164
1956
  style: "text"
165
1957
  }, iconProp));