UNPKG

@pagopa/mui-italia

Version:

[Material-UI](https://mui.com/core/) theme inspired by [Bootstrap Italia](https://italia.github.io/bootstrap-italia/).

38 lines (37 loc) 1.53 kB
"use strict"; "use client"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PartyAvatar = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const material_1 = require("@mui/material"); const AccountBalanceRounded_1 = tslib_1.__importDefault(require("@mui/icons-material/AccountBalanceRounded")); const _theme_1 = require("../../theme/index"); const PartyAvatar = ({ customAlt, customSrc, size = 48, id, }) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ id: id, alt: customAlt, src: customSrc, sx: { position: "relative", width: size, height: size, backgroundColor: customSrc ? _theme_1.theme.palette.background.paper : _theme_1.theme.palette.grey[200], boxSizing: "border-box", padding: _theme_1.theme.spacing(0.75) /* 6px */, /* Color of the fallback icon */ color: _theme_1.theme.palette.text.disabled, "& .MuiAvatar-img": { objectFit: "contain", objectPosition: "center", }, /* Inner shadow */ "&:after": { content: "''", position: "absolute", left: 0, right: 0, top: 0, bottom: 0, boxShadow: `inset 0 0 0 1px ${_theme_1.theme.palette.divider}`, borderRadius: "inherit", }, } }, { children: (0, jsx_runtime_1.jsx)(AccountBalanceRounded_1.default, {}) }))); exports.PartyAvatar = PartyAvatar;