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

feat/migrate @material-ui to @mui/material #352

Merged
merged 89 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
20d694e
feat: add Dialog v2 props
KarineBrandelli Jun 12, 2024
b04f99b
deps: remove react-router
KarineBrandelli Jun 12, 2024
3100720
chore: remove react-router from Breadcrumbs
KarineBrandelli Jun 12, 2024
9e73392
fix: faker deprecated options
KarineBrandelli Jun 12, 2024
fa19f22
chore: remove unused component
KarineBrandelli Jun 12, 2024
4f8dc97
feat: migrate ThemeProvider from @material-ui to @mui
KarineBrandelli Jun 12, 2024
0e81ce4
feat: migrate Badge from @material to @mui
KarineBrandelli Jun 12, 2024
3e1a5fc
deps: install @mui/styles
KarineBrandelli Jun 13, 2024
fa71959
feat: update Chip from @material to @mui
KarineBrandelli Jun 13, 2024
0aeaef6
feat: migrate Button from @material to @mui
KarineBrandelli Jun 13, 2024
93b679f
chore: adjust props on components that use Button v4
KarineBrandelli Jun 13, 2024
1524bcb
refact: adjust code
KarineBrandelli Jun 13, 2024
c8e1388
feat: migrate Sidebar from @material to @mui
KarineBrandelli Jun 13, 2024
c8a5393
feat: migrate Header from @material to @mui
KarineBrandelli Jun 13, 2024
064bdb1
test: update snapshots
KarineBrandelli Jun 13, 2024
4bb6bf8
feat: migrate IconButton from @material to @mui
KarineBrandelli Jun 14, 2024
1948520
feat: migrate Paper from @material to @mui
KarineBrandelli Jun 14, 2024
b5388a0
chore: adjusts
KarineBrandelli Jun 14, 2024
381829f
feat: migrate ExpansionPanel from @material to @mui
KarineBrandelli Jun 14, 2024
1674a8e
test: run tests
KarineBrandelli Jun 14, 2024
d8b2de3
feat: migrate Chapter from @material to @mui
KarineBrandelli Jun 14, 2024
d2428aa
feat: migrate Divider from @material to @mui
KarineBrandelli Jun 14, 2024
e8a4728
feat: migrate Collapse from @material to @mui
KarineBrandelli Jun 14, 2024
2e4dc18
feat: migrate Fade from @material to @mui
KarineBrandelli Jun 14, 2024
8b54c57
feat: migrate Grow from @material to @mui
KarineBrandelli Jun 14, 2024
eea22b2
feat: migrate Progress from @material to @mui
KarineBrandelli Jun 14, 2024
b6b6fbe
feat: migrate Tooltip from @material to @mui
KarineBrandelli Jun 14, 2024
aa20012
feat: migrate Snackbar from @material to @mui
KarineBrandelli Jun 14, 2024
4e9b8e4
feat: migrate PinInput from @material to @mui
KarineBrandelli Jun 14, 2024
8260df0
feat: migrate Radio and RadioGroup from @material to @mui
KarineBrandelli Jun 14, 2024
407fa26
chore: adjusts
KarineBrandelli Jun 14, 2024
23f7d3a
feat: migrate InputAdornment from @material to @mui
KarineBrandelli Jun 14, 2024
4010f6d
feat: migrate Checkbox from @material to @mui
KarineBrandelli Jun 14, 2024
7064613
chore: adjust DefaultProps import path
KarineBrandelli Jun 14, 2024
14d6bea
feat: migrate Slider from @material to @mui
KarineBrandelli Jun 14, 2024
ad90075
feat: migrate Bradcrumbs from @material to @mui
KarineBrandelli Jun 14, 2024
3845de3
feat: migrate Tab and Tabs from @material to @mui
KarineBrandelli Jun 17, 2024
27cc464
fix: types import path
KarineBrandelli Jun 17, 2024
7a61448
feat: migrate StepCard from @material to @mui
KarineBrandelli Jun 17, 2024
2036a78
test: fix tests
KarineBrandelli Jun 17, 2024
a3a7d93
feat: migrate Stepper from @material to @mui
KarineBrandelli Jun 17, 2024
39671fa
feat: migrate Drawer from @material to @mui
KarineBrandelli Jun 17, 2024
3e744f0
feat: migrate Menu from @material to @mui
KarineBrandelli Jun 17, 2024
a3c6f4b
feat: migrate Select from @material to @mui
KarineBrandelli Jun 17, 2024
f09f3e1
test: fix test
KarineBrandelli Jun 17, 2024
8974d9d
feat: update Table from @material to @mui
KarineBrandelli Jun 17, 2024
5c5e23e
feat: migrate DataTable from @material to @mui
KarineBrandelli Jun 17, 2024
8d8ef80
chore: adjust makeStyles
KarineBrandelli Jun 17, 2024
b1bef4d
feat: migrate NothingFound from @material to @mui
KarineBrandelli Jun 17, 2024
b16a5bb
test: update snapshots
KarineBrandelli Jun 17, 2024
06bcda0
feat: migrate Fab from @material to @mui
KarineBrandelli Jun 17, 2024
dc437c5
feat: migrate Typography from @material to @mui
KarineBrandelli Jun 18, 2024
42f2e46
chore: adjusts
KarineBrandelli Jun 18, 2024
07f8a8b
test: run tests
KarineBrandelli Jun 18, 2024
a83ec14
test: fix test
KarineBrandelli Jun 18, 2024
e01fee9
feat: migrate TextField from @material to @mui
KarineBrandelli Jun 18, 2024
4567b67
chore: adjust style props from @material-ui/pickers
KarineBrandelli Jun 18, 2024
0f05fd3
test: adjust tests
KarineBrandelli Jun 18, 2024
0e30709
feat: migrate Dialog from @material to @mui
KarineBrandelli Jun 18, 2024
1800d44
chore: adjusts
KarineBrandelli Jun 18, 2024
fcbede6
feat: migrate List and ListItem from @material to @mui
KarineBrandelli Jun 18, 2024
1c7aeba
fix: button, select, text-field and menu props
KarineBrandelli Jun 18, 2024
6d743e5
test: run tests
KarineBrandelli Jun 18, 2024
22dc143
chore: remove ChipField component
KarineBrandelli Jun 21, 2024
9e61095
fix: Fab hover
KarineBrandelli Jun 21, 2024
309f774
fix: List background color
KarineBrandelli Jun 21, 2024
f801334
fix: remove unnecessary styles
KarineBrandelli Jun 21, 2024
cd0a2fb
chore: general adjusts
KarineBrandelli Jun 21, 2024
69e4cbd
fix: Select onChange prop
KarineBrandelli Jun 21, 2024
e5a8e22
feat: migrate Autocomplete from @material/lab to @mui
KarineBrandelli Jun 21, 2024
068af89
test: run tests
KarineBrandelli Jun 21, 2024
1703212
deps: remove material-ui-chip-input
KarineBrandelli Jun 21, 2024
77f9ea3
deps: remove @material-ui/lab
KarineBrandelli Jun 21, 2024
8c52319
chore: remove material-ui from configs and docs
KarineBrandelli Jun 21, 2024
158eaa0
deps: update dependencies
KarineBrandelli Jun 21, 2024
7c4017f
Merge branch 'master' of github.com:nginformatica/flipper-ui into fea…
KarineBrandelli Jun 26, 2024
fdf0a96
deps: update dependencies
KarineBrandelli Jun 26, 2024
5b7b38f
fix: general adjusts
KarineBrandelli Jul 1, 2024
1b17f5e
test: run tests
KarineBrandelli Jul 1, 2024
641f9c4
deps: migrate @material-ui/pickers to @mui/x-date-pickers
KarineBrandelli Jul 1, 2024
14599d4
feat: migrate Pickers from @material-ui/pickers to @mui/x-date-pickers
KarineBrandelli Jul 1, 2024
2892698
deps: update dependencies
KarineBrandelli Jul 2, 2024
e9dc5db
docs: update package version
KarineBrandelli Jul 2, 2024
5131251
deps: update dependencies
KarineBrandelli Jul 2, 2024
122204a
fix: props adjustment
KarineBrandelli Jul 3, 2024
83f40ae
docs: update description
KarineBrandelli Jul 3, 2024
c396360
test: run tests
KarineBrandelli Jul 3, 2024
73cb11b
docs: update major package version
KarineBrandelli Jul 3, 2024
530da92
chore: adjusts
KarineBrandelli Jul 3, 2024
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
8 changes: 4 additions & 4 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ module.exports = {
[
'import',
{
libraryName: '@material-ui/core',
libraryName: '@mui/material',
libraryDirectory: '',
camel2DashComponentName: false
},
'material'
'mui'
],
[
'import',
{
libraryName: '@mui/material',
libraryName: '@mui/styles',
libraryDirectory: '',
camel2DashComponentName: false
},
'mui'
'styles'
],
[
'import',
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div align="center">
React UI based on the <br/>

`@material-ui/core` and `@mui/material` <br/>
`@mui/material` <br/>
toolkit for the web.

[![npm package](https://img.shields.io/npm/v/flipper-ui/latest.svg)](https://www.npmjs.com/package/flipper-ui)
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module.exports = {
'<rootDir>/src/core/**/*.(ts|tsx)',
'!<rootDir>/src/core/data-display/data-table/*.(ts|tsx)',
'!<rootDir>/src/core/feedback/dialog-v2/index.ts',
'!<rootDir>/src/core/navigation/breadcrumbs/index.tsx'
'!<rootDir>/src/core/navigation/breadcrumbs/index.tsx',
'!<rootDir>/src/core/inputs/select/index.tsx',
'!<rootDir>/src/core/inputs/date-time/index.tsx'
],
transform: {
'.+\\.(ts|tsx)$': 'ts-jest'
Expand Down
65 changes: 29 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "flipper-ui",
"version": "0.33.1",
"description": "",
"version": "0.34.0",
"description": "React UI based on the @mui/material toolkit for the web",
"main": "dist/index.js",
"homepage": "https://flipper-ui.ngi.com.br/",
"author": "NG",
"license": "MIT",
"homepage": "https://flipper-ui.ngi.com.br/",
"repository": {
"type": "git",
"url": "https://github.com/nginformatica/flipper-ui.git"
Expand Down Expand Up @@ -33,46 +33,43 @@
"test": "jest --verbose --silent --passWithNoTests --noStackTrace --runInBand"
},
"dependencies": {
"@date-io/date-fns": "1.3.6",
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5",
"@material-ui/core": "4.12.4",
"@material-ui/lab": "4.0.0-alpha.61",
"@material-ui/pickers": "3.3.11",
"@mui/icons-material": "5.15.19",
"@mui/material": "5.15.19",
"@mui/icons-material": "5.15.21",
"@mui/material": "5.15.21",
"@mui/styles": "5.15.21",
"@mui/x-date-pickers": "7.8.0",
"date-fns": "2.30.0",
"material-ui-chip-input": "2.0.0-beta.2",
"ramda": "0.25.0",
"react-loading-skeleton": "3.4.0",
"react-number-format": "4.4.1",
"sprintf-js": "1.1.3",
"uuid": "9.0.1"
"uuid": "10.0.0"
},
"devDependencies": {
"@babel/cli": "7.24.6",
"@babel/core": "7.24.6",
"@babel/plugin-transform-runtime": "7.24.6",
"@babel/preset-env": "7.24.6",
"@babel/preset-typescript": "7.24.6",
"@babel/cli": "7.24.7",
"@babel/core": "7.24.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.24.7",
"@babel/preset-typescript": "7.24.7",
"@faker-js/faker": "8.4.1",
"@storybook/addon-essentials": "7.6.17",
"@storybook/addon-styling-webpack": "1.0.0",
"@storybook/react": "7.6.17",
"@storybook/react-webpack5": "7.6.17",
"@stylistic/eslint-plugin": "1.5.4",
"@testing-library/dom": "10.1.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@stylistic/eslint-plugin": "2.3.0",
"@testing-library/dom": "10.3.0",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/node": "20.12.12",
"@types/node": "20.14.9",
"@types/ramda": "0.25.36",
"@types/react": "18.3.3",
"@types/sprintf-js": "1.1.4",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "7.15.0",
"@typescript-eslint/parser": "7.15.0",
"babel-loader": "9.1.3",
"babel-plugin-import": "1.13.8",
"babel-plugin-module-resolver": "5.0.2",
Expand All @@ -81,30 +78,26 @@
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"fs-extra": "11.2.0",
"identity-obj-proxy": "3.0.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"prettier": "3.2.5",
"prettier": "3.3.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router": "6.23.1",
"react-router-dom": "6.23.1",
"storybook": "7.6.17",
"styled-components": "6.1.11",
"ts-jest": "29.1.4",
"ts-jest": "29.1.5",
"ts-loader": "9.5.1",
"typescript": "5.4.5",
"webpack": "5.91.0"
"typescript": "5.5.3",
"webpack": "5.92.1"
},
"peerDependencies": {
"react": ">=17.0.0",
"react-dom": ">=17.0.0",
"react-router": ">=5.0.0",
"react-router-dom": ">=5.0.0",
"styled-components": ">=5.0.0"
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0",
"styled-components": "^6.0.0"
},
"publishConfig": {
"ignore": [
Expand Down
22 changes: 8 additions & 14 deletions src/core/data-display/actions/__snapshots__/actions.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,31 @@ exports[`Actions should match snapshot 1`] = `
class="sc-aYaIB ivIxy"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text"
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit css-1y942vo-MuiButtonBase-root-MuiButton-root"
data-testid="cancel-action"
href=""
name="cancel-action"
style="margin: 0px 16px; opacity: 1;"
tabindex="0"
type="button"
>
Voltar
<span
class="MuiButton-label"
>
Voltar
</span>
<span
class="MuiTouchRipple-root"
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary"
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorSecondary MuiButton-root MuiButton-contained MuiButton-containedSecondary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorSecondary css-zcbmsk-MuiButtonBase-root-MuiButton-root"
data-testid="confirm-action"
href=""
name="confirm-action"
style="opacity: 1;"
tabindex="0"
type="button"
>
Excluir
<span
class="MuiButton-label"
>
Excluir
</span>
<span
class="MuiTouchRipple-root"
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>
</div>
Expand Down
13 changes: 11 additions & 2 deletions src/core/data-display/actions/actions.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,20 @@ const meta: Meta<typeof Actions> = {
description: 'The buttons margin.'
},
actionButtonColor: {
options: ['inherit', 'primary', 'secondary', 'default', undefined],
options: [
'inherit',
'primary',
'secondary',
'success',
'error',
'info',
'warning',
undefined
],
control: { type: 'radio' },
description:
'The "Confirmar" button color.' +
'Must be `"inherit" | "primary" | "secondary" | "default" | undefined`' +
'Must be `"inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning"`' +
'If not set, the default is "secondary"'
},
disabled: {
Expand Down
14 changes: 10 additions & 4 deletions src/core/data-display/actions/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React from 'react'
import type { ButtonProps } from '@material-ui/core'
import Button from '@/core/inputs/button'
import { Wrapper } from './styles'

export interface IProps {
export interface IActionsProps {
padding?: number | string
margin?: number | string
align?: 'flex-end' | 'flex-start' | 'center'
prefix?: string
buttons?: Array<'confirm' | 'cancel'>
actionButtonColor?: ButtonProps['color']
actionButtonColor?:
| 'inherit'
| 'primary'
| 'secondary'
| 'success'
| 'error'
| 'info'
| 'warning'
names?: {
cancel: string
confirm: string
Expand All @@ -26,7 +32,7 @@ export interface IProps {
onConfirm(): void
}

const Actions = (props: IProps) => {
const Actions = (props: IActionsProps) => {
const showButton =
!props.readonly && (!props.buttons || props.buttons.includes('confirm'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
exports[`Advertise should match snapshot 1`] = `
<div>
<div
class="MuiPaper-root sc-gEvDqW gPmBbd MuiPaper-elevation1 MuiPaper-rounded"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 sc-gEvDqW gPmBbd css-1ps6pg7-MuiPaper-root"
role="mui-paper-container"
style="padding: 4px;"
>
<p
class="MuiTypography-root sc-aYaIB ikghlf MuiTypography-body2"
class="MuiTypography-root MuiTypography-body2 sc-aYaIB ikghlf css-e784if-MuiTypography-root"
style="margin: 0px 12px; padding: 6px 18px;"
>
comment
</p>
<span
class="MuiTypography-root sc-aYaIB ikghlf MuiTypography-caption"
class="MuiTypography-root MuiTypography-caption sc-aYaIB ikghlf css-1sn4lm3-MuiTypography-root"
style="margin: 0px 12px; padding: 6px 18px;"
>
author
Expand Down
6 changes: 3 additions & 3 deletions src/core/data-display/advertise/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import type { CSSProperties } from 'react'
import type { DefaultProps } from '../../types'
import { AdvertiseTypography, Paper } from './styles'
import { AdvertiseTypography, AdvertiseContainer } from './styles'

export interface AdvertiseProps extends DefaultProps {
comment: string
Expand All @@ -18,7 +18,7 @@ const Advertise = ({
authorStyle = {},
...otherProps
}: AdvertiseProps) => (
<Paper padding={padding} {...otherProps}>
<AdvertiseContainer padding={padding} {...otherProps}>
<AdvertiseTypography
margin='0 12px'
padding='6px 18px'
Expand All @@ -32,7 +32,7 @@ const Advertise = ({
style={{ ...authorStyle }}>
{author}
</AdvertiseTypography>
</Paper>
</AdvertiseContainer>
)

export default Advertise
4 changes: 2 additions & 2 deletions src/core/data-display/advertise/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default as styled } from 'styled-components'
import Typography from '@/core/data-display/typography'
import MuiPaper from '@/core/surfaces/paper'
import Paper from '@/core/surfaces/paper'
import { theme } from '@/theme'

const { grays } = theme.colors
Expand All @@ -11,7 +11,7 @@ export const AdvertiseTypography = styled(Typography)`
}
`

export const Paper = styled(MuiPaper)`
export const AdvertiseContainer = styled(Paper)`
display: flex;
flex-direction: column;
`
3 changes: 1 addition & 2 deletions src/core/data-display/avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import type { CSSProperties, ReactNode } from 'react'
import { Avatar as MuiAvatar } from '@mui/material'
import { take } from 'ramda'

export interface IProps {
name?: string
Expand All @@ -13,7 +12,7 @@ export interface IProps {
const Avatar = (props: IProps) => {
const getChild = () => {
if (props.name) {
return take(1, props.name.toUpperCase())
return props.name.charAt(0).toUpperCase()
}

return props.icon
Expand Down
4 changes: 2 additions & 2 deletions src/core/data-display/badge/__snapshots__/badge.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
exports[`Badge should match snapshot 1`] = `
<div>
<span
class="MuiBadge-root"
class="MuiBadge-root css-1c32n2y-MuiBadge-root"
>
Badge
<span
class="MuiBadge-badge makeStyles-badge-3 MuiBadge-anchorOriginTopRightRectangle"
class="MuiBadge-badge MuiBadge-standard MuiBadge-anchorOriginTopRight MuiBadge-anchorOriginTopRightRectangular MuiBadge-overlapRectangular css-dlwkee-MuiBadge-badge"
>
2
</span>
Expand Down
Loading