UNPKG

@lunit/oui

Version:

Lunit Oncology UI components

91 lines (90 loc) 3.66 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { Typography } from '@mui/material'; import theme from '../theme'; export const PresentationTypography = (props) => { const { size, isDimmed, ...rest } = props; if (size === 'small-dimmed') { return (_jsx(Typography, { variant: "body_m2", ...rest, style: { color: theme.palette.neutralGrey[40] } })); } if (size === 'small') { return (_jsx(Typography, { variant: "body8", ...rest, style: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } })); } if (size === 'small-bold') { return (_jsx(Typography, { variant: "body8", ...rest, style: { fontWeight: 'bold', color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } })); } if (size === 'medium-bold') { return (_jsx(Typography, { variant: "body_b1", ...rest, style: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } })); } if (size === 'large-bold') { return (_jsx(Typography, { variant: "h9", ...rest, style: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } })); } // Fallback to medium size return (_jsx(Typography, { variant: "body5", ...rest, style: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } })); }; export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = false, }) => { const symbolColor = color?.length ? color : 'black'; if (symbol === 'circle') { return (_jsx("div", { style: { height: '100%', width: '10px', display: 'flex', opacity: isDimmed ? 0.5 : 1, }, children: _jsx("span", { style: { height: '6px', width: '6px', backgroundColor: symbolColor, borderRadius: '50%', border: '1px solid black', } }) })); } if (symbol === 'rectangle') { return (_jsx("div", { style: { height: '100%', width: '10px', display: 'flex', opacity: isDimmed ? 0.5 : 1, }, children: _jsx("span", { style: { height: '10px', width: '10px', backgroundColor: symbolColor, } }) })); } if (symbol === 'border-circle') { return (_jsx("div", { style: { height: '100%', width: '10px', display: 'flex', opacity: isDimmed ? 0.5 : 1, }, children: _jsx("span", { style: { height: '10px', width: '10px', backgroundColor: symbolColor, borderRadius: '50%', border: '1px solid black', } }) })); } if (symbol === 'border-rectangle') { return (_jsx("div", { style: { height: '100%', width: '10px', display: 'flex', opacity: isDimmed ? 0.5 : 1, }, children: _jsx("span", { style: { height: '10px', width: '10px', backgroundColor: symbolColor, border: '1px solid black', } }) })); } // Fallback return (_jsx("div", { style: { height: '100%', width: '10px', display: 'flex', opacity: isDimmed ? 0.5 : 1, }, children: _jsx("span", { style: { height: '10px', width: '10px', backgroundColor: 'black', } }) })); };