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