@movable/ui 0.0.0 → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ increment:
7
+ description: Override Default Version Increment
8
+ required: false
9
+ default: ''
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ with:
17
+ fetch-depth: 0 # Necessary to generate changelog from commit history
18
+ - uses: volta-cli/action@v1
19
+
20
+ - name: git config
21
+ run: |
22
+ git config user.name "${GITHUB_ACTOR}"
23
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
24
+
25
+ - name: Get yarn cache directory path
26
+ id: yarn-cache-dir-path
27
+ run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
28
+ - uses: actions/cache@v2
29
+ with:
30
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31
+ key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32
+ restore-keys: |
33
+ ${{ runner.os }}-yarn-
34
+
35
+ - run: yarn install --immutable
36
+
37
+ - name: Configure NPM with auth token
38
+ run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
39
+ env:
40
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41
+
42
+ - run: yarn release ${{ github.event.inputs.increment }}
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CHANGELOG.md ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movable/ui",
3
- "version": "0.0.0",
3
+ "version": "0.1.0-alpha.0",
4
4
  "description": "Movable Ink's shared MUI components and MUI theme for our vite applications",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -29,11 +29,15 @@
29
29
  "devDependencies": {
30
30
  "@commitlint/cli": "^17.6.7",
31
31
  "@commitlint/config-conventional": "^17.6.7",
32
+ "@release-it/conventional-changelog": "^7.0.1",
32
33
  "@rollup/plugin-commonjs": "^25.0.3",
33
34
  "@rollup/plugin-node-resolve": "^15.1.0",
34
35
  "@rollup/plugin-typescript": "^11.1.2",
35
36
  "@types/react": "^18.2.19",
36
37
  "@types/react-dom": "^18.2.7",
38
+ "@typescript-eslint/eslint-plugin": "^6.7.0",
39
+ "eslint-plugin-react-hooks": "^4.6.0",
40
+ "eslint-plugin-react-refresh": "^0.4.3",
37
41
  "husky": "^8.0.0",
38
42
  "lint-staged": "^13.2.3",
39
43
  "postcss": "^8.4.27",
@@ -54,5 +58,8 @@
54
58
  },
55
59
  "volta": {
56
60
  "node": "18.17.0"
61
+ },
62
+ "dependencies": {
63
+ "@mui/material": "^5.14.8"
57
64
  }
58
65
  }
package/src/theme.ts ADDED
@@ -0,0 +1,252 @@
1
+ import {
2
+ blue,
3
+ green,
4
+ grey,
5
+ lightBlue,
6
+ orange,
7
+ purple,
8
+ red,
9
+ } from '@mui/material/colors';
10
+ import { ThemeOptions, alpha, createTheme } from '@mui/material/styles';
11
+
12
+ declare module '@mui/material/styles' {
13
+ interface PaletteColor {
14
+ selected?: string;
15
+ }
16
+ interface Palette {
17
+ focusVisible: string;
18
+ neutral50: string;
19
+ neutral100: string;
20
+ neutral200: string;
21
+ neutral300: string;
22
+ neutral400: string;
23
+ neutral500: string;
24
+ neutral600: string;
25
+ neutral700: string;
26
+ neutral800: string;
27
+ neutral900: string;
28
+ neutralA100: string;
29
+ neutralA200: string;
30
+ neutralA400: string;
31
+ neutralA700: string;
32
+ blue50: string;
33
+ blue100: string;
34
+ blue200: string;
35
+ blue300: string;
36
+ blue400: string;
37
+ blue500: string;
38
+ blue600: string;
39
+ blue700: string;
40
+ blue800: string;
41
+ blue900: string;
42
+ }
43
+ interface PalletteOptions {
44
+ focusVisible: string;
45
+ neutral50: string;
46
+ neutral100: string;
47
+ neutral200: string;
48
+ neutral300: string;
49
+ neutral400: string;
50
+ neutral500: string;
51
+ neutral600: string;
52
+ neutral700: string;
53
+ neutral800: string;
54
+ neutral900: string;
55
+ neutralA100: string;
56
+ neutralA200: string;
57
+ neutralA400: string;
58
+ neutralA700: string;
59
+ blue50: string;
60
+ blue100: string;
61
+ blue200: string;
62
+ blue300: string;
63
+ blue400: string;
64
+ blue500: string;
65
+ }
66
+ }
67
+
68
+ // TODO [Low]: put in /shared folder
69
+ const theme = createTheme({
70
+ components: {
71
+ MuiDataGrid: {
72
+ styleOverrides: {
73
+ root: {
74
+ border: 'none',
75
+ '.MuiDataGrid-toolbarContainer .MuiTextField-root': {
76
+ backgroundColor: grey[100],
77
+ padding: '8px',
78
+ borderRadius: '8px',
79
+ },
80
+ '.MuiInput-underline:before': {
81
+ borderBottom: 'none !important',
82
+ color: 'red',
83
+ },
84
+ '.MuiDataGrid-toolbarContainer button': {
85
+ backgroundColor: grey[100],
86
+ color: grey[900],
87
+ padding: '4px 10px',
88
+ },
89
+ '.MuiDataGrid-toolbarContainer svg': {
90
+ color: grey[700],
91
+ },
92
+ },
93
+ },
94
+ },
95
+
96
+ MuiButton: {
97
+ styleOverrides: {
98
+ root: {
99
+ textTransform: 'capitalize',
100
+ },
101
+ textPrimary: {
102
+ color: blue[400],
103
+ },
104
+ outlinedInherit: {
105
+ borderColor: alpha(grey[900], 0.03),
106
+ },
107
+ },
108
+ },
109
+
110
+ MuiSelect: {
111
+ defaultProps: {
112
+ size: 'small',
113
+ },
114
+ styleOverrides: {
115
+ root: {
116
+ backgroundColor: grey[100],
117
+ },
118
+ },
119
+ },
120
+
121
+ MuiTextField: {
122
+ defaultProps: {
123
+ size: 'small',
124
+ },
125
+ styleOverrides: {
126
+ root: {
127
+ backgroundColor: grey[100],
128
+ },
129
+ },
130
+ },
131
+
132
+ MuiLink: {
133
+ styleOverrides: {
134
+ root: {
135
+ color: blue[400],
136
+ textDecoration: 'none',
137
+ },
138
+ },
139
+ },
140
+
141
+ MuiChip: {
142
+ styleOverrides: {
143
+ filledPrimary: {
144
+ backgroundColor: blue[50],
145
+ color: blue[900],
146
+ '.MuiChip-deleteIcon': {
147
+ color: blue[800],
148
+ '&:hover': {
149
+ color: blue[900],
150
+ },
151
+ '&:active': {
152
+ color: blue[900],
153
+ },
154
+ },
155
+ },
156
+ filledSuccess: {
157
+ backgroundColor: green[50],
158
+ color: green[900],
159
+ },
160
+ filledError: {
161
+ backgroundColor: red[50],
162
+ color: blue[900],
163
+ },
164
+ },
165
+ },
166
+ },
167
+
168
+ palette: {
169
+ text: {
170
+ primary: grey[900],
171
+ secondary: grey[700],
172
+ disabled: grey[700],
173
+ },
174
+
175
+ focusVisible: alpha(blue[700], 0.3),
176
+
177
+ neutral50: grey[50],
178
+ neutral100: grey[100],
179
+ neutral200: grey[200],
180
+ neutral300: grey[300],
181
+ neutral400: grey[400],
182
+ neutral500: grey[500],
183
+ neutral600: grey[600],
184
+ neutral700: grey[700],
185
+ neutral800: grey[800],
186
+ neutral900: grey[900],
187
+ neutralA100: grey['A100'],
188
+ neutralA200: grey['A200'],
189
+ neutralA400: grey['A400'],
190
+ neutralA700: grey['A700'],
191
+
192
+ blue50: blue[50],
193
+ blue100: blue[100],
194
+ blue200: blue[200],
195
+ blue300: blue[300],
196
+ blue400: blue[400],
197
+ blue500: blue[500],
198
+ blue600: blue[600],
199
+ blue700: blue[700],
200
+ blue800: blue[800],
201
+ blue900: blue[900],
202
+ // todo: add rest of colors. see https://www.figma.com/file/9yr8neepsdgLbiFADaR6M2/MI----Library-Base?type=design&node-id=477-93017&t=wf27RohUWMM0z3UH-0
203
+
204
+ primary: {
205
+ main: blue[700],
206
+ dark: blue[800],
207
+ light: blue[600],
208
+ contrastText: '#FFFFFF',
209
+ selected: alpha(blue[700], 0.08),
210
+ },
211
+ secondary: {
212
+ main: purple[500],
213
+ dark: purple[700],
214
+ light: purple[300],
215
+ contrastText: '#FFFFFF',
216
+ },
217
+ error: {
218
+ main: red[700],
219
+ dark: red[800],
220
+ light: red[400],
221
+ contrastText: '#FFFFFF',
222
+ },
223
+ warning: {
224
+ main: orange[800],
225
+ dark: orange[900],
226
+ light: orange[500],
227
+ contrastText: '#FFFFFF',
228
+ },
229
+ info: {
230
+ main: lightBlue[800],
231
+ dark: lightBlue[900],
232
+ light: orange[700],
233
+ contrastText: '#FFFFFF',
234
+ },
235
+ success: {
236
+ main: green[800],
237
+ dark: green[900],
238
+ light: green[500],
239
+ contrastText: '#FFFFFF',
240
+ },
241
+ action: {
242
+ active: grey[700],
243
+ hover: alpha(grey[700], 0.04),
244
+ selected: alpha(grey[700], 0.08),
245
+ focus: alpha(grey[700], 0.12),
246
+ disabledBackground: grey[200],
247
+ disabled: grey[700],
248
+ },
249
+ },
250
+ } as ThemeOptions);
251
+
252
+ export default theme;