@bigbinary/neeto-molecules 4.1.48 → 4.1.50

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.
@@ -18,1100 +18,13 @@ var Close = require('@bigbinary/neeto-icons/Close');
18
18
  var Input = require('@bigbinary/neetoui/Input');
19
19
  var index = require('./index-JY2zVpnv.js');
20
20
  var ramda = require('ramda');
21
- var _extends = require('@babel/runtime/helpers/esm/extends');
22
- var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
23
- var _inheritsLoose = require('@babel/runtime/helpers/esm/inheritsLoose');
24
- var React = require('react');
25
- var ReactDOM = require('react-dom');
21
+ var CSSTransition = require('./CSSTransition-D_jVZ_GR.js');
26
22
  require('./_commonjsHelpers-BJu3ubxk.js');
27
-
28
- /**
29
- * Checks if a given element has a CSS class.
30
- *
31
- * @param element the element
32
- * @param className the CSS class name
33
- */
34
- function hasClass(element, className) {
35
- if (element.classList) return !!className && element.classList.contains(className);
36
- return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
37
- }
38
-
39
- /**
40
- * Adds a CSS class to a given element.
41
- *
42
- * @param element the element
43
- * @param className the CSS class name
44
- */
45
-
46
- function addClass(element, className) {
47
- 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);
48
- }
49
-
50
- function replaceClassName(origClass, classToRemove) {
51
- return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
52
- }
53
- /**
54
- * Removes a CSS class from a given element.
55
- *
56
- * @param element the element
57
- * @param className the CSS class name
58
- */
59
-
60
-
61
- function removeClass$1(element, className) {
62
- if (element.classList) {
63
- element.classList.remove(className);
64
- } else if (typeof element.className === 'string') {
65
- element.className = replaceClassName(element.className, className);
66
- } else {
67
- element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
68
- }
69
- }
70
-
71
- var config = {
72
- disabled: false
73
- };
74
-
75
- var timeoutsShape = process.env.NODE_ENV !== 'production' ? index.PropTypes.oneOfType([index.PropTypes.number, index.PropTypes.shape({
76
- enter: index.PropTypes.number,
77
- exit: index.PropTypes.number,
78
- appear: index.PropTypes.number
79
- }).isRequired]) : null;
80
- var classNamesShape = process.env.NODE_ENV !== 'production' ? index.PropTypes.oneOfType([index.PropTypes.string, index.PropTypes.shape({
81
- enter: index.PropTypes.string,
82
- exit: index.PropTypes.string,
83
- active: index.PropTypes.string
84
- }), index.PropTypes.shape({
85
- enter: index.PropTypes.string,
86
- enterDone: index.PropTypes.string,
87
- enterActive: index.PropTypes.string,
88
- exit: index.PropTypes.string,
89
- exitDone: index.PropTypes.string,
90
- exitActive: index.PropTypes.string
91
- })]) : null;
92
-
93
- var TransitionGroupContext = React.createContext(null);
94
-
95
- var forceReflow = function forceReflow(node) {
96
- return node.scrollTop;
97
- };
98
-
99
- var UNMOUNTED = 'unmounted';
100
- var EXITED = 'exited';
101
- var ENTERING = 'entering';
102
- var ENTERED = 'entered';
103
- var EXITING = 'exiting';
104
- /**
105
- * The Transition component lets you describe a transition from one component
106
- * state to another _over time_ with a simple declarative API. Most commonly
107
- * it's used to animate the mounting and unmounting of a component, but can also
108
- * be used to describe in-place transition states as well.
109
- *
110
- * ---
111
- *
112
- * **Note**: `Transition` is a platform-agnostic base component. If you're using
113
- * transitions in CSS, you'll probably want to use
114
- * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
115
- * instead. It inherits all the features of `Transition`, but contains
116
- * additional features necessary to play nice with CSS transitions (hence the
117
- * name of the component).
118
- *
119
- * ---
120
- *
121
- * By default the `Transition` component does not alter the behavior of the
122
- * component it renders, it only tracks "enter" and "exit" states for the
123
- * components. It's up to you to give meaning and effect to those states. For
124
- * example we can add styles to a component when it enters or exits:
125
- *
126
- * ```jsx
127
- * import { Transition } from 'react-transition-group';
128
- *
129
- * const duration = 300;
130
- *
131
- * const defaultStyle = {
132
- * transition: `opacity ${duration}ms ease-in-out`,
133
- * opacity: 0,
134
- * }
135
- *
136
- * const transitionStyles = {
137
- * entering: { opacity: 1 },
138
- * entered: { opacity: 1 },
139
- * exiting: { opacity: 0 },
140
- * exited: { opacity: 0 },
141
- * };
142
- *
143
- * const Fade = ({ in: inProp }) => (
144
- * <Transition in={inProp} timeout={duration}>
145
- * {state => (
146
- * <div style={{
147
- * ...defaultStyle,
148
- * ...transitionStyles[state]
149
- * }}>
150
- * I'm a fade Transition!
151
- * </div>
152
- * )}
153
- * </Transition>
154
- * );
155
- * ```
156
- *
157
- * There are 4 main states a Transition can be in:
158
- * - `'entering'`
159
- * - `'entered'`
160
- * - `'exiting'`
161
- * - `'exited'`
162
- *
163
- * Transition state is toggled via the `in` prop. When `true` the component
164
- * begins the "Enter" stage. During this stage, the component will shift from
165
- * its current transition state, to `'entering'` for the duration of the
166
- * transition and then to the `'entered'` stage once it's complete. Let's take
167
- * the following example (we'll use the
168
- * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
169
- *
170
- * ```jsx
171
- * function App() {
172
- * const [inProp, setInProp] = useState(false);
173
- * return (
174
- * <div>
175
- * <Transition in={inProp} timeout={500}>
176
- * {state => (
177
- * // ...
178
- * )}
179
- * </Transition>
180
- * <button onClick={() => setInProp(true)}>
181
- * Click to Enter
182
- * </button>
183
- * </div>
184
- * );
185
- * }
186
- * ```
187
- *
188
- * When the button is clicked the component will shift to the `'entering'` state
189
- * and stay there for 500ms (the value of `timeout`) before it finally switches
190
- * to `'entered'`.
191
- *
192
- * When `in` is `false` the same thing happens except the state moves from
193
- * `'exiting'` to `'exited'`.
194
- */
195
-
196
- var Transition = /*#__PURE__*/function (_React$Component) {
197
- _inheritsLoose(Transition, _React$Component);
198
-
199
- function Transition(props, context) {
200
- var _this;
201
-
202
- _this = _React$Component.call(this, props, context) || this;
203
- var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
204
-
205
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
206
- var initialStatus;
207
- _this.appearStatus = null;
208
-
209
- if (props.in) {
210
- if (appear) {
211
- initialStatus = EXITED;
212
- _this.appearStatus = ENTERING;
213
- } else {
214
- initialStatus = ENTERED;
215
- }
216
- } else {
217
- if (props.unmountOnExit || props.mountOnEnter) {
218
- initialStatus = UNMOUNTED;
219
- } else {
220
- initialStatus = EXITED;
221
- }
222
- }
223
-
224
- _this.state = {
225
- status: initialStatus
226
- };
227
- _this.nextCallback = null;
228
- return _this;
229
- }
230
-
231
- Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
232
- var nextIn = _ref.in;
233
-
234
- if (nextIn && prevState.status === UNMOUNTED) {
235
- return {
236
- status: EXITED
237
- };
238
- }
239
-
240
- return null;
241
- } // getSnapshotBeforeUpdate(prevProps) {
242
- // let nextStatus = null
243
- // if (prevProps !== this.props) {
244
- // const { status } = this.state
245
- // if (this.props.in) {
246
- // if (status !== ENTERING && status !== ENTERED) {
247
- // nextStatus = ENTERING
248
- // }
249
- // } else {
250
- // if (status === ENTERING || status === ENTERED) {
251
- // nextStatus = EXITING
252
- // }
253
- // }
254
- // }
255
- // return { nextStatus }
256
- // }
257
- ;
258
-
259
- var _proto = Transition.prototype;
260
-
261
- _proto.componentDidMount = function componentDidMount() {
262
- this.updateStatus(true, this.appearStatus);
263
- };
264
-
265
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
266
- var nextStatus = null;
267
-
268
- if (prevProps !== this.props) {
269
- var status = this.state.status;
270
-
271
- if (this.props.in) {
272
- if (status !== ENTERING && status !== ENTERED) {
273
- nextStatus = ENTERING;
274
- }
275
- } else {
276
- if (status === ENTERING || status === ENTERED) {
277
- nextStatus = EXITING;
278
- }
279
- }
280
- }
281
-
282
- this.updateStatus(false, nextStatus);
283
- };
284
-
285
- _proto.componentWillUnmount = function componentWillUnmount() {
286
- this.cancelNextCallback();
287
- };
288
-
289
- _proto.getTimeouts = function getTimeouts() {
290
- var timeout = this.props.timeout;
291
- var exit, enter, appear;
292
- exit = enter = appear = timeout;
293
-
294
- if (timeout != null && typeof timeout !== 'number') {
295
- exit = timeout.exit;
296
- enter = timeout.enter; // TODO: remove fallback for next major
297
-
298
- appear = timeout.appear !== undefined ? timeout.appear : enter;
299
- }
300
-
301
- return {
302
- exit: exit,
303
- enter: enter,
304
- appear: appear
305
- };
306
- };
307
-
308
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
309
- if (mounting === void 0) {
310
- mounting = false;
311
- }
312
-
313
- if (nextStatus !== null) {
314
- // nextStatus will always be ENTERING or EXITING.
315
- this.cancelNextCallback();
316
-
317
- if (nextStatus === ENTERING) {
318
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
319
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
320
- // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
321
- // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
322
-
323
- if (node) forceReflow(node);
324
- }
325
-
326
- this.performEnter(mounting);
327
- } else {
328
- this.performExit();
329
- }
330
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
331
- this.setState({
332
- status: UNMOUNTED
333
- });
334
- }
335
- };
336
-
337
- _proto.performEnter = function performEnter(mounting) {
338
- var _this2 = this;
339
-
340
- var enter = this.props.enter;
341
- var appearing = this.context ? this.context.isMounting : mounting;
342
-
343
- var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],
344
- maybeNode = _ref2[0],
345
- maybeAppearing = _ref2[1];
346
-
347
- var timeouts = this.getTimeouts();
348
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
349
- // if we are mounting and running this it means appear _must_ be set
350
-
351
- if (!mounting && !enter || config.disabled) {
352
- this.safeSetState({
353
- status: ENTERED
354
- }, function () {
355
- _this2.props.onEntered(maybeNode);
356
- });
357
- return;
358
- }
359
-
360
- this.props.onEnter(maybeNode, maybeAppearing);
361
- this.safeSetState({
362
- status: ENTERING
363
- }, function () {
364
- _this2.props.onEntering(maybeNode, maybeAppearing);
365
-
366
- _this2.onTransitionEnd(enterTimeout, function () {
367
- _this2.safeSetState({
368
- status: ENTERED
369
- }, function () {
370
- _this2.props.onEntered(maybeNode, maybeAppearing);
371
- });
372
- });
373
- });
374
- };
375
-
376
- _proto.performExit = function performExit() {
377
- var _this3 = this;
378
-
379
- var exit = this.props.exit;
380
- var timeouts = this.getTimeouts();
381
- var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED
382
-
383
- if (!exit || config.disabled) {
384
- this.safeSetState({
385
- status: EXITED
386
- }, function () {
387
- _this3.props.onExited(maybeNode);
388
- });
389
- return;
390
- }
391
-
392
- this.props.onExit(maybeNode);
393
- this.safeSetState({
394
- status: EXITING
395
- }, function () {
396
- _this3.props.onExiting(maybeNode);
397
-
398
- _this3.onTransitionEnd(timeouts.exit, function () {
399
- _this3.safeSetState({
400
- status: EXITED
401
- }, function () {
402
- _this3.props.onExited(maybeNode);
403
- });
404
- });
405
- });
406
- };
407
-
408
- _proto.cancelNextCallback = function cancelNextCallback() {
409
- if (this.nextCallback !== null) {
410
- this.nextCallback.cancel();
411
- this.nextCallback = null;
412
- }
413
- };
414
-
415
- _proto.safeSetState = function safeSetState(nextState, callback) {
416
- // This shouldn't be necessary, but there are weird race conditions with
417
- // setState callbacks and unmounting in testing, so always make sure that
418
- // we can cancel any pending setState callbacks after we unmount.
419
- callback = this.setNextCallback(callback);
420
- this.setState(nextState, callback);
421
- };
422
-
423
- _proto.setNextCallback = function setNextCallback(callback) {
424
- var _this4 = this;
425
-
426
- var active = true;
427
-
428
- this.nextCallback = function (event) {
429
- if (active) {
430
- active = false;
431
- _this4.nextCallback = null;
432
- callback(event);
433
- }
434
- };
435
-
436
- this.nextCallback.cancel = function () {
437
- active = false;
438
- };
439
-
440
- return this.nextCallback;
441
- };
442
-
443
- _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
444
- this.setNextCallback(handler);
445
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
446
- var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
447
-
448
- if (!node || doesNotHaveTimeoutOrListener) {
449
- setTimeout(this.nextCallback, 0);
450
- return;
451
- }
452
-
453
- if (this.props.addEndListener) {
454
- var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
455
- maybeNode = _ref3[0],
456
- maybeNextCallback = _ref3[1];
457
-
458
- this.props.addEndListener(maybeNode, maybeNextCallback);
459
- }
460
-
461
- if (timeout != null) {
462
- setTimeout(this.nextCallback, timeout);
463
- }
464
- };
465
-
466
- _proto.render = function render() {
467
- var status = this.state.status;
468
-
469
- if (status === UNMOUNTED) {
470
- return null;
471
- }
472
-
473
- var _this$props = this.props,
474
- children = _this$props.children;
475
- _this$props.in;
476
- _this$props.mountOnEnter;
477
- _this$props.unmountOnExit;
478
- _this$props.appear;
479
- _this$props.enter;
480
- _this$props.exit;
481
- _this$props.timeout;
482
- _this$props.addEndListener;
483
- _this$props.onEnter;
484
- _this$props.onEntering;
485
- _this$props.onEntered;
486
- _this$props.onExit;
487
- _this$props.onExiting;
488
- _this$props.onExited;
489
- _this$props.nodeRef;
490
- var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
491
-
492
- return (
493
- /*#__PURE__*/
494
- // allows for nested Transitions
495
- React.createElement(TransitionGroupContext.Provider, {
496
- value: null
497
- }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))
498
- );
499
- };
500
-
501
- return Transition;
502
- }(React.Component);
503
-
504
- Transition.contextType = TransitionGroupContext;
505
- Transition.propTypes = process.env.NODE_ENV !== "production" ? {
506
- /**
507
- * A React reference to DOM element that need to transition:
508
- * https://stackoverflow.com/a/51127130/4671932
509
- *
510
- * - When `nodeRef` prop is used, `node` is not passed to callback functions
511
- * (e.g. `onEnter`) because user already has direct access to the node.
512
- * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
513
- * `nodeRef` need to be provided to `Transition` with changed `key` prop
514
- * (see
515
- * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
516
- */
517
- nodeRef: index.PropTypes.shape({
518
- current: typeof Element === 'undefined' ? index.PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {
519
- var value = propValue[key];
520
- return index.PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
521
- }
522
- }),
523
-
524
- /**
525
- * A `function` child can be used instead of a React element. This function is
526
- * called with the current transition status (`'entering'`, `'entered'`,
527
- * `'exiting'`, `'exited'`), which can be used to apply context
528
- * specific props to a component.
529
- *
530
- * ```jsx
531
- * <Transition in={this.state.in} timeout={150}>
532
- * {state => (
533
- * <MyComponent className={`fade fade-${state}`} />
534
- * )}
535
- * </Transition>
536
- * ```
537
- */
538
- children: index.PropTypes.oneOfType([index.PropTypes.func.isRequired, index.PropTypes.element.isRequired]).isRequired,
539
-
540
- /**
541
- * Show the component; triggers the enter or exit states
542
- */
543
- in: index.PropTypes.bool,
544
-
545
- /**
546
- * By default the child component is mounted immediately along with
547
- * the parent `Transition` component. If you want to "lazy mount" the component on the
548
- * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
549
- * mounted, even on "exited", unless you also specify `unmountOnExit`.
550
- */
551
- mountOnEnter: index.PropTypes.bool,
552
-
553
- /**
554
- * By default the child component stays mounted after it reaches the `'exited'` state.
555
- * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
556
- */
557
- unmountOnExit: index.PropTypes.bool,
558
-
559
- /**
560
- * By default the child component does not perform the enter transition when
561
- * it first mounts, regardless of the value of `in`. If you want this
562
- * behavior, set both `appear` and `in` to `true`.
563
- *
564
- * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
565
- * > only adds an additional enter transition. However, in the
566
- * > `<CSSTransition>` component that first enter transition does result in
567
- * > additional `.appear-*` classes, that way you can choose to style it
568
- * > differently.
569
- */
570
- appear: index.PropTypes.bool,
571
-
572
- /**
573
- * Enable or disable enter transitions.
574
- */
575
- enter: index.PropTypes.bool,
576
-
577
- /**
578
- * Enable or disable exit transitions.
579
- */
580
- exit: index.PropTypes.bool,
581
-
582
- /**
583
- * The duration of the transition, in milliseconds.
584
- * Required unless `addEndListener` is provided.
585
- *
586
- * You may specify a single timeout for all transitions:
587
- *
588
- * ```jsx
589
- * timeout={500}
590
- * ```
591
- *
592
- * or individually:
593
- *
594
- * ```jsx
595
- * timeout={{
596
- * appear: 500,
597
- * enter: 300,
598
- * exit: 500,
599
- * }}
600
- * ```
601
- *
602
- * - `appear` defaults to the value of `enter`
603
- * - `enter` defaults to `0`
604
- * - `exit` defaults to `0`
605
- *
606
- * @type {number | { enter?: number, exit?: number, appear?: number }}
607
- */
608
- timeout: function timeout(props) {
609
- var pt = timeoutsShape;
610
- if (!props.addEndListener) pt = pt.isRequired;
611
-
612
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
613
- args[_key - 1] = arguments[_key];
614
- }
615
-
616
- return pt.apply(void 0, [props].concat(args));
617
- },
618
-
619
- /**
620
- * Add a custom transition end trigger. Called with the transitioning
621
- * DOM node and a `done` callback. Allows for more fine grained transition end
622
- * logic. Timeouts are still used as a fallback if provided.
623
- *
624
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
625
- *
626
- * ```jsx
627
- * addEndListener={(node, done) => {
628
- * // use the css transitionend event to mark the finish of a transition
629
- * node.addEventListener('transitionend', done, false);
630
- * }}
631
- * ```
632
- */
633
- addEndListener: index.PropTypes.func,
634
-
635
- /**
636
- * Callback fired before the "entering" status is applied. An extra parameter
637
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
638
- *
639
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
640
- *
641
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
642
- */
643
- onEnter: index.PropTypes.func,
644
-
645
- /**
646
- * Callback fired after the "entering" status is applied. An extra parameter
647
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
648
- *
649
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
650
- *
651
- * @type Function(node: HtmlElement, isAppearing: bool)
652
- */
653
- onEntering: index.PropTypes.func,
654
-
655
- /**
656
- * Callback fired after the "entered" status is applied. An extra parameter
657
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
658
- *
659
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
660
- *
661
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
662
- */
663
- onEntered: index.PropTypes.func,
664
-
665
- /**
666
- * Callback fired before the "exiting" status is applied.
667
- *
668
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
669
- *
670
- * @type Function(node: HtmlElement) -> void
671
- */
672
- onExit: index.PropTypes.func,
673
-
674
- /**
675
- * Callback fired after the "exiting" status is applied.
676
- *
677
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
678
- *
679
- * @type Function(node: HtmlElement) -> void
680
- */
681
- onExiting: index.PropTypes.func,
682
-
683
- /**
684
- * Callback fired after the "exited" status is applied.
685
- *
686
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
687
- *
688
- * @type Function(node: HtmlElement) -> void
689
- */
690
- onExited: index.PropTypes.func
691
- } : {}; // Name the function so it is clearer in the documentation
692
-
693
- function noop() {}
694
-
695
- Transition.defaultProps = {
696
- in: false,
697
- mountOnEnter: false,
698
- unmountOnExit: false,
699
- appear: false,
700
- enter: true,
701
- exit: true,
702
- onEnter: noop,
703
- onEntering: noop,
704
- onEntered: noop,
705
- onExit: noop,
706
- onExiting: noop,
707
- onExited: noop
708
- };
709
- Transition.UNMOUNTED = UNMOUNTED;
710
- Transition.EXITED = EXITED;
711
- Transition.ENTERING = ENTERING;
712
- Transition.ENTERED = ENTERED;
713
- Transition.EXITING = EXITING;
714
-
715
- var _addClass = function addClass$1(node, classes) {
716
- return node && classes && classes.split(' ').forEach(function (c) {
717
- return addClass(node, c);
718
- });
719
- };
720
-
721
- var removeClass = function removeClass(node, classes) {
722
- return node && classes && classes.split(' ').forEach(function (c) {
723
- return removeClass$1(node, c);
724
- });
725
- };
726
- /**
727
- * A transition component inspired by the excellent
728
- * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
729
- * use it if you're using CSS transitions or animations. It's built upon the
730
- * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
731
- * component, so it inherits all of its props.
732
- *
733
- * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
734
- * and `exit` states of the transition. The first class is applied and then a
735
- * second `*-active` class in order to activate the CSS transition. After the
736
- * transition, matching `*-done` class names are applied to persist the
737
- * transition state.
738
- *
739
- * ```jsx
740
- * function App() {
741
- * const [inProp, setInProp] = useState(false);
742
- * return (
743
- * <div>
744
- * <CSSTransition in={inProp} timeout={200} classNames="my-node">
745
- * <div>
746
- * {"I'll receive my-node-* classes"}
747
- * </div>
748
- * </CSSTransition>
749
- * <button type="button" onClick={() => setInProp(true)}>
750
- * Click to Enter
751
- * </button>
752
- * </div>
753
- * );
754
- * }
755
- * ```
756
- *
757
- * When the `in` prop is set to `true`, the child component will first receive
758
- * the class `example-enter`, then the `example-enter-active` will be added in
759
- * the next tick. `CSSTransition` [forces a
760
- * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
761
- * between before adding the `example-enter-active`. This is an important trick
762
- * because it allows us to transition between `example-enter` and
763
- * `example-enter-active` even though they were added immediately one after
764
- * another. Most notably, this is what makes it possible for us to animate
765
- * _appearance_.
766
- *
767
- * ```css
768
- * .my-node-enter {
769
- * opacity: 0;
770
- * }
771
- * .my-node-enter-active {
772
- * opacity: 1;
773
- * transition: opacity 200ms;
774
- * }
775
- * .my-node-exit {
776
- * opacity: 1;
777
- * }
778
- * .my-node-exit-active {
779
- * opacity: 0;
780
- * transition: opacity 200ms;
781
- * }
782
- * ```
783
- *
784
- * `*-active` classes represent which styles you want to animate **to**, so it's
785
- * important to add `transition` declaration only to them, otherwise transitions
786
- * might not behave as intended! This might not be obvious when the transitions
787
- * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
788
- * the example above (minus `transition`), but it becomes apparent in more
789
- * complex transitions.
790
- *
791
- * **Note**: If you're using the
792
- * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
793
- * prop, make sure to define styles for `.appear-*` classes as well.
794
- */
795
-
796
-
797
- var CSSTransition = /*#__PURE__*/function (_React$Component) {
798
- _inheritsLoose(CSSTransition, _React$Component);
799
-
800
- function CSSTransition() {
801
- var _this;
802
-
803
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
804
- args[_key] = arguments[_key];
805
- }
806
-
807
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
808
- _this.appliedClasses = {
809
- appear: {},
810
- enter: {},
811
- exit: {}
812
- };
813
-
814
- _this.onEnter = function (maybeNode, maybeAppearing) {
815
- var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
816
- node = _this$resolveArgument[0],
817
- appearing = _this$resolveArgument[1];
818
-
819
- _this.removeClasses(node, 'exit');
820
-
821
- _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
822
-
823
- if (_this.props.onEnter) {
824
- _this.props.onEnter(maybeNode, maybeAppearing);
825
- }
826
- };
827
-
828
- _this.onEntering = function (maybeNode, maybeAppearing) {
829
- var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
830
- node = _this$resolveArgument2[0],
831
- appearing = _this$resolveArgument2[1];
832
-
833
- var type = appearing ? 'appear' : 'enter';
834
-
835
- _this.addClass(node, type, 'active');
836
-
837
- if (_this.props.onEntering) {
838
- _this.props.onEntering(maybeNode, maybeAppearing);
839
- }
840
- };
841
-
842
- _this.onEntered = function (maybeNode, maybeAppearing) {
843
- var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
844
- node = _this$resolveArgument3[0],
845
- appearing = _this$resolveArgument3[1];
846
-
847
- var type = appearing ? 'appear' : 'enter';
848
-
849
- _this.removeClasses(node, type);
850
-
851
- _this.addClass(node, type, 'done');
852
-
853
- if (_this.props.onEntered) {
854
- _this.props.onEntered(maybeNode, maybeAppearing);
855
- }
856
- };
857
-
858
- _this.onExit = function (maybeNode) {
859
- var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
860
- node = _this$resolveArgument4[0];
861
-
862
- _this.removeClasses(node, 'appear');
863
-
864
- _this.removeClasses(node, 'enter');
865
-
866
- _this.addClass(node, 'exit', 'base');
867
-
868
- if (_this.props.onExit) {
869
- _this.props.onExit(maybeNode);
870
- }
871
- };
872
-
873
- _this.onExiting = function (maybeNode) {
874
- var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
875
- node = _this$resolveArgument5[0];
876
-
877
- _this.addClass(node, 'exit', 'active');
878
-
879
- if (_this.props.onExiting) {
880
- _this.props.onExiting(maybeNode);
881
- }
882
- };
883
-
884
- _this.onExited = function (maybeNode) {
885
- var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
886
- node = _this$resolveArgument6[0];
887
-
888
- _this.removeClasses(node, 'exit');
889
-
890
- _this.addClass(node, 'exit', 'done');
891
-
892
- if (_this.props.onExited) {
893
- _this.props.onExited(maybeNode);
894
- }
895
- };
896
-
897
- _this.resolveArguments = function (maybeNode, maybeAppearing) {
898
- return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
899
- : [maybeNode, maybeAppearing];
900
- };
901
-
902
- _this.getClassNames = function (type) {
903
- var classNames = _this.props.classNames;
904
- var isStringClassNames = typeof classNames === 'string';
905
- var prefix = isStringClassNames && classNames ? classNames + "-" : '';
906
- var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
907
- var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
908
- var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
909
- return {
910
- baseClassName: baseClassName,
911
- activeClassName: activeClassName,
912
- doneClassName: doneClassName
913
- };
914
- };
915
-
916
- return _this;
917
- }
918
-
919
- var _proto = CSSTransition.prototype;
920
-
921
- _proto.addClass = function addClass(node, type, phase) {
922
- var className = this.getClassNames(type)[phase + "ClassName"];
923
-
924
- var _this$getClassNames = this.getClassNames('enter'),
925
- doneClassName = _this$getClassNames.doneClassName;
926
-
927
- if (type === 'appear' && phase === 'done' && doneClassName) {
928
- className += " " + doneClassName;
929
- } // This is to force a repaint,
930
- // which is necessary in order to transition styles when adding a class name.
931
-
932
-
933
- if (phase === 'active') {
934
- if (node) forceReflow(node);
935
- }
936
-
937
- if (className) {
938
- this.appliedClasses[type][phase] = className;
939
-
940
- _addClass(node, className);
941
- }
942
- };
943
-
944
- _proto.removeClasses = function removeClasses(node, type) {
945
- var _this$appliedClasses$ = this.appliedClasses[type],
946
- baseClassName = _this$appliedClasses$.base,
947
- activeClassName = _this$appliedClasses$.active,
948
- doneClassName = _this$appliedClasses$.done;
949
- this.appliedClasses[type] = {};
950
-
951
- if (baseClassName) {
952
- removeClass(node, baseClassName);
953
- }
954
-
955
- if (activeClassName) {
956
- removeClass(node, activeClassName);
957
- }
958
-
959
- if (doneClassName) {
960
- removeClass(node, doneClassName);
961
- }
962
- };
963
-
964
- _proto.render = function render() {
965
- var _this$props = this.props;
966
- _this$props.classNames;
967
- var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
968
-
969
- return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {
970
- onEnter: this.onEnter,
971
- onEntered: this.onEntered,
972
- onEntering: this.onEntering,
973
- onExit: this.onExit,
974
- onExiting: this.onExiting,
975
- onExited: this.onExited
976
- }));
977
- };
978
-
979
- return CSSTransition;
980
- }(React.Component);
981
-
982
- CSSTransition.defaultProps = {
983
- classNames: ''
984
- };
985
- CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
986
- /**
987
- * The animation classNames applied to the component as it appears, enters,
988
- * exits or has finished the transition. A single name can be provided, which
989
- * will be suffixed for each stage, e.g. `classNames="fade"` applies:
990
- *
991
- * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
992
- * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
993
- * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
994
- *
995
- * A few details to note about how these classes are applied:
996
- *
997
- * 1. They are _joined_ with the ones that are already defined on the child
998
- * component, so if you want to add some base styles, you can use
999
- * `className` without worrying that it will be overridden.
1000
- *
1001
- * 2. If the transition component mounts with `in={false}`, no classes are
1002
- * applied yet. You might be expecting `*-exit-done`, but if you think
1003
- * about it, a component cannot finish exiting if it hasn't entered yet.
1004
- *
1005
- * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
1006
- * allows you to define different behavior for when appearing is done and
1007
- * when regular entering is done, using selectors like
1008
- * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
1009
- * an epic entrance animation when element first appears in the DOM using
1010
- * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
1011
- * simply use `fade-enter-done` for defining both cases.
1012
- *
1013
- * Each individual classNames can also be specified independently like:
1014
- *
1015
- * ```js
1016
- * classNames={{
1017
- * appear: 'my-appear',
1018
- * appearActive: 'my-active-appear',
1019
- * appearDone: 'my-done-appear',
1020
- * enter: 'my-enter',
1021
- * enterActive: 'my-active-enter',
1022
- * enterDone: 'my-done-enter',
1023
- * exit: 'my-exit',
1024
- * exitActive: 'my-active-exit',
1025
- * exitDone: 'my-done-exit',
1026
- * }}
1027
- * ```
1028
- *
1029
- * If you want to set these classes using CSS Modules:
1030
- *
1031
- * ```js
1032
- * import styles from './styles.css';
1033
- * ```
1034
- *
1035
- * you might want to use camelCase in your CSS file, that way could simply
1036
- * spread them instead of listing them one by one:
1037
- *
1038
- * ```js
1039
- * classNames={{ ...styles }}
1040
- * ```
1041
- *
1042
- * @type {string | {
1043
- * appear?: string,
1044
- * appearActive?: string,
1045
- * appearDone?: string,
1046
- * enter?: string,
1047
- * enterActive?: string,
1048
- * enterDone?: string,
1049
- * exit?: string,
1050
- * exitActive?: string,
1051
- * exitDone?: string,
1052
- * }}
1053
- */
1054
- classNames: classNamesShape,
1055
-
1056
- /**
1057
- * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
1058
- * applied.
1059
- *
1060
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1061
- *
1062
- * @type Function(node: HtmlElement, isAppearing: bool)
1063
- */
1064
- onEnter: index.PropTypes.func,
1065
-
1066
- /**
1067
- * A `<Transition>` callback fired immediately after the 'enter-active' or
1068
- * 'appear-active' class is applied.
1069
- *
1070
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1071
- *
1072
- * @type Function(node: HtmlElement, isAppearing: bool)
1073
- */
1074
- onEntering: index.PropTypes.func,
1075
-
1076
- /**
1077
- * A `<Transition>` callback fired immediately after the 'enter' or
1078
- * 'appear' classes are **removed** and the `done` class is added to the DOM node.
1079
- *
1080
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1081
- *
1082
- * @type Function(node: HtmlElement, isAppearing: bool)
1083
- */
1084
- onEntered: index.PropTypes.func,
1085
-
1086
- /**
1087
- * A `<Transition>` callback fired immediately after the 'exit' class is
1088
- * applied.
1089
- *
1090
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
1091
- *
1092
- * @type Function(node: HtmlElement)
1093
- */
1094
- onExit: index.PropTypes.func,
1095
-
1096
- /**
1097
- * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
1098
- *
1099
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
1100
- *
1101
- * @type Function(node: HtmlElement)
1102
- */
1103
- onExiting: index.PropTypes.func,
1104
-
1105
- /**
1106
- * A `<Transition>` callback fired immediately after the 'exit' classes
1107
- * are **removed** and the `exit-done` class is added to the DOM node.
1108
- *
1109
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
1110
- *
1111
- * @type Function(node: HtmlElement)
1112
- */
1113
- onExited: index.PropTypes.func
1114
- }) : {};
23
+ require('@babel/runtime/helpers/esm/extends');
24
+ require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
25
+ require('@babel/runtime/helpers/esm/inheritsLoose');
26
+ require('react');
27
+ require('react-dom');
1115
28
 
1116
29
  var css = ".neeto-molecules-menubar__wrapper{background-color:rgb(var(--neeto-ui-white))!important;border-inline-end:1px solid rgb(var(--neeto-ui-gray-200));flex-shrink:0;overflow:hidden;transition:all .3s}@media (prefers-reduced-motion:reduce){.neeto-molecules-menubar__wrapper{transition:none}}.neeto-molecules-menubar__container{height:100vh;height:100dvh;overflow-y:auto;padding:2rem!important;width:20.25rem}@media screen and (max-width:1024px){.neeto-molecules-menubar__container{padding:2.5rem 1.5rem 1.5rem!important;width:17.5rem}}@media screen and (max-width:768px){.neeto-molecules-menubar__container{padding:2.5rem 1.25rem 1.5rem!important;width:15rem}}.neeto-molecules-menubar__title{margin-bottom:1rem}.neeto-molecules-menubar__search{align-items:center;display:flex;gap:.25rem;margin-bottom:1.25rem}.neeto-molecules-menubar__subtitle{align-items:center;display:flex;justify-content:space-between;margin-bottom:1.25rem;margin-top:1.25rem}.neeto-molecules-menubar__subtitle-actions{align-items:center;display:flex;gap:.25rem}.neeto-molecules-menubar__add-new-wrap,.neeto-molecules-menubar__block{margin-bottom:.5rem;padding:.4375rem .5rem}.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:start;transition:all .3s;width:100%}@media (prefers-reduced-motion:reduce){.neeto-molecules-menubar__block{transition:none}}.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-end-start-radius:var(--neeto-ui-rounded);border-start-start-radius:var(--neeto-ui-rounded);content:\"\";height:100%;inset-inline-start:-1px;position:absolute;top:0;width:.1875rem}.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-inline-end:.25rem}.neeto-molecules-menubar__item{border:thin solid transparent;border-radius:var(--neeto-ui-rounded);cursor:pointer;margin-bottom:.5rem;padding:.75rem;text-align:start;transition:all .3s;width:100%}@media (prefers-reduced-motion:reduce){.neeto-molecules-menubar__item{transition:none}}@media screen and (max-width:1024px){.neeto-molecules-menubar__item{padding:.625rem}}@media screen and (max-width:768px){.neeto-molecules-menubar__item{padding:.5rem}}.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:20.25rem}.neeto-molecules-menubar-exit-active.neeto-molecules-menubar__wrapper{width:0}@media (prefers-reduced-motion:reduce){.neeto-molecules-menubar-enter-active.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-enter-done.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-enter.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-exit-active.neeto-molecules-menubar__wrapper,.neeto-molecules-menubar-exit.neeto-molecules-menubar__wrapper{transition:none}}";
1117
30
  injectCss.n(css,{});
@@ -1298,7 +211,7 @@ var MenuBar = function MenuBar(_ref) {
1298
211
  className = _ref$className === void 0 ? "" : _ref$className,
1299
212
  otherProps = _objectWithoutProperties(_ref, _excluded);
1300
213
  var prefersReducedMotion = reactUtils.usePrefersReducedMotion();
1301
- return /*#__PURE__*/jsxRuntime.jsx(CSSTransition, {
214
+ return /*#__PURE__*/jsxRuntime.jsx(CSSTransition.CSSTransition, {
1302
215
  unmountOnExit: true,
1303
216
  classNames: "neeto-molecules-menubar",
1304
217
  "in": showMenu,