Skip to content

Commit 7bcfe77

Browse files
(BA-903) design-system-mui package (#10)
* (BA-903) starter design-system-mui package * update-mui-design-system * update-mui-design-system * update-mui-design-system * fix-build * update-yarn-lock * create design-system-mui Co-authored-by: Alexandre Anicio <[email protected]> Co-authored-by: Filipe de Castro <[email protected]>
1 parent a0657c4 commit 7bcfe77

File tree

29 files changed

+2145
-1300
lines changed

29 files changed

+2145
-1300
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
# custom
4+
dist
5+
36
# dependencies
47
node_modules
58
.pnp

apps/docs/next.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
const withTM = require('next-transpile-modules')(['@baseapp-frontend/core'])
1+
const withTM = require('next-transpile-modules')([
2+
'@baseapp-frontend/core',
3+
'@baseapp-frontend/config',
4+
'@baseapp-frontend/design-system-mui',
5+
'@baseapp-frontend/tsconfig',
6+
])
27

38
module.exports = withTM({
49
reactStrictMode: true,

apps/docs/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
6+
"dev": "next dev -p 3099",
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint"
1010
},
1111
"dependencies": {
1212
"@baseapp-frontend/core": "*",
13-
"next": "12.1.0",
14-
"react": "17.0.2",
15-
"react-dom": "17.0.2"
13+
"@baseapp-frontend/design-system-mui": "*",
14+
"@emotion/react": "^11.10.0",
15+
"@emotion/styled": "^11.10.0",
16+
"@mui/material": "^5.10.0",
17+
"next": "^12.2.4",
18+
"react": "^18.2.0",
19+
"react-dom": "^18.2.0"
1620
},
1721
"devDependencies": {
1822
"@baseapp-frontend/config": "*",

apps/docs/pages/index.tsx

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,54 @@
1+
import {
2+
ButtonWithLoading,
3+
PasswordField,
4+
ImageUploader,
5+
} from '@baseapp-frontend/design-system-mui'
6+
import { Divider, useTheme } from '@mui/material'
7+
import { useState } from 'react'
8+
19
export default function Docs() {
10+
const [images, setImages] = useState([])
11+
const theme = useTheme()
212
return (
313
<div>
4-
<h1>Docs</h1>
14+
<h1>Components demo</h1>
15+
<Divider style={{ margin: theme.spacing(2, 0) }} />
16+
17+
<h2>{`<ButtonWithLoading>`}</h2>
18+
<div style={{ width: theme.spacing(48), display: 'flex', flexDirection: 'column' }}>
19+
<ButtonWithLoading variant="contained" style={{ margin: theme.spacing(2, 0) }}>
20+
button
21+
</ButtonWithLoading>
22+
23+
<ButtonWithLoading variant="contained" loading>
24+
button
25+
</ButtonWithLoading>
26+
</div>
27+
28+
<Divider style={{ margin: theme.spacing(2, 0) }} />
29+
30+
<div style={{ width: theme.spacing(48) }}>
31+
<h2>{`<PasswordField />`}</h2>
32+
<PasswordField />
33+
34+
<PasswordField helperText="Type your password." />
35+
36+
<PasswordField error helperText="Incorrect entry." />
37+
</div>
38+
39+
<Divider style={{ margin: theme.spacing(2, 0) }} />
40+
41+
<h2>{`<ImageUploader />`}</h2>
42+
<div style={{ width: theme.spacing(48) }}>
43+
<ImageUploader
44+
images={images}
45+
setImages={setImages}
46+
name="imageUploeader"
47+
ImageProps={{ style: { outline: '1px solid blue' } }}
48+
buttonLabel="Upload your image here"
49+
buttonRemoveLabel="Remove"
50+
/>
51+
</div>
552
</div>
653
)
754
}

packages/core/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @baseapp-frontend/core
22

3+
## 1.1.0
4+
5+
### Minor Changes
6+
7+
- Updated following packages:
8+
- "next": from "^12.1.0" to "^12.2.4",
9+
- "react": from "^17.0.2" to "^18.2.0",
10+
- "react-dom": from "^17.0.2" to "^18.2.0",
11+
- "@testing-library/react":from "^12.1.2" to "^13.3.0",
12+
- "@testing-library/react-hooks": from "^7.0.2" to "^8.0.1",
13+
- "react-test-renderer": from "^17.0.2" to "^18.2.0",
14+
15+
316
## 1.0.0
417

518
### Major Changes

packages/core/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@baseapp-frontend/core",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Core utilities.",
55
"main": "./src/index.tsx",
66
"scripts": {
@@ -30,8 +30,8 @@
3030
"@babel/core": "^7.16.12",
3131
"@babel/preset-env": "^7.16.11",
3232
"@babel/preset-typescript": "^7.16.7",
33-
"@testing-library/react": "^12.1.2",
34-
"@testing-library/react-hooks": "^7.0.2",
33+
"@testing-library/react": "^13.3.0",
34+
"@testing-library/react-hooks": "^8.0.1",
3535
"@types/humps": "^2.0.1",
3636
"@types/jest": "^27.4.0",
3737
"@types/js-cookie": "^3.0.1",
@@ -43,11 +43,11 @@
4343
"babel-jest": "^27.4.6",
4444
"eslint": "^8.10.0",
4545
"jest": "^27.4.7",
46-
"next": "^12.1.0",
4746
"prettier": "^2.5.1",
48-
"react": "^17.0.2",
49-
"react-dom": "^17.0.2",
50-
"react-test-renderer": "^17.0.2",
47+
"next": "^12.2.4",
48+
"react": "^18.2.0",
49+
"react-dom": "^18.2.0",
50+
"react-test-renderer": "^18.2.0",
5151
"ts-jest": "^27.1.3",
5252
"typescript": "^4.5.4"
5353
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@baseapp-frontend/config/.eslintrc.js')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@baseapp-frontend/config/.prettierrc.js')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @baseapp-frontend/design-system-mui
2+
3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- Created design-system-mui package
8+
- Created following components:
9+
- ButtonWithLoading
10+
- ImageUploader (component used in WTF project)
11+
- PasswordField
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# **`@baseapp-frontend/design-system-mui`**
2+
3+
## **Overview**
4+
5+
This package defines our design system configuration (e.g. color pallete, typography, spacings, etc). It also shares reusable components that make up the design system as a whole.
6+
7+
## **What should be added here?**
8+
9+
In order to add any new feature inside the `design-system-mui` package, we need to ask ourselves some questions:
10+
11+
- Is that feature part of the design system configuration or is it a reusable design component?

0 commit comments

Comments
 (0)