@rocket.chat/fuselage 0.83.0 → 0.84.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/components/Menu/MenuDropdown.d.ts +23 -1
- package/dist/components/Menu/MenuDropdown.d.ts.map +1 -1
- package/dist/components/Menu/MenuPopover.d.ts.map +1 -1
- package/dist/components/Menu/MenuPortalContext.d.ts +17 -0
- package/dist/components/Menu/MenuPortalContext.d.ts.map +1 -0
- package/dist/components/Menu/MenuSection.d.ts +7 -3
- package/dist/components/Menu/MenuSection.d.ts.map +1 -1
- package/dist/components/Menu/MenuSubmenu.d.ts +24 -0
- package/dist/components/Menu/MenuSubmenu.d.ts.map +1 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/stately/MenuSubmenuTrigger.d.ts +20 -0
- package/dist/components/Menu/stately/MenuSubmenuTrigger.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +3 -2
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/SidebarV2/SidebarCollapseGroup.d.ts +2 -1
- package/dist/components/SidebarV2/SidebarCollapseGroup.d.ts.map +1 -1
- package/dist/components/SidebarV2/SidebarCollapseGroupMenu.d.ts +3 -0
- package/dist/components/SidebarV2/SidebarCollapseGroupMenu.d.ts.map +1 -0
- package/dist/components/SidebarV2/SidebarGroupTitle.d.ts +2 -1
- package/dist/components/SidebarV2/SidebarGroupTitle.d.ts.map +1 -1
- package/dist/components/SidebarV2/helpers.d.ts.map +1 -1
- package/dist/components/SidebarV2/index.d.ts +1 -0
- package/dist/components/SidebarV2/index.d.ts.map +1 -1
- package/dist/fuselage.css +4 -4
- package/dist/fuselage.css.map +1 -1
- package/dist/fuselage.development.js +263 -24
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +49 -49
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +20 -21
|
@@ -3769,7 +3769,7 @@ const Menu = ({ icon = 'kebab', placement = 'bottom-start', title, is: MenuButto
|
|
|
3769
3769
|
const sizes = { large, medium, tiny, mini };
|
|
3770
3770
|
const defaultSmall = !large && !medium && !tiny && !mini;
|
|
3771
3771
|
const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
|
|
3772
|
-
const popover = state.isOpen && ((0, jsx_runtime_1.jsx)(MenuPopover_1.default, { state: state, triggerRef: ref, placement: (0, helpers_1.getPlacement)(placement), maxWidth: maxWidth, children: (0, jsx_runtime_1.jsx)(MenuDropdown_1.default, { ...props, ...menuProps }) }));
|
|
3772
|
+
const popover = state.isOpen && ((0, jsx_runtime_1.jsx)(MenuPopover_1.default, { state: state, triggerRef: ref, placement: (0, helpers_1.getPlacement)(placement), maxWidth: maxWidth, children: (0, jsx_runtime_1.jsx)(MenuDropdown_1.default, { ...props, ...menuProps, rootMenuTriggerState: state }) }));
|
|
3773
3773
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [button ? ((0, react_1.cloneElement)(button, {
|
|
3774
3774
|
...buttonProps,
|
|
3775
3775
|
ref,
|
|
@@ -3803,11 +3803,21 @@ const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
|
|
|
3803
3803
|
const react_stately_1 = __webpack_require__(/*! react-stately */ "react-stately");
|
|
3804
3804
|
const MenuItem_1 = __importDefault(__webpack_require__(/*! ./MenuItem */ "./src/components/Menu/MenuItem.tsx"));
|
|
3805
3805
|
const MenuSection_1 = __importDefault(__webpack_require__(/*! ./MenuSection */ "./src/components/Menu/MenuSection.tsx"));
|
|
3806
|
-
|
|
3806
|
+
const MenuSubmenu_1 = __importDefault(__webpack_require__(/*! ./MenuSubmenu */ "./src/components/Menu/MenuSubmenu.tsx"));
|
|
3807
|
+
function MenuDropDown({ rootMenuTriggerState, menuRef, ...props }) {
|
|
3807
3808
|
const state = (0, react_stately_1.useTreeState)(props);
|
|
3808
|
-
const
|
|
3809
|
+
const fallbackRef = (0, react_1.useRef)(null);
|
|
3810
|
+
const ref = menuRef ?? fallbackRef;
|
|
3809
3811
|
const { menuProps } = (0, react_aria_1.useMenu)(props, state, ref);
|
|
3810
|
-
return ((0, jsx_runtime_1.jsx)("div", { ...menuProps, ref: ref, children: [...state.collection].map((item) =>
|
|
3812
|
+
return ((0, jsx_runtime_1.jsx)("div", { ...menuProps, ref: ref, children: [...state.collection].map((item) => {
|
|
3813
|
+
if (item.type === 'section') {
|
|
3814
|
+
return ((0, jsx_runtime_1.jsx)(MenuSection_1.default, { section: item, state: state, rootMenuTriggerState: rootMenuTriggerState, parentMenuRef: ref, onAction: props.onAction }, item.key));
|
|
3815
|
+
}
|
|
3816
|
+
if (item.hasChildNodes) {
|
|
3817
|
+
return ((0, jsx_runtime_1.jsx)(MenuSubmenu_1.default, { item: item, state: state, rootMenuTriggerState: rootMenuTriggerState, parentMenuRef: ref, onAction: props.onAction }, item.key));
|
|
3818
|
+
}
|
|
3819
|
+
return (0, jsx_runtime_1.jsx)(MenuItem_1.default, { item: item, state: state }, item.key);
|
|
3820
|
+
}) }));
|
|
3811
3821
|
}
|
|
3812
3822
|
exports["default"] = MenuDropDown;
|
|
3813
3823
|
|
|
@@ -3886,19 +3896,79 @@ exports["default"] = (0, react_2.memo)(MenuOption);
|
|
|
3886
3896
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3887
3897
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
3888
3898
|
const fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
|
|
3899
|
+
const react_1 = __webpack_require__(/*! react */ "react");
|
|
3900
|
+
const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
|
|
3889
3901
|
const DropdownDesktop_1 = __webpack_require__(/*! ../Dropdown/DropdownDesktop */ "./src/components/Dropdown/DropdownDesktop.tsx");
|
|
3890
3902
|
const DropdownMobile_1 = __webpack_require__(/*! ../Dropdown/DropdownMobile */ "./src/components/Dropdown/DropdownMobile.tsx");
|
|
3891
3903
|
const Popover_1 = __webpack_require__(/*! ../Popover */ "./src/components/Popover/index.ts");
|
|
3904
|
+
const MenuPortalContext_1 = __webpack_require__(/*! ./MenuPortalContext */ "./src/components/Menu/MenuPortalContext.ts");
|
|
3892
3905
|
function MenuPopover({ children, state, offset = 4, maxWidth, ...props }) {
|
|
3893
3906
|
const isMobile = !(0, fuselage_hooks_1.useBreakpoints)().includes('sm');
|
|
3894
|
-
|
|
3895
|
-
|
|
3907
|
+
// The root popover (no container above it) renders a `display: contents`
|
|
3908
|
+
// mount point and shares it with the rest of the tree. Submenu popovers
|
|
3909
|
+
// portal into it, so their DOM nests under the root popover and the whole
|
|
3910
|
+
// tree behaves as one for focus/`aria-hidden` purposes — matching how
|
|
3911
|
+
// `react-aria-components` groups submenu popovers via `PopoverGroupContext`.
|
|
3912
|
+
const groupContainer = (0, MenuPortalContext_1.useMenuPortalContainer)();
|
|
3913
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
3914
|
+
const isSubmenu = groupContainer !== null;
|
|
3915
|
+
const popoverRef = (0, react_1.useRef)(null);
|
|
3916
|
+
// react-aria only lets the *topmost* overlay dismiss on an outside click.
|
|
3917
|
+
// While a submenu is open it is topmost, but submenus are non-modal (hence
|
|
3918
|
+
// non-dismissable), so neither the submenu nor the root closes. Since every
|
|
3919
|
+
// open submenu portals into the root popover, the root popover element
|
|
3920
|
+
// contains the entire menu tree — so we close the whole menu on any
|
|
3921
|
+
// interaction outside it (ignoring the trigger, which toggles on its own).
|
|
3922
|
+
(0, react_aria_1.useInteractOutside)({
|
|
3923
|
+
ref: popoverRef,
|
|
3924
|
+
isDisabled: isSubmenu,
|
|
3925
|
+
onInteractOutside: (event) => {
|
|
3926
|
+
const trigger = props.triggerRef?.current;
|
|
3927
|
+
if (trigger && trigger.contains(event.target)) {
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
state.close();
|
|
3931
|
+
},
|
|
3932
|
+
});
|
|
3933
|
+
const popover = ((0, jsx_runtime_1.jsxs)(Popover_1.Popover, { state: state, offset: offset, popoverRef: popoverRef, ...props, portalContainer: isSubmenu ? (groupContainer?.current ?? undefined) : undefined, children: [isMobile ? ((0, jsx_runtime_1.jsx)(DropdownMobile_1.DropdownMobile, { children: children })) : ((0, jsx_runtime_1.jsx)(DropdownDesktop_1.DropdownDesktop, { maxHeight: '80vh', overflowY: 'auto', maxWidth: maxWidth, children: children })), !isSubmenu && ((0, jsx_runtime_1.jsx)("span", { ref: containerRef, style: { display: 'contents' } }))] }));
|
|
3934
|
+
if (isSubmenu) {
|
|
3935
|
+
return popover;
|
|
3896
3936
|
}
|
|
3897
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
3937
|
+
return ((0, jsx_runtime_1.jsx)(MenuPortalContext_1.MenuPortalContext.Provider, { value: containerRef, children: popover }));
|
|
3898
3938
|
}
|
|
3899
3939
|
exports["default"] = MenuPopover;
|
|
3900
3940
|
|
|
3901
3941
|
|
|
3942
|
+
/***/ },
|
|
3943
|
+
|
|
3944
|
+
/***/ "./src/components/Menu/MenuPortalContext.ts"
|
|
3945
|
+
/*!**************************************************!*\
|
|
3946
|
+
!*** ./src/components/Menu/MenuPortalContext.ts ***!
|
|
3947
|
+
\**************************************************/
|
|
3948
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
3949
|
+
|
|
3950
|
+
|
|
3951
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3952
|
+
exports.useMenuPortalContainer = exports.MenuPortalContext = void 0;
|
|
3953
|
+
const react_1 = __webpack_require__(/*! react */ "react");
|
|
3954
|
+
/**
|
|
3955
|
+
* Ref to the root menu popover's portal container.
|
|
3956
|
+
*
|
|
3957
|
+
* Submenu popovers portal into this container instead of straight into
|
|
3958
|
+
* `document.body`, so the whole menu tree lives in a single DOM subtree nested
|
|
3959
|
+
* under the root popover. This mirrors `react-aria-components`'
|
|
3960
|
+
* `PopoverGroupContext` and is what keeps focus tracking and `aria-hidden`
|
|
3961
|
+
* scoping correct across submenu levels — without it each portaled submenu
|
|
3962
|
+
* looks like "outside" to the root popover and close-on-blur tears the tree
|
|
3963
|
+
* down.
|
|
3964
|
+
*
|
|
3965
|
+
* `null` means there is no root yet, i.e. the consuming popover IS the root.
|
|
3966
|
+
*/
|
|
3967
|
+
exports.MenuPortalContext = (0, react_1.createContext)(null);
|
|
3968
|
+
const useMenuPortalContainer = () => (0, react_1.useContext)(exports.MenuPortalContext);
|
|
3969
|
+
exports.useMenuPortalContainer = useMenuPortalContainer;
|
|
3970
|
+
|
|
3971
|
+
|
|
3902
3972
|
/***/ },
|
|
3903
3973
|
|
|
3904
3974
|
/***/ "./src/components/Menu/MenuSection.tsx"
|
|
@@ -3918,7 +3988,8 @@ const Box_1 = __webpack_require__(/*! ../Box */ "./src/components/Box/index.ts")
|
|
|
3918
3988
|
const Divider_1 = __webpack_require__(/*! ../Divider */ "./src/components/Divider/index.ts");
|
|
3919
3989
|
const Option_1 = __webpack_require__(/*! ../Option */ "./src/components/Option/index.ts");
|
|
3920
3990
|
const MenuItem_1 = __importDefault(__webpack_require__(/*! ./MenuItem */ "./src/components/Menu/MenuItem.tsx"));
|
|
3921
|
-
|
|
3991
|
+
const MenuSubmenu_1 = __importDefault(__webpack_require__(/*! ./MenuSubmenu */ "./src/components/Menu/MenuSubmenu.tsx"));
|
|
3992
|
+
function MenuSection({ section, state, rootMenuTriggerState, parentMenuRef, onAction, }) {
|
|
3922
3993
|
const { itemProps, headingProps, groupProps } = (0, react_aria_1.useMenuSection)({
|
|
3923
3994
|
'heading': section.rendered,
|
|
3924
3995
|
'aria-label': section['aria-label'],
|
|
@@ -3927,11 +3998,85 @@ function MenuSection({ section, state, }) {
|
|
|
3927
3998
|
elementType: 'span',
|
|
3928
3999
|
});
|
|
3929
4000
|
// If the section is not the first, add a separator element.
|
|
3930
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [section.key !== state.collection.getFirstKey() && ((0, jsx_runtime_1.jsx)(Divider_1.Divider, { ...separatorProps })), (0, jsx_runtime_1.jsxs)("div", { ...itemProps, children: [section.rendered && ((0, jsx_runtime_1.jsx)(Option_1.OptionTitle, { ...headingProps, children: section.rendered })), (0, jsx_runtime_1.jsx)(Box_1.Box, { ...groupProps, padding: '0', children: [...section.childNodes].map((node) => ((0, jsx_runtime_1.jsx)(MenuItem_1.default, { item: node, state: state }, node.key))) })] })] }));
|
|
4001
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [section.key !== state.collection.getFirstKey() && ((0, jsx_runtime_1.jsx)(Divider_1.Divider, { ...separatorProps })), (0, jsx_runtime_1.jsxs)("div", { ...itemProps, children: [section.rendered && ((0, jsx_runtime_1.jsx)(Option_1.OptionTitle, { ...headingProps, children: section.rendered })), (0, jsx_runtime_1.jsx)(Box_1.Box, { ...groupProps, padding: '0', children: [...section.childNodes].map((node) => node.hasChildNodes ? ((0, jsx_runtime_1.jsx)(MenuSubmenu_1.default, { item: node, state: state, rootMenuTriggerState: rootMenuTriggerState, parentMenuRef: parentMenuRef, onAction: onAction }, node.key)) : ((0, jsx_runtime_1.jsx)(MenuItem_1.default, { item: node, state: state }, node.key))) })] })] }));
|
|
3931
4002
|
}
|
|
3932
4003
|
exports["default"] = MenuSection;
|
|
3933
4004
|
|
|
3934
4005
|
|
|
4006
|
+
/***/ },
|
|
4007
|
+
|
|
4008
|
+
/***/ "./src/components/Menu/MenuSubmenu.tsx"
|
|
4009
|
+
/*!*********************************************!*\
|
|
4010
|
+
!*** ./src/components/Menu/MenuSubmenu.tsx ***!
|
|
4011
|
+
\*********************************************/
|
|
4012
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
4013
|
+
|
|
4014
|
+
|
|
4015
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4016
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4017
|
+
};
|
|
4018
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4019
|
+
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
4020
|
+
const react_1 = __webpack_require__(/*! react */ "react");
|
|
4021
|
+
const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
|
|
4022
|
+
const react_stately_1 = __webpack_require__(/*! react-stately */ "react-stately");
|
|
4023
|
+
const Icon_1 = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
|
|
4024
|
+
const MenuDropdown_1 = __importDefault(__webpack_require__(/*! ./MenuDropdown */ "./src/components/Menu/MenuDropdown.tsx"));
|
|
4025
|
+
const MenuOption_1 = __importDefault(__webpack_require__(/*! ./MenuOption */ "./src/components/Menu/MenuOption.tsx"));
|
|
4026
|
+
const MenuPopover_1 = __importDefault(__webpack_require__(/*! ./MenuPopover */ "./src/components/Menu/MenuPopover.tsx"));
|
|
4027
|
+
/**
|
|
4028
|
+
* Renders a menu item that opens a nested submenu.
|
|
4029
|
+
*
|
|
4030
|
+
* The trigger item belongs to the parent menu's tree state (so arrow-key
|
|
4031
|
+
* navigation keeps working), while the submenu renders its own `MenuDropDown`
|
|
4032
|
+
* built from the trigger's children — giving it an isolated collection and
|
|
4033
|
+
* focus scope, mirroring how `react-aria-components` handles `SubmenuTrigger`.
|
|
4034
|
+
*/
|
|
4035
|
+
function MenuSubmenu({ item, state, rootMenuTriggerState, parentMenuRef, onAction, }) {
|
|
4036
|
+
const triggerRef = (0, react_1.useRef)(null);
|
|
4037
|
+
const submenuRef = (0, react_1.useRef)(null);
|
|
4038
|
+
const submenuTriggerState = (0, react_stately_1.useSubmenuTriggerState)({ triggerKey: item.key }, rootMenuTriggerState);
|
|
4039
|
+
const { submenuTriggerProps, submenuProps, popoverProps } = (0, react_aria_1.useSubmenuTrigger)({ parentMenuRef, submenuRef }, submenuTriggerState, triggerRef);
|
|
4040
|
+
/** react-aria's submenu hooks bind Escape to `state.closeAll()`, tearing down the whole menu tree. We override Escape so it dismisses only this submenu level — keeping its ancestors open — matching react-aria-components, where Escape closes the latest open submenu one level at a time.
|
|
4041
|
+
**/
|
|
4042
|
+
const closeSubmenu = () => {
|
|
4043
|
+
// Mirror the ArrowLeft behavior: move focus back to the trigger so the parent menu stays keyboard-navigable and a subsequent Escape closes the next level up.
|
|
4044
|
+
triggerRef.current?.focus();
|
|
4045
|
+
submenuTriggerState.close();
|
|
4046
|
+
};
|
|
4047
|
+
/** Fires when focus is inside the submenu (keyboard navigation). */
|
|
4048
|
+
const onSubmenuKeyDown = (event) => {
|
|
4049
|
+
if (event.key === 'Escape') {
|
|
4050
|
+
event.stopPropagation();
|
|
4051
|
+
closeSubmenu();
|
|
4052
|
+
return;
|
|
4053
|
+
}
|
|
4054
|
+
submenuProps.onKeyDown?.(event);
|
|
4055
|
+
};
|
|
4056
|
+
/** Fires when focus is on the trigger itself (e.g. a hover/press-opened submenu). When this submenu is open, close just it; once it's closed, let Escape bubble so the parent menu handles the next level up.
|
|
4057
|
+
**/
|
|
4058
|
+
const onTriggerKeyDown = (event) => {
|
|
4059
|
+
if (event.key === 'Escape') {
|
|
4060
|
+
if (submenuTriggerState.isOpen) {
|
|
4061
|
+
closeSubmenu();
|
|
4062
|
+
return;
|
|
4063
|
+
}
|
|
4064
|
+
event.continuePropagation();
|
|
4065
|
+
return;
|
|
4066
|
+
}
|
|
4067
|
+
submenuTriggerProps.onKeyDown?.(event);
|
|
4068
|
+
};
|
|
4069
|
+
const { menuItemProps, isFocused, isDisabled } = (0, react_aria_1.useMenuItem)({ ...submenuTriggerProps, onKeyDown: onTriggerKeyDown, key: item.key }, state, triggerRef);
|
|
4070
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MenuOption_1.default, { ...(0, react_aria_1.mergeProps)(menuItemProps, {
|
|
4071
|
+
'id': submenuTriggerProps.id,
|
|
4072
|
+
'aria-haspopup': submenuTriggerProps['aria-haspopup'],
|
|
4073
|
+
'aria-expanded': submenuTriggerProps['aria-expanded'],
|
|
4074
|
+
'aria-controls': submenuTriggerProps['aria-controls'],
|
|
4075
|
+
}), ref: triggerRef, focus: isFocused, disabled: isDisabled, is: 'div', variant: item.value?.variant, children: (0, jsx_runtime_1.jsxs)("div", { className: 'rcx-option__wrapper', children: [item.rendered, (0, jsx_runtime_1.jsx)("div", { className: 'rcx-option__input', children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: 'chevron-left', size: 'x16' }) })] }) }), submenuTriggerState.isOpen && ((0, jsx_runtime_1.jsx)(MenuPopover_1.default, { ...popoverProps, state: submenuTriggerState, triggerRef: triggerRef, placement: 'right top', children: (0, jsx_runtime_1.jsx)(MenuDropdown_1.default, { ...submenuProps, onKeyDown: onSubmenuKeyDown, rootMenuTriggerState: rootMenuTriggerState, menuRef: submenuRef, onAction: onAction, children: item.props?.children }) }))] }));
|
|
4076
|
+
}
|
|
4077
|
+
exports["default"] = MenuSubmenu;
|
|
4078
|
+
|
|
4079
|
+
|
|
3935
4080
|
/***/ },
|
|
3936
4081
|
|
|
3937
4082
|
/***/ "./src/components/Menu/helpers/helpers.ts"
|
|
@@ -3990,11 +4135,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3990
4135
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3991
4136
|
};
|
|
3992
4137
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3993
|
-
exports.MenuItemDescription = exports.MenuItemTitle = exports.MenuItemSkeleton = exports.MenuItemInput = exports.MenuItemIcon = exports.MenuItemContent = exports.MenuItemColumn = exports.MenuItemAvatar = exports.MenuSection = exports.MenuItem = exports.Menu = void 0;
|
|
4138
|
+
exports.MenuItemDescription = exports.MenuItemTitle = exports.MenuItemSkeleton = exports.MenuItemInput = exports.MenuItemIcon = exports.MenuItemContent = exports.MenuItemColumn = exports.MenuItemAvatar = exports.MenuSection = exports.MenuSubmenuTrigger = exports.MenuItem = exports.Menu = void 0;
|
|
3994
4139
|
var Menu_1 = __webpack_require__(/*! ./Menu */ "./src/components/Menu/Menu.tsx");
|
|
3995
4140
|
Object.defineProperty(exports, "Menu", ({ enumerable: true, get: function () { return __importDefault(Menu_1).default; } }));
|
|
3996
4141
|
var MenuItem_1 = __webpack_require__(/*! ./stately/MenuItem */ "./src/components/Menu/stately/MenuItem.tsx");
|
|
3997
4142
|
Object.defineProperty(exports, "MenuItem", ({ enumerable: true, get: function () { return __importDefault(MenuItem_1).default; } }));
|
|
4143
|
+
var MenuSubmenuTrigger_1 = __webpack_require__(/*! ./stately/MenuSubmenuTrigger */ "./src/components/Menu/stately/MenuSubmenuTrigger.tsx");
|
|
4144
|
+
Object.defineProperty(exports, "MenuSubmenuTrigger", ({ enumerable: true, get: function () { return __importDefault(MenuSubmenuTrigger_1).default; } }));
|
|
3998
4145
|
var MenuSection_1 = __webpack_require__(/*! ./stately/MenuSection */ "./src/components/Menu/stately/MenuSection.tsx");
|
|
3999
4146
|
Object.defineProperty(exports, "MenuSection", ({ enumerable: true, get: function () { return __importDefault(MenuSection_1).default; } }));
|
|
4000
4147
|
var Option_1 = __webpack_require__(/*! ../Option */ "./src/components/Option/index.ts");
|
|
@@ -4127,6 +4274,74 @@ MenuSection.getCollectionNode = function* getCollectionNode(props) {
|
|
|
4127
4274
|
exports["default"] = MenuSection;
|
|
4128
4275
|
|
|
4129
4276
|
|
|
4277
|
+
/***/ },
|
|
4278
|
+
|
|
4279
|
+
/***/ "./src/components/Menu/stately/MenuSubmenuTrigger.tsx"
|
|
4280
|
+
/*!************************************************************!*\
|
|
4281
|
+
!*** ./src/components/Menu/stately/MenuSubmenuTrigger.tsx ***!
|
|
4282
|
+
\************************************************************/
|
|
4283
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
4284
|
+
|
|
4285
|
+
|
|
4286
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4287
|
+
const react_1 = __webpack_require__(/*! react */ "react");
|
|
4288
|
+
function MenuSubmenuTrigger(_props) {
|
|
4289
|
+
return null;
|
|
4290
|
+
}
|
|
4291
|
+
const toElementArray = (children) => {
|
|
4292
|
+
const result = [];
|
|
4293
|
+
const visit = (node) => {
|
|
4294
|
+
if (Array.isArray(node)) {
|
|
4295
|
+
node.forEach(visit);
|
|
4296
|
+
return;
|
|
4297
|
+
}
|
|
4298
|
+
if ((0, react_1.isValidElement)(node)) {
|
|
4299
|
+
result.push(node);
|
|
4300
|
+
}
|
|
4301
|
+
};
|
|
4302
|
+
visit(children);
|
|
4303
|
+
return result;
|
|
4304
|
+
};
|
|
4305
|
+
MenuSubmenuTrigger.getCollectionNode = function* getCollectionNode(props, context) {
|
|
4306
|
+
const [trigger, ...submenuItems] = toElementArray(props.children);
|
|
4307
|
+
if (!trigger || submenuItems.length === 0) {
|
|
4308
|
+
throw new Error('A <MenuSubmenuTrigger> must have at least two children: the trigger item followed by one or more submenu items.');
|
|
4309
|
+
}
|
|
4310
|
+
const rendered = trigger.props.children;
|
|
4311
|
+
const textValue = props.textValue ||
|
|
4312
|
+
trigger.props.textValue ||
|
|
4313
|
+
(typeof rendered === 'string' ? rendered : '') ||
|
|
4314
|
+
props['aria-label'] ||
|
|
4315
|
+
trigger.props['aria-label'] ||
|
|
4316
|
+
'';
|
|
4317
|
+
if (!textValue && !context?.suppressTextValueWarning) {
|
|
4318
|
+
console.warn('<MenuSubmenuTrigger> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
|
|
4319
|
+
}
|
|
4320
|
+
yield {
|
|
4321
|
+
'type': 'item',
|
|
4322
|
+
// Only the submenu items are forwarded as children — the trigger element is
|
|
4323
|
+
// consumed here and rendered separately by `MenuSubmenu`.
|
|
4324
|
+
'props': { ...props, children: submenuItems },
|
|
4325
|
+
rendered,
|
|
4326
|
+
textValue,
|
|
4327
|
+
'aria-label': props['aria-label'] || trigger.props['aria-label'],
|
|
4328
|
+
'value': (props.variant
|
|
4329
|
+
? { variant: props.variant }
|
|
4330
|
+
: undefined),
|
|
4331
|
+
'hasChildNodes': true,
|
|
4332
|
+
*'childNodes'() {
|
|
4333
|
+
for (const item of submenuItems) {
|
|
4334
|
+
yield {
|
|
4335
|
+
type: 'item',
|
|
4336
|
+
element: item,
|
|
4337
|
+
};
|
|
4338
|
+
}
|
|
4339
|
+
},
|
|
4340
|
+
};
|
|
4341
|
+
};
|
|
4342
|
+
exports["default"] = MenuSubmenuTrigger;
|
|
4343
|
+
|
|
4344
|
+
|
|
4130
4345
|
/***/ },
|
|
4131
4346
|
|
|
4132
4347
|
/***/ "./src/components/Message/Message.tsx"
|
|
@@ -7749,8 +7964,9 @@ const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-ru
|
|
|
7749
7964
|
const react_1 = __webpack_require__(/*! react */ "react");
|
|
7750
7965
|
const react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
|
|
7751
7966
|
const contexts_1 = __webpack_require__(/*! ../../contexts */ "./src/contexts/index.ts");
|
|
7752
|
-
function Popover({ portalContainer, ...props }) {
|
|
7753
|
-
const
|
|
7967
|
+
function Popover({ portalContainer, popoverRef: popoverRefProp, ...props }) {
|
|
7968
|
+
const fallbackRef = (0, react_1.useRef)(null);
|
|
7969
|
+
const popoverRef = popoverRefProp ?? fallbackRef;
|
|
7754
7970
|
const { state, children, isNonModal } = props;
|
|
7755
7971
|
const { document: ownerDocument } = (0, contexts_1.useOwnerDocument)();
|
|
7756
7972
|
const { popoverProps, underlayProps } = (0, react_aria_1.usePopover)({
|
|
@@ -7758,7 +7974,7 @@ function Popover({ portalContainer, ...props }) {
|
|
|
7758
7974
|
popoverRef,
|
|
7759
7975
|
boundaryElement: ownerDocument?.body,
|
|
7760
7976
|
}, state);
|
|
7761
|
-
return ((0, jsx_runtime_1.jsxs)(react_aria_1.Overlay, { portalContainer: ownerDocument?.body, children: [!isNonModal && (0, jsx_runtime_1.jsx)("div", { ...underlayProps }), (0, jsx_runtime_1.jsxs)("div", { ...popoverProps, ref: popoverRef, children: [!isNonModal && (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close }), children, (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close })] })] }));
|
|
7977
|
+
return ((0, jsx_runtime_1.jsxs)(react_aria_1.Overlay, { portalContainer: portalContainer ?? ownerDocument?.body, children: [!isNonModal && (0, jsx_runtime_1.jsx)("div", { ...underlayProps }), (0, jsx_runtime_1.jsxs)("div", { ...popoverProps, ref: popoverRef, children: [!isNonModal && (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close }), children, (0, jsx_runtime_1.jsx)(react_aria_1.DismissButton, { onDismiss: state.close })] })] }));
|
|
7762
7978
|
}
|
|
7763
7979
|
exports["default"] = Popover;
|
|
7764
7980
|
|
|
@@ -9042,13 +9258,13 @@ exports.SidebarCollapseGroup = SidebarCollapseGroup;
|
|
|
9042
9258
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
9043
9259
|
const SidebarGroupTitle_1 = __webpack_require__(/*! ./SidebarGroupTitle */ "./src/components/SidebarV2/SidebarGroupTitle.tsx");
|
|
9044
9260
|
const useCollapse_1 = __webpack_require__(/*! ./hooks/useCollapse */ "./src/components/SidebarV2/hooks/useCollapse.tsx");
|
|
9045
|
-
function SidebarCollapseGroup({ ref, expanded: propExpanded, defaultExpanded, tabIndex, children, badge, title, ...props }) {
|
|
9261
|
+
function SidebarCollapseGroup({ ref, expanded: propExpanded, defaultExpanded, tabIndex, children, badge, menu, title, ...props }) {
|
|
9046
9262
|
const { barProps, expanded, panelExpanded, panelId, titleId } = (0, useCollapse_1.useCollapse)({
|
|
9047
9263
|
expanded: propExpanded,
|
|
9048
9264
|
defaultExpanded,
|
|
9049
9265
|
tabIndex,
|
|
9050
9266
|
});
|
|
9051
|
-
return ((0, jsx_runtime_1.jsxs)("section", { className: 'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group', ...props, children: [(0, jsx_runtime_1.jsx)(SidebarGroupTitle_1.SidebarGroupTitle, { expanded: expanded, title: title, titleId: titleId, badge: badge, barProps: barProps, role: 'button' }), (0, jsx_runtime_1.jsx)("div", { role: 'list', ref: ref, className: [
|
|
9267
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: 'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group', ...props, children: [(0, jsx_runtime_1.jsx)(SidebarGroupTitle_1.SidebarGroupTitle, { expanded: expanded, title: title, titleId: titleId, badge: badge, menu: menu, barProps: barProps, role: 'button' }), (0, jsx_runtime_1.jsx)("div", { role: 'list', ref: ref, className: [
|
|
9052
9268
|
'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group__panel rcx-box--animated',
|
|
9053
9269
|
panelExpanded && 'rcx-sidebar-v2-collapse-group__panel--expanded',
|
|
9054
9270
|
]
|
|
@@ -9057,6 +9273,26 @@ function SidebarCollapseGroup({ ref, expanded: propExpanded, defaultExpanded, ta
|
|
|
9057
9273
|
}
|
|
9058
9274
|
|
|
9059
9275
|
|
|
9276
|
+
/***/ },
|
|
9277
|
+
|
|
9278
|
+
/***/ "./src/components/SidebarV2/SidebarCollapseGroupMenu.tsx"
|
|
9279
|
+
/*!***************************************************************!*\
|
|
9280
|
+
!*** ./src/components/SidebarV2/SidebarCollapseGroupMenu.tsx ***!
|
|
9281
|
+
\***************************************************************/
|
|
9282
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
9283
|
+
|
|
9284
|
+
|
|
9285
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9286
|
+
exports.SidebarCollapseGroupMenu = void 0;
|
|
9287
|
+
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
9288
|
+
const appendClassName_1 = __webpack_require__(/*! ../../helpers/appendClassName */ "./src/helpers/appendClassName.ts");
|
|
9289
|
+
const patchChildren_1 = __webpack_require__(/*! ../../helpers/patchChildren */ "./src/helpers/patchChildren.ts");
|
|
9290
|
+
const SidebarCollapseGroupMenu = ({ children, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: 'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group__menu-wrapper rcx-box--animated', ...props, children: (0, patchChildren_1.patchChildren)((0, jsx_runtime_1.jsx)("span", { className: 'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group__menu', children: children }), (childProps) => ({
|
|
9291
|
+
className: (0, appendClassName_1.appendClassName)(childProps.className, 'rcx-sidebar-v2-collapse-group__menu'),
|
|
9292
|
+
})) }));
|
|
9293
|
+
exports.SidebarCollapseGroupMenu = SidebarCollapseGroupMenu;
|
|
9294
|
+
|
|
9295
|
+
|
|
9060
9296
|
/***/ },
|
|
9061
9297
|
|
|
9062
9298
|
/***/ "./src/components/SidebarV2/SidebarDivider.tsx"
|
|
@@ -9137,12 +9373,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
9137
9373
|
exports.SidebarGroupTitle = void 0;
|
|
9138
9374
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
9139
9375
|
const Chevron_1 = __webpack_require__(/*! ../Chevron */ "./src/components/Chevron/index.ts");
|
|
9140
|
-
const
|
|
9376
|
+
const SidebarCollapseGroupMenu_1 = __webpack_require__(/*! ./SidebarCollapseGroupMenu */ "./src/components/SidebarV2/SidebarCollapseGroupMenu.tsx");
|
|
9377
|
+
const SidebarGroupTitle = ({ title, titleId, badge, menu, barProps, expanded, role, ...props }) => ((0, jsx_runtime_1.jsxs)("div", { className: [
|
|
9141
9378
|
'rcx-box rcx-box--full',
|
|
9142
9379
|
'rcx-sidebar-v2-collapse-group__bar rcx-box--animated',
|
|
9143
9380
|
]
|
|
9144
9381
|
.filter(Boolean)
|
|
9145
|
-
.join(' '), ...
|
|
9382
|
+
.join(' '), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'rcx-box rcx-sidebar-v2-collapse-group__bar-button', role: role, ...barProps, children: [expanded !== undefined && (0, jsx_runtime_1.jsx)(Chevron_1.Chevron, { size: 'x20', right: !expanded }), title && ((0, jsx_runtime_1.jsx)("h4", { className: 'rcx-box rcx-box--full rcx-sidebar-v2-collapse-group__title', id: titleId, children: title })), !expanded && badge && badge] }), menu && (0, jsx_runtime_1.jsx)(SidebarCollapseGroupMenu_1.SidebarCollapseGroupMenu, { children: menu })] }));
|
|
9146
9383
|
exports.SidebarGroupTitle = SidebarGroupTitle;
|
|
9147
9384
|
|
|
9148
9385
|
|
|
@@ -9653,7 +9890,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9653
9890
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9654
9891
|
};
|
|
9655
9892
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9656
|
-
exports.SidebarV2GroupTitle = exports.SidebarV2Divider = exports.SidebarV2Section = exports.SidebarV2ButtonGroup = exports.SidebarV2Banner = exports.SidebarV2CollapseGroup = exports.SidebarV2Link = exports.SidebarV2Actions = exports.SidebarV2Action = exports.SidebarV2AccordionItem = exports.SidebarV2Accordion = exports.SidebarV2 = void 0;
|
|
9893
|
+
exports.SidebarV2GroupTitle = exports.SidebarV2Divider = exports.SidebarV2Section = exports.SidebarV2ButtonGroup = exports.SidebarV2Banner = exports.SidebarV2CollapseGroupMenu = exports.SidebarV2CollapseGroup = exports.SidebarV2Link = exports.SidebarV2Actions = exports.SidebarV2Action = exports.SidebarV2AccordionItem = exports.SidebarV2Accordion = exports.SidebarV2 = void 0;
|
|
9657
9894
|
var Sidebar_1 = __webpack_require__(/*! ./Sidebar */ "./src/components/SidebarV2/Sidebar.tsx");
|
|
9658
9895
|
Object.defineProperty(exports, "SidebarV2", ({ enumerable: true, get: function () { return Sidebar_1.Sidebar; } }));
|
|
9659
9896
|
var SidebarAccordion_1 = __webpack_require__(/*! ./SidebarAccordion */ "./src/components/SidebarV2/SidebarAccordion.tsx");
|
|
@@ -9669,6 +9906,8 @@ Object.defineProperty(exports, "SidebarV2Link", ({ enumerable: true, get: functi
|
|
|
9669
9906
|
__exportStar(__webpack_require__(/*! ./SidebarItem */ "./src/components/SidebarV2/SidebarItem/index.ts"), exports);
|
|
9670
9907
|
var SidebarCollapseGroup_1 = __webpack_require__(/*! ./SidebarCollapseGroup */ "./src/components/SidebarV2/SidebarCollapseGroup.tsx");
|
|
9671
9908
|
Object.defineProperty(exports, "SidebarV2CollapseGroup", ({ enumerable: true, get: function () { return SidebarCollapseGroup_1.SidebarCollapseGroup; } }));
|
|
9909
|
+
var SidebarCollapseGroupMenu_1 = __webpack_require__(/*! ./SidebarCollapseGroupMenu */ "./src/components/SidebarV2/SidebarCollapseGroupMenu.tsx");
|
|
9910
|
+
Object.defineProperty(exports, "SidebarV2CollapseGroupMenu", ({ enumerable: true, get: function () { return SidebarCollapseGroupMenu_1.SidebarCollapseGroupMenu; } }));
|
|
9672
9911
|
var SidebarBanner_1 = __webpack_require__(/*! ./SidebarBanner */ "./src/components/SidebarV2/SidebarBanner.tsx");
|
|
9673
9912
|
Object.defineProperty(exports, "SidebarV2Banner", ({ enumerable: true, get: function () { return SidebarBanner_1.SidebarBanner; } }));
|
|
9674
9913
|
__exportStar(__webpack_require__(/*! ./SidebarFooter */ "./src/components/SidebarV2/SidebarFooter/index.ts"), exports);
|
|
@@ -12349,17 +12588,17 @@ module.exports = require("react/jsx-runtime");
|
|
|
12349
12588
|
/******/ });
|
|
12350
12589
|
/************************************************************************/
|
|
12351
12590
|
/******/ // The module cache
|
|
12352
|
-
/******/
|
|
12591
|
+
/******/ const __webpack_module_cache__ = {};
|
|
12353
12592
|
/******/
|
|
12354
12593
|
/******/ // The require function
|
|
12355
12594
|
/******/ function __webpack_require__(moduleId) {
|
|
12356
12595
|
/******/ // Check if module is in cache
|
|
12357
|
-
/******/
|
|
12596
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
12358
12597
|
/******/ if (cachedModule !== undefined) {
|
|
12359
12598
|
/******/ return cachedModule.exports;
|
|
12360
12599
|
/******/ }
|
|
12361
12600
|
/******/ // Create a new module (and put it into the cache)
|
|
12362
|
-
/******/
|
|
12601
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
12363
12602
|
/******/ // no module.id needed
|
|
12364
12603
|
/******/ // no module.loaded needed
|
|
12365
12604
|
/******/ exports: {}
|
|
@@ -12368,7 +12607,7 @@ module.exports = require("react/jsx-runtime");
|
|
|
12368
12607
|
/******/ // Execute the module function
|
|
12369
12608
|
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
12370
12609
|
/******/ delete __webpack_module_cache__[moduleId];
|
|
12371
|
-
/******/
|
|
12610
|
+
/******/ const e = new Error("Cannot find module '" + moduleId + "'");
|
|
12372
12611
|
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
12373
12612
|
/******/ throw e;
|
|
12374
12613
|
/******/ }
|
|
@@ -12383,7 +12622,7 @@ module.exports = require("react/jsx-runtime");
|
|
|
12383
12622
|
/******/ (() => {
|
|
12384
12623
|
/******/ // define __esModule on exports
|
|
12385
12624
|
/******/ __webpack_require__.r = (exports) => {
|
|
12386
|
-
/******/ if(
|
|
12625
|
+
/******/ if(Symbol.toStringTag) {
|
|
12387
12626
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
12388
12627
|
/******/ }
|
|
12389
12628
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -12395,7 +12634,7 @@ module.exports = require("react/jsx-runtime");
|
|
|
12395
12634
|
/******/ // startup
|
|
12396
12635
|
/******/ // Load entry module and return exports
|
|
12397
12636
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
12398
|
-
/******/
|
|
12637
|
+
/******/ let __webpack_exports__ = __webpack_require__("./src/index.ts");
|
|
12399
12638
|
/******/ module.exports = __webpack_exports__;
|
|
12400
12639
|
/******/
|
|
12401
12640
|
/******/ })()
|