UNPKG

nice-ui

Version:

React design system, components, and utilities

35 lines (34 loc) 916 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextSep = void 0; const React = require("react"); const nano_theme_1 = require("nano-theme"); const h = React.createElement; const separatorClass = (0, nano_theme_1.rule)({ h: '1px', mar: '3px 0', w: '100%', }); const ContextSep = ({ line, grey, small, noMargin }) => { const theme = (0, nano_theme_1.useTheme)(); const props = { className: separatorClass, }; if (line) { props.style = { background: theme.isLight ? theme.g(0.92) : theme.g(0.8), }; } if (grey) { props.style = { height: small ? 3 : 7, margin: 0, background: theme.isLight ? theme.g(0.985) : theme.g(0.92), }; } if (noMargin) { props.style.margin = 0; } return h('div', props); }; exports.ContextSep = ContextSep;