@selfcommunity/react-theme-default
Version:
Default theme to use with SelfCommunity TS library
40 lines (39 loc) • 2.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const system_1 = require("@mui/system");
const material_1 = require("@mui/material");
const Component = {
styleOverrides: {
root: ({ theme }) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
'& .SCSearchAutocomplete-input': {
padding: theme.spacing(0, 2),
borderRadius: theme.shape.borderRadius,
'& .MuiAutocomplete-input': {
padding: theme.spacing(0.5, 1),
color: (0, material_1.getContrastRatio)((_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.navbar) === null || _b === void 0 ? void 0 : _b.main, '#fff') > 4.5 ? '#fff' : theme.palette.primary.main
}
},
'& .MuiInputBase-root': {
'& .MuiIcon-root': {
color: (0, material_1.getContrastRatio)((_d = (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.navbar) === null || _d === void 0 ? void 0 : _d.main, '#fff') > 4.5 ? '#fff' : theme.palette.primary.main
},
'& fieldset': {
borderColor: (0, system_1.alpha)((0, material_1.getContrastRatio)((_f = (_e = theme.palette) === null || _e === void 0 ? void 0 : _e.navbar) === null || _f === void 0 ? void 0 : _f.main, '#fff') > 4.5 ? '#fff' : theme.palette.primary.main, theme.palette.action.disabledOpacity)
},
'&:hover fieldset': {
borderColor: (0, material_1.getContrastRatio)((_h = (_g = theme.palette) === null || _g === void 0 ? void 0 : _g.navbar) === null || _h === void 0 ? void 0 : _h.main, '#fff') > 4.5 ? '#fff' : theme.palette.primary.main
},
'&.Mui-focused fieldset': {
borderColor: (0, material_1.getContrastRatio)((_k = (_j = theme.palette) === null || _j === void 0 ? void 0 : _j.navbar) === null || _k === void 0 ? void 0 : _k.main, '#fff') > 4.5 ? '#fff' : theme.palette.secondary.main
},
'&.Mui-focused .SCSearchAutocomplete-icon': {
color: (0, material_1.getContrastRatio)((_m = (_l = theme.palette) === null || _l === void 0 ? void 0 : _l.navbar) === null || _m === void 0 ? void 0 : _m.main, '#fff') > 4.5 ? '#fff' : theme.palette.secondary.main
}
}
});
}
}
};
exports.default = Component;