UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

23 lines (22 loc) 787 B
import { jsx as _jsx } from "react/jsx-runtime"; import { createSubcomponent } from '@workday/canvas-kit-react/common'; import { usePopupModel, usePopupPopper } from './hooks'; import { Popper } from './Popper'; // We moved this out of the component function to prevent rebuilding this object on re-renders. const popperOptions = { modifiers: [ { name: 'offset', options: { offset: () => [0, 4], }, }, ], }; export const PopupPopper = createSubcomponent('div')({ displayName: 'Popup.Popper', modelHook: usePopupModel, elemPropsHook: usePopupPopper, })(({ children, ...elemProps }) => { return (_jsx(Popper, { ...elemProps, popperOptions: popperOptions, ...elemProps, children: children })); });