UNPKG

@nex-ui/react

Version:

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

50 lines (47 loc) • 1.29 kB
"use client"; import { jsx } from 'react/jsx-runtime'; import { useDefaultProps } from '../utils/useDefaultProps.mjs'; import { useSlotClasses } from '../utils/useSlotClasses.mjs'; import { useStyles } from '../utils/useStyles.mjs'; import { useSlot } from '../utils/useSlot.mjs'; import { dividerRecipe } from '../../theme/recipes/divider.mjs'; const slots = [ 'root' ]; const Divider = (inProps)=>{ const props = useDefaultProps({ name: 'Divider', props: inProps }); const { role = 'separator', orientation = 'horizontal', ...remainingProps } = props; const ownerState = { ...props, orientation }; const slotClasses = useSlotClasses({ name: 'Divider', slots }); const style = useStyles({ ownerState, name: 'Divider', recipe: dividerRecipe }); const [DividerRoot, getDividerRootProps] = useSlot({ style, elementType: 'hr', externalForwardedProps: remainingProps, classNames: slotClasses.root, a11y: { role }, dataAttrs: { orientation } }); return /*#__PURE__*/ jsx(DividerRoot, { ...getDividerRootProps() }); }; Divider.displayName = 'Divider'; export { Divider };