UNPKG

nice-ui

Version:

React design system, components, and utilities

23 lines (22 loc) 823 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AvatarStack = void 0; const React = require("react"); const nano_theme_1 = require("nano-theme"); const blockClass = (0, nano_theme_1.rule)({ w: '100%', d: 'flex', }); const itemClass = (0, nano_theme_1.rule)({ op: 0.8, '&:hover': { op: 1, }, }); const AvatarStack = ({ gap = 0, noHoverEffect: noHover, children }) => { const list = React.Children.map(children, (el, index) => !el ? null : (React.createElement("div", { key: index, className: noHover ? undefined : itemClass, style: { marginLeft: gap } }, el))); if (!list) return null; return (React.createElement("div", { className: blockClass, style: { marginLeft: -gap } }, list.filter(Boolean))); }; exports.AvatarStack = AvatarStack;