@wordpress/components
Version:
UI components for WordPress.
39 lines (34 loc) • 1 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* External dependencies
*/
/**
* Internal dependencies
*/
import { contextConnect } from '../../ui/context';
import { Divider } from '../../divider';
import { useCardDivider } from './hook';
function UnconnectedCardDivider(props, forwardedRef) {
const dividerProps = useCardDivider(props);
return createElement(Divider, _extends({}, dividerProps, {
ref: forwardedRef
}));
}
/**
* `CardDivider` renders an optional divider within a `Card`.
* It is typically used to divide multiple `CardBody` components from each other.
*
* ```jsx
* import { Card, CardBody, CardDivider } from `@wordpress/components`;
*
* <Card>
* <CardBody>...</CardBody>
* <CardDivider />
* <CardBody>...</CardBody>
* </Card>
* ```
*/
export const CardDivider = contextConnect(UnconnectedCardDivider, 'CardDivider');
export default CardDivider;
//# sourceMappingURL=component.js.map