@actinc/dls
Version:
Design Language System (DLS) for ACT & Encoura front-end projects.
263 lines • 8.68 kB
JavaScript
/**
* 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.
*/
var _a;
import { grey } from '@mui/material/colors';
import Color from 'color';
import DLS_COMPONENT_NAMES from "../../constants/DLS_COMPONENT_NAMES";
import THEME_ENCOURA_CLASSIC from "../themeEncouraClassic";
import COLORS, { secondaryMain } from './colors';
var COMPONENTS = (_a = {},
_a[DLS_COMPONENT_NAMES.AREA_CHART] = {
defaultProps: {
colors: COLORS.CHART.primary,
},
},
_a[DLS_COMPONENT_NAMES.BAR_CHART] = {
defaultProps: {
colors: COLORS.CHART.primary,
},
},
_a[DLS_COMPONENT_NAMES.HEAT_MAP] = {
defaultProps: {
color: secondaryMain,
},
},
_a[DLS_COMPONENT_NAMES.LINE_CHART] = {
defaultProps: {
colors: COLORS.CHART.primary,
},
},
_a[DLS_COMPONENT_NAMES.MAP] = {
defaultProps: {
color: secondaryMain,
},
},
_a[DLS_COMPONENT_NAMES.OVERLAPPED_BAR_CHART] = {
defaultProps: {
colors: COLORS.CHART.quaternary,
},
},
_a[DLS_COMPONENT_NAMES.PIE_CHART] = {
defaultProps: {
colors: COLORS.CHART.tertiary,
},
},
_a[DLS_COMPONENT_NAMES.SCATTER_PLOT] = {
defaultProps: {
color: COLORS.CHART.secondary[1],
},
},
_a[DLS_COMPONENT_NAMES.STACKED_BAR_CHART] = {
defaultProps: {
colors: COLORS.CHART.primary,
},
},
_a.MuiAvatar = {
styleOverrides: {
root: {
border: "1px solid ".concat(grey[400]),
},
},
},
_a.MuiButton = {
styleOverrides: {
'& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-input': {
'&:hover': {
backgroundColor: Color(THEME_ENCOURA_CLASSIC.palette.secondary.main)
.fade(0.9)
.rgb()
.string(),
},
},
},
},
_a.MuiCalendarPicker = {
styleOverrides: {
root: {
maxHeight: THEME_ENCOURA_CLASSIC.spacing(40),
overflow: 'hidden',
},
},
},
_a.MuiListItem = {
styleOverrides: {
root: {
'&[aria-selected="true"]': {
backgroundColor: 'inherit',
},
},
},
},
_a.MuiListItemText = {
styleOverrides: {
primary: {
fontWeight: Number(THEME_ENCOURA_CLASSIC.typography.fontWeightLight),
},
root: {
userSelect: 'none',
wordWrap: 'break-word',
},
},
},
_a.MuiMenuItem = {
styleOverrides: {
root: {
'&:hover': {
backgroundColor: COLORS.SECONDARY_LIGHT,
color: COLORS.SECONDARY,
},
'&[aria-selected="true"]': {
backgroundColor: 'transparent !important',
color: COLORS.SECONDARY,
cursor: 'auto',
},
color: COLORS.TEXT_PRIMARY,
fontSize: THEME_ENCOURA_CLASSIC.typography.h4.fontSize,
fontWeight: Number(THEME_ENCOURA_CLASSIC.typography.fontWeightLight),
},
},
},
_a.MuiPopper = {
styleOverrides: {
root: {
zIndex: THEME_ENCOURA_CLASSIC.zIndex.modal,
},
},
},
_a.MuiSelect = {
styleOverrides: {
icon: {
top: '25%',
},
},
},
_a.MuiSwitch = {
styleOverrides: {
root: {
'& .Mui-checked+.MuiSwitch-track ': {
backgroundColor: "".concat(THEME_ENCOURA_CLASSIC.palette.info.main, " !important"),
opacity: '1 !important',
},
},
},
},
_a.MuiTableBody = {
styleOverrides: {
root: {
'& a > .MuiTableRow-root:not(.MuiTableRow-head):nth-child(odd)': {
backgroundColor: 'inherit',
},
'& a:nth-child(even):hover ': {
backgroundColor: THEME_ENCOURA_CLASSIC.palette.common.white,
},
'& a:nth-child(odd)': {
backgroundColor: COLORS.TABLE.accentBackgroundColor,
},
'& a:nth-child(odd):hover': {
backgroundColor: COLORS.TABLE.accentBackgroundColor,
},
},
},
},
_a.MuiTableCell = {
styleOverrides: {
body: {
color: COLORS.TEXT_PRIMARY,
fontSize: "".concat(Number(THEME_ENCOURA_CLASSIC.typography.body2.fontSize), "px !important"),
padding: THEME_ENCOURA_CLASSIC.spacing(2),
},
head: {
backgroundColor: THEME_ENCOURA_CLASSIC.palette.common.white,
borderLeft: 'none !important',
borderRight: 'none !important',
color: "".concat(THEME_ENCOURA_CLASSIC.palette.secondary.dark, " !important"),
fontWeight: Number(THEME_ENCOURA_CLASSIC.typography.fontWeightBold),
padding: THEME_ENCOURA_CLASSIC.spacing(2),
userSelect: 'none',
},
root: {
backgroundColor: 'transparent !important',
borderBottom: 'none',
},
},
},
_a.MuiTableContainer = {
styleOverrides: {
root: {
backgroundColor: THEME_ENCOURA_CLASSIC.palette.common.white,
border: 'none !important',
color: 'inherit',
maxHeight: 'inherit',
},
},
},
_a.MuiTableRow = {
styleOverrides: {
head: {
backgroundColor: THEME_ENCOURA_CLASSIC.palette.common.white,
position: 'sticky',
top: 0,
},
root: {
'&:not(.MuiTableRow-head):nth-child(even):hover': {
backgroundColor: THEME_ENCOURA_CLASSIC.palette.common.white,
},
'&:not(.MuiTableRow-head):nth-child(odd)': {
backgroundColor: COLORS.TABLE.accentBackgroundColor,
},
'&:not(.MuiTableRow-head):nth-child(odd):hover': {
backgroundColor: COLORS.TABLE.accentBackgroundColor,
},
},
},
},
_a.MuiTextField = {
styleOverrides: {
root: {
'& .MuiInputBase-input': {
boxShadow: 'none !important',
fontWeight: Number(THEME_ENCOURA_CLASSIC.typography.fontWeightLight),
},
'& .MuiInputLabel-outlined': {
color: COLORS.TEXT_PRIMARY,
},
'& .MuiInputLabel-outlined.Mui-focused': {
color: COLORS.SECONDARY,
},
'& .MuiOutlinedInput-input': {
color: COLORS.TEXT_PRIMARY,
},
'& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline': {
borderColor: THEME_ENCOURA_CLASSIC.palette.grey[300],
},
'& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-input': {
color: COLORS.TEXT_PRIMARY,
},
'& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline': {
borderColor: COLORS.SECONDARY,
},
'& .MuiOutlinedInput-root.Mui-focused .MuiSvgIcon-root': {
color: COLORS.SECONDARY,
},
'&:hover .MuiInputLabel-outlined': {
color: COLORS.SECONDARY,
},
'&:hover .MuiOutlinedInput-input': {
color: COLORS.SECONDARY,
},
'&:hover .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline': {
borderColor: COLORS.SECONDARY,
},
'&:hover .MuiSvgIcon-root': {
color: COLORS.SECONDARY,
},
},
},
},
_a);
export default COMPONENTS;
//# sourceMappingURL=components.js.map