Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Remove createStyles from @material-ui/core #26018

Merged
merged 43 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f65c6a5
init
mnajdova Apr 26, 2021
0492da2
revert
mnajdova Apr 26, 2021
a198803
test updates
mnajdova Apr 26, 2021
bd8a443
remove warning
mnajdova Apr 26, 2021
8b81eeb
misc
mnajdova Apr 26, 2021
10cd53f
media query
mnajdova Apr 26, 2021
14e546b
fixes
mnajdova Apr 26, 2021
93a9281
fixes
mnajdova Apr 26, 2021
7f63ba3
ts fixes
mnajdova Apr 26, 2021
c7885cc
prettier
mnajdova Apr 26, 2021
54ca796
init
mnajdova Apr 27, 2021
1e245c0
reverted some changes
mnajdova Apr 27, 2021
896d973
prettier & Popper fix
mnajdova Apr 27, 2021
a69548a
Merge branch 'next' into feat/extract-material-ui-theming
mnajdova Apr 27, 2021
38ec9b2
add in ci.json
mnajdova Apr 27, 2021
224f6d4
update rollup
mnajdova Apr 27, 2021
e34a84b
fix package
mnajdova Apr 27, 2021
fd016d3
bump utils package
mnajdova Apr 27, 2021
ae4713e
size snapshot
mnajdova Apr 27, 2021
9cc6155
rename package
mnajdova Apr 28, 2021
4aaa2fb
prettier
mnajdova Apr 28, 2021
30bb8ed
duplicate utlities
mnajdova Apr 28, 2021
ec40710
spec fixes
mnajdova Apr 28, 2021
b06797b
moved test to @material-ui/styles
mnajdova Apr 28, 2021
40423b5
Update packages/material-ui-styles/src/getThemeProps/getThemeProps.sp…
mnajdova Apr 28, 2021
9f6cdbc
Update packages/material-ui/src/styles/variants.d.ts
mnajdova Apr 28, 2021
5ea31d4
Merge branch 'feat/create-styles' into feat/remove-createStyles
mnajdova Apr 28, 2021
031da6f
changes
mnajdova Apr 28, 2021
5a023f2
migration guide
mnajdova Apr 28, 2021
0038937
Merge branch 'next' into feat/remove-createStyles
mnajdova Apr 28, 2021
2dd38ed
fix empty lines in js demos
mnajdova Apr 28, 2021
993f842
remove createStyles from core
mnajdova Apr 28, 2021
3ca2fed
prettier
mnajdova Apr 28, 2021
267571b
replaced multiline imports
mnajdova Apr 28, 2021
6973b1c
fixes
mnajdova Apr 28, 2021
e5ea6c2
bring back createStyles
mnajdova Apr 28, 2021
7bdee91
Merge branch 'next' into feat/remove-createStyles
mnajdova Apr 29, 2021
c09c7ec
removed usages of createStyles & revreted heleprs.js changes
mnajdova Apr 29, 2021
b8e70d5
add comment for removing it in v6
mnajdova Apr 29, 2021
ce52e09
add cast
mnajdova Apr 29, 2021
80011da
removed plugin
mnajdova Apr 29, 2021
555f4fd
Update docs/src/pages/guides/migration-v4/migration-v4.md
mnajdova Apr 29, 2021
62d43a4
add back warning
mnajdova Apr 29, 2021
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/examples/preact/scripts
# auto-generated by Framer
/framer/Material-UI.framerfx/design/document.json
/packages/babel-plugin-unwrap-createstyles/test/__fixtures__/
/packages/material-ui-codemod/lib
/packages/material-ui-codemod/src/*/*.test/*
/packages/material-ui-codemod/src/*/*.test.js
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"@babel/preset-typescript": "^7.7.4",
"@types/marked": "^2.0.0",
"@types/recharts": "^1.8.14",
"babel-plugin-unwrap-createstyles": "5.0.0-alpha.24",
"cross-fetch": "^3.0.5",
"gm": "^1.23.0"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/formattedTSDemos.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tsConfig = typescriptToProptypes.loadConfig(path.resolve(__dirname, '../ts

const babelConfig = {
presets: ['@babel/preset-typescript'],
plugins: ['babel-plugin-unwrap-createstyles'],
plugins: [],
generatorOpts: { retainLines: true },
babelrc: false,
configFile: false,
Expand Down
24 changes: 11 additions & 13 deletions docs/src/pages/components/autocomplete/CustomInputAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import * as React from 'react';
import clsx from 'clsx';
import Autocomplete from '@material-ui/core/Autocomplete';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import { makeStyles, Theme } from '@material-ui/core/styles';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
autocomplete: {
display: 'inline-block',
},
input: {
width: 200,
backgroundColor: theme.palette.background.paper,
color: theme.palette.getContrastText(theme.palette.background.paper),
},
}),
);
const useStyles = makeStyles((theme: Theme) => ({
autocomplete: {
display: 'inline-block',
},
input: {
width: 200,
backgroundColor: theme.palette.background.paper,
color: theme.palette.getContrastText(theme.palette.background.paper),
},
}));

const options = ['Option 1', 'Option 2'];

Expand Down
236 changes: 116 additions & 120 deletions docs/src/pages/components/autocomplete/GitHubLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import * as React from 'react';
import { useTheme, makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import { useTheme, makeStyles, Theme } from '@material-ui/core/styles';
import Popper from '@material-ui/core/Popper';
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
import SettingsIcon from '@material-ui/icons/Settings';
Expand All @@ -23,136 +23,132 @@ function PopperComponent(props: PopperComponentProps) {
return <div {...other} />;
}

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: 221,
fontSize: 13,
const useStyles = makeStyles((theme: Theme) => ({
root: {
width: 221,
fontSize: 13,
},
button: {
fontSize: 13,
width: '100%',
textAlign: 'left',
paddingBottom: 8,
color: theme.palette.mode === 'light' ? '#586069' : '#8b949e',
fontWeight: 600,
'&:hover,&:focus': {
color: theme.palette.mode === 'light' ? '#0366d6' : '#58a6ff',
},
button: {
fontSize: 13,
'& span': {
width: '100%',
textAlign: 'left',
paddingBottom: 8,
color: theme.palette.mode === 'light' ? '#586069' : '#8b949e',
fontWeight: 600,
'&:hover,&:focus': {
color: theme.palette.mode === 'light' ? '#0366d6' : '#58a6ff',
},
'& span': {
width: '100%',
},
'& svg': {
width: 16,
height: 16,
},
},
tag: {
marginTop: 3,
height: 20,
padding: '.15em 4px',
fontWeight: 600,
lineHeight: '15px',
borderRadius: 2,
},
popper: {
border: `1px solid ${theme.palette.mode === 'light' ? '#e1e4e8' : '#30363d'}`,
boxShadow: `0 8px 24px ${
theme.palette.mode === 'light' ? 'rgba(149, 157, 165, 0.2)' : 'rgb(1, 4, 9)'
}`,
borderRadius: 6,
width: 300,
zIndex: theme.zIndex.modal,
fontSize: 13,
color: theme.palette.mode === 'light' ? '#24292e' : '#c9d1d9',
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#1c2128',
},
header: {
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? '#eaecef' : '#30363d'
}`,
padding: '8px 10px',
fontWeight: 600,
'& svg': {
width: 16,
height: 16,
},
inputBase: {
padding: 10,
width: '100%',
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? '#eaecef' : '#30363d'
}`,
'& input': {
borderRadius: 4,
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#0d1117',
padding: 8,
transition: theme.transitions.create(['border-color', 'box-shadow']),
border: `1px solid ${
theme.palette.mode === 'light' ? '#eaecef' : '#30363d'
},
tag: {
marginTop: 3,
height: 20,
padding: '.15em 4px',
fontWeight: 600,
lineHeight: '15px',
borderRadius: 2,
},
popper: {
border: `1px solid ${theme.palette.mode === 'light' ? '#e1e4e8' : '#30363d'}`,
boxShadow: `0 8px 24px ${
theme.palette.mode === 'light' ? 'rgba(149, 157, 165, 0.2)' : 'rgb(1, 4, 9)'
}`,
borderRadius: 6,
width: 300,
zIndex: theme.zIndex.modal,
fontSize: 13,
color: theme.palette.mode === 'light' ? '#24292e' : '#c9d1d9',
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#1c2128',
},
header: {
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? '#eaecef' : '#30363d'
}`,
padding: '8px 10px',
fontWeight: 600,
},
inputBase: {
padding: 10,
width: '100%',
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? '#eaecef' : '#30363d'
}`,
'& input': {
borderRadius: 4,
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#0d1117',
padding: 8,
transition: theme.transitions.create(['border-color', 'box-shadow']),
border: `1px solid ${theme.palette.mode === 'light' ? '#eaecef' : '#30363d'}`,
fontSize: 14,
'&:focus': {
boxShadow: `0px 0px 0px 3px ${
theme.palette.mode === 'light'
? 'rgba(3, 102, 214, 0.3)'
: 'rgb(12, 45, 107)'
}`,
fontSize: 14,
'&:focus': {
boxShadow: `0px 0px 0px 3px ${
theme.palette.mode === 'light'
? 'rgba(3, 102, 214, 0.3)'
: 'rgb(12, 45, 107)'
}`,
borderColor: theme.palette.mode === 'light' ? '#0366d6' : '#388bfd',
},
borderColor: theme.palette.mode === 'light' ? '#0366d6' : '#388bfd',
},
},
paper: {
boxShadow: 'none',
margin: 0,
color: 'inherit',
fontSize: 13,
},
listbox: {
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#1c2128',
padding: 0,
'& .MuiAutocomplete-option': {
minHeight: 'auto',
alignItems: 'flex-start',
padding: 8,
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? ' #eaecef' : '#30363d'
}`,
'&[aria-selected="true"]': {
backgroundColor: 'transparent',
},
'&[data-focus="true"], &[data-focus="true"][aria-selected="true"]': {
backgroundColor: theme.palette.action.hover,
},
},
paper: {
boxShadow: 'none',
margin: 0,
color: 'inherit',
fontSize: 13,
},
listbox: {
backgroundColor: theme.palette.mode === 'light' ? '#fff' : '#1c2128',
padding: 0,
'& .MuiAutocomplete-option': {
minHeight: 'auto',
alignItems: 'flex-start',
padding: 8,
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? ' #eaecef' : '#30363d'
}`,
'&[aria-selected="true"]': {
backgroundColor: 'transparent',
},
},
popperDisablePortal: {
position: 'relative',
},
iconSelected: {
width: 17,
height: 17,
marginRight: 5,
marginLeft: -2,
},
color: {
width: 14,
height: 14,
flexShrink: 0,
borderRadius: 3,
marginRight: 8,
marginTop: 2,
},
text: {
flexGrow: 1,
'& span': {
color: theme.palette.mode === 'light' ? '#586069' : '#8b949e',
'&[data-focus="true"], &[data-focus="true"][aria-selected="true"]': {
backgroundColor: theme.palette.action.hover,
},
},
close: {
opacity: 0.6,
width: 18,
height: 18,
},
popperDisablePortal: {
position: 'relative',
},
iconSelected: {
width: 17,
height: 17,
marginRight: 5,
marginLeft: -2,
},
color: {
width: 14,
height: 14,
flexShrink: 0,
borderRadius: 3,
marginRight: 8,
marginTop: 2,
},
text: {
flexGrow: 1,
'& span': {
color: theme.palette.mode === 'light' ? '#586069' : '#8b949e',
},
}),
);
},
close: {
opacity: 0.6,
width: 18,
height: 18,
},
}));

export default function GitHubLabel() {
const classes = useStyles();
Expand Down
18 changes: 8 additions & 10 deletions docs/src/pages/components/autocomplete/LimitTags.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import * as React from 'react';
import Autocomplete from '@material-ui/core/Autocomplete';
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
import { makeStyles, Theme } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: 500,
'& > * + *': {
marginTop: theme.spacing(3),
},
const useStyles = makeStyles((theme: Theme) => ({
root: {
width: 500,
'& > * + *': {
marginTop: theme.spacing(3),
},
}),
);
},
}));

export default function LimitTags() {
const classes = useStyles();
Expand Down
18 changes: 8 additions & 10 deletions docs/src/pages/components/autocomplete/Sizes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
import * as React from 'react';
import Chip from '@material-ui/core/Chip';
import Autocomplete from '@material-ui/core/Autocomplete';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import { makeStyles, Theme } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
width: 500,
'& > * + *': {
marginTop: theme.spacing(2),
},
const useStyles = makeStyles((theme: Theme) => ({
root: {
width: 500,
'& > * + *': {
marginTop: theme.spacing(2),
},
}),
);
},
}));

export default function Sizes() {
const classes = useStyles();
Expand Down
Loading