Skip to content

Commit

Permalink
Remove slider prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Sep 8, 2023
1 parent 0f2c71a commit af183e7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 199 deletions.
106 changes: 7 additions & 99 deletions packages/mui-material-next/src/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Identity<Type>(x: Type): Type {
return x;
}

const SliderRoot = styled('span', {
export const SliderRoot = styled('span', {
name: 'MuiSlider',
slot: 'Root',
overridesResolver: (props, styles) => {
Expand Down Expand Up @@ -95,21 +95,7 @@ const SliderRoot = styled('span', {
},
};
});

SliderRoot.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderRoot };

const SliderRail = styled('span', {
export const SliderRail = styled('span', {
name: 'MuiSlider',
slot: 'Rail',
overridesResolver: (props, styles) => styles.rail,
Expand All @@ -136,20 +122,7 @@ const SliderRail = styled('span', {
}),
}));

SliderRail.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderRail };

const SliderTrack = styled('span', {
export const SliderTrack = styled('span', {
name: 'MuiSlider',
slot: 'Track',
overridesResolver: (props, styles) => styles.track,
Expand Down Expand Up @@ -184,20 +157,7 @@ const SliderTrack = styled('span', {
};
});

SliderTrack.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderTrack };

const SliderThumb = styled('span', {
export const SliderThumb = styled('span', {
name: 'MuiSlider',
slot: 'Thumb',
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== 'isOverlapping',
Expand Down Expand Up @@ -285,20 +245,7 @@ const SliderThumb = styled('span', {
};
});

SliderThumb.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderThumb };

const SliderValueLabel = styled('span', {
export const SliderValueLabel = styled('span', {
name: 'MuiSlider',
slot: 'ValueLabel',
shouldForwardProp: (prop) =>
Expand Down Expand Up @@ -382,20 +329,7 @@ const SliderValueLabel = styled('span', {
};
});

SliderValueLabel.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.element,
} as any;

export { SliderValueLabel };

const SliderMark = styled('span', {
export const SliderMark = styled('span', {
name: 'MuiSlider',
slot: 'Mark',
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== 'markActive',
Expand Down Expand Up @@ -429,20 +363,7 @@ const SliderMark = styled('span', {
}),
);

SliderMark.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderMark };

const SliderMarkLabel = styled('span', {
export const SliderMarkLabel = styled('span', {
name: 'MuiSlider',
slot: 'MarkLabel',
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== 'markLabelActive',
Expand Down Expand Up @@ -481,19 +402,6 @@ const SliderMarkLabel = styled('span', {
},
);

SliderMarkLabel.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
} as any;

export { SliderMarkLabel };

const useUtilityClasses = (ownerState: SliderOwnerState) => {
const { disabled, dragging, marked, orientation, track, classes, color, size } = ownerState;

Expand Down
109 changes: 9 additions & 100 deletions packages/mui-material/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
import useTheme from '../styles/useTheme';
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
import capitalize from '../utils/capitalize';
import SliderValueLabel from './SliderValueLabel';
import BaseSliderValueLabel from './SliderValueLabel';
import sliderClasses, { getSliderUtilityClass } from './sliderClasses';

function Identity(x) {
return x;
}

const SliderRoot = styled('span', {
export const SliderRoot = styled('span', {
name: 'MuiSlider',
slot: 'Root',
overridesResolver: (props, styles) => {
Expand Down Expand Up @@ -94,20 +94,7 @@ const SliderRoot = styled('span', {
},
}));

SliderRoot.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderRoot };

const SliderRail = styled('span', {
export const SliderRail = styled('span', {
name: 'MuiSlider',
slot: 'Rail',
overridesResolver: (props, styles) => styles.rail,
Expand All @@ -134,20 +121,7 @@ const SliderRail = styled('span', {
}),
}));

SliderRail.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderRail };

const SliderTrack = styled('span', {
export const SliderTrack = styled('span', {
name: 'MuiSlider',
slot: 'Track',
overridesResolver: (props, styles) => styles.track,
Expand Down Expand Up @@ -188,20 +162,7 @@ const SliderTrack = styled('span', {
};
});

SliderTrack.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderTrack };

const SliderThumb = styled('span', {
export const SliderThumb = styled('span', {
name: 'MuiSlider',
slot: 'Thumb',
overridesResolver: (props, styles) => {
Expand Down Expand Up @@ -284,20 +245,7 @@ const SliderThumb = styled('span', {
},
}));

SliderThumb.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderThumb };

const StyledSliderValueLabel = styled(SliderValueLabel, {
export const SliderValueLabel = styled(BaseSliderValueLabel, {
name: 'MuiSlider',
slot: 'ValueLabel',
overridesResolver: (props, styles) => styles.valueLabel,
Expand Down Expand Up @@ -360,20 +308,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
}),
}));

StyledSliderValueLabel.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { StyledSliderValueLabel as SliderValueLabel };

const SliderMark = styled('span', {
export const SliderMark = styled('span', {
name: 'MuiSlider',
slot: 'Mark',
shouldForwardProp: (prop) => slotShouldForwardProp(prop) && prop !== 'markActive',
Expand Down Expand Up @@ -402,20 +337,7 @@ const SliderMark = styled('span', {
}),
}));

SliderMark.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderMark };

const SliderMarkLabel = styled('span', {
export const SliderMarkLabel = styled('span', {
name: 'MuiSlider',
slot: 'MarkLabel',
shouldForwardProp: (prop) => slotShouldForwardProp(prop) && prop !== 'markLabelActive',
Expand Down Expand Up @@ -444,19 +366,6 @@ const SliderMarkLabel = styled('span', {
}),
}));

SliderMarkLabel.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* @ignore
*/
children: PropTypes.node,
};

export { SliderMarkLabel };

const useUtilityClasses = (ownerState) => {
const { disabled, dragging, marked, orientation, track, classes, color, size } = ownerState;

Expand Down Expand Up @@ -584,7 +493,7 @@ const Slider = React.forwardRef(function Slider(inputProps, ref) {
const RailSlot = slots?.rail ?? components.Rail ?? SliderRail;
const TrackSlot = slots?.track ?? components.Track ?? SliderTrack;
const ThumbSlot = slots?.thumb ?? components.Thumb ?? SliderThumb;
const ValueLabelSlot = slots?.valueLabel ?? components.ValueLabel ?? StyledSliderValueLabel;
const ValueLabelSlot = slots?.valueLabel ?? components.ValueLabel ?? SliderValueLabel;
const MarkSlot = slots?.mark ?? components.Mark ?? SliderMark;
const MarkLabelSlot = slots?.markLabel ?? components.MarkLabel ?? SliderMarkLabel;
const InputSlot = slots?.input ?? components.Input ?? 'input';
Expand Down

0 comments on commit af183e7

Please sign in to comment.