@ozen-ui/kit
Version:
React component library
20 lines (19 loc) • 1.25 kB
JavaScript
import { __assign, __rest } from "tslib";
import './Divider.css';
import React from 'react';
import { useThemeProps } from '../../hooks/useThemeProps';
import { cn } from '../../utils/classname';
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
import { DIVIDER_DEFAULT_TAG } from './constants';
export var cnDivider = cn('Divider');
export var Divider = polymorphicComponentWithRef(function (inProps, ref) {
var props = useThemeProps({
props: inProps,
name: 'Divider',
});
var _a = props.as, Tag = _a === void 0 ? DIVIDER_DEFAULT_TAG : _a, _b = props.color, color = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 's' : _c, _d = props.orientation, orientation = _d === void 0 ? 'horizontal' : _d, display = props.display, className = props.className, flexItem = props.flexItem, other = __rest(props, ["as", "color", "size", "orientation", "display", "className", "flexItem"]);
return (React.createElement(Tag, __assign({ className: cnDivider({ display: display, size: size, orientation: orientation, flexItem: flexItem, color: color }, [
className,
]), role: "separator" }, other, { ref: ref })));
});
Divider.displayName = 'Divider';