UNPKG

@actinc/dls

Version:

Design Language System (DLS) for ACT & Encoura front-end projects.

71 lines 2.86 kB
/** * Copyright (c) ACT, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { ListItem, ListItemIcon, ListItemText, Paper, } from '@mui/material'; import { listItemTextClasses } from '@mui/material/ListItemText'; import { styled } from '@mui/material/styles'; import DLS_COMPONENT_NAMES from "../../../constants/DLS_COMPONENT_NAMES"; import DLS_COMPONENT_SLOT_NAMES from "../../../constants/DLS_COMPONENT_SLOT_NAMES"; export var StyledUl = styled('ul')(function (_a) { var theme = _a.theme, numberOfItems = _a.numberOfItems; return ({ marginTop: numberOfItems > 6 ? theme.spacing(-1) : theme.spacing(3), paddingLeft: theme.spacing(1), }); }); export var StyledListItem = styled(ListItem)(function (_a) { var chartWidth = _a.chartWidth, theme = _a.theme; return ({ padding: chartWidth && Number(chartWidth) > 350 ? theme.spacing(0.5, 2) : theme.spacing(0, 1), }); }); export var StyledListItemIcon = styled(ListItemIcon)(function (_a) { var theme = _a.theme; return ({ marginRight: theme.spacing(1), minWidth: 'auto', }); }); export var StyledPaper = styled(Paper)(function (_a) { var chartWidth = _a.chartWidth, optionsLength = _a.optionsLength, showAsSquare = _a.showAsSquare, theme = _a.theme; return ({ // eslint-disable-next-line no-nested-ternary borderRadius: showAsSquare ? theme.shape.borderRadius : optionsLength && optionsLength > 4 ? theme.shape.borderRadius : '50%', height: chartWidth && Number(chartWidth) > 350 ? theme.spacing(3.5) : theme.spacing(2.5), width: chartWidth && Number(chartWidth) > 350 ? theme.spacing(3.5) : theme.spacing(2.5), }); }); export var StyledListItemText = styled(ListItemText, { name: DLS_COMPONENT_NAMES.PIE_CHART, slot: DLS_COMPONENT_SLOT_NAMES[DLS_COMPONENT_NAMES.PIE_CHART] .PIE_LEGEND_LABEL, })(function (_a) { var _b; var chartHeight = _a.chartHeight, chartLegendTextFontSize = _a.chartLegendTextFontSize, chartLegendTextFontSizeSmall = _a.chartLegendTextFontSizeSmall, chartWidth = _a.chartWidth, theme = _a.theme; return (_b = {}, _b["& .".concat(listItemTextClasses.primary)] = { fontSize: chartWidth && Number(chartWidth) > 350 && chartHeight && Number(chartHeight) >= 350 ? Number(chartLegendTextFontSize) || theme.typography.body1.fontSize : Number(chartLegendTextFontSizeSmall) || theme.typography.body2.fontSize, }, _b); }); //# sourceMappingURL=styles.js.map