@rocket.chat/fuselage 0.32.0-dev.389 → 0.32.0-dev.390
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { UsePositionOptions } from '@rocket.chat/fuselage-hooks';
|
|
2
2
|
import type { ComponentProps, ElementType } from 'react';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import type { AriaMenuProps } from 'react-aria';
|
|
4
5
|
import type { MenuTriggerProps } from 'react-stately';
|
|
5
6
|
import type Box from '../../Box/Box';
|
|
@@ -20,7 +21,8 @@ interface MenuButtonProps<T> extends AriaMenuProps<T>, MenuTriggerProps {
|
|
|
20
21
|
className?: ComponentProps<typeof Box>['className'];
|
|
21
22
|
pressed?: boolean;
|
|
22
23
|
maxWidth?: string;
|
|
24
|
+
button?: React.ReactElement;
|
|
23
25
|
}
|
|
24
|
-
declare const Menu: <T extends object>({ icon, placement, title, is: MenuButton, className, pressed, maxWidth, ...props }: MenuButtonProps<T>) => JSX.Element;
|
|
26
|
+
declare const Menu: <T extends object>({ icon, placement, title, is: MenuButton, className, pressed, maxWidth, button, ...props }: MenuButtonProps<T>) => JSX.Element;
|
|
25
27
|
export default Menu;
|
|
26
28
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/V2/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/V2/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,UAAU,eAAe,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB;IACrE,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,SAAS,CAAC,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B;AACD,QAAA,MAAM,IAAI,mJA4DT,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -7083,7 +7083,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
7083
7083
|
|
|
7084
7084
|
|
|
7085
7085
|
var Menu = function (_a) {
|
|
7086
|
-
var _b = _a.icon, icon = _b === void 0 ? 'kebab' : _b, _c = _a.placement, placement = _c === void 0 ? 'bottom-start' : _c, title = _a.title, _d = _a.is, MenuButton = _d === void 0 ? _Button__WEBPACK_IMPORTED_MODULE_3__.IconButton : _d, className = _a.className, pressed = _a.pressed, _e = _a.maxWidth, maxWidth = _e === void 0 ? 'x250' : _e, props = __rest(_a, ["icon", "placement", "title", "is", "className", "pressed", "maxWidth"]);
|
|
7086
|
+
var _b = _a.icon, icon = _b === void 0 ? 'kebab' : _b, _c = _a.placement, placement = _c === void 0 ? 'bottom-start' : _c, title = _a.title, _d = _a.is, MenuButton = _d === void 0 ? _Button__WEBPACK_IMPORTED_MODULE_3__.IconButton : _d, className = _a.className, pressed = _a.pressed, _e = _a.maxWidth, maxWidth = _e === void 0 ? 'x250' : _e, button = _a.button, props = __rest(_a, ["icon", "placement", "title", "is", "className", "pressed", "maxWidth", "button"]);
|
|
7087
7087
|
var state = (0,react_stately__WEBPACK_IMPORTED_MODULE_2__.useMenuTriggerState)(props);
|
|
7088
7088
|
var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
7089
7089
|
var _f = (0,react_aria__WEBPACK_IMPORTED_MODULE_1__.useMenuTrigger)({}, state, ref), menuTriggerProps = _f.menuTriggerProps, menuProps = _f.menuProps;
|
|
@@ -7092,7 +7092,7 @@ var Menu = function (_a) {
|
|
|
7092
7092
|
var sizes = { large: large, medium: medium, tiny: tiny, mini: mini };
|
|
7093
7093
|
var defaultSmall = !large && !medium && !tiny && !mini;
|
|
7094
7094
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
|
|
7095
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MenuButton, __assign({}, buttonProps, { ref: ref, icon: icon, className: className, title: title, pressed: pressed || state.isOpen, small: defaultSmall }, sizes)),
|
|
7095
|
+
button ? ((0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(button, __assign(__assign({}, buttonProps), { ref: ref, icon: icon, className: className, title: title, pressed: pressed || state.isOpen }))) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MenuButton, __assign({}, buttonProps, { ref: ref, icon: icon, className: className, title: title, pressed: pressed || state.isOpen, small: defaultSmall }, sizes))),
|
|
7096
7096
|
state.isOpen && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MenuPopover__WEBPACK_IMPORTED_MODULE_5__["default"], { state: state, triggerRef: ref, placement: (0,_helpers_helpers__WEBPACK_IMPORTED_MODULE_6__.getPlacement)(placement), maxWidth: maxWidth },
|
|
7097
7097
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MenuDropdown__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({}, props, menuProps))))));
|
|
7098
7098
|
};
|