Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

289 строки
8.8 KiB

  1. import {createTheme} from "@mui/material";
  2. export const PNSPS_BUTTON_THEME = createTheme({
  3. palette: {
  4. create: {
  5. main: '#57B962',
  6. // light: will be calculated from palette.primary.main,
  7. // dark: will be calculated from palette.primary.main,
  8. // contrastText: will be calculated to contrast with palette.primary.main
  9. contrastText: '#FFFFFF',
  10. },
  11. delete: {
  12. main: '#E03C04',
  13. contrastText: '#FFFFFF',
  14. },
  15. cancel: {
  16. main: '#999999',
  17. contrastText: '#FFFFFF',
  18. },
  19. save:{
  20. main: '#448DF2',
  21. contrastText: '#FFFFFF',
  22. },
  23. export:{
  24. main: '#8C52FF',
  25. contrastText: '#FFFFFF',
  26. },
  27. saveAs:{
  28. main: '#FFBD59',
  29. contrastText: '#FFFFFF',
  30. },
  31. edit:{
  32. main: '#F3AF2B',
  33. contrastText: '#FFFFFF',
  34. },
  35. error:{
  36. main: '#F3AF2B',
  37. contrastText: '#FFFFFF',
  38. },
  39. exportExcel:{
  40. main: '#6A8B9E',
  41. contrastText: '#FFFFFF',
  42. },
  43. success:{
  44. main: '#448DF2',
  45. contrastText: '#FFFFFF',
  46. },
  47. green:{
  48. main: '#4ac234',
  49. contrastText: '#FFFFFF',
  50. },
  51. orange: {
  52. main: '#ed9740',
  53. light: '#ff5e5e',
  54. dark: '#b0671e',
  55. contrastText: '#fff',
  56. },
  57. },
  58. components: {
  59. MuiDataGrid: {
  60. styleOverrides: {
  61. actionsCell: {
  62. '& .MuiDataGrid-actionsContainer .MuiIconButton-root': {
  63. fontSize: '80px', // Set the desired icon size here
  64. },
  65. },
  66. },
  67. },
  68. MuiButton: {
  69. defaultProps: {
  70. disableRipple: true,
  71. },
  72. styleOverrides: {
  73. /* -----------------------------
  74. Icon alignment
  75. ------------------------------ */
  76. startIcon: {
  77. display: 'flex',
  78. alignItems: 'center',
  79. justifyContent: 'center',
  80. '& > *:nth-of-type(1)': { fontSize: '28px' },
  81. },
  82. /* -----------------------------
  83. Base button styles
  84. ------------------------------ */
  85. root: {
  86. fontSize: '1.2rem',
  87. fontWeight: '600',
  88. height: '45px',
  89. minWidth: '35vw',
  90. '@media (min-width: 600px)': { minWidth: '20vw' },
  91. '@media (min-width: 960px)': { minWidth: '15vw' },
  92. '@media (min-width: 1280px)': { minWidth: '9vw' },
  93. textTransform: 'none',
  94. alignItems: 'normal',
  95. '&:active': {
  96. boxShadow: 'none',
  97. transform: 'none',
  98. },
  99. },
  100. /* -----------------------------
  101. Remove default contained elevation / blue focus
  102. ------------------------------ */
  103. contained: ({ theme, ownerState }) => ({
  104. boxShadow: 'none',
  105. '&:hover': { boxShadow: 'none' },
  106. '&:active': {
  107. backgroundColor: theme.palette[ownerState.color]?.main ?? theme.palette.primary.main,
  108. boxShadow: 'none',
  109. },
  110. '&.Mui-focusVisible': { boxShadow: 'none' },
  111. }),
  112. /* -----------------------------
  113. RESET / CANCEL (contained + cancel)
  114. WCAG 2.1 AA compliant
  115. ------------------------------ */
  116. containedCancel: {
  117. backgroundColor: '#616161', // dark grey (passes with white text)
  118. color: '#FFFFFF',
  119. border: '0 !important',
  120. outline: 'none',
  121. boxShadow: 'none !important',
  122. '&:hover': {
  123. backgroundColor: '#545454',
  124. boxShadow: 'none !important',
  125. },
  126. '&:active': {
  127. backgroundColor: '#616161',
  128. boxShadow: 'none !important',
  129. },
  130. /* ✅ Keyboard TAB focus (visible & accessible) */
  131. '&.Mui-focusVisible': {
  132. boxShadow: '0 0 0 3px rgba(255,255,255,0.6) !important',
  133. },
  134. },
  135. /* -----------------------------
  136. Optional: outlined cancel variant
  137. ------------------------------ */
  138. outlinedCancel: {
  139. borderColor: '#616161',
  140. color: '#424242',
  141. '&:hover': {
  142. borderColor: '#616161',
  143. backgroundColor: 'transparent',
  144. },
  145. '&:active': {
  146. backgroundColor: 'transparent',
  147. },
  148. '&.Mui-focusVisible': {
  149. boxShadow: '0 0 0 3px rgba(66,66,66,0.4)',
  150. },
  151. },
  152. outlined: {
  153. '&:active': {
  154. backgroundColor: 'transparent',
  155. },
  156. },
  157. },
  158. },
  159. }
  160. });
  161. export const PNSPS_LONG_BUTTON_THEME = createTheme({
  162. palette: {
  163. create: {
  164. main: '#57B962',
  165. // light: will be calculated from palette.primary.main,
  166. // dark: will be calculated from palette.primary.main,
  167. // contrastText: will be calculated to contrast with palette.primary.main
  168. contrastText: '#FFFFFF',
  169. },
  170. delete: {
  171. main: '#E03C04',
  172. contrastText: '#FFFFFF',
  173. },
  174. cancel: {
  175. main: '#999999',
  176. contrastText: '#FFFFFF',
  177. },
  178. save:{
  179. main: '#448DF2',
  180. contrastText: '#FFFFFF',
  181. },
  182. export:{
  183. main: '#8C52FF',
  184. contrastText: '#FFFFFF',
  185. },
  186. saveAs:{
  187. main: '#FFBD59',
  188. contrastText: '#FFFFFF',
  189. },
  190. edit:{
  191. main: '#ffa733',
  192. contrastText: '#FFFFFF',
  193. },
  194. exportExcel:{
  195. main: '#60667E',
  196. contrastText: '#FFFFFF',
  197. },
  198. success:{
  199. main: '#3f50b5',
  200. contrastText: '#FFFFFF',
  201. },
  202. orange: {
  203. main: '#ed9740',
  204. light: '#ff5e5e',
  205. dark: '#b0671e',
  206. contrastText: '#fff',
  207. },
  208. },
  209. components: {
  210. MuiDataGrid: {
  211. styleOverrides: {
  212. actionsCell: {
  213. '& .MuiDataGrid-actionsContainer .MuiIconButton-root': {
  214. fontSize: '80px', // Set the desired icon size here
  215. },
  216. },
  217. },
  218. },
  219. MuiButton: {
  220. defaultProps: {
  221. disableRipple: true,
  222. },
  223. styleOverrides: {
  224. startIcon:{
  225. display: 'flex',
  226. alignItems: 'center',
  227. justifyContent: 'center',
  228. '& > *:nth-of-type(1)': {
  229. fontSize: '28px',
  230. },
  231. },
  232. root: {
  233. fontSize: '1.2rem',
  234. fontWeight: '600',
  235. height: '45px',
  236. minWidth: '60vw', // Default width for xs screen sizes
  237. '@media (min-width: 600px)': { // sm breakpoint
  238. minWidth: '33vw',
  239. },
  240. '@media (min-width: 960px)': { // md breakpoint
  241. minWidth: '25vw',
  242. },
  243. '@media (min-width: 1280px)': { // lg breakpoint
  244. minWidth: '16vw',
  245. },
  246. textTransform: "none",
  247. alignItems: 'normal',
  248. '&:active': {
  249. boxShadow: 'none',
  250. transform: 'none',
  251. },
  252. },
  253. contained: ({ theme, ownerState }) => ({
  254. boxShadow: 'none',
  255. '&:hover': { boxShadow: 'none' },
  256. '&:active': {
  257. backgroundColor: theme.palette[ownerState.color]?.main ?? theme.palette.primary.main,
  258. boxShadow: 'none',
  259. },
  260. '&.Mui-focusVisible': { boxShadow: 'none' },
  261. }),
  262. outlined: {
  263. '&:active': {
  264. backgroundColor: 'transparent',
  265. },
  266. },
  267. },
  268. },
  269. }
  270. });