@react-hive/honey-layout 17.12.0 → 18.0.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/HoneyBox/HoneyBox.d.ts +1 -1
- package/dist/components/HoneyContextMenu/HoneyContextMenu.types.d.ts +7 -0
- package/dist/components/HoneyContextMenu/HoneyContextMenuContent.d.ts +3 -4
- package/dist/components/HoneyContextMenu/HoneyContextMenuContentOption.d.ts +2 -3
- package/dist/components/HoneyContextMenu/HoneyContextMenuContentOptionStyled.d.ts +2 -2
- package/dist/components/HoneyFlex/HoneyFlex.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +1 -1
- package/dist/components/HoneyList/HoneyListStyled.d.ts +1 -1
- package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +20 -17
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.dev.cjs
CHANGED
|
@@ -4061,7 +4061,7 @@ const HoneyContextMenuContentOption = ({ option, renderOption, ...props }) => {
|
|
|
4061
4061
|
};
|
|
4062
4062
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyContextMenuContentOptionStyled__WEBPACK_IMPORTED_MODULE_3__.HoneyContextMenuContentOptionStyled, { onClick: handleClick,
|
|
4063
4063
|
// ARIA
|
|
4064
|
-
role: "menuitem", "aria-disabled": isDisabled, "data-testid": "honey-context-menu-option", ...props, children: renderOption?.(option) ?? option.label }));
|
|
4064
|
+
role: "menuitem", "aria-disabled": isDisabled, "data-testid": "honey-context-menu-option", ...props, children: renderOption?.({ option, context, isDisabled }) ?? option.label }));
|
|
4065
4065
|
};
|
|
4066
4066
|
|
|
4067
4067
|
|
|
@@ -5012,10 +5012,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5012
5012
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
5013
5013
|
/* harmony import */ var _floating_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/react */ "./node_modules/.pnpm/@floating-ui+react@0.27.19_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@floating-ui/react/dist/floating-ui.react.mjs");
|
|
5014
5014
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
5015
|
-
/* harmony import */ var
|
|
5016
|
-
/* harmony import */ var
|
|
5017
|
-
/* harmony import */ var
|
|
5018
|
-
/* harmony import */ var
|
|
5015
|
+
/* harmony import */ var _react_hive_honey_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @react-hive/honey-hooks */ "./node_modules/.pnpm/@react-hive+honey-hooks@3.1.0_react@19.2.7/node_modules/@react-hive/honey-hooks/dist/index.mjs");
|
|
5016
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components */ "./src/components/index.ts");
|
|
5017
|
+
/* harmony import */ var _HoneyPopupStyled__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./HoneyPopupStyled */ "./src/components/HoneyPopup/HoneyPopupStyled.ts");
|
|
5018
|
+
/* harmony import */ var _HoneyPopupPortal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./HoneyPopupPortal */ "./src/components/HoneyPopup/HoneyPopupPortal.tsx");
|
|
5019
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hooks */ "./src/components/HoneyPopup/hooks/index.ts");
|
|
5020
|
+
|
|
5019
5021
|
|
|
5020
5022
|
|
|
5021
5023
|
|
|
@@ -5026,17 +5028,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5026
5028
|
|
|
5027
5029
|
const HoneyPopupContent = ({ children, referenceProps, content, contentProps, focusManagerProps, arrowProps, portalProps, adjustStyles, context, ...popupOptions }) => {
|
|
5028
5030
|
const { useArrow, onClose } = popupOptions;
|
|
5029
|
-
const
|
|
5031
|
+
const onCloseRef = (0,_react_hive_honey_hooks__WEBPACK_IMPORTED_MODULE_4__.useHoneyLatest)(onClose);
|
|
5032
|
+
const { nodeId, floating, isOpen, arrowRef, interactions, transition } = (0,_hooks__WEBPACK_IMPORTED_MODULE_8__.useHoneyPopup)(popupOptions);
|
|
5030
5033
|
const handleDeactivateOverlay = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
|
|
5031
|
-
|
|
5032
|
-
}, [
|
|
5034
|
+
onCloseRef.current?.('escape-key');
|
|
5035
|
+
}, []);
|
|
5033
5036
|
const popupContext = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
|
|
5034
5037
|
context,
|
|
5035
5038
|
floatingContext: floating.context,
|
|
5036
5039
|
}), [context, floating.context]);
|
|
5037
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
|
|
5040
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopupStyled__WEBPACK_IMPORTED_MODULE_6__.HoneyPopupStyled, { ref: floating.refs.setReference, ...interactions.getReferenceProps({
|
|
5038
5041
|
onClick: e => e.stopPropagation(),
|
|
5039
|
-
}), ...referenceProps, "data-testid": "honey-popup", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
|
|
5042
|
+
}), ...referenceProps, "data-testid": "honey-popup", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components__WEBPACK_IMPORTED_MODULE_5__.HoneyPopupContext, { value: popupContext, children: [(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_3__.invokeIfFunction)(children, popupContext), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floating_ui_react__WEBPACK_IMPORTED_MODULE_2__.FloatingNode, { id: nodeId, children: transition.isMounted && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopupPortal__WEBPACK_IMPORTED_MODULE_7__.HoneyPopupPortal, { ...portalProps, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floating_ui_react__WEBPACK_IMPORTED_MODULE_2__.FloatingFocusManager, { context: floating.context, disabled: !isOpen, ...focusManagerProps, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components__WEBPACK_IMPORTED_MODULE_5__.HoneyOverlay, { ref: floating.refs.setFloating, active: isOpen, style: adjustStyles?.({
|
|
5040
5043
|
...floating.floatingStyles,
|
|
5041
5044
|
...transition.styles,
|
|
5042
5045
|
}, {
|
|
@@ -6239,7 +6242,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6239
6242
|
* and unregistering overlays.
|
|
6240
6243
|
*/
|
|
6241
6244
|
const useHoneyOverlays = () => {
|
|
6242
|
-
const
|
|
6245
|
+
const overlaysRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
|
|
6243
6246
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
6244
6247
|
/**
|
|
6245
6248
|
* Handles global keyup events and forwards them to the top-level overlay.
|
|
@@ -6250,18 +6253,18 @@ const useHoneyOverlays = () => {
|
|
|
6250
6253
|
* @param e - The native keyboard event emitted by the document.
|
|
6251
6254
|
*/
|
|
6252
6255
|
const handleKeyUp = (e) => {
|
|
6253
|
-
if (!
|
|
6256
|
+
if (!overlaysRef.current.length) {
|
|
6254
6257
|
// No overlays to handle key events.
|
|
6255
6258
|
return;
|
|
6256
6259
|
}
|
|
6257
|
-
const topLevelOverlay =
|
|
6260
|
+
const topLevelOverlay = overlaysRef.current[overlaysRef.current.length - 1];
|
|
6258
6261
|
topLevelOverlay.notifyListeners('keyup', e.code, e);
|
|
6259
6262
|
};
|
|
6260
6263
|
document.addEventListener('keyup', handleKeyUp);
|
|
6261
6264
|
return () => {
|
|
6262
6265
|
document.removeEventListener('keyup', handleKeyUp);
|
|
6263
6266
|
};
|
|
6264
|
-
}, [
|
|
6267
|
+
}, []);
|
|
6265
6268
|
/**
|
|
6266
6269
|
* Registers a new overlay and adds it to the top of the overlay stack.
|
|
6267
6270
|
*
|
|
@@ -6344,7 +6347,7 @@ const useHoneyOverlays = () => {
|
|
|
6344
6347
|
}
|
|
6345
6348
|
},
|
|
6346
6349
|
};
|
|
6347
|
-
|
|
6350
|
+
overlaysRef.current = [...overlaysRef.current, overlay];
|
|
6348
6351
|
return overlay;
|
|
6349
6352
|
}, []);
|
|
6350
6353
|
/**
|
|
@@ -6355,10 +6358,10 @@ const useHoneyOverlays = () => {
|
|
|
6355
6358
|
* @param targetOverlayId - The ID of the overlay to remove.
|
|
6356
6359
|
*/
|
|
6357
6360
|
const unregisterOverlay = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(targetOverlayId => {
|
|
6358
|
-
|
|
6361
|
+
overlaysRef.current = overlaysRef.current.filter(overlay => overlay.id !== targetOverlayId);
|
|
6359
6362
|
}, []);
|
|
6360
6363
|
return {
|
|
6361
|
-
overlays,
|
|
6364
|
+
overlays: overlaysRef.current,
|
|
6362
6365
|
registerOverlay,
|
|
6363
6366
|
unregisterOverlay,
|
|
6364
6367
|
};
|