@ariakit/react
Version:
Toolkit for building accessible web apps with React
37 lines (23 loc) • 1.19 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true});
var _ITEGEFBHcjs = require('./ITEGEFBH.cjs');
var _LZ6L3ECGcjs = require('./LZ6L3ECG.cjs');
// ../ariakit-react-components/dist/dialog/dialog-description.js
var _react = require('react');
var TagName = "p";
var useDialogDescription = _LZ6L3ECGcjs.createHook.call(void 0, function useDialogDescription2({ store, ...props }) {
const setDescriptionId = _react.useContext.call(void 0, _ITEGEFBHcjs.DialogDescriptionContext);
const id = _LZ6L3ECGcjs.useId.call(void 0, props.id);
_LZ6L3ECGcjs.useSafeLayoutEffect.call(void 0, () => {
setDescriptionId == null ? void 0 : setDescriptionId(id);
return () => setDescriptionId == null ? void 0 : setDescriptionId(void 0);
}, [setDescriptionId, id]);
props = {
...props,
id
};
return _LZ6L3ECGcjs.removeUndefinedValues.call(void 0, props);
});
var DialogDescription = _LZ6L3ECGcjs.forwardRef.call(void 0, function DialogDescription2(props) {
return _LZ6L3ECGcjs.createElement.call(void 0, TagName, useDialogDescription(props));
});
exports.useDialogDescription = useDialogDescription; exports.DialogDescription = DialogDescription;