@linagora/twake-mui 1.2.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.
- package/CHANGELOG.md +95 -0
- package/README.md +97 -0
- package/dist/components/Avatar/helpers.js +72 -0
- package/dist/components/Avatar/index.js +62 -0
- package/dist/components/ThemeProvider/index.js +17 -0
- package/dist/components/ThemeProvider/types.js +1 -0
- package/dist/index.js +8 -0
- package/dist/lib/makeDarkOverrides.js +42 -0
- package/dist/lib/makeLightOverrides.js +42 -0
- package/dist/lib/makePalette.js +79 -0
- package/dist/lib/makeTheme.js +43 -0
- package/dist/lib/makeTypography.js +111 -0
- package/dist/lib/overrides/accordionOverrides.js +63 -0
- package/dist/lib/overrides/autocompleteOverrides.js +31 -0
- package/dist/lib/overrides/avatarOverrides.js +85 -0
- package/dist/lib/overrides/backdropOverrides.js +17 -0
- package/dist/lib/overrides/buttonOverrides.js +86 -0
- package/dist/lib/overrides/checkboxOverrides.js +11 -0
- package/dist/lib/overrides/datePickerOverrides.js +143 -0
- package/dist/lib/overrides/dialogOverrides.js +43 -0
- package/dist/lib/overrides/iconButtonOverrides.js +13 -0
- package/dist/lib/overrides/menuItemOverrides.js +24 -0
- package/dist/lib/overrides/popoverOverrides.js +11 -0
- package/dist/lib/overrides/textFieldOverrides.js +90 -0
- package/dist/lib/overrides/toggleButtonOverrides.js +42 -0
- package/dist/lib/palette.json +102 -0
- package/dist/lib/radius.js +7 -0
- package/dist/lib/theme.js +2 -0
- package/dist/lib/types.js +1 -0
- package/package.json +73 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/linagora/twake-ui/compare/v1.1.0...v1.2.0) (2026-04-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove :has() selector for jsdom compatibility in tests ([252889d](https://github.com/linagora/twake-ui/commit/252889d6499fa3ad76cfa7de8d05e88a5fe9197f))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add component overrides for DatePicker, Accordion, Checkbox, IconButton ([c5e18a1](https://github.com/linagora/twake-ui/commit/c5e18a1faba4f8a65c7eaa56d5c3f0581be8aa59))
|
|
12
|
+
* **twake-mui:** add Avatar component with gradient background support ([d3ad072](https://github.com/linagora/twake-ui/commit/d3ad072f78d94068a4675adb8493b630e9d7add2))
|
|
13
|
+
|
|
14
|
+
# Changelog
|
|
15
|
+
|
|
16
|
+
All notable changes to this project will be documented in this file.
|
|
17
|
+
|
|
18
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
19
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
20
|
+
|
|
21
|
+
## [1.1.7]
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- DatePicker: MuiYearCalendar-root width set to 245px
|
|
26
|
+
- DatePicker: MuiYearCalendar-button and MuiMonthCalendar-button use theme primary (orange) for selected/hover/focus instead of default blue
|
|
27
|
+
- DatePicker: MuiYearCalendar-button base styles aligned with MuiMonthCalendar-button (fontSize, lineHeight, height, width, transparent tabindex="0")
|
|
28
|
+
|
|
29
|
+
## [1.1.6]
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- DatePicker/DateCalendar: documented triple-class selector for MUI X specificity; no API change
|
|
34
|
+
|
|
35
|
+
## [1.1.5]
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Updated DatePicker selected day background color to use theme primary color (orange) instead of default blue
|
|
40
|
+
- Added override for MuiButtonBase-root.MuiPickersDay-root.Mui-selected to ensure proper styling
|
|
41
|
+
|
|
42
|
+
## [1.1.4]
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- Global styles for DatePicker components
|
|
47
|
+
- Custom styling for DateCalendar header and controls
|
|
48
|
+
- Improved typography and spacing for calendar components
|
|
49
|
+
|
|
50
|
+
## [1.1.3]
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- Updated CHANGELOG documentation
|
|
55
|
+
|
|
56
|
+
## [1.1.2]
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- Updated Button component padding for medium size (from 8px to 9px, contained from 9px to 10px)
|
|
61
|
+
- Updated ToggleButton component with medium size padding (9px 24px)
|
|
62
|
+
- Improved type safety for palette grey configuration
|
|
63
|
+
- Refactored component overrides to remove unnecessary theme parameter dependencies
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- Updated TypeScript configuration to enable package building for local development usage
|
|
68
|
+
- Added declaration file generation and output directory configuration
|
|
69
|
+
|
|
70
|
+
## [1.1.1]
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
|
|
74
|
+
- Avatar component with gradient background support
|
|
75
|
+
- Avatar helpers: nameToColor, supportedColors, colorMapping
|
|
76
|
+
- Avatar overrides with custom size classes (xs, s, m, l, xl)
|
|
77
|
+
- Export nameToColor and supportedColors from package index
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- Avatar component now supports gradient backgrounds with 11 predefined colors
|
|
82
|
+
- Avatar size system updated with new dimensions and typography
|
|
83
|
+
|
|
84
|
+
## [1.0.0]
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- Initial release
|
|
89
|
+
- Palette system with techno-independent color definitions
|
|
90
|
+
- Typography system with custom variants
|
|
91
|
+
- Button component overrides (contained, outlined, text)
|
|
92
|
+
- TextField component overrides
|
|
93
|
+
- Dialog/Modal component overrides
|
|
94
|
+
- ThemeProvider wrapper component
|
|
95
|
+
- TypeScript type definitions
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# twake-mui
|
|
2
|
+
|
|
3
|
+
MUI v7 theme system for Twake Calendar and other Twake applications.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
You need to use Node 24+
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @linagora/twake-mui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Don't forget to also install peerDependencies (see package.json)
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Basic Usage
|
|
20
|
+
|
|
21
|
+
Wrap your app with the Provider to get the Material-UI theme
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { TwakeMuiThemeProvider } from '@linagora/twake-mui'
|
|
25
|
+
|
|
26
|
+
function App() {
|
|
27
|
+
return (
|
|
28
|
+
<TwakeMuiThemeProvider>{/* Your application */}</TwakeMuiThemeProvider>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then you can use Material-UI components from Twake-mui
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { Button } from '@linagora/twake-mui'
|
|
37
|
+
|
|
38
|
+
function Component() {
|
|
39
|
+
return (
|
|
40
|
+
<Button>Label</Button>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Accessing Theme
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { useTheme } from '@linagora/twake-mui'
|
|
49
|
+
|
|
50
|
+
function MyComponent() {
|
|
51
|
+
const theme = useTheme()
|
|
52
|
+
const primaryColor = theme.palette.primary.main
|
|
53
|
+
// ...
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- **Palette System**: Techno-independent color definitions
|
|
60
|
+
- **Component Overrides**: Pre-styled Button, TextField, Dialog components
|
|
61
|
+
- **MUI v7 Compatible**: Built for Material-UI v7
|
|
62
|
+
|
|
63
|
+
## Development
|
|
64
|
+
|
|
65
|
+
This package is part of the `twake-ui` monorepo.
|
|
66
|
+
|
|
67
|
+
### Build
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm run build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Local Development
|
|
74
|
+
|
|
75
|
+
To use this package locally in another project:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# In twake-ui/packages/twake-mui
|
|
79
|
+
npm link
|
|
80
|
+
|
|
81
|
+
# In your project
|
|
82
|
+
npm link twake-mui
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or use file path in package.json:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"@linagora/twake-mui": "file:../twake-ui/packages/twake-mui"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export var sizeToFontSize = {
|
|
2
|
+
xs: 9.109,
|
|
3
|
+
s: 12.525,
|
|
4
|
+
m: 18.219,
|
|
5
|
+
l: 27.328,
|
|
6
|
+
xl: 36.438
|
|
7
|
+
};
|
|
8
|
+
export var sizeToNb = {
|
|
9
|
+
xs: 18,
|
|
10
|
+
s: 28,
|
|
11
|
+
m: 36,
|
|
12
|
+
l: 54,
|
|
13
|
+
xl: 72
|
|
14
|
+
};
|
|
15
|
+
export var sizeToFontWeight = {
|
|
16
|
+
xs: 500,
|
|
17
|
+
s: 500,
|
|
18
|
+
m: 500,
|
|
19
|
+
l: 600,
|
|
20
|
+
xl: 600
|
|
21
|
+
};
|
|
22
|
+
export var sizeToLineHeight = {
|
|
23
|
+
xs: 18.219,
|
|
24
|
+
s: 18.219,
|
|
25
|
+
m: 27.328,
|
|
26
|
+
l: 36.438,
|
|
27
|
+
xl: 45.547
|
|
28
|
+
};
|
|
29
|
+
export var supportedColors = [
|
|
30
|
+
'sunrise',
|
|
31
|
+
'downy',
|
|
32
|
+
'sugarCoral',
|
|
33
|
+
'pinkBonnet',
|
|
34
|
+
'blueMana',
|
|
35
|
+
'nightBlue',
|
|
36
|
+
'snowPea',
|
|
37
|
+
'pluviophile',
|
|
38
|
+
'cornflower',
|
|
39
|
+
'paleGreen',
|
|
40
|
+
'moonBlue'
|
|
41
|
+
];
|
|
42
|
+
export var colorMapping = {
|
|
43
|
+
sunrise: 'linear-gradient(136deg, #F8D280 14.84%, #F2AC69 96.03%)',
|
|
44
|
+
downy: 'linear-gradient(136deg, #81EAD4 14.84%, #62C6B7 96.03%)',
|
|
45
|
+
sugarCoral: 'linear-gradient(136deg, #F19E86 14.84%, #F95967 96.03%)',
|
|
46
|
+
pinkBonnet: 'linear-gradient(136deg, #E4ABF0 14.84%, #D96EED 96.03%)',
|
|
47
|
+
blueMana: 'linear-gradient(136deg, #85D9FD 14.84%, #2A9EFC 96.03%)',
|
|
48
|
+
nightBlue: 'linear-gradient(136deg, #80AEFF 39.32%, #883DFE 96.03%)',
|
|
49
|
+
snowPea: 'linear-gradient(136deg, #BDF4A1 14.84%, #52CE64 96.03%)',
|
|
50
|
+
pluviophile: 'linear-gradient(136deg, #A1D6F4 14.84%, #52CEC2 96.03%)',
|
|
51
|
+
cornflower: 'linear-gradient(135deg, #86D9D3 0%, #1CCFB4 100%)',
|
|
52
|
+
paleGreen: 'linear-gradient(135deg, #E2FA17 0%, #75D8CB 100%)',
|
|
53
|
+
moonBlue: 'linear-gradient(136deg, #6DCFFF 14.84%, #3D88F8 96.03%)'
|
|
54
|
+
};
|
|
55
|
+
var colors = supportedColors.filter(Boolean);
|
|
56
|
+
var makeKey = function (colors, name) {
|
|
57
|
+
return (Array.from(name.toUpperCase())
|
|
58
|
+
.map(function (letter) { return letter.charCodeAt(0); })
|
|
59
|
+
.reduce(function (sum, number) { return sum + number; }, 0) % colors.length);
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Generate color from name
|
|
63
|
+
* @param name - Name string to generate color from
|
|
64
|
+
* @returns Color key from supportedColors
|
|
65
|
+
*/
|
|
66
|
+
export var nameToColor = function (name) {
|
|
67
|
+
if (name === void 0) { name = ''; }
|
|
68
|
+
if (!name)
|
|
69
|
+
return undefined;
|
|
70
|
+
var key = makeKey(colors, name);
|
|
71
|
+
return colors[key];
|
|
72
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { Avatar as MuiAvatar } from '@mui/material';
|
|
24
|
+
import { styled } from '@mui/material/styles';
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { colorMapping, nameToColor, supportedColors } from './helpers';
|
|
27
|
+
var capitalize = function (str) {
|
|
28
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
29
|
+
};
|
|
30
|
+
var StyledAvatar = styled(MuiAvatar, {
|
|
31
|
+
shouldForwardProp: function (prop) { return prop !== 'gradientColor'; }
|
|
32
|
+
})(function (_a) {
|
|
33
|
+
var theme = _a.theme, gradientColor = _a.gradientColor;
|
|
34
|
+
return (__assign({}, (gradientColor && {
|
|
35
|
+
color: theme.palette.primary.contrastText,
|
|
36
|
+
background: colorMapping[gradientColor] || undefined
|
|
37
|
+
})));
|
|
38
|
+
});
|
|
39
|
+
export var Avatar = function (_a) {
|
|
40
|
+
var className = _a.className, color = _a.color, size = _a.size, border = _a.border, innerBorder = _a.innerBorder, disabled = _a.disabled, _b = _a.display, display = _b === void 0 ? 'initial' : _b, sx = _a.sx, props = __rest(_a, ["className", "color", "size", "border", "innerBorder", "disabled", "display", "sx"]);
|
|
41
|
+
var defaultColor = typeof props.children === 'string' ? nameToColor(props.children) : undefined;
|
|
42
|
+
var finalColor = color === 'none'
|
|
43
|
+
? undefined
|
|
44
|
+
: color && supportedColors.includes(color)
|
|
45
|
+
? color
|
|
46
|
+
: defaultColor;
|
|
47
|
+
var classNames = [];
|
|
48
|
+
if (className)
|
|
49
|
+
classNames.push(className);
|
|
50
|
+
if (size && typeof size === 'string')
|
|
51
|
+
classNames.push("size-".concat(size));
|
|
52
|
+
if (disabled)
|
|
53
|
+
classNames.push('disabled');
|
|
54
|
+
if (border)
|
|
55
|
+
classNames.push('border');
|
|
56
|
+
if (innerBorder)
|
|
57
|
+
classNames.push('innerBorder');
|
|
58
|
+
if (display !== 'initial')
|
|
59
|
+
classNames.push("display".concat(capitalize(display)));
|
|
60
|
+
return (React.createElement(StyledAvatar, __assign({ gradientColor: finalColor, className: classNames.join(' ') || undefined, sx: sx }, props)));
|
|
61
|
+
};
|
|
62
|
+
export default Avatar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CssBaseline } from '@mui/material';
|
|
2
|
+
import { ThemeProvider as MuiThemeProvider, createTheme } from '@mui/material/styles';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { makeTheme } from '../../lib/makeTheme';
|
|
5
|
+
export var TwakeMuiThemeProvider = function (_a) {
|
|
6
|
+
var children = _a.children, _b = _a.mode, mode = _b === void 0 ? 'light' : _b, themeOptions = _a.themeOptions;
|
|
7
|
+
var theme = useMemo(function () {
|
|
8
|
+
var baseTheme = makeTheme(mode);
|
|
9
|
+
if (!themeOptions) {
|
|
10
|
+
return baseTheme;
|
|
11
|
+
}
|
|
12
|
+
return createTheme(baseTheme, themeOptions);
|
|
13
|
+
}, [mode, themeOptions]);
|
|
14
|
+
return (React.createElement(MuiThemeProvider, { theme: theme },
|
|
15
|
+
React.createElement(CssBaseline, null),
|
|
16
|
+
children));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from '@mui/material';
|
|
2
|
+
export { createTheme, ThemeProvider, styled, alpha, darken, lighten, useTheme } from '@mui/material/styles';
|
|
3
|
+
export { default as Autocomplete } from '@mui/material/Autocomplete';
|
|
4
|
+
export { TwakeMuiThemeProvider } from './components/ThemeProvider';
|
|
5
|
+
export { theme } from './lib/theme';
|
|
6
|
+
export { radius } from './lib/radius';
|
|
7
|
+
export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
8
|
+
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { alpha } from '@mui/material/styles';
|
|
13
|
+
import { accordionOverrides } from './overrides/accordionOverrides';
|
|
14
|
+
import { autocompleteOverrides } from './overrides/autocompleteOverrides';
|
|
15
|
+
import { avatarOverrides } from './overrides/avatarOverrides';
|
|
16
|
+
import { backdropOverrides } from './overrides/backdropOverrides';
|
|
17
|
+
import { buttonOverrides } from './overrides/buttonOverrides';
|
|
18
|
+
import { checkboxOverrides } from './overrides/checkboxOverrides';
|
|
19
|
+
import { datePickerOverrides } from './overrides/datePickerOverrides';
|
|
20
|
+
import { dialogOverrides, dialogTitleOverrides, dialogContentOverrides, dialogActionsOverrides } from './overrides/dialogOverrides';
|
|
21
|
+
import { iconButtonOverrides } from './overrides/iconButtonOverrides';
|
|
22
|
+
import { menuItemOverrides } from './overrides/menuItemOverrides';
|
|
23
|
+
import { popoverOverrides } from './overrides/popoverOverrides';
|
|
24
|
+
import { textFieldOverrides, outlinedInputOverrides, inputBaseOverrides, selectOverrides } from './overrides/textFieldOverrides';
|
|
25
|
+
import { toggleButtonGroupOverrides, toggleButtonOverrides } from './overrides/toggleButtonOverrides';
|
|
26
|
+
export var makeDarkOverrides = function (theme) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
var datePickerOverridesResult = datePickerOverrides(theme);
|
|
29
|
+
var accordionOverridesResult = accordionOverrides(theme);
|
|
30
|
+
return __assign(__assign({ MuiButton: buttonOverrides(theme), MuiTextField: textFieldOverrides(), MuiOutlinedInput: outlinedInputOverrides(), MuiInputBase: inputBaseOverrides(), MuiSelect: selectOverrides(), MuiAutocomplete: autocompleteOverrides(), MuiDialog: dialogOverrides(), MuiDialogTitle: dialogTitleOverrides(), MuiDialogContent: dialogContentOverrides(), MuiDialogActions: dialogActionsOverrides(), MuiPopover: popoverOverrides(), MuiAvatar: avatarOverrides(theme), MuiToggleButtonGroup: toggleButtonGroupOverrides(), MuiToggleButton: toggleButtonOverrides(theme), MuiIconButton: iconButtonOverrides(), MuiCheckbox: checkboxOverrides(), MuiBackdrop: backdropOverrides(theme), MuiTypography: {
|
|
31
|
+
styleOverrides: {
|
|
32
|
+
root: {
|
|
33
|
+
color: alpha(theme.palette.grey[50], 0.9)
|
|
34
|
+
},
|
|
35
|
+
caption: {
|
|
36
|
+
// Typography caption overrides will be implemented later
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} }, datePickerOverridesResult), { MuiAccordion: accordionOverridesResult.MuiAccordion, MuiAccordionSummary: accordionOverridesResult.MuiAccordionSummary, MuiCssBaseline: {
|
|
40
|
+
styleOverrides: __assign(__assign({}, (((_a = datePickerOverridesResult.MuiCssBaseline) === null || _a === void 0 ? void 0 : _a.styleOverrides) || {})), (((_b = accordionOverridesResult.MuiCssBaseline) === null || _b === void 0 ? void 0 : _b.styleOverrides) || {}))
|
|
41
|
+
}, MuiMenuItem: menuItemOverrides(theme) });
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { alpha } from '@mui/material/styles';
|
|
13
|
+
import { accordionOverrides } from './overrides/accordionOverrides';
|
|
14
|
+
import { autocompleteOverrides } from './overrides/autocompleteOverrides';
|
|
15
|
+
import { avatarOverrides } from './overrides/avatarOverrides';
|
|
16
|
+
import { backdropOverrides } from './overrides/backdropOverrides';
|
|
17
|
+
import { buttonOverrides } from './overrides/buttonOverrides';
|
|
18
|
+
import { checkboxOverrides } from './overrides/checkboxOverrides';
|
|
19
|
+
import { datePickerOverrides } from './overrides/datePickerOverrides';
|
|
20
|
+
import { dialogOverrides, dialogTitleOverrides, dialogContentOverrides, dialogActionsOverrides } from './overrides/dialogOverrides';
|
|
21
|
+
import { iconButtonOverrides } from './overrides/iconButtonOverrides';
|
|
22
|
+
import { menuItemOverrides } from './overrides/menuItemOverrides';
|
|
23
|
+
import { popoverOverrides } from './overrides/popoverOverrides';
|
|
24
|
+
import { textFieldOverrides, outlinedInputOverrides, inputBaseOverrides, selectOverrides } from './overrides/textFieldOverrides';
|
|
25
|
+
import { toggleButtonGroupOverrides, toggleButtonOverrides } from './overrides/toggleButtonOverrides';
|
|
26
|
+
export var makeLightOverrides = function (theme) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
var datePickerOverridesResult = datePickerOverrides(theme);
|
|
29
|
+
var accordionOverridesResult = accordionOverrides(theme);
|
|
30
|
+
return __assign(__assign({ MuiButton: buttonOverrides(theme), MuiTextField: textFieldOverrides(), MuiOutlinedInput: outlinedInputOverrides(), MuiInputBase: inputBaseOverrides(), MuiSelect: selectOverrides(), MuiAutocomplete: autocompleteOverrides(), MuiDialog: dialogOverrides(), MuiDialogTitle: dialogTitleOverrides(), MuiDialogContent: dialogContentOverrides(), MuiDialogActions: dialogActionsOverrides(), MuiPopover: popoverOverrides(), MuiAvatar: avatarOverrides(theme), MuiToggleButtonGroup: toggleButtonGroupOverrides(), MuiToggleButton: toggleButtonOverrides(theme), MuiIconButton: iconButtonOverrides(), MuiCheckbox: checkboxOverrides(), MuiBackdrop: backdropOverrides(theme), MuiTypography: {
|
|
31
|
+
styleOverrides: {
|
|
32
|
+
root: {
|
|
33
|
+
color: alpha(theme.palette.grey[900], 0.9)
|
|
34
|
+
},
|
|
35
|
+
caption: {
|
|
36
|
+
// Typography caption overrides will be implemented later
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} }, datePickerOverridesResult), { MuiAccordionSummary: accordionOverridesResult.MuiAccordionSummary, MuiCssBaseline: {
|
|
40
|
+
styleOverrides: __assign(__assign({}, (((_a = datePickerOverridesResult.MuiCssBaseline) === null || _a === void 0 ? void 0 : _a.styleOverrides) || {})), (((_b = accordionOverridesResult.MuiCssBaseline) === null || _b === void 0 ? void 0 : _b.styleOverrides) || {}))
|
|
41
|
+
}, MuiMenuItem: menuItemOverrides(theme) });
|
|
42
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import paletteJson from './palette.json';
|
|
2
|
+
var paletteData = paletteJson;
|
|
3
|
+
export var makePalette = function (mode) {
|
|
4
|
+
if (mode === void 0) { mode = 'light'; }
|
|
5
|
+
return {
|
|
6
|
+
mode: mode,
|
|
7
|
+
primary: {
|
|
8
|
+
light: paletteData.Primary[300],
|
|
9
|
+
main: paletteData.Primary[600],
|
|
10
|
+
dark: paletteData.Primary[800],
|
|
11
|
+
contrastText: paletteData.Primary.ContrastText
|
|
12
|
+
},
|
|
13
|
+
secondary: {
|
|
14
|
+
light: paletteData.Secondary[300],
|
|
15
|
+
main: paletteData.Secondary[600],
|
|
16
|
+
dark: paletteData.Secondary[800],
|
|
17
|
+
contrastText: paletteData.Secondary.ContrastText
|
|
18
|
+
},
|
|
19
|
+
error: {
|
|
20
|
+
light: paletteData.Error[300],
|
|
21
|
+
main: paletteData.Error[600],
|
|
22
|
+
dark: paletteData.Error[800],
|
|
23
|
+
contrastText: paletteData.Error.ContrastText
|
|
24
|
+
},
|
|
25
|
+
warning: {
|
|
26
|
+
light: paletteData.Warning[300],
|
|
27
|
+
main: paletteData.Warning[500],
|
|
28
|
+
dark: paletteData.Warning[700],
|
|
29
|
+
contrastText: paletteData.Warning.ContrastText
|
|
30
|
+
},
|
|
31
|
+
success: {
|
|
32
|
+
light: paletteData.Success[300],
|
|
33
|
+
main: paletteData.Success[600],
|
|
34
|
+
dark: paletteData.Success[800],
|
|
35
|
+
contrastText: paletteData.Success.ContrastText
|
|
36
|
+
},
|
|
37
|
+
info: {
|
|
38
|
+
light: paletteData.Info[300],
|
|
39
|
+
main: paletteData.Info[600],
|
|
40
|
+
dark: paletteData.Info[800],
|
|
41
|
+
contrastText: '#fff'
|
|
42
|
+
},
|
|
43
|
+
grey: {
|
|
44
|
+
50: paletteData.Grey[50],
|
|
45
|
+
100: paletteData.Grey[100],
|
|
46
|
+
200: paletteData.Grey[200],
|
|
47
|
+
300: paletteData.Grey[300],
|
|
48
|
+
400: paletteData.Grey[400],
|
|
49
|
+
500: paletteData.Grey[500],
|
|
50
|
+
600: paletteData.Grey[600],
|
|
51
|
+
700: paletteData.Grey[700],
|
|
52
|
+
800: paletteData.Grey[800],
|
|
53
|
+
900: paletteData.Grey[900],
|
|
54
|
+
A100: paletteData.Grey.A100,
|
|
55
|
+
A200: paletteData.Grey.A200,
|
|
56
|
+
A400: paletteData.Grey.A400,
|
|
57
|
+
A700: paletteData.Grey.A700,
|
|
58
|
+
A900: paletteData.Grey.A900
|
|
59
|
+
},
|
|
60
|
+
text: {
|
|
61
|
+
primary: '#000000',
|
|
62
|
+
secondary: '#717D96',
|
|
63
|
+
disabled: '#C5C7CA'
|
|
64
|
+
},
|
|
65
|
+
background: {
|
|
66
|
+
default: '#FFFFFF',
|
|
67
|
+
paper: '#FFFFFF'
|
|
68
|
+
},
|
|
69
|
+
divider: '#E1E3E6',
|
|
70
|
+
action: {
|
|
71
|
+
active: paletteData.Primary['A400'],
|
|
72
|
+
hover: 'rgba(246, 126, 53, 0.04)',
|
|
73
|
+
selected: 'rgba(246, 126, 53, 0.08)',
|
|
74
|
+
disabled: 'rgba(0, 0, 0, 0.32)',
|
|
75
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
76
|
+
focus: 'rgba(246, 126, 53, 0.12)'
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { createTheme } from '@mui/material/styles';
|
|
13
|
+
import { makeDarkOverrides } from './makeDarkOverrides';
|
|
14
|
+
import { makeLightOverrides } from './makeLightOverrides';
|
|
15
|
+
import { makePalette } from './makePalette';
|
|
16
|
+
import { makeTypography } from './makeTypography';
|
|
17
|
+
// DatePicker styles are applied through component overrides
|
|
18
|
+
var themesCommonConfig = {
|
|
19
|
+
shape: {
|
|
20
|
+
borderRadius: 6
|
|
21
|
+
},
|
|
22
|
+
breakpoints: {
|
|
23
|
+
values: {
|
|
24
|
+
xs: 0,
|
|
25
|
+
sm: 480,
|
|
26
|
+
md: 768,
|
|
27
|
+
lg: 1023,
|
|
28
|
+
xl: 1200
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
zIndex: {
|
|
32
|
+
modal: 1300
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export var makeTheme = function (mode) {
|
|
36
|
+
if (mode === void 0) { mode = 'light'; }
|
|
37
|
+
var palette = makePalette(mode);
|
|
38
|
+
var typography = makeTypography();
|
|
39
|
+
var theme = createTheme(__assign(__assign({}, themesCommonConfig), { palette: palette, typography: typography }));
|
|
40
|
+
var components = mode === 'dark' ? makeDarkOverrides(theme) : makeLightOverrides(theme);
|
|
41
|
+
// Create the final theme with components
|
|
42
|
+
return createTheme(__assign(__assign({}, theme), { components: components }));
|
|
43
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export var makeTypography = function () {
|
|
2
|
+
return {
|
|
3
|
+
fontFamily: [
|
|
4
|
+
'"Inter"',
|
|
5
|
+
'-apple-system',
|
|
6
|
+
'BlinkMacSystemFont',
|
|
7
|
+
'"Segoe UI"',
|
|
8
|
+
'Roboto',
|
|
9
|
+
'"Helvetica Neue"',
|
|
10
|
+
'Arial',
|
|
11
|
+
'sans-serif',
|
|
12
|
+
'"Apple Color Emoji"',
|
|
13
|
+
'"Segoe UI Emoji"',
|
|
14
|
+
'"Segoe UI Symbol"'
|
|
15
|
+
].join(','),
|
|
16
|
+
h1: {
|
|
17
|
+
fontSize: 45,
|
|
18
|
+
fontWeight: 600,
|
|
19
|
+
lineHeight: 1.156,
|
|
20
|
+
letterSpacing: '0'
|
|
21
|
+
},
|
|
22
|
+
h2: {
|
|
23
|
+
fontSize: 32,
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
lineHeight: 1.25,
|
|
26
|
+
letterSpacing: '0'
|
|
27
|
+
},
|
|
28
|
+
h3: {
|
|
29
|
+
fontSize: 24,
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
lineHeight: 1.333,
|
|
32
|
+
letterSpacing: '0'
|
|
33
|
+
},
|
|
34
|
+
h4: {
|
|
35
|
+
fontSize: 22,
|
|
36
|
+
fontWeight: 600,
|
|
37
|
+
lineHeight: 1.273,
|
|
38
|
+
letterSpacing: '0'
|
|
39
|
+
},
|
|
40
|
+
h5: {
|
|
41
|
+
fontSize: 16,
|
|
42
|
+
fontWeight: 600,
|
|
43
|
+
lineHeight: 1.5,
|
|
44
|
+
letterSpacing: '0'
|
|
45
|
+
},
|
|
46
|
+
h6: {
|
|
47
|
+
fontSize: 14,
|
|
48
|
+
fontWeight: 500,
|
|
49
|
+
lineHeight: 1.429,
|
|
50
|
+
letterSpacing: '0'
|
|
51
|
+
},
|
|
52
|
+
subtitle1: {
|
|
53
|
+
fontSize: 14,
|
|
54
|
+
fontWeight: 500,
|
|
55
|
+
lineHeight: 1.143,
|
|
56
|
+
letterSpacing: '0.5px'
|
|
57
|
+
},
|
|
58
|
+
subtitle2: {
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
fontWeight: 600,
|
|
61
|
+
lineHeight: 1.429,
|
|
62
|
+
letterSpacing: '0.25px'
|
|
63
|
+
},
|
|
64
|
+
body1: {
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
fontWeight: 400,
|
|
67
|
+
lineHeight: 1.5,
|
|
68
|
+
letterSpacing: '-0.15px'
|
|
69
|
+
},
|
|
70
|
+
body2: {
|
|
71
|
+
fontSize: 14,
|
|
72
|
+
fontWeight: 400,
|
|
73
|
+
lineHeight: 1.429,
|
|
74
|
+
letterSpacing: '0.25px'
|
|
75
|
+
},
|
|
76
|
+
button: {
|
|
77
|
+
fontSize: 14,
|
|
78
|
+
fontWeight: 500,
|
|
79
|
+
lineHeight: 1.429,
|
|
80
|
+
textTransform: 'none',
|
|
81
|
+
letterSpacing: '0.1px'
|
|
82
|
+
},
|
|
83
|
+
buttonLarge: {
|
|
84
|
+
fontSize: 16,
|
|
85
|
+
fontWeight: 500,
|
|
86
|
+
lineHeight: 1.5,
|
|
87
|
+
textTransform: 'none',
|
|
88
|
+
letterSpacing: '0.15px'
|
|
89
|
+
},
|
|
90
|
+
buttonSmall: {
|
|
91
|
+
fontSize: 11,
|
|
92
|
+
fontWeight: 500,
|
|
93
|
+
lineHeight: 1.455,
|
|
94
|
+
textTransform: 'none',
|
|
95
|
+
letterSpacing: '0.5px'
|
|
96
|
+
},
|
|
97
|
+
caption: {
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
fontWeight: 500,
|
|
100
|
+
lineHeight: 1.333,
|
|
101
|
+
letterSpacing: '0.5px'
|
|
102
|
+
},
|
|
103
|
+
overline: {
|
|
104
|
+
fontSize: 11,
|
|
105
|
+
fontWeight: 500,
|
|
106
|
+
lineHeight: 1.455,
|
|
107
|
+
letterSpacing: '0.4px',
|
|
108
|
+
textTransform: 'none'
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|