UNPKG

@vectara/vectara-ui

Version:

Vectara's design system, codified as a React and Sass component library

13 lines (12 loc) 1.1 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from "classnames"; export const VuiPanel = ({ icon, children, actions, background, backgroundScale = "height", align = "top", color = "default", backgroundMaxSize }) => { const classes = classNames("vuiPanel", `vuiPanel--${color}`, `vuiPanel--align-${align}`); const style = backgroundMaxSize !== undefined ? { maxWidth: backgroundScale === "width" ? backgroundMaxSize : undefined, maxHeight: backgroundScale === "height" ? backgroundMaxSize : undefined } : {}; return (_jsxs("div", Object.assign({ className: classes }, { children: [background && (_jsx("img", { className: `vuiPanelBackground vuiBackgroundScale--${backgroundScale}`, src: background, style: style })), icon && _jsx("div", Object.assign({ className: "vuiPanelIcon" }, { children: icon })), children && _jsx("div", Object.assign({ className: "vuiPanelContent" }, { children: children })), actions && _jsx("div", Object.assign({ className: "vuiPanelActions" }, { children: actions }))] }))); };