Skip to content

Commit d0d5637

Browse files
committed
Drop createStyles from published files
1 parent a88b871 commit d0d5637

34 files changed

+154
-154
lines changed

packages/material-ui-lab/src/ClockPicker/Clock.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44
import IconButton from '@material-ui/core/IconButton';
55
import Typography from '@material-ui/core/Typography';
6-
import { createStyles, WithStyles, Theme, withStyles } from '@material-ui/core/styles';
6+
import { WithStyles, Theme, withStyles } from '@material-ui/core/styles';
77
import ClockPointer from './ClockPointer';
88
import { useUtils, MuiPickersAdapter } from '../internal/pickers/hooks/useUtils';
99
import { ClockViewType } from '../internal/pickers/constants/ClockType';
@@ -35,7 +35,7 @@ export interface ClockProps<TDate> extends ReturnType<typeof useMeridiemMode> {
3535
}
3636

3737
export const styles = (theme: Theme) =>
38-
createStyles({
38+
({
3939
root: {
4040
display: 'flex',
4141
justifyContent: 'center',
@@ -93,7 +93,7 @@ export const styles = (theme: Theme) =>
9393
backgroundColor: theme.palette.primary.light,
9494
},
9595
},
96-
});
96+
} as const);
9797

9898
export type ClockClassKey = keyof WithStyles<typeof styles>['classes'];
9999

packages/material-ui-lab/src/ClockPicker/ClockNumber.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
3-
import { createStyles, WithStyles, withStyles, Theme } from '@material-ui/core/styles';
3+
import { WithStyles, withStyles, Theme } from '@material-ui/core/styles';
44
import { CLOCK_WIDTH, CLOCK_HOUR_WIDTH } from '../internal/pickers/constants/dimensions';
55

66
export interface ClockNumberProps {
@@ -13,7 +13,7 @@ export interface ClockNumberProps {
1313
}
1414

1515
export const styles = (theme: Theme) =>
16-
createStyles({
16+
({
1717
root: {
1818
width: CLOCK_HOUR_WIDTH,
1919
height: CLOCK_HOUR_WIDTH,
@@ -41,7 +41,7 @@ export const styles = (theme: Theme) =>
4141
...theme.typography.body2,
4242
color: theme.palette.text.secondary,
4343
},
44-
});
44+
} as const);
4545

4646
export type ClockNumberClassKey = keyof WithStyles<typeof styles>['classes'];
4747

packages/material-ui-lab/src/ClockPicker/ClockPicker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3-
import { createStyles, WithStyles, withStyles } from '@material-ui/core/styles';
3+
import { WithStyles, withStyles } from '@material-ui/core/styles';
44
import Clock from './Clock';
55
import { pipe } from '../internal/pickers/utils';
66
import { useUtils, useNow, MuiPickersAdapter } from '../internal/pickers/hooks/useUtils';
@@ -80,13 +80,13 @@ export interface ClockPickerProps<TDate>
8080
showViewSwitcher?: boolean;
8181
}
8282

83-
export const styles = createStyles({
83+
export const styles = {
8484
arrowSwitcher: {
8585
position: 'absolute',
8686
right: 12,
8787
top: 15,
8888
},
89-
});
89+
} as const;
9090

9191
const getDefaultClockLabelText = <TDate extends any>(
9292
view: 'hours' | 'minutes' | 'seconds',

packages/material-ui-lab/src/ClockPicker/ClockPointer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
3-
import { withStyles, createStyles, Theme, WithStyles } from '@material-ui/core/styles';
3+
import { withStyles, Theme, WithStyles } from '@material-ui/core/styles';
44
import { CLOCK_WIDTH, CLOCK_HOUR_WIDTH } from '../internal/pickers/constants/dimensions';
55
import { ClockViewType } from '../internal/pickers/constants/ClockType';
66

77
export const styles = (theme: Theme) =>
8-
createStyles({
8+
({
99
root: {
1010
width: 2,
1111
backgroundColor: theme.palette.primary.main,
@@ -31,7 +31,7 @@ export const styles = (theme: Theme) =>
3131
noPoint: {
3232
backgroundColor: theme.palette.primary.main,
3333
},
34-
});
34+
} as const);
3535

3636
export type ClockPointerClassKey = keyof WithStyles<typeof styles>['classes'];
3737

packages/material-ui-lab/src/DatePicker/DatePickerToolbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
33
import Typography from '@material-ui/core/Typography';
4-
import { createStyles, WithStyles, withStyles } from '@material-ui/core/styles';
4+
import { WithStyles, withStyles } from '@material-ui/core/styles';
55
import PickersToolbar from '../internal/pickers/PickersToolbar';
66
import { useUtils } from '../internal/pickers/hooks/useUtils';
77
import { isYearAndMonthViews, isYearOnlyView } from '../internal/pickers/date-utils';
88
import { DatePickerView } from '../internal/pickers/typings/Views';
99
import { ToolbarComponentProps } from '../internal/pickers/typings/BasePicker';
1010

11-
export const styles = createStyles({
11+
export const styles = {
1212
root: {},
1313
dateTitleLandscape: {
1414
margin: 'auto 16px auto auto',
@@ -17,7 +17,7 @@ export const styles = createStyles({
1717
position: 'relative',
1818
top: 4,
1919
},
20-
});
20+
} as const;
2121
export type DatePickerToolbarClassKey = keyof WithStyles<typeof styles>['classes'];
2222

2323
/**

packages/material-ui-lab/src/DateRangePicker/DateRangePickerInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles';
2+
import { withStyles, WithStyles, Theme } from '@material-ui/core/styles';
33
import { useUtils } from '../internal/pickers/hooks/useUtils';
44
import { RangeInput, DateRange, CurrentlySelectingRangeEndProps } from './RangeTypes';
55
import { useMaskedInput } from '../internal/pickers/hooks/useMaskedInput';
@@ -9,7 +9,7 @@ import { mergeRefs, executeInTheNextEventLoopTick } from '../internal/pickers/ut
99
import { DateInputProps, MuiTextFieldProps } from '../internal/pickers/PureDateInput';
1010

1111
export const styles = (theme: Theme) =>
12-
createStyles({
12+
({
1313
root: {
1414
display: 'flex',
1515
alignItems: 'baseline',
@@ -24,7 +24,7 @@ export const styles = (theme: Theme) =>
2424
margin: '0 16px',
2525
},
2626
},
27-
});
27+
} as const);
2828

2929
export interface ExportedDateRangePickerInputProps {
3030
/**

packages/material-ui-lab/src/DateRangePicker/DateRangePickerToolbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as React from 'react';
22
import Typography from '@material-ui/core/Typography';
3-
import { withStyles, createStyles, WithStyles } from '@material-ui/core/styles';
3+
import { withStyles, WithStyles } from '@material-ui/core/styles';
44
import PickersToolbar from '../internal/pickers/PickersToolbar';
55
import { useUtils } from '../internal/pickers/hooks/useUtils';
66
import PickersToolbarButton from '../internal/pickers/PickersToolbarButton';
77
import { ToolbarComponentProps } from '../internal/pickers/typings/BasePicker';
88
import { DateRange, CurrentlySelectingRangeEndProps } from './RangeTypes';
99

10-
export const styles = createStyles({
10+
export const styles = {
1111
root: {},
1212
penIcon: {
1313
position: 'relative',
@@ -16,7 +16,7 @@ export const styles = createStyles({
1616
dateTextContainer: {
1717
display: 'flex',
1818
},
19-
});
19+
} as const;
2020

2121
interface DateRangePickerToolbarProps
2222
extends CurrentlySelectingRangeEndProps,

packages/material-ui-lab/src/DateRangePicker/DateRangePickerViewDesktop.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles';
2+
import { withStyles, WithStyles, Theme } from '@material-ui/core/styles';
33
import { DateRange } from './RangeTypes';
44
import { useUtils } from '../internal/pickers/hooks/useUtils';
55
import { calculateRangePreview } from './date-range-manager';
@@ -45,7 +45,7 @@ interface DesktopDateRangeCalendarProps<TDate>
4545
}
4646

4747
export const styles = (theme: Theme) =>
48-
createStyles({
48+
({
4949
root: {
5050
display: 'flex',
5151
flexDirection: 'row',
@@ -65,7 +65,7 @@ export const styles = (theme: Theme) =>
6565
alignItems: 'center',
6666
justifyContent: 'space-between',
6767
},
68-
});
68+
} as const);
6969

7070
function getCalendarsArray(calendars: ExportedDesktopDateRangeCalendarProps<unknown>['calendars']) {
7171
switch (calendars) {

packages/material-ui-lab/src/DateRangePickerDay/DateRangePickerDay.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
4-
import { withStyles, WithStyles, alpha, createStyles, Theme } from '@material-ui/core/styles';
4+
import { withStyles, WithStyles, alpha, Theme } from '@material-ui/core/styles';
55
import { DAY_MARGIN } from '../internal/pickers/constants/dimensions';
66
import { useUtils } from '../internal/pickers/hooks/useUtils';
77
import PickersDay, { PickersDayProps, areDayPropsEqual } from '../PickersDay/PickersDay';
@@ -26,7 +26,7 @@ const startBorderStyle = {
2626
};
2727

2828
const styles = (theme: Theme) =>
29-
createStyles({
29+
({
3030
root: {
3131
'&:first-child $rangeIntervalDayPreview': {
3232
...startBorderStyle,
@@ -92,7 +92,7 @@ const styles = (theme: Theme) =>
9292
},
9393
rangeIntervalDayPreviewStart: {},
9494
rangeIntervalDayPreviewEnd: {},
95-
});
95+
} as const);
9696

9797
/**
9898
* @ignore - do not document.

packages/material-ui-lab/src/DateTimePicker/DateTimePickerTabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import clsx from 'clsx';
33
import Tab from '@material-ui/core/Tab';
44
import Tabs from '@material-ui/core/Tabs';
55
import Paper from '@material-ui/core/Paper';
6-
import { createStyles, WithStyles, withStyles, Theme, useTheme } from '@material-ui/core/styles';
6+
import { WithStyles, withStyles, Theme, useTheme } from '@material-ui/core/styles';
77
import TimeIcon from '../internal/svg-icons/Time';
88
import DateRangeIcon from '../internal/svg-icons/DateRange';
99
import { WrapperVariantContext } from '../internal/pickers/wrappers/WrapperVariantContext';
@@ -36,7 +36,7 @@ export const styles = (theme: Theme) => {
3636
const tabsBackground =
3737
theme.palette.mode === 'light' ? theme.palette.primary.main : theme.palette.background.default;
3838

39-
return createStyles({
39+
return {
4040
root: {},
4141
modeDesktop: {
4242
order: 1,
@@ -45,7 +45,7 @@ export const styles = (theme: Theme) => {
4545
color: theme.palette.getContrastText(tabsBackground),
4646
backgroundColor: tabsBackground,
4747
},
48-
});
48+
};
4949
};
5050

5151
export type DateTimePickerTabsClassKey = keyof WithStyles<typeof styles>['classes'];

packages/material-ui-lab/src/DateTimePicker/DateTimePickerToolbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { createStyles, WithStyles, withStyles } from '@material-ui/core/styles';
2+
import { WithStyles, withStyles } from '@material-ui/core/styles';
33
import PickersToolbarText from '../internal/pickers/PickersToolbarText';
44
import PickersToolbar from '../internal/pickers/PickersToolbar';
55
import ToolbarButton from '../internal/pickers/PickersToolbarButton';
@@ -9,7 +9,7 @@ import { WrapperVariantContext } from '../internal/pickers/wrappers/WrapperVaria
99
import { ToolbarComponentProps } from '../internal/pickers/typings/BasePicker';
1010
import { DateTimePickerView } from '../internal/pickers/typings/Views';
1111

12-
export const styles = createStyles({
12+
export const styles = {
1313
root: {
1414
paddingLeft: 16,
1515
paddingRight: 16,
@@ -33,7 +33,7 @@ export const styles = createStyles({
3333
top: 8,
3434
right: 8,
3535
},
36-
});
36+
} as const;
3737

3838
export type DateTimePickerToolbarClassKey = keyof WithStyles<typeof styles>['classes'];
3939

packages/material-ui-lab/src/DayPicker/DayPicker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3-
import { createStyles, withStyles, WithStyles } from '@material-ui/core/styles';
3+
import { withStyles, WithStyles } from '@material-ui/core/styles';
44
import clsx from 'clsx';
55
import MonthPicker from '../MonthPicker/MonthPicker';
66
import { useCalendarState } from './useCalendarState';
@@ -63,7 +63,7 @@ export type ExportedDayPickerProps<TDate> = Omit<
6363
| 'className'
6464
>;
6565

66-
export const styles = createStyles({
66+
export const styles = {
6767
root: {
6868
display: 'flex',
6969
flexDirection: 'column',
@@ -79,7 +79,7 @@ export const styles = createStyles({
7979
minHeight: (DAY_SIZE + DAY_MARGIN * 4) * 7,
8080
height: '100%',
8181
},
82-
});
82+
} as const;
8383

8484
export type DayPickerClassKey = keyof WithStyles<typeof styles>['classes'];
8585

packages/material-ui-lab/src/DayPicker/PickersCalendar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
33
import Typography from '@material-ui/core/Typography';
4-
import { createStyles, WithStyles, withStyles, Theme, useTheme } from '@material-ui/core/styles';
4+
import { WithStyles, withStyles, Theme, useTheme } from '@material-ui/core/styles';
55
import PickersDay, { PickersDayProps } from '../PickersDay/PickersDay';
66
import { useUtils, useNow } from '../internal/pickers/hooks/useUtils';
77
import { PickerOnChangeFn } from '../internal/pickers/hooks/useViews';
@@ -61,7 +61,7 @@ export interface PickersCalendarProps<TDate> extends ExportedCalendarProps<TDate
6161

6262
const weeksContainerHeight = (DAY_SIZE + DAY_MARGIN * 4) * 6;
6363
export const styles = (theme: Theme) =>
64-
createStyles({
64+
({
6565
root: {
6666
minHeight: weeksContainerHeight,
6767
},
@@ -94,7 +94,7 @@ export const styles = (theme: Theme) =>
9494
alignItems: 'center',
9595
color: theme.palette.text.secondary,
9696
},
97-
});
97+
} as const);
9898

9999
export type PickersCalendarClassKey = keyof WithStyles<typeof styles>['classes'];
100100

packages/material-ui-lab/src/DayPicker/PickersCalendarHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44
import Fade from '@material-ui/core/Fade';
5-
import { createStyles, WithStyles, withStyles, Theme } from '@material-ui/core/styles';
5+
import { WithStyles, withStyles, Theme } from '@material-ui/core/styles';
66
import IconButton from '@material-ui/core/IconButton';
77
import { SlideDirection } from './PickersSlideTransition';
88
import { useUtils } from '../internal/pickers/hooks/useUtils';
@@ -60,7 +60,7 @@ export interface PickersCalendarHeaderProps<TDate>
6060
}
6161

6262
export const styles = (theme: Theme) =>
63-
createStyles({
63+
({
6464
root: {
6565
display: 'flex',
6666
alignItems: 'center',
@@ -96,7 +96,7 @@ export const styles = (theme: Theme) =>
9696
labelItem: {
9797
marginRight: 6,
9898
},
99-
});
99+
} as const);
100100

101101
export type PickersCalendarHeaderClassKey = keyof WithStyles<typeof styles>['classes'];
102102

packages/material-ui-lab/src/DayPicker/PickersFadeTransitionGroup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
3-
import { createStyles, WithStyles, withStyles, Theme } from '@material-ui/core/styles';
3+
import { WithStyles, withStyles, Theme } from '@material-ui/core/styles';
44
import { CSSTransition, TransitionGroup } from 'react-transition-group';
55

66
interface FadeTransitionProps {
@@ -12,7 +12,7 @@ interface FadeTransitionProps {
1212

1313
const animationDuration = 500;
1414
export const styles = (theme: Theme) =>
15-
createStyles({
15+
({
1616
root: {
1717
display: 'block',
1818
position: 'relative',
@@ -36,7 +36,7 @@ export const styles = (theme: Theme) =>
3636
duration: animationDuration / 2,
3737
}),
3838
},
39-
});
39+
} as const);
4040

4141
export type PickersFadeTransitionGroupClassKey = keyof WithStyles<typeof styles>['classes'];
4242

0 commit comments

Comments
 (0)