Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,21 @@ Use `sx` prop to add the margin bottom instead:
-<Typography paragraph />
+<Typography sx={{ marginBottom: '16px' }} />
```

#### Divider deprecated props removed

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#divider-props) below to migrate the code as described in the following sections:

```bash
npx @mui/codemod@latest deprecations/divider-props <path>
```

The deprecated `Divider` prop have been removed.
Use `sx={{ opacity : "0.6" }}` (or any opacity):

```diff
<Divider
- light
+ sx={{ opacity: 0.6 }}
/>
```
13 changes: 0 additions & 13 deletions docs/pages/material-ui/api/divider.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"component": { "type": { "name": "elementType" } },
"flexItem": { "type": { "name": "bool" }, "default": "false" },
"light": {
"type": { "name": "bool" },
"default": "false",
"deprecated": true,
"deprecationInfo": "Use &lt;Divider sx={{ opacity: 0.6 }} /&gt; (or any opacity or color) instead. See <a href=\"https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
},
"orientation": {
"type": { "name": "enum", "description": "'horizontal'<br>&#124;&nbsp;'vertical'" },
"default": "'horizontal'"
Expand Down Expand Up @@ -67,13 +61,6 @@
"description": "Styles applied to the root element if `variant=\"inset\"`.",
"isGlobal": false
},
{
"key": "light",
"className": "MuiDivider-light",
"description": "Styles applied to the root element if `light={true}`.",
"isGlobal": false,
"isDeprecated": true
},
{
"key": "middle",
"className": "MuiDivider-middle",
Expand Down
6 changes: 0 additions & 6 deletions docs/translations/api-docs/divider/divider.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"flexItem": {
"description": "If <code>true</code>, a vertical divider will have the correct height when used in flex container. (By default, a vertical divider will have a calculated height of <code>0px</code> if it is the child of a flex container.)"
},
"light": { "description": "If <code>true</code>, the divider will have a lighter color." },
"orientation": { "description": "The component orientation." },
"sx": {
"description": "The system prop that allows defining system overrides as well as additional CSS styles."
Expand Down Expand Up @@ -39,11 +38,6 @@
"nodeName": "the root element",
"conditions": "<code>variant=\"inset\"</code>"
},
"light": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "<code>light={true}</code>"
},
"middle": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
Expand Down
6 changes: 0 additions & 6 deletions packages/mui-material/src/Divider/Divider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ export interface DividerOwnProps {
* @default false
*/
flexItem?: boolean | undefined;
/**
* If `true`, the divider will have a lighter color.
* @default false
* @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
light?: boolean | undefined;
/**
* The component orientation.
* @default 'horizontal'
Expand Down
21 changes: 1 addition & 20 deletions packages/mui-material/src/Divider/Divider.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import { useDefaultProps } from '../DefaultPropsProvider';
import { getDividerUtilityClass } from './dividerClasses';

const useUtilityClasses = (ownerState) => {
const { absolute, children, classes, flexItem, light, orientation, textAlign, variant } =
ownerState;
const { absolute, children, classes, flexItem, orientation, textAlign, variant } = ownerState;

const slots = {
root: [
'root',
absolute && 'absolute',
variant,
light && 'light',
orientation === 'vertical' && 'vertical',
flexItem && 'flexItem',
children && 'withChildren',
Expand All @@ -41,7 +39,6 @@ const DividerRoot = styled('div', {
styles.root,
ownerState.absolute && styles.absolute,
styles[ownerState.variant],
ownerState.light && styles.light,
ownerState.orientation === 'vertical' && styles.vertical,
ownerState.flexItem && styles.flexItem,
ownerState.children && styles.withChildren,
Expand Down Expand Up @@ -74,14 +71,6 @@ const DividerRoot = styled('div', {
width: '100%',
},
},
{
props: {
light: true,
},
style: {
borderColor: theme.alpha((theme.vars || theme).palette.divider, 0.08),
},
},
{
props: {
variant: 'inset',
Expand Down Expand Up @@ -229,7 +218,6 @@ const Divider = React.forwardRef(function Divider(inProps, ref) {
orientation = 'horizontal',
component = children || orientation === 'vertical' ? 'div' : 'hr',
flexItem = false,
light = false,
role = component !== 'hr' ? 'separator' : undefined,
textAlign = 'center',
variant = 'fullWidth',
Expand All @@ -241,7 +229,6 @@ const Divider = React.forwardRef(function Divider(inProps, ref) {
absolute,
component,
flexItem,
light,
orientation,
role,
textAlign,
Expand Down Expand Up @@ -314,12 +301,6 @@ Divider.propTypes /* remove-proptypes */ = {
* @default false
*/
flexItem: PropTypes.bool,
/**
* If `true`, the divider will have a lighter color.
* @default false
* @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
light: PropTypes.bool,
/**
* The component orientation.
* @default 'horizontal'
Expand Down
5 changes: 0 additions & 5 deletions packages/mui-material/src/Divider/Divider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ describe('<Divider />', () => {
expect(container.firstChild).to.have.class(classes.absolute);
});

it('should set the light class', () => {
const { container } = render(<Divider light />);
expect(container.firstChild).to.have.class(classes.light);
});

it('should set the flexItem class', () => {
const { container } = render(<Divider flexItem />);
expect(container.firstChild).to.have.class(classes.flexItem);
Expand Down
5 changes: 0 additions & 5 deletions packages/mui-material/src/Divider/dividerClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export interface DividerClasses {
inset: string;
/** Styles applied to the root element if `variant="fullWidth"`. */
fullWidth: string;
/** Styles applied to the root element if `light={true}`.
* @deprecated
*/
light: string;
/** Styles applied to the root element if `variant="middle"`. */
middle: string;
/** Styles applied to the root element if `orientation="vertical"`. */
Expand Down Expand Up @@ -49,7 +45,6 @@ const dividerClasses: DividerClasses = generateUtilityClasses('MuiDivider', [
'inset',
'middle',
'flexItem',
'light',
'vertical',
'withChildren',
'withChildrenVertical',
Expand Down
1 change: 0 additions & 1 deletion test/integration/material-ui/components.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ function DividerTest() {
return (
<div>
<Divider />
<Divider light />
</div>
);
}
Expand Down
Loading