main
Last change
on this file since 5d6f37a was 5d6f37a, checked in by Naum Shapkarovski <naumshapkarovski@…>, 7 weeks ago |
add customer
|
-
Property mode
set to
100644
|
File size:
2.8 KB
|
Line | |
---|
1 | import { alpha } from '@mui/material/styles';
|
---|
2 |
|
---|
3 | // ----------------------------------------------------------------------
|
---|
4 |
|
---|
5 | export type ColorSchema = 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error';
|
---|
6 |
|
---|
7 | declare module '@mui/material/styles/createPalette' {
|
---|
8 | interface TypeBackground {
|
---|
9 | neutral: string;
|
---|
10 | }
|
---|
11 | interface SimplePaletteColorOptions {
|
---|
12 | lighter: string;
|
---|
13 | darker: string;
|
---|
14 | }
|
---|
15 | interface PaletteColor {
|
---|
16 | lighter: string;
|
---|
17 | darker: string;
|
---|
18 | }
|
---|
19 | }
|
---|
20 |
|
---|
21 | // SETUP COLORS
|
---|
22 |
|
---|
23 | const GREY = {
|
---|
24 | 0: '#FFFFFF',
|
---|
25 | 100: '#F9FAFB',
|
---|
26 | 200: '#F4F6F8',
|
---|
27 | 300: '#DFE3E8',
|
---|
28 | 400: '#C4CDD5',
|
---|
29 | 500: '#919EAB',
|
---|
30 | 600: '#637381',
|
---|
31 | 700: '#454F5B',
|
---|
32 | 800: '#212B36',
|
---|
33 | 900: '#161C24',
|
---|
34 | };
|
---|
35 |
|
---|
36 | const PRIMARY = {
|
---|
37 | lighter: '#C8FAD6',
|
---|
38 | light: '#5BE49B',
|
---|
39 | main: '#00A76F',
|
---|
40 | dark: '#007867',
|
---|
41 | darker: '#004B50',
|
---|
42 | contrastText: '#FFFFFF',
|
---|
43 | };
|
---|
44 |
|
---|
45 | const SECONDARY = {
|
---|
46 | lighter: '#EFD6FF',
|
---|
47 | light: '#C684FF',
|
---|
48 | main: '#8E33FF',
|
---|
49 | dark: '#5119B7',
|
---|
50 | darker: '#27097A',
|
---|
51 | contrastText: '#FFFFFF',
|
---|
52 | };
|
---|
53 |
|
---|
54 | const INFO = {
|
---|
55 | lighter: '#CAFDF5',
|
---|
56 | light: '#61F3F3',
|
---|
57 | main: '#00B8D9',
|
---|
58 | dark: '#006C9C',
|
---|
59 | darker: '#003768',
|
---|
60 | contrastText: '#FFFFFF',
|
---|
61 | };
|
---|
62 |
|
---|
63 | const SUCCESS = {
|
---|
64 | lighter: '#D3FCD2',
|
---|
65 | light: '#77ED8B',
|
---|
66 | main: '#22C55E',
|
---|
67 | dark: '#118D57',
|
---|
68 | darker: '#065E49',
|
---|
69 | contrastText: '#ffffff',
|
---|
70 | };
|
---|
71 |
|
---|
72 | const WARNING = {
|
---|
73 | lighter: '#FFF5CC',
|
---|
74 | light: '#FFD666',
|
---|
75 | main: '#FFAB00',
|
---|
76 | dark: '#B76E00',
|
---|
77 | darker: '#7A4100',
|
---|
78 | contrastText: GREY[800],
|
---|
79 | };
|
---|
80 |
|
---|
81 | const ERROR = {
|
---|
82 | lighter: '#FFE9D5',
|
---|
83 | light: '#FFAC82',
|
---|
84 | main: '#FF5630',
|
---|
85 | dark: '#B71D18',
|
---|
86 | darker: '#7A0916',
|
---|
87 | contrastText: '#FFFFFF',
|
---|
88 | };
|
---|
89 |
|
---|
90 | const COMMON = {
|
---|
91 | common: {
|
---|
92 | black: '#000000',
|
---|
93 | white: '#FFFFFF',
|
---|
94 | },
|
---|
95 | primary: PRIMARY,
|
---|
96 | secondary: SECONDARY,
|
---|
97 | info: INFO,
|
---|
98 | success: SUCCESS,
|
---|
99 | warning: WARNING,
|
---|
100 | error: ERROR,
|
---|
101 | grey: GREY,
|
---|
102 | divider: alpha(GREY[500], 0.2),
|
---|
103 | action: {
|
---|
104 | hover: alpha(GREY[500], 0.08),
|
---|
105 | selected: alpha(GREY[500], 0.16),
|
---|
106 | disabled: alpha(GREY[500], 0.8),
|
---|
107 | disabledBackground: alpha(GREY[500], 0.24),
|
---|
108 | focus: alpha(GREY[500], 0.24),
|
---|
109 | hoverOpacity: 0.08,
|
---|
110 | disabledOpacity: 0.48,
|
---|
111 | },
|
---|
112 | };
|
---|
113 |
|
---|
114 | export function palette(mode: 'light' | 'dark') {
|
---|
115 | const light = {
|
---|
116 | ...COMMON,
|
---|
117 | mode: 'light',
|
---|
118 | text: {
|
---|
119 | primary: GREY[800],
|
---|
120 | secondary: GREY[600],
|
---|
121 | disabled: GREY[500],
|
---|
122 | },
|
---|
123 | background: {
|
---|
124 | paper: '#FFFFFF',
|
---|
125 | default: '#FFFFFF',
|
---|
126 | neutral: GREY[200],
|
---|
127 | },
|
---|
128 | action: {
|
---|
129 | ...COMMON.action,
|
---|
130 | active: GREY[600],
|
---|
131 | },
|
---|
132 | };
|
---|
133 |
|
---|
134 | const dark = {
|
---|
135 | ...COMMON,
|
---|
136 | mode: 'dark',
|
---|
137 | text: {
|
---|
138 | primary: '#FFFFFF',
|
---|
139 | secondary: GREY[500],
|
---|
140 | disabled: GREY[600],
|
---|
141 | },
|
---|
142 | background: {
|
---|
143 | paper: GREY[800],
|
---|
144 | default: GREY[900],
|
---|
145 | neutral: alpha(GREY[500], 0.12),
|
---|
146 | },
|
---|
147 | action: {
|
---|
148 | ...COMMON.action,
|
---|
149 | active: GREY[500],
|
---|
150 | },
|
---|
151 | };
|
---|
152 |
|
---|
153 | return mode === 'light' ? light : dark;
|
---|
154 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.