UNPKG

@ozen-ui/kit

Version:

React component library

15 lines (14 loc) 1 kB
import { __assign, __rest } from "tslib"; import './Paper.css'; import React from 'react'; import { useThemeProps } from '../../hooks/useThemeProps'; import { cn } from '../../utils/classname'; import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef'; import { PAPER_DEFAULT_TAG } from './constants'; export var cnPaper = cn('Paper'); export var Paper = polymorphicComponentWithRef(function (inProps, ref) { var props = useThemeProps({ props: inProps, name: 'Paper' }); var _a = props.as, Tag = _a === void 0 ? PAPER_DEFAULT_TAG : _a, children = props.children, radius = props.radius, background = props.background, shadow = props.shadow, className = props.className, other = __rest(props, ["as", "children", "radius", "background", "shadow", "className"]); return (React.createElement(Tag, __assign({}, other, { className: cnPaper({ radius: radius, background: background, shadow: shadow }, [className]), ref: ref }), children)); }); Paper.displayName = 'Paper';