UNPKG

@nex-ui/react

Version:

🎉 A beautiful, modern, and reliable React component library.

47 lines (44 loc) • 1.42 kB
"use client"; import { jsx } from 'react/jsx-runtime'; import { useDefaultProps } from '../utils/useDefaultProps.mjs'; import { useStyles } from '../utils/useStyles.mjs'; import { useSlotClasses } from '../utils/useSlotClasses.mjs'; import { useSlot } from '../utils/useSlot.mjs'; import { ModalBody } from '../modal/ModalBody.mjs'; import { drawerBodyRecipe } from '../../theme/recipes/drawer.mjs'; const slots = [ 'root' ]; const DrawerBody = (inProps)=>{ const props = useDefaultProps({ name: 'DrawerBody', props: inProps }); const { children, tabIndex = 0, ...remainingProps } = props; const style = useStyles({ ownerState: props, name: 'DrawerBody', recipe: drawerBodyRecipe }); const slotClasses = useSlotClasses({ name: 'DrawerBody', slots }); const [DrawerBodyRoot, getDrawerBodyRootProps] = useSlot({ style, elementType: ModalBody, classNames: slotClasses.root, externalForwardedProps: remainingProps, shouldForwardComponent: false, a11y: { // https://dequeuniversity.com/rules/axe/4.10/scrollable-region-focusable?application=axeAPI tabIndex } }); return /*#__PURE__*/ jsx(DrawerBodyRoot, { ...getDrawerBodyRootProps(), children: children }); }; DrawerBody.displayName = 'DrawerBody'; export { DrawerBody };