Skip to content

Commit

Permalink
removed unused classes, small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajdova committed Apr 19, 2021
1 parent 6c22e09 commit d9d0362
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 36 deletions.
10 changes: 1 addition & 9 deletions docs/pages/api-docs/timeline-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
},
"name": "TimelineItem",
"styles": {
"classes": [
"root",
"alignLeft",
"alignRight",
"alignAlternate",
"missingOppositeContent",
"content",
"oppositeContent"
],
"classes": ["root", "alignLeft", "alignRight", "alignAlternate", "missingOppositeContent"],
"globalClasses": {},
"name": "MuiTimelineItem"
},
Expand Down
8 changes: 0 additions & 8 deletions docs/translations/api-docs/timeline-item/timeline-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "TimelineOppositeContent isn't provided"
},
"content": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the timeline content node"
},
"oppositeContent": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the timeline opposite content node"
}
}
}
4 changes: 0 additions & 4 deletions packages/material-ui-lab/src/TimelineItem/TimelineItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export interface TimelineItemProps extends StandardProps<React.HTMLAttributes<HT
alignAlternate?: string;
/** Styles applied to the root element if TimelineOppositeContent isn't provided. */
missingOppositeContent?: string;
/** Styles applied to the timeline content node. */
content?: string;
/** Styles applied to the timeline opposite content node. */
oppositeContent?: string;
};
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
Expand Down
19 changes: 6 additions & 13 deletions packages/material-ui-lab/src/TimelineItem/TimelineItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { deepmerge } from '@material-ui/utils';
import { capitalize, isMuiElement } from '@material-ui/core/utils';
import {
experimentalStyled,
Expand All @@ -16,23 +15,17 @@ import timelineItemClasses, { getTimelineItemUtilityClass } from './timelineItem
const overridesResolver = (props, styles) => {
const { styleProps } = props;

return deepmerge(
{
...styles[`align${capitalize(styleProps.align)}`],
[`& .${timelineItemClasses.content}`]: styles.content,
[`& .${timelineItemClasses.oppositeContent}`]: styles.oppositeContent,
},
styles.root || {},
);
return {
...styles.root,
...styles[`align${capitalize(styleProps.align)}`],
};
};

const useUtilityClasses = (styleProps) => {
const { align, classes } = styleProps;
const { align, classes, hasOppositeContent } = styleProps;

const slots = {
root: ['root', `align${capitalize(align)}`],
content: ['content'],
oppositeContent: ['oppositeContent'],
root: ['root', `align${capitalize(align)}`, !hasOppositeContent && 'missingOppositeContent'],
};

return composeClasses(slots, getTimelineItemUtilityClass, classes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const timelineItemClasses = generateUtilityClasses('MuiTimelineItem', [
'alignRight',
'alignAlternate',
'missingOppositeContent',
'content',
'oppositeContent',
]);

export default timelineItemClasses;

0 comments on commit d9d0362

Please sign in to comment.