Skip to content

Commit

Permalink
push build files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jul 21, 2023
1 parent 25075b3 commit 21f9404
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/cjs/helpers/materialUI.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export declare function insertDividerBetweenElements({ elements, dividerProps }:
elements: React.ReactElement[];
dividerProps?: DividerProps;
}): React.ReactElement[];
export declare function getStyleOverrides(ownerState: Record<string, unknown>, componentKey: keyof NonNullable<ThemeOptions['components']>, muiClassName?: string, components?: ThemeOptions['components']): object;
export declare function getStyleOverrides(ownerState: CommonProps, componentKey: keyof NonNullable<ThemeOptions['components']>, muiClassName?: string, components?: ThemeOptions['components']): object;
export declare function getClassNames(props: CommonProps): string[];
export declare function includesClassNames(propsOrClassNames: CommonProps | string[], includes: string[]): boolean;
export declare function matchClassNames(propsOrClassNames: CommonProps | string[], pattern: string | RegExp): RegExpMatchArray[];
28 changes: 16 additions & 12 deletions lib/cjs/theme/ThemedBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ var ThemedBox = function (_a) {
color: bgcolor.contrastText,
textDecorationColor: bgcolor.contrastText
};
function getStyleOverrides(ownerState, componentKey, muiClassName) {
function overrideStyles(ownerState, styleOverrides, componentKey, muiClassName) {
if (muiClassName === void 0) { muiClassName = 'root'; }
return (0, helpers_1.getStyleOverrides)(ownerState, componentKey, muiClassName, options.components);
return __assign(__assign({}, (0, helpers_1.getStyleOverrides)(ownerState, componentKey, muiClassName, options.components)), (!(0, helpers_1.includesClassNames)(ownerState, ['no-override']) && styleOverrides));
}
var theme = (0, material_1.responsiveFontSizes)((0, material_1.createTheme)(__assign(__assign({}, options), { components: __assign(__assign({}, options.components), { MuiTypography: __assign(__assign({}, (_b = options.components) === null || _b === void 0 ? void 0 : _b.MuiTypography), { styleOverrides: __assign(__assign({}, (_d = (_c = options.components) === null || _c === void 0 ? void 0 : _c.MuiTypography) === null || _d === void 0 ? void 0 : _d.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiTypography')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiTypography');
} }) }), MuiFormHelperText: __assign(__assign({}, (_e = options.components) === null || _e === void 0 ? void 0 : _e.MuiFormHelperText), { styleOverrides: __assign(__assign({}, (_g = (_f = options.components) === null || _f === void 0 ? void 0 : _f.MuiFormHelperText) === null || _g === void 0 ? void 0 : _g.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiFormHelperText')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiFormHelperText');
} }) }), MuiLink: __assign(__assign({}, (_h = options.components) === null || _h === void 0 ? void 0 : _h.MuiLink), { styleOverrides: __assign(__assign({}, (_k = (_j = options.components) === null || _j === void 0 ? void 0 : _j.MuiLink) === null || _k === void 0 ? void 0 : _k.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiLink')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiLink');
} }) }), MuiButton: __assign(__assign({}, (_l = options.components) === null || _l === void 0 ? void 0 : _l.MuiButton), { styleOverrides: __assign(__assign({}, (_o = (_m = options.components) === null || _m === void 0 ? void 0 : _m.MuiButton) === null || _o === void 0 ? void 0 : _o.styleOverrides), { contained: function (_a) {
var _b;
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiButton', 'contained')), (userType === 'independent' && (_b = {
return overrideStyles(ownerState, __assign({}, (userType === 'independent' && (_b = {
backgroundColor: 'white',
'&:hover': {
backgroundColor: '#f6f5f5',
Expand All @@ -94,22 +94,26 @@ var ThemedBox = function (_a) {
backgroundColor: 'white',
color: bgcolor.contrastText
},
_b))));
_b))), 'MuiButton', 'contained');
}, outlined: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign(__assign({}, getStyleOverrides(ownerState, 'MuiButton', 'outlined')), fontStyleOverrides), { border: "2px solid ".concat(bgcolor.contrastText), '&:hover': {
return overrideStyles(ownerState, __assign(__assign({}, fontStyleOverrides), { border: "2px solid ".concat(bgcolor.contrastText), '&:hover': {
border: "2px solid ".concat(bgcolor.contrastText),
backgroundColor: 'transparent',
textDecoration: 'underline'
} }));
} }), 'MuiButton', 'outlined');
} }) }), MuiCheckbox: __assign(__assign({}, (_p = options.components) === null || _p === void 0 ? void 0 : _p.MuiCheckbox), { styleOverrides: __assign(__assign({}, (_r = (_q = options.components) === null || _q === void 0 ? void 0 : _q.MuiCheckbox) === null || _r === void 0 ? void 0 : _r.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiCheckbox')), { color: "".concat(bgcolor.contrastText, " !important") }));
return overrideStyles(ownerState, {
color: "".concat(bgcolor.contrastText, " !important")
}, 'MuiCheckbox');
} }) }), MuiSvgIcon: __assign(__assign({}, (_s = options.components) === null || _s === void 0 ? void 0 : _s.MuiSvgIcon), { styleOverrides: __assign(__assign({}, (_u = (_t = options.components) === null || _t === void 0 ? void 0 : _t.MuiSvgIcon) === null || _u === void 0 ? void 0 : _u.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiSvgIcon')), { '&.checkbox-error': {
return overrideStyles(ownerState, {
'&.checkbox-error': {
color: "".concat(bgcolor.contrastText, " !important")
} }));
}
}, 'MuiSvgIcon');
} }) }) }) })));
return (react_1.default.createElement(material_1.ThemeProvider, { theme: theme },
react_1.default.createElement(material_1.Box, __assign({ sx: __assign(__assign(__assign({}, sx), (withShapes && {
Expand Down
2 changes: 1 addition & 1 deletion lib/esm/helpers/materialUI.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export declare function insertDividerBetweenElements({ elements, dividerProps }:
elements: React.ReactElement[];
dividerProps?: DividerProps;
}): React.ReactElement[];
export declare function getStyleOverrides(ownerState: Record<string, unknown>, componentKey: keyof NonNullable<ThemeOptions['components']>, muiClassName?: string, components?: ThemeOptions['components']): object;
export declare function getStyleOverrides(ownerState: CommonProps, componentKey: keyof NonNullable<ThemeOptions['components']>, muiClassName?: string, components?: ThemeOptions['components']): object;
export declare function getClassNames(props: CommonProps): string[];
export declare function includesClassNames(propsOrClassNames: CommonProps | string[], includes: string[]): boolean;
export declare function matchClassNames(propsOrClassNames: CommonProps | string[], pattern: string | RegExp): RegExpMatchArray[];
30 changes: 17 additions & 13 deletions lib/esm/theme/ThemedBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Box, ThemeProvider, buttonClasses, responsiveFontSizes, createTheme } f
import { Circle as CircleIcon, Hexagon as HexagonIcon } from '@mui/icons-material';
import { themeOptions } from '.';
import palette from './palette';
import { getStyleOverrides as _getStyleOverrides } from '../helpers';
import { getStyleOverrides, includesClassNames } from '../helpers';
var ThemedBox = function (_a) {
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
var _v = _a.options, options = _v === void 0 ? themeOptions : _v, _w = _a.withShapes, withShapes = _w === void 0 ? false : _w, userType = _a.userType, children = _a.children, sx = _a.sx, otherBoxProps = __rest(_a, ["options", "withShapes", "userType", "children", "sx"]);
Expand Down Expand Up @@ -58,23 +58,23 @@ var ThemedBox = function (_a) {
color: bgcolor.contrastText,
textDecorationColor: bgcolor.contrastText
};
function getStyleOverrides(ownerState, componentKey, muiClassName) {
function overrideStyles(ownerState, styleOverrides, componentKey, muiClassName) {
if (muiClassName === void 0) { muiClassName = 'root'; }
return _getStyleOverrides(ownerState, componentKey, muiClassName, options.components);
return __assign(__assign({}, getStyleOverrides(ownerState, componentKey, muiClassName, options.components)), (!includesClassNames(ownerState, ['no-override']) && styleOverrides));
}
var theme = responsiveFontSizes(createTheme(__assign(__assign({}, options), { components: __assign(__assign({}, options.components), { MuiTypography: __assign(__assign({}, (_b = options.components) === null || _b === void 0 ? void 0 : _b.MuiTypography), { styleOverrides: __assign(__assign({}, (_d = (_c = options.components) === null || _c === void 0 ? void 0 : _c.MuiTypography) === null || _d === void 0 ? void 0 : _d.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiTypography')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiTypography');
} }) }), MuiFormHelperText: __assign(__assign({}, (_e = options.components) === null || _e === void 0 ? void 0 : _e.MuiFormHelperText), { styleOverrides: __assign(__assign({}, (_g = (_f = options.components) === null || _f === void 0 ? void 0 : _f.MuiFormHelperText) === null || _g === void 0 ? void 0 : _g.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiFormHelperText')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiFormHelperText');
} }) }), MuiLink: __assign(__assign({}, (_h = options.components) === null || _h === void 0 ? void 0 : _h.MuiLink), { styleOverrides: __assign(__assign({}, (_k = (_j = options.components) === null || _j === void 0 ? void 0 : _j.MuiLink) === null || _k === void 0 ? void 0 : _k.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiLink')), fontStyleOverrides));
return overrideStyles(ownerState, __assign({}, fontStyleOverrides), 'MuiLink');
} }) }), MuiButton: __assign(__assign({}, (_l = options.components) === null || _l === void 0 ? void 0 : _l.MuiButton), { styleOverrides: __assign(__assign({}, (_o = (_m = options.components) === null || _m === void 0 ? void 0 : _m.MuiButton) === null || _o === void 0 ? void 0 : _o.styleOverrides), { contained: function (_a) {
var _b;
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiButton', 'contained')), (userType === 'independent' && (_b = {
return overrideStyles(ownerState, __assign({}, (userType === 'independent' && (_b = {
backgroundColor: 'white',
'&:hover': {
backgroundColor: '#f6f5f5',
Expand All @@ -89,22 +89,26 @@ var ThemedBox = function (_a) {
backgroundColor: 'white',
color: bgcolor.contrastText
},
_b))));
_b))), 'MuiButton', 'contained');
}, outlined: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign(__assign({}, getStyleOverrides(ownerState, 'MuiButton', 'outlined')), fontStyleOverrides), { border: "2px solid ".concat(bgcolor.contrastText), '&:hover': {
return overrideStyles(ownerState, __assign(__assign({}, fontStyleOverrides), { border: "2px solid ".concat(bgcolor.contrastText), '&:hover': {
border: "2px solid ".concat(bgcolor.contrastText),
backgroundColor: 'transparent',
textDecoration: 'underline'
} }));
} }), 'MuiButton', 'outlined');
} }) }), MuiCheckbox: __assign(__assign({}, (_p = options.components) === null || _p === void 0 ? void 0 : _p.MuiCheckbox), { styleOverrides: __assign(__assign({}, (_r = (_q = options.components) === null || _q === void 0 ? void 0 : _q.MuiCheckbox) === null || _r === void 0 ? void 0 : _r.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiCheckbox')), { color: "".concat(bgcolor.contrastText, " !important") }));
return overrideStyles(ownerState, {
color: "".concat(bgcolor.contrastText, " !important")
}, 'MuiCheckbox');
} }) }), MuiSvgIcon: __assign(__assign({}, (_s = options.components) === null || _s === void 0 ? void 0 : _s.MuiSvgIcon), { styleOverrides: __assign(__assign({}, (_u = (_t = options.components) === null || _t === void 0 ? void 0 : _t.MuiSvgIcon) === null || _u === void 0 ? void 0 : _u.styleOverrides), { root: function (_a) {
var ownerState = _a.ownerState;
return (__assign(__assign({}, getStyleOverrides(ownerState, 'MuiSvgIcon')), { '&.checkbox-error': {
return overrideStyles(ownerState, {
'&.checkbox-error': {
color: "".concat(bgcolor.contrastText, " !important")
} }));
}
}, 'MuiSvgIcon');
} }) }) }) })));
return (React.createElement(ThemeProvider, { theme: theme },
React.createElement(Box, __assign({ sx: __assign(__assign(__assign({}, sx), (withShapes && {
Expand Down

0 comments on commit 21f9404

Please sign in to comment.