UNPKG

@geneui/components

Version:

The Gene UI components library designed for BI tools

17 lines (13 loc) 1.36 kB
import { _ as __rest } from '../tslib.es6-f211516f.js'; import React__default, { useMemo } from 'react'; import { c as classnames } from '../index-031ff73c.js'; import { s as styleInject } from '../style-inject.es-746bb8ed.js'; var css_248z = "[data-gene-ui-version=\"2.16.5\"] .divider{background:rgba(var(--background-sc-rgb),.05);height:2.6rem;width:1px}[data-gene-ui-version=\"2.16.5\"] .divider:not(.divider-withNoSpace){margin:0 1.5rem}[data-gene-ui-version=\"2.16.5\"] .divider:not(.divider-withNoSpace).type-horizontal{margin:1.5rem 0}[data-gene-ui-version=\"2.16.5\"] .divider.type-horizontal{height:1px;width:2.6rem}[data-gene-ui-version=\"2.16.5\"] .divider.type-horizontal.full-width{width:100%}"; styleInject(css_248z); const Divider = (_a) => { var { type = 'vertical', className, size, withSpace = true } = _a, restProps = __rest(_a, ["type", "className", "size", "withSpace"]); const modifiedSize = useMemo(() => (typeof size === 'number' ? `${size / 10}rem` : size), [size]); const styles = useMemo(() => (type === 'vertical' ? { height: modifiedSize } : { width: modifiedSize }), [modifiedSize, type]); return (React__default.createElement("div", Object.assign({ className: classnames('divider', `type-${type}`, { 'divider-withNoSpace': !withSpace }, className), style: styles }, restProps))); }; export { Divider as default };