UNPKG

nice-ui

Version:

React design system, components, and utilities

29 lines (28 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SeparatorColorful = void 0; const React = require("react"); const nano_theme_1 = require("nano-theme"); const blockClass = (0, nano_theme_1.rule)({ w: '100%', h: '1px', d: 'flex', alignItems: 'stretch', }); const SeparatorColorful = ({ invisible, contrast, height = 1, grey = false }) => { const theme = (0, nano_theme_1.useTheme)(); const style = invisible ? {} : { background: theme.g(0.1, theme.isLight ? (contrast ? 0.12 : 0.06) : 0.08) }; if (height !== 1) { style.height = height; } const brand = theme.color.sem.brand; const length = brand.length; const components = []; for (let i = 0; i < length; i++) { components.push(React.createElement("div", { key: i, style: { background: brand[i], width: 100 / length + '%', visibility: grey ? 'hidden' : 'visible' } })); } return (React.createElement("div", { className: blockClass, style: style }, components)); }; exports.SeparatorColorful = SeparatorColorful;