@doist/reactist 23.0.1-beta → 23.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/reactist.cjs.development.js +185 -142
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/box/box.module.css.js +1 -1
- package/es/checkbox-field/checkbox-field.js +1 -1
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/heading/heading.js.map +1 -1
- package/es/heading/heading.module.css.js +1 -1
- package/es/hooks/use-previous/use-previous.js +26 -0
- package/es/hooks/use-previous/use-previous.js.map +1 -0
- package/es/menu/menu.js +38 -35
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +4 -3
- package/es/modal/modal.js.map +1 -1
- package/es/prose/prose.module.css.js +1 -1
- package/es/tabs/tabs.js +47 -40
- package/es/tabs/tabs.js.map +1 -1
- package/es/toast/use-toasts.js +1 -1
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +62 -23
- package/es/tooltip/tooltip.js.map +1 -1
- package/lib/box/box.module.css.js +1 -1
- package/lib/checkbox-field/checkbox-field.js +1 -1
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/heading/heading.d.ts +4 -4
- package/lib/heading/heading.js.map +1 -1
- package/lib/heading/heading.module.css.js +1 -1
- package/lib/hooks/use-previous/use-previous.js +2 -0
- package/lib/hooks/use-previous/use-previous.js.map +1 -0
- package/lib/menu/menu.d.ts +4 -4
- package/lib/menu/menu.js +1 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/modal.d.ts +2 -1
- package/lib/modal/modal.js +1 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/prose/prose.module.css.js +1 -1
- package/lib/tabs/tabs.d.ts +8 -10
- package/lib/tabs/tabs.js +1 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/toast/use-toasts.js +1 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/tooltip.d.ts +4 -2
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/utils/test-helpers.d.ts +2 -13
- package/package.json +4 -2
- package/styles/alert.css +1 -1
- package/styles/avatar.css +1 -1
- package/styles/badge.css +1 -1
- package/styles/banner.css +1 -1
- package/styles/base-button.css +1 -1
- package/styles/base-field.css +1 -1
- package/styles/box.css +1 -1
- package/styles/box.module.css.css +1 -1
- package/styles/checkbox-field.css +1 -1
- package/styles/color-picker.css +1 -1
- package/styles/columns.css +1 -1
- package/styles/deprecated-button.css +1 -1
- package/styles/divider.css +1 -1
- package/styles/dropdown.css +1 -1
- package/styles/heading.css +2 -2
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +1 -1
- package/styles/hidden.css +1 -1
- package/styles/loading.css +1 -1
- package/styles/modal.css +1 -1
- package/styles/notice.css +1 -1
- package/styles/password-field.css +1 -1
- package/styles/progress-bar.css +1 -1
- package/styles/prose.css +2 -2
- package/styles/prose.module.css.css +1 -1
- package/styles/reactist.css +4 -4
- package/styles/select-field.css +1 -1
- package/styles/static-toast.css +1 -1
- package/styles/switch-field.css +1 -1
- package/styles/tabs.css +1 -1
- package/styles/text-area.css +1 -1
- package/styles/text-field.css +1 -1
- package/styles/text-link.css +1 -1
- package/styles/text.css +1 -1
- package/styles/time.css +1 -1
- package/styles/tooltip.css +1 -1
- package/styles/use-toasts.css +1 -1
- package/es/checkbox-field/use-fork-ref.js +0 -35
- package/es/checkbox-field/use-fork-ref.js.map +0 -1
- package/lib/checkbox-field/use-fork-ref.d.ts +0 -11
- package/lib/checkbox-field/use-fork-ref.js +0 -2
- package/lib/checkbox-field/use-fork-ref.js.map +0 -1
|
@@ -8,10 +8,15 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var classNames = _interopDefault(require('classnames'));
|
|
10
10
|
var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
|
|
11
|
-
var
|
|
11
|
+
var tooltip = require('ariakit/tooltip');
|
|
12
|
+
var portal = require('ariakit/portal');
|
|
13
|
+
var ariakitReactUtils = require('ariakit-react-utils');
|
|
12
14
|
var useCallbackRef = require('use-callback-ref');
|
|
13
15
|
var FocusLock = _interopDefault(require('react-focus-lock'));
|
|
14
16
|
var ariaHidden = require('aria-hidden');
|
|
17
|
+
var dialog = require('ariakit/dialog');
|
|
18
|
+
var tab = require('ariakit/tab');
|
|
19
|
+
var Ariakit = require('ariakit/menu');
|
|
15
20
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
16
21
|
var dayjs = _interopDefault(require('dayjs'));
|
|
17
22
|
var LocalizedFormat = _interopDefault(require('dayjs/plugin/localizedFormat'));
|
|
@@ -190,7 +195,7 @@ function mapResponsiveProp(fromValue, mapper) {
|
|
|
190
195
|
};
|
|
191
196
|
}
|
|
192
197
|
|
|
193
|
-
var modules_54d944f2 = {"box":"
|
|
198
|
+
var modules_54d944f2 = {"box":"fb8d74bb","position-absolute":"_18f74af9","position-fixed":"b292fef1","position-relative":"e4e217d4","position-sticky":"_66895b64","tablet-position-absolute":"_00e8a0ce","tablet-position-fixed":"efaf64be","tablet-position-relative":"_76e540fd","tablet-position-sticky":"bd286900","desktop-position-absolute":"_09e9f472","desktop-position-fixed":"_893383f1","desktop-position-relative":"dea3890d","desktop-position-sticky":"_6a61c94d","display-block":"_64dcc902","display-flex":"_14423c92","display-inline":"_6a38242d","display-inlineBlock":"_348efc1f","display-inlineFlex":"_150907c8","display-none":"_3da48ad6","tablet-display-block":"_0daac9f2","tablet-display-flex":"f62c43b1","tablet-display-inline":"_5839a4e4","tablet-display-inlineBlock":"_8068aaf2","tablet-display-inlineFlex":"_76562ea5","tablet-display-none":"_4f7a886f","desktop-display-block":"_4fd4b789","desktop-display-flex":"_4d08e78f","desktop-display-inline":"_0da15585","desktop-display-inlineBlock":"d0fcc019","desktop-display-inlineFlex":"_79f967d4","desktop-display-none":"_2ffa0d03","flexDirection-column":"_2d7320f2","flexDirection-row":"_5f8879d9","tablet-flexDirection-column":"_2c919a43","tablet-flexDirection-row":"_4da1f194","desktop-flexDirection-column":"_66fd35ea","desktop-flexDirection-row":"_4b79448d","flexWrap-wrap":"_202b0c8c","flexWrap-nowrap":"_45a8f27f","flexShrink-0":"_7d9ec5b0","flexGrow-0":"_9ce442fb","flexGrow-1":"c3b69d70","alignItems-flexStart":"_7cc6458c","alignItems-center":"b76144ce","alignItems-flexEnd":"e42ffab4","alignItems-baseline":"_3975b234","tablet-alignItems-flexStart":"b670f77e","tablet-alignItems-center":"_976e7156","tablet-alignItems-flexEnd":"_385c60b1","tablet-alignItems-baseline":"_52b577fc","desktop-alignItems-flexStart":"_2e1cc27f","desktop-alignItems-center":"_3a9e51e9","desktop-alignItems-flexEnd":"dfc189b2","desktop-alignItems-baseline":"_5fabaec4","justifyContent-flexStart":"a65d9c55","justifyContent-center":"b4e05554","justifyContent-flexEnd":"f76804e6","justifyContent-spaceAround":"_0095203e","justifyContent-spaceBetween":"_6eb365d1","justifyContent-spaceEvenly":"_4111e641","tablet-justifyContent-flexStart":"_6fda855d","tablet-justifyContent-center":"c2d359f8","tablet-justifyContent-flexEnd":"e271941d","tablet-justifyContent-spaceAround":"_2321488d","tablet-justifyContent-spaceBetween":"e4a9b2e3","tablet-justifyContent-spaceEvenly":"bdc232f2","desktop-justifyContent-flexStart":"_0d16bb5c","desktop-justifyContent-center":"eca8082a","desktop-justifyContent-flexEnd":"_97ea6bb7","desktop-justifyContent-spaceBetween":"_58e61602","alignSelf-stretch":"_794c8ab8","alignSelf-flexStart":"c510efd5","alignSelf-center":"b3f71626","alignSelf-flexEnd":"_13771d73","alignSelf-baseline":"_64318454","tablet-alignSelf-stretch":"_309c6ba7","tablet-alignSelf-flexStart":"_92dfd036","tablet-alignSelf-center":"_811f9906","tablet-alignSelf-flexEnd":"_2cd2336e","tablet-alignSelf-baseline":"bd2c9dad","desktop-alignSelf-stretch":"d8215926","desktop-alignSelf-flexStart":"b78f5c06","desktop-alignSelf-center":"_683e0cdb","desktop-alignSelf-flexEnd":"_489f1dc8","desktop-alignSelf-baseline":"_4aca1032","overflow-hidden":"_68aab614","overflow-auto":"ac28a3b1","overflow-visible":"_50b88b52","overflow-scroll":"c2fdd1c1","height-full":"_75ca308a","bg-default":"a9ca9830","bg-aside":"b9ff0c93","bg-highlight":"efc303e5","bg-selected":"ec657626","bg-toast":"_00d3482f","borderRadius-standard":"_958da546","borderRadius-full":"_79077c62","border-primary":"_68981e89","border-secondary":"_2bda8f7a","border-tertiary":"_7152c573","textAlign-start":"_1f362dec","textAlign-center":"_1c09cd18","textAlign-end":"b9663f5e","textAlign-justify":"a0eba489","tablet-textAlign-start":"_60b9abf8","tablet-textAlign-center":"_2c70943c","tablet-textAlign-end":"a512d4e1","tablet-textAlign-justify":"_5d02c334","desktop-textAlign-start":"ad2496a1","desktop-textAlign-center":"ee87b016","desktop-textAlign-end":"_6dd48127","desktop-textAlign-justify":"_1e70d216"};
|
|
194
199
|
|
|
195
200
|
var modules_b537a8ee = {"paddingTop-xsmall":"c4803194","paddingTop-small":"_4e9ab24b","paddingTop-medium":"_1d226e27","paddingTop-large":"eb6097f1","paddingTop-xlarge":"d3229ba4","paddingTop-xxlarge":"_47978ba4","tablet-paddingTop-xsmall":"f987719c","tablet-paddingTop-small":"_8dbc4b4d","tablet-paddingTop-medium":"ae44fe07","tablet-paddingTop-large":"ffe9548d","tablet-paddingTop-xlarge":"f2b76a44","tablet-paddingTop-xxlarge":"c6eb8f43","desktop-paddingTop-xsmall":"_8699b560","desktop-paddingTop-small":"_02c374b7","desktop-paddingTop-medium":"_0dd0332f","desktop-paddingTop-large":"da55f1f6","desktop-paddingTop-xlarge":"_8ef2a278","desktop-paddingTop-xxlarge":"_8b493b28","paddingRight-xsmall":"_211eebc7","paddingRight-small":"ad0ccf15","paddingRight-medium":"a03e39af","paddingRight-large":"f0941ead","paddingRight-xlarge":"e47c5a43","paddingRight-xxlarge":"e849a5cf","tablet-paddingRight-xsmall":"_85374228","tablet-paddingRight-small":"_89df37b9","tablet-paddingRight-medium":"_1cc50ebe","tablet-paddingRight-large":"_1060982b","tablet-paddingRight-xlarge":"be58847d","tablet-paddingRight-xxlarge":"_45093484","desktop-paddingRight-xsmall":"f8d99d6a","desktop-paddingRight-small":"efa076d9","desktop-paddingRight-medium":"e59caa64","desktop-paddingRight-large":"da42f46a","desktop-paddingRight-xlarge":"b3ee2580","desktop-paddingRight-xxlarge":"_3ef94658","paddingBottom-xsmall":"b0e6eab4","paddingBottom-small":"_9510d053","paddingBottom-medium":"d7af60c9","paddingBottom-large":"b75f86cd","paddingBottom-xlarge":"fbd4ce29","paddingBottom-xxlarge":"_33e3ad63","tablet-paddingBottom-xsmall":"f0302da7","tablet-paddingBottom-small":"_4f9b8012","tablet-paddingBottom-medium":"_4333e20e","tablet-paddingBottom-large":"_30bbc76c","tablet-paddingBottom-xlarge":"ba5a4008","tablet-paddingBottom-xxlarge":"_423a3b1a","desktop-paddingBottom-xsmall":"b40139b7","desktop-paddingBottom-small":"f96071fa","desktop-paddingBottom-medium":"fe803c9a","desktop-paddingBottom-large":"_01686eb9","desktop-paddingBottom-xlarge":"afa763d8","desktop-paddingBottom-xxlarge":"a95785f1","paddingLeft-xsmall":"cad4e2ec","paddingLeft-small":"d70b3c17","paddingLeft-medium":"_8c851bd6","paddingLeft-large":"_078feb3c","paddingLeft-xlarge":"_76ab968c","paddingLeft-xxlarge":"aaca85d7","tablet-paddingLeft-xsmall":"_5eb0e5aa","tablet-paddingLeft-small":"_0384fb4f","tablet-paddingLeft-medium":"edffff6f","tablet-paddingLeft-large":"_873b9a46","tablet-paddingLeft-xlarge":"_89105db5","tablet-paddingLeft-xxlarge":"db1966fe","desktop-paddingLeft-xsmall":"b17f826b","desktop-paddingLeft-small":"_6dc83610","desktop-paddingLeft-medium":"_3421b8b2","desktop-paddingLeft-large":"_68cec7a6","desktop-paddingLeft-xlarge":"_94bde020","desktop-paddingLeft-xxlarge":"b94ee579"};
|
|
196
201
|
|
|
@@ -450,6 +455,18 @@ const HiddenVisually = /*#__PURE__*/polymorphicComponent(function HiddenVisually
|
|
|
450
455
|
|
|
451
456
|
var modules_95f1407a = {"tooltip":"_487c82cd"};
|
|
452
457
|
|
|
458
|
+
const SHOW_DELAY = 1000;
|
|
459
|
+
const HIDE_DELAY = 100;
|
|
460
|
+
|
|
461
|
+
function useDelayedTooltipState(initialState) {
|
|
462
|
+
const tooltipState = tooltip.useTooltipState(initialState);
|
|
463
|
+
const delay = useDelay();
|
|
464
|
+
return React.useMemo(() => _objectSpread2(_objectSpread2({}, tooltipState), {}, {
|
|
465
|
+
show: delay(() => tooltipState.show(), SHOW_DELAY),
|
|
466
|
+
hide: delay(() => tooltipState.hide(), HIDE_DELAY)
|
|
467
|
+
}), [delay, tooltipState]);
|
|
468
|
+
}
|
|
469
|
+
|
|
453
470
|
function Tooltip({
|
|
454
471
|
children,
|
|
455
472
|
content,
|
|
@@ -458,12 +475,10 @@ function Tooltip({
|
|
|
458
475
|
withArrow = false,
|
|
459
476
|
exceptionallySetClassName
|
|
460
477
|
}) {
|
|
461
|
-
const
|
|
478
|
+
const state = useDelayedTooltipState({
|
|
462
479
|
placement: position,
|
|
463
|
-
|
|
464
|
-
hideTimeout: 100
|
|
480
|
+
gutter: gapSize
|
|
465
481
|
});
|
|
466
|
-
const isOpen = tooltip.useState('open');
|
|
467
482
|
const child = React.Children.only(children);
|
|
468
483
|
|
|
469
484
|
if (!child) {
|
|
@@ -492,7 +507,7 @@ function Tooltip({
|
|
|
492
507
|
const eventKey = event.key;
|
|
493
508
|
|
|
494
509
|
if (eventKey !== 'Escape' && eventKey !== 'Enter' && eventKey !== 'Space') {
|
|
495
|
-
|
|
510
|
+
state.show();
|
|
496
511
|
}
|
|
497
512
|
}
|
|
498
513
|
|
|
@@ -507,26 +522,25 @@ function Tooltip({
|
|
|
507
522
|
function handleBlur(event) {
|
|
508
523
|
var _child$props2;
|
|
509
524
|
|
|
510
|
-
|
|
525
|
+
state.hide();
|
|
511
526
|
child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.onBlur == null ? void 0 : _child$props2.onBlur(event);
|
|
512
527
|
}
|
|
513
528
|
|
|
514
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}),
|
|
527
|
-
as:
|
|
528
|
-
|
|
529
|
-
store: tooltip,
|
|
529
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(tooltip.TooltipAnchor, {
|
|
530
|
+
state: state,
|
|
531
|
+
ref: child.ref,
|
|
532
|
+
described: true
|
|
533
|
+
}, anchorProps => {
|
|
534
|
+
// Let child props override anchor props so user can specify attributes like tabIndex
|
|
535
|
+
// Also, do not apply the child's props to TooltipAnchor as props like `as` can create problems
|
|
536
|
+
// by applying the replacement component/element twice
|
|
537
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread2(_objectSpread2(_objectSpread2({}, anchorProps), child.props), {}, {
|
|
538
|
+
onFocus: handleFocus,
|
|
539
|
+
onBlur: handleBlur
|
|
540
|
+
}));
|
|
541
|
+
}), state.open && content ? /*#__PURE__*/React.createElement(Box, {
|
|
542
|
+
as: tooltip.Tooltip,
|
|
543
|
+
state: state,
|
|
530
544
|
className: [modules_95f1407a.tooltip, exceptionallySetClassName],
|
|
531
545
|
background: "toast",
|
|
532
546
|
borderRadius: "standard",
|
|
@@ -536,7 +550,37 @@ function Tooltip({
|
|
|
536
550
|
width: "fitContent",
|
|
537
551
|
overflow: "hidden",
|
|
538
552
|
textAlign: "center"
|
|
539
|
-
}, withArrow ? /*#__PURE__*/React.createElement(
|
|
553
|
+
}, withArrow ? /*#__PURE__*/React.createElement(tooltip.TooltipArrow, null) : null, typeof content === 'function' ? content() : content) : null);
|
|
554
|
+
}
|
|
555
|
+
// Internal helpers
|
|
556
|
+
//
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Returns a function offering the same interface as setTimeout, but cleans up on unmount.
|
|
560
|
+
*
|
|
561
|
+
* The timeout state is shared, and only one delayed function can be active at any given time. If
|
|
562
|
+
* a new delayed function is called while another one was waiting for its time to run, that older
|
|
563
|
+
* invocation is cleared and it never runs.
|
|
564
|
+
*
|
|
565
|
+
* This is suitable for our use case here, but probably not the most intuitive thing in general.
|
|
566
|
+
* That's why this is not made a shared util or something like it.
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
function useDelay() {
|
|
570
|
+
const timeoutRef = React.useRef();
|
|
571
|
+
const clearTimeouts = React.useCallback(function clearTimeouts() {
|
|
572
|
+
if (timeoutRef.current != null) {
|
|
573
|
+
clearTimeout(timeoutRef.current);
|
|
574
|
+
}
|
|
575
|
+
}, []); // Runs clearTimeouts when the component is unmounted
|
|
576
|
+
|
|
577
|
+
React.useEffect(() => clearTimeouts, [clearTimeouts]);
|
|
578
|
+
return React.useCallback(function delay(fn, delay) {
|
|
579
|
+
return () => {
|
|
580
|
+
clearTimeouts();
|
|
581
|
+
timeoutRef.current = setTimeout(fn, delay);
|
|
582
|
+
};
|
|
583
|
+
}, [clearTimeouts]);
|
|
540
584
|
}
|
|
541
585
|
|
|
542
586
|
var modules_c7f5018f = {"svg":"_51539197","spinner":"_54fbe2b3","tint":"a0c466ed","fill":"_745b73d3"};
|
|
@@ -1311,7 +1355,7 @@ function ToastsProvider({
|
|
|
1311
1355
|
}, [defaultAutoDismissDelay, defaultDismissLabel, removeToast]);
|
|
1312
1356
|
return /*#__PURE__*/React__default.createElement(ToastsContext.Provider, {
|
|
1313
1357
|
value: showToast
|
|
1314
|
-
}, children, /*#__PURE__*/React__default.createElement(
|
|
1358
|
+
}, children, /*#__PURE__*/React__default.createElement(portal.Portal, null, toasts.length === 0 ? null : /*#__PURE__*/React__default.createElement(Box, {
|
|
1315
1359
|
className: [modules_d11e18f0.stackedToastsView, containerClassName],
|
|
1316
1360
|
position: "fixed",
|
|
1317
1361
|
width: "full",
|
|
@@ -1398,7 +1442,7 @@ function Toast(props) {
|
|
|
1398
1442
|
return null;
|
|
1399
1443
|
}
|
|
1400
1444
|
|
|
1401
|
-
var modules_949d2ff4 = {"heading":"
|
|
1445
|
+
var modules_949d2ff4 = {"heading":"bff24867","weight-medium":"_9b540c61","weight-light":"c6729907","tone-secondary":"d6507f70","tone-danger":"d1846d93","size-largest":"_7cbdd1ba","size-larger":"b3e14969","size-smaller":"be14a265","lineClampMultipleLines":"_71391f13","lineClamp-1":"_97298b1b","lineClamp-2":"_6d357d76","lineClamp-3":"d820b451","lineClamp-4":"_8d37487d","lineClamp-5":"_5215b4d7"};
|
|
1402
1446
|
|
|
1403
1447
|
const _excluded$e = ["level", "weight", "size", "tone", "children", "lineClamp", "align", "exceptionallySetClassName"];
|
|
1404
1448
|
const Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
@@ -1429,7 +1473,7 @@ const Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
|
1429
1473
|
}), children);
|
|
1430
1474
|
});
|
|
1431
1475
|
|
|
1432
|
-
var modules_8ebe6db0 = {"prose":"
|
|
1476
|
+
var modules_8ebe6db0 = {"prose":"_560c1e08","darkModeTypography":"_8b53b13e"};
|
|
1433
1477
|
|
|
1434
1478
|
const _excluded$f = ["darkModeTypography", "exceptionallySetClassName"];
|
|
1435
1479
|
/**
|
|
@@ -1560,37 +1604,6 @@ function CheckboxIcon(_ref) {
|
|
|
1560
1604
|
|
|
1561
1605
|
var modules_664a6a80 = {"container":"_84dfdb83","disabled":"_131a2ca4","checked":"_95b1556d","keyFocused":"_49de7ebd","icon":"_6b4b1851","label":"_9047f3bd"};
|
|
1562
1606
|
|
|
1563
|
-
/**
|
|
1564
|
-
* Sets both a function and object React ref.
|
|
1565
|
-
*/
|
|
1566
|
-
|
|
1567
|
-
function setRef(ref, value) {
|
|
1568
|
-
if (typeof ref === 'function') {
|
|
1569
|
-
ref(value);
|
|
1570
|
-
} else if (ref) {
|
|
1571
|
-
ref.current = value;
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
/**
|
|
1575
|
-
* Merges React Refs into a single memoized function ref so you can pass it to an element.
|
|
1576
|
-
* @example
|
|
1577
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
1578
|
-
* const internalRef = React.useRef();
|
|
1579
|
-
* return <div {...props} ref={useForkRef(internalRef, ref)} />;
|
|
1580
|
-
* });
|
|
1581
|
-
*/
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
function useForkRef(...refs) {
|
|
1585
|
-
return React.useMemo(() => {
|
|
1586
|
-
if (!refs.some(Boolean)) return;
|
|
1587
|
-
return value => {
|
|
1588
|
-
refs.forEach(ref => setRef(ref, value));
|
|
1589
|
-
};
|
|
1590
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1591
|
-
refs);
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
1607
|
const _excluded$j = ["label", "icon", "disabled", "indeterminate", "defaultChecked", "onChange"];
|
|
1595
1608
|
const CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref, ref) {
|
|
1596
1609
|
var _ref2, _props$checked, _props$checked2;
|
|
@@ -1622,7 +1635,7 @@ const CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref,
|
|
|
1622
1635
|
const [checkedState, setChecked] = React.useState((_ref2 = (_props$checked = props.checked) != null ? _props$checked : defaultChecked) != null ? _ref2 : false);
|
|
1623
1636
|
const isChecked = (_props$checked2 = props.checked) != null ? _props$checked2 : checkedState;
|
|
1624
1637
|
const internalRef = React.useRef(null);
|
|
1625
|
-
const combinedRef = useForkRef(internalRef, ref);
|
|
1638
|
+
const combinedRef = ariakitReactUtils.useForkRef(internalRef, ref);
|
|
1626
1639
|
React.useEffect(function setIndeterminate() {
|
|
1627
1640
|
if (internalRef.current && typeof indeterminate === 'boolean') {
|
|
1628
1641
|
internalRef.current.indeterminate = indeterminate;
|
|
@@ -2233,7 +2246,7 @@ function Modal(_ref) {
|
|
|
2233
2246
|
onDismiss == null ? void 0 : onDismiss();
|
|
2234
2247
|
}
|
|
2235
2248
|
}, [onDismiss]);
|
|
2236
|
-
const
|
|
2249
|
+
const state = dialog.useDialogState({
|
|
2237
2250
|
open: isOpen,
|
|
2238
2251
|
setOpen
|
|
2239
2252
|
});
|
|
@@ -2267,7 +2280,7 @@ function Modal(_ref) {
|
|
|
2267
2280
|
return null;
|
|
2268
2281
|
}
|
|
2269
2282
|
|
|
2270
|
-
return /*#__PURE__*/React.createElement(
|
|
2283
|
+
return /*#__PURE__*/React.createElement(portal.Portal, {
|
|
2271
2284
|
portalRef: portalRef,
|
|
2272
2285
|
portalElement: portalElement
|
|
2273
2286
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -2286,10 +2299,10 @@ function Modal(_ref) {
|
|
|
2286
2299
|
autoFocus: autoFocus,
|
|
2287
2300
|
whiteList: isNotInternalFrame,
|
|
2288
2301
|
returnFocus: true
|
|
2289
|
-
}, /*#__PURE__*/React.createElement(
|
|
2302
|
+
}, /*#__PURE__*/React.createElement(dialog.Dialog, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2290
2303
|
ref: dialogRef,
|
|
2291
2304
|
as: Box,
|
|
2292
|
-
|
|
2305
|
+
state: state,
|
|
2293
2306
|
hideOnEscape: hideOnEscape,
|
|
2294
2307
|
preventBodyScroll: true,
|
|
2295
2308
|
borderRadius: "full",
|
|
@@ -2451,6 +2464,28 @@ function ModalActions(_ref5) {
|
|
|
2451
2464
|
}, children));
|
|
2452
2465
|
}
|
|
2453
2466
|
|
|
2467
|
+
/**
|
|
2468
|
+
* usePrevious tracks the change of the given value -
|
|
2469
|
+
* when a given value has been changed from a previous call,
|
|
2470
|
+
* it will return the value prior to the change.
|
|
2471
|
+
*
|
|
2472
|
+
* Example:
|
|
2473
|
+
*
|
|
2474
|
+
* const [x, setX] = useState(1)
|
|
2475
|
+
* const prevX = usePrevious(x)
|
|
2476
|
+
*
|
|
2477
|
+
* Suppose `setX(2)` is called, then in the next component render
|
|
2478
|
+
* x = 2 and prevX = 1
|
|
2479
|
+
*/
|
|
2480
|
+
|
|
2481
|
+
function usePrevious(value) {
|
|
2482
|
+
const ref = React.useRef(null);
|
|
2483
|
+
React.useEffect(() => {
|
|
2484
|
+
ref.current = value;
|
|
2485
|
+
}, [value]);
|
|
2486
|
+
return ref.current;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2454
2489
|
var modules_40c67f5b = {"tab":"e96bf360","track":"_430e252d","tab-neutral":"f631ccbe","tab-themed":"_6ba96acc","track-neutral":"ef4cd8d3","track-themed":"_344b3b10"};
|
|
2455
2490
|
|
|
2456
2491
|
const _excluded$s = ["as", "children", "id", "exceptionallySetClassName"],
|
|
@@ -2468,21 +2503,26 @@ function Tabs({
|
|
|
2468
2503
|
variant = 'neutral',
|
|
2469
2504
|
onSelectedIdChange
|
|
2470
2505
|
}) {
|
|
2471
|
-
const
|
|
2472
|
-
defaultSelectedId,
|
|
2506
|
+
const tabState = tab.useTabState({
|
|
2473
2507
|
selectedId,
|
|
2474
2508
|
setSelectedId: onSelectedIdChange
|
|
2475
2509
|
});
|
|
2476
|
-
const
|
|
2477
|
-
const
|
|
2478
|
-
|
|
2479
|
-
|
|
2510
|
+
const previousDefaultSelectedId = usePrevious(defaultSelectedId);
|
|
2511
|
+
const {
|
|
2512
|
+
selectedId: actualSelectedId,
|
|
2513
|
+
select
|
|
2514
|
+
} = tabState;
|
|
2515
|
+
React.useEffect(function selectDefaultTab() {
|
|
2516
|
+
if (!selectedId && defaultSelectedId !== previousDefaultSelectedId && defaultSelectedId !== actualSelectedId && defaultSelectedId !== undefined) {
|
|
2517
|
+
select(defaultSelectedId);
|
|
2518
|
+
}
|
|
2519
|
+
}, [selectedId, defaultSelectedId, actualSelectedId, select, previousDefaultSelectedId]);
|
|
2520
|
+
const memoizedTabState = React.useMemo(function memoizeTabState() {
|
|
2480
2521
|
return {
|
|
2481
|
-
|
|
2482
|
-
variant
|
|
2483
|
-
selectedId: (_ref = selectedId != null ? selectedId : actualSelectedId) != null ? _ref : null
|
|
2522
|
+
tabState,
|
|
2523
|
+
variant
|
|
2484
2524
|
};
|
|
2485
|
-
}, [variant,
|
|
2525
|
+
}, [variant, tabState]);
|
|
2486
2526
|
return /*#__PURE__*/React.createElement(TabsContext.Provider, {
|
|
2487
2527
|
value: memoizedTabState
|
|
2488
2528
|
}, children);
|
|
@@ -2492,27 +2532,30 @@ function Tabs({
|
|
|
2492
2532
|
*/
|
|
2493
2533
|
|
|
2494
2534
|
|
|
2495
|
-
const Tab = /*#__PURE__*/polymorphicComponent(function Tab(
|
|
2535
|
+
const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref, ref) {
|
|
2496
2536
|
let {
|
|
2497
2537
|
as,
|
|
2498
2538
|
children,
|
|
2499
2539
|
id,
|
|
2500
2540
|
exceptionallySetClassName
|
|
2501
|
-
} =
|
|
2502
|
-
props = _objectWithoutProperties(
|
|
2541
|
+
} = _ref,
|
|
2542
|
+
props = _objectWithoutProperties(_ref, _excluded$s);
|
|
2503
2543
|
|
|
2504
2544
|
const tabContextValue = React.useContext(TabsContext);
|
|
2505
|
-
|
|
2545
|
+
|
|
2546
|
+
if (!tabContextValue) {
|
|
2547
|
+
return null;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2506
2550
|
const {
|
|
2507
2551
|
variant,
|
|
2508
|
-
|
|
2552
|
+
tabState
|
|
2509
2553
|
} = tabContextValue;
|
|
2510
|
-
|
|
2511
|
-
return /*#__PURE__*/React.createElement(react.Tab, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2554
|
+
return /*#__PURE__*/React.createElement(tab.Tab, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2512
2555
|
as: as,
|
|
2513
|
-
className:
|
|
2556
|
+
className: classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" + variant]),
|
|
2514
2557
|
id: id,
|
|
2515
|
-
|
|
2558
|
+
state: tabState,
|
|
2516
2559
|
ref: ref
|
|
2517
2560
|
}), children);
|
|
2518
2561
|
});
|
|
@@ -2520,12 +2563,12 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref2, ref) {
|
|
|
2520
2563
|
* A component used to group `<Tab>` elements together.
|
|
2521
2564
|
*/
|
|
2522
2565
|
|
|
2523
|
-
function TabList(
|
|
2566
|
+
function TabList(_ref2) {
|
|
2524
2567
|
let {
|
|
2525
2568
|
children,
|
|
2526
2569
|
space
|
|
2527
|
-
} =
|
|
2528
|
-
props = _objectWithoutProperties(
|
|
2570
|
+
} = _ref2,
|
|
2571
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
2529
2572
|
|
|
2530
2573
|
const tabContextValue = React.useContext(TabsContext);
|
|
2531
2574
|
|
|
@@ -2534,15 +2577,15 @@ function TabList(_ref3) {
|
|
|
2534
2577
|
}
|
|
2535
2578
|
|
|
2536
2579
|
const {
|
|
2537
|
-
|
|
2580
|
+
tabState,
|
|
2538
2581
|
variant
|
|
2539
2582
|
} = tabContextValue;
|
|
2540
2583
|
return (
|
|
2541
2584
|
/*#__PURE__*/
|
|
2542
2585
|
// The extra <Box> prevents <Inline>'s negative margins from collapsing when used in a flex container
|
|
2543
2586
|
// which will render the track with the wrong height
|
|
2544
|
-
React.createElement(Box, null, /*#__PURE__*/React.createElement(
|
|
2545
|
-
|
|
2587
|
+
React.createElement(Box, null, /*#__PURE__*/React.createElement(tab.TabList, _objectSpread2({
|
|
2588
|
+
state: tabState,
|
|
2546
2589
|
as: Box,
|
|
2547
2590
|
position: "relative",
|
|
2548
2591
|
width: "maxContent"
|
|
@@ -2554,24 +2597,22 @@ function TabList(_ref3) {
|
|
|
2554
2597
|
);
|
|
2555
2598
|
}
|
|
2556
2599
|
/**
|
|
2557
|
-
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a
|
|
2558
|
-
* corresponding `<Tab>` component.
|
|
2600
|
+
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
2559
2601
|
*/
|
|
2560
2602
|
|
|
2561
2603
|
|
|
2562
|
-
const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(
|
|
2604
|
+
const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref3, ref) {
|
|
2563
2605
|
let {
|
|
2564
2606
|
children,
|
|
2565
2607
|
id,
|
|
2566
2608
|
as,
|
|
2567
2609
|
render = 'always'
|
|
2568
|
-
} =
|
|
2569
|
-
props = _objectWithoutProperties(
|
|
2610
|
+
} = _ref3,
|
|
2611
|
+
props = _objectWithoutProperties(_ref3, _excluded3$1);
|
|
2570
2612
|
|
|
2571
2613
|
const tabContextValue = React.useContext(TabsContext);
|
|
2572
2614
|
const [tabRendered, setTabRendered] = React.useState(false);
|
|
2573
|
-
const
|
|
2574
|
-
const tabIsActive = selectedId === id;
|
|
2615
|
+
const tabIsActive = (tabContextValue == null ? void 0 : tabContextValue.tabState.selectedId) === id;
|
|
2575
2616
|
React.useEffect(function trackTabRenderedState() {
|
|
2576
2617
|
if (!tabRendered && tabIsActive) {
|
|
2577
2618
|
setTabRendered(true);
|
|
@@ -2583,28 +2624,28 @@ const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref4, ref)
|
|
|
2583
2624
|
}
|
|
2584
2625
|
|
|
2585
2626
|
const {
|
|
2586
|
-
|
|
2627
|
+
tabState
|
|
2587
2628
|
} = tabContextValue;
|
|
2588
2629
|
const shouldRender = render === 'always' || render === 'active' && tabIsActive || render === 'lazy' && (tabIsActive || tabRendered);
|
|
2589
|
-
return shouldRender ? /*#__PURE__*/React.createElement(
|
|
2590
|
-
tabId: id
|
|
2591
|
-
|
|
2630
|
+
return shouldRender ? /*#__PURE__*/React.createElement(tab.TabPanel, _objectSpread2(_objectSpread2({
|
|
2631
|
+
tabId: id
|
|
2632
|
+
}, props), {}, {
|
|
2633
|
+
state: tabState,
|
|
2592
2634
|
as: as,
|
|
2593
2635
|
ref: ref
|
|
2594
2636
|
}), children) : null;
|
|
2595
2637
|
});
|
|
2596
2638
|
/**
|
|
2597
|
-
* Allows content to be rendered based on the current tab being selected while outside of the
|
|
2598
|
-
*
|
|
2639
|
+
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|
|
2640
|
+
* component. Can be placed freely within the main `<Tabs>` component.
|
|
2599
2641
|
*/
|
|
2600
2642
|
|
|
2601
2643
|
function TabAwareSlot({
|
|
2602
2644
|
children
|
|
2603
2645
|
}) {
|
|
2604
2646
|
const tabContextValue = React.useContext(TabsContext);
|
|
2605
|
-
const selectedId = tabContextValue == null ? void 0 : tabContextValue.tabStore.useState('selectedId');
|
|
2606
2647
|
return tabContextValue ? children({
|
|
2607
|
-
selectedId
|
|
2648
|
+
selectedId: tabContextValue == null ? void 0 : tabContextValue.tabState.selectedId
|
|
2608
2649
|
}) : null;
|
|
2609
2650
|
}
|
|
2610
2651
|
|
|
@@ -2632,20 +2673,27 @@ function Menu(_ref) {
|
|
|
2632
2673
|
} = _ref,
|
|
2633
2674
|
props = _objectWithoutProperties(_ref, _excluded$t);
|
|
2634
2675
|
|
|
2635
|
-
const [anchorRect,
|
|
2636
|
-
const getAnchorRect = React.useMemo(() =>
|
|
2637
|
-
|
|
2638
|
-
|
|
2676
|
+
const [anchorRect, handleAnchorRectChange] = React.useState(null);
|
|
2677
|
+
const getAnchorRect = React.useMemo(() => {
|
|
2678
|
+
return anchorRect ? () => anchorRect : undefined;
|
|
2679
|
+
}, [anchorRect]);
|
|
2680
|
+
const state = Ariakit.useMenuState(_objectSpread2({
|
|
2681
|
+
focusLoop: true,
|
|
2682
|
+
gutter: 8,
|
|
2683
|
+
shift: 4,
|
|
2684
|
+
getAnchorRect
|
|
2639
2685
|
}, props));
|
|
2686
|
+
React.useEffect(() => {
|
|
2687
|
+
if (!state.open) handleAnchorRectChange(null);
|
|
2688
|
+
}, [state.open]);
|
|
2640
2689
|
const handleItemSelect = React.useCallback(function handleItemSelect(value) {
|
|
2641
|
-
onItemSelect
|
|
2690
|
+
if (onItemSelect) onItemSelect(value);
|
|
2642
2691
|
}, [onItemSelect]);
|
|
2643
2692
|
const value = React.useMemo(() => ({
|
|
2644
|
-
|
|
2693
|
+
state,
|
|
2645
2694
|
handleItemSelect,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
}), [menuStore, handleItemSelect, getAnchorRect, setAnchorRect]);
|
|
2695
|
+
handleAnchorRectChange
|
|
2696
|
+
}), [state, handleItemSelect]);
|
|
2649
2697
|
return /*#__PURE__*/React.createElement(MenuContext.Provider, {
|
|
2650
2698
|
value: value
|
|
2651
2699
|
}, children);
|
|
@@ -2662,10 +2710,10 @@ const MenuButton = /*#__PURE__*/polymorphicComponent(function MenuButton(_ref2,
|
|
|
2662
2710
|
props = _objectWithoutProperties(_ref2, _excluded2$3);
|
|
2663
2711
|
|
|
2664
2712
|
const {
|
|
2665
|
-
|
|
2713
|
+
state
|
|
2666
2714
|
} = React.useContext(MenuContext);
|
|
2667
|
-
return /*#__PURE__*/React.createElement(
|
|
2668
|
-
|
|
2715
|
+
return /*#__PURE__*/React.createElement(Ariakit.MenuButton, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2716
|
+
state: state,
|
|
2669
2717
|
ref: ref,
|
|
2670
2718
|
className: classNames('reactist_menubutton', exceptionallySetClassName)
|
|
2671
2719
|
}));
|
|
@@ -2680,17 +2728,17 @@ const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMen
|
|
|
2680
2728
|
props = _objectWithoutProperties(_ref3, _excluded3$2);
|
|
2681
2729
|
|
|
2682
2730
|
const {
|
|
2683
|
-
|
|
2684
|
-
|
|
2731
|
+
handleAnchorRectChange,
|
|
2732
|
+
state
|
|
2685
2733
|
} = React.useContext(MenuContext);
|
|
2686
|
-
const handleContextMenu = React.useCallback(
|
|
2734
|
+
const handleContextMenu = React.useCallback(event => {
|
|
2687
2735
|
event.preventDefault();
|
|
2688
|
-
|
|
2736
|
+
handleAnchorRectChange({
|
|
2689
2737
|
x: event.clientX,
|
|
2690
2738
|
y: event.clientY
|
|
2691
2739
|
});
|
|
2692
|
-
|
|
2693
|
-
}, [
|
|
2740
|
+
state.show();
|
|
2741
|
+
}, [handleAnchorRectChange, state]);
|
|
2694
2742
|
return /*#__PURE__*/React.createElement(component, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2695
2743
|
onContextMenu: handleContextMenu,
|
|
2696
2744
|
ref
|
|
@@ -2708,19 +2756,14 @@ const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref)
|
|
|
2708
2756
|
props = _objectWithoutProperties(_ref4, _excluded4$1);
|
|
2709
2757
|
|
|
2710
2758
|
const {
|
|
2711
|
-
|
|
2712
|
-
getAnchorRect
|
|
2759
|
+
state
|
|
2713
2760
|
} = React.useContext(MenuContext);
|
|
2714
|
-
|
|
2715
|
-
return isOpen ? /*#__PURE__*/React.createElement(react.Portal, {
|
|
2761
|
+
return state.open ? /*#__PURE__*/React.createElement(portal.Portal, {
|
|
2716
2762
|
preserveTabOrder: true
|
|
2717
|
-
}, /*#__PURE__*/React.createElement(
|
|
2718
|
-
|
|
2719
|
-
gutter: 8,
|
|
2720
|
-
shift: 4,
|
|
2763
|
+
}, /*#__PURE__*/React.createElement(Ariakit.Menu, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2764
|
+
state: state,
|
|
2721
2765
|
ref: ref,
|
|
2722
2766
|
className: classNames('reactist_menulist', exceptionallySetClassName),
|
|
2723
|
-
getAnchorRect: getAnchorRect != null ? getAnchorRect : undefined,
|
|
2724
2767
|
modal: modal
|
|
2725
2768
|
}))) : null;
|
|
2726
2769
|
});
|
|
@@ -2743,11 +2786,11 @@ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref)
|
|
|
2743
2786
|
|
|
2744
2787
|
const {
|
|
2745
2788
|
handleItemSelect,
|
|
2746
|
-
|
|
2789
|
+
state
|
|
2747
2790
|
} = React.useContext(MenuContext);
|
|
2748
2791
|
const {
|
|
2749
2792
|
hide
|
|
2750
|
-
} =
|
|
2793
|
+
} = state;
|
|
2751
2794
|
const handleClick = React.useCallback(function handleClick(event) {
|
|
2752
2795
|
onClick == null ? void 0 : onClick(event);
|
|
2753
2796
|
const onSelectResult = onSelect && !event.defaultPrevented ? onSelect() : undefined;
|
|
@@ -2755,9 +2798,9 @@ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref)
|
|
|
2755
2798
|
handleItemSelect(value);
|
|
2756
2799
|
if (shouldClose) hide();
|
|
2757
2800
|
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
2758
|
-
return /*#__PURE__*/React.createElement(
|
|
2801
|
+
return /*#__PURE__*/React.createElement(Ariakit.MenuItem, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2759
2802
|
as: as,
|
|
2760
|
-
|
|
2803
|
+
state: state,
|
|
2761
2804
|
ref: ref,
|
|
2762
2805
|
onClick: handleClick,
|
|
2763
2806
|
className: exceptionallySetClassName,
|
|
@@ -2792,11 +2835,11 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
|
|
|
2792
2835
|
}, ref) {
|
|
2793
2836
|
const {
|
|
2794
2837
|
handleItemSelect: parentMenuItemSelect,
|
|
2795
|
-
|
|
2838
|
+
state
|
|
2796
2839
|
} = React.useContext(MenuContext);
|
|
2797
2840
|
const {
|
|
2798
2841
|
hide: parentMenuHide
|
|
2799
|
-
} =
|
|
2842
|
+
} = state;
|
|
2800
2843
|
const handleSubItemSelect = React.useCallback(function handleSubItemSelect(value) {
|
|
2801
2844
|
if (onItemSelect) onItemSelect(value);
|
|
2802
2845
|
parentMenuItemSelect(value);
|
|
@@ -2810,9 +2853,9 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
|
|
|
2810
2853
|
}, [button]);
|
|
2811
2854
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
2812
2855
|
onItemSelect: handleSubItemSelect
|
|
2813
|
-
}, /*#__PURE__*/React.createElement(
|
|
2856
|
+
}, /*#__PURE__*/React.createElement(Ariakit.MenuItem, {
|
|
2814
2857
|
as: "div",
|
|
2815
|
-
|
|
2858
|
+
state: state,
|
|
2816
2859
|
ref: ref,
|
|
2817
2860
|
hideOnClick: false
|
|
2818
2861
|
}, renderMenuButton), list);
|
|
@@ -2833,11 +2876,11 @@ const MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroup(_ref6, re
|
|
|
2833
2876
|
props = _objectWithoutProperties(_ref6, _excluded6);
|
|
2834
2877
|
|
|
2835
2878
|
const {
|
|
2836
|
-
|
|
2879
|
+
state
|
|
2837
2880
|
} = React.useContext(MenuContext);
|
|
2838
|
-
return /*#__PURE__*/React.createElement(
|
|
2881
|
+
return /*#__PURE__*/React.createElement(Ariakit.MenuGroup, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2839
2882
|
ref: ref,
|
|
2840
|
-
|
|
2883
|
+
state: state,
|
|
2841
2884
|
className: exceptionallySetClassName
|
|
2842
2885
|
}), label ? /*#__PURE__*/React.createElement("div", {
|
|
2843
2886
|
role: "presentation",
|