Skip to content

Commit

Permalink
Lint, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Jun 11, 2021
1 parent 80d99e6 commit fac9536
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
6 changes: 0 additions & 6 deletions docs/src/pages/components/switches/UnstyledSwitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ const Root = styled('span')({
borderRadius: '20px',
margin: '10px',
cursor: 'pointer',

[`&.${switchUnstyledClasses.disabled}`]: {
opacity: 0.5,
cursor: 'not-allowed',
},

[`& .${switchUnstyledClasses.thumb}`]: {
display: 'block',
width: '24px',
Expand All @@ -32,26 +30,22 @@ const Root = styled('span')({
position: 'relative',
transition: 'all 200ms ease',
},

[`& .${switchUnstyledClasses.button}`]: {
display: 'block',
height: '100%',
borderRadius: '20px',
},

[`& .${switchUnstyledClasses.focusVisible} .${switchUnstyledClasses.thumb}`]: {
backgroundColor: 'rgba(255,255,255,1)',
boxShadow: '0 0 1px 8px rgba(0,0,0,0.25)',
},

[`&.${switchUnstyledClasses.checked} .${switchUnstyledClasses.thumb}`]: {
left: '4px',
top: '24px',
width: '32px',
height: '32px',
backgroundColor: 'rgba(255,255,255,0.9)',
},

[`& .${switchUnstyledClasses.input}`]: {
cursor: 'inherit',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ const useUtilityClasses = (styleProps: ButtonUnstyledProps<any> & { focusVisible
const { disabled, focusVisible } = styleProps;

const slots = {
root: [
'root',
disabled && 'disabled',
focusVisible && 'focusVisible',
],
root: ['root', disabled && 'disabled', focusVisible && 'focusVisible'],
};

return composeClasses(slots, getButtonUnstyledUtilityClass, {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getButtonUnstyledUtilityClass(slot: string): string {

const buttonUnstyledClasses: ButtonUnstyledClasses = generateUtilityClasses('ButtonUnstyled', [
'root',
'focusVisible'
'focusVisible',
]);

export default buttonUnstyledClasses;
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const SwitchUnstyled = function SwitchUnstyled<
componentsProps={{ root: { role: undefined } }}
tabIndex={-1}
disabled={isDisabled}
className={classes.button}>
className={classes.button}
>
<Thumb {...thumbProps} className={classes.thumb} />
<Input
type="checkbox"
Expand Down
3 changes: 2 additions & 1 deletion packages/material-ui-unstyled/src/moduleAugmentation.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React = require('react');

declare module 'react' {
function forwardRef<T, P = {}>(
render: (props: P, ref: ForwardedRef<T>) => ReactElement | null
render: (props: P, ref: ForwardedRef<T>) => ReactElement | null,
): (props: P & RefAttributes<T>) => ReactElement | null;
}

0 comments on commit fac9536

Please sign in to comment.