UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

16 lines (15 loc) 777 B
import { jsx as _jsx } from "react/jsx-runtime"; import { createSubcomponent } from '@workday/canvas-kit-react/common'; import { usePopupPopper, Popper } from '@workday/canvas-kit-react/popup'; import { useDialogPopper, useDialogModel } from './hooks'; export const DialogPopper = createSubcomponent('div')({ displayName: 'Dialog.Popper', modelHook: useDialogModel, })(({ children, placement, popperOptions, ref, ...props }, Element, model) => { const popperProps = usePopupPopper(model, { placement, popperOptions }, ref); const elemProps = useDialogPopper(model, props); if (model.state.visibility === 'hidden') { return null; } return (_jsx(Element, { ...elemProps, children: _jsx(Popper, { ...popperProps, children: children }) })); });