Private
Public Access
1
0
Files

33 lines
1.6 KiB
JavaScript

'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "OverlayDrawerSurface", {
enumerable: true,
get: function() {
return OverlayDrawerSurface;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactdialog = require("@fluentui/react-dialog");
const _useOverlayDrawerSurfaceStylesstyles = require("./useOverlayDrawerSurfaceStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const OverlayDrawerSurface = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const dialogSurfaceState = (0, _reactdialog.useDialogSurface_unstable)({
...props,
/**
* Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.
* We need to cast the ref to a `div` element type to not break Dialog's ref type.
*
* FIXME: Evaluate the possibility to remove this cast when Dialog is refactored to accept `aside` elements.
*/ as: props.as
}, ref);
const dialogSurfaceContextValues = (0, _reactdialog.useDialogSurfaceContextValues_unstable)(dialogSurfaceState);
(0, _useOverlayDrawerSurfaceStylesstyles.useOverlayDrawerSurfaceStyles_unstable)(dialogSurfaceState);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useOverlayDrawerSurfaceStyles_unstable')(dialogSurfaceState);
return (0, _reactdialog.renderDialogSurface_unstable)(dialogSurfaceState, dialogSurfaceContextValues);
});
OverlayDrawerSurface.displayName = 'OverlayDrawerSurface';