@m4l/styles 0.0.7 → 0.0.9
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/index.js +58 -47
- package/package.json +1 -1
- package/theme/index.d.ts +2 -0
- package/theme/overrides/M4LExtendedComponents/M4LImageButton.d.ts +3 -3
- package/theme/overrides/M4LRHFComponents/M4LRHFCheckbox.d.ts +4 -4
- package/theme/overrides/MUIComponents/Paper.d.ts +10 -10
- package/theme/palette.d.ts +2 -2
- package/types/augmentations.d.ts +1 -9
- package/utils/getColorState.d.ts +2 -2
package/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { alpha as t, useTheme as
|
|
2
|
-
import { StyledEngineProvider as yr, Theme as fr, ThemeOptions as hr, ThemeProvider as Mr, createTheme as vr, styled as Br } from "@mui/material/styles";
|
|
1
|
+
import { alpha as t, useTheme as R } from "@mui/material/styles";
|
|
3
2
|
import { alpha as n } from "@mui/system";
|
|
4
3
|
import { alpha as F } from "@mui/material";
|
|
5
|
-
import { useResponsive as
|
|
4
|
+
import { useResponsive as $ } from "@m4l/graphics";
|
|
6
5
|
function c(o, e) {
|
|
7
6
|
return `linear-gradient(to bottom, ${o}, ${e})`;
|
|
8
7
|
}
|
|
@@ -139,7 +138,7 @@ const r = {
|
|
|
139
138
|
80: "#fff0",
|
|
140
139
|
90: "#fff0"
|
|
141
140
|
}
|
|
142
|
-
},
|
|
141
|
+
}, A = {
|
|
143
142
|
patronus: {
|
|
144
143
|
4: t(r.patronusBlue[50], 0.04),
|
|
145
144
|
12: t(r.patronusBlue[50], 0.12),
|
|
@@ -210,7 +209,7 @@ const r = {
|
|
|
210
209
|
dark: r.patronusBlue[40],
|
|
211
210
|
darker: r.patronusBlue[20],
|
|
212
211
|
contrastText: r.marbleLight[10]
|
|
213
|
-
},
|
|
212
|
+
}, T = {
|
|
214
213
|
lighter: "#fff0",
|
|
215
214
|
light: "#fff0",
|
|
216
215
|
main: "#fff0",
|
|
@@ -263,39 +262,39 @@ const r = {
|
|
|
263
262
|
50048: t("#919EAB", 0.48),
|
|
264
263
|
50056: t("#919EAB", 0.56),
|
|
265
264
|
50080: t("#919EAB", 0.8)
|
|
266
|
-
},
|
|
265
|
+
}, D = {
|
|
267
266
|
primary: c(b.light, b.main),
|
|
268
267
|
info: c(y.light, y.main),
|
|
269
268
|
success: c(f.light, f.main),
|
|
270
269
|
warning: c(h.light, h.main),
|
|
271
270
|
error: c(M.light, M.main)
|
|
272
|
-
},
|
|
271
|
+
}, I = {
|
|
273
272
|
violet: ["#826AF9", "#9E86FF", "#D0AEFF", "#F7D2FF"],
|
|
274
273
|
blue: ["#2D99FF", "#83CFFF", "#A5F3FF", "#CCFAFF"],
|
|
275
274
|
green: ["#2CD9C5", "#60F1C8", "#A4F7CC", "#C0F2DC"],
|
|
276
275
|
yellow: ["#FFE700", "#FFEF5A", "#FFF7AE", "#FFF3D6"],
|
|
277
276
|
red: ["#FF6C40", "#FF8F6D", "#FFBD98", "#FFF2D4"]
|
|
278
|
-
},
|
|
277
|
+
}, z = {
|
|
279
278
|
normal: r.crayonBlue[50],
|
|
280
279
|
hover: r.crayonBlue[70]
|
|
281
|
-
},
|
|
280
|
+
}, G = {
|
|
282
281
|
normal: r.acidGreen[60],
|
|
283
282
|
hover: r.acidGreen[70]
|
|
284
|
-
},
|
|
283
|
+
}, E = {
|
|
285
284
|
normal: r.flameRed[40],
|
|
286
285
|
hover: r.flameRed[60]
|
|
287
|
-
},
|
|
286
|
+
}, H = {
|
|
288
287
|
normal: r.flameRed[60],
|
|
289
288
|
hover: r.flameRed[70]
|
|
290
|
-
},
|
|
289
|
+
}, P = {
|
|
291
290
|
default: t(r.coolGrey[50], 0.24),
|
|
292
291
|
transition: t(r.coolGrey[50], 0.08)
|
|
293
292
|
}, l = {
|
|
294
|
-
info: { ...
|
|
295
|
-
success: { ...
|
|
296
|
-
error: { ...
|
|
297
|
-
warning: { ...
|
|
298
|
-
skeleton: { ...
|
|
293
|
+
info: { ...z },
|
|
294
|
+
success: { ...G },
|
|
295
|
+
error: { ...E },
|
|
296
|
+
warning: { ...H },
|
|
297
|
+
skeleton: { ...P }
|
|
299
298
|
}, k = {
|
|
300
299
|
common: { black: "#000", white: "#fff" },
|
|
301
300
|
primary: { ...b },
|
|
@@ -303,15 +302,15 @@ const r = {
|
|
|
303
302
|
...l
|
|
304
303
|
},
|
|
305
304
|
patronus: { ...r },
|
|
306
|
-
opacity: {
|
|
307
|
-
secondary: { ...
|
|
305
|
+
opacity: { ...A },
|
|
306
|
+
secondary: { ...T, contrastText: "#fff" },
|
|
308
307
|
info: { ...y, contrastText: "#fff" },
|
|
309
308
|
success: { ...f, contrastText: x[800] },
|
|
310
309
|
warning: { ...h, contrastText: x[800] },
|
|
311
310
|
error: { ...M, contrastText: "#fff" },
|
|
312
311
|
grey: x,
|
|
313
|
-
gradients:
|
|
314
|
-
chart:
|
|
312
|
+
gradients: D,
|
|
313
|
+
chart: I,
|
|
315
314
|
divider: x[50024],
|
|
316
315
|
action: {
|
|
317
316
|
hoverOpacity: 0.08,
|
|
@@ -321,7 +320,11 @@ const r = {
|
|
|
321
320
|
light: {
|
|
322
321
|
...k,
|
|
323
322
|
mode: "light",
|
|
324
|
-
text: {
|
|
323
|
+
text: {
|
|
324
|
+
primary: r.ashBlak[10],
|
|
325
|
+
secondary: r.coolGrey[40],
|
|
326
|
+
disabled: r.coolGrey[10]
|
|
327
|
+
},
|
|
325
328
|
background: {
|
|
326
329
|
paper: "#fff0",
|
|
327
330
|
default: r.marbleLight[10],
|
|
@@ -333,7 +336,11 @@ const r = {
|
|
|
333
336
|
dark: {
|
|
334
337
|
...k,
|
|
335
338
|
mode: "dark",
|
|
336
|
-
text: {
|
|
339
|
+
text: {
|
|
340
|
+
primary: r.marbleLight[30],
|
|
341
|
+
secondary: r.coolGrey[20],
|
|
342
|
+
disabled: r.coolGrey[50]
|
|
343
|
+
},
|
|
337
344
|
background: {
|
|
338
345
|
paper: "#fff0",
|
|
339
346
|
default: r.ashBlak[10],
|
|
@@ -388,15 +395,19 @@ const r = {
|
|
|
388
395
|
darker: r.blazeOrange[20],
|
|
389
396
|
contrastText: r.marbleLight[10]
|
|
390
397
|
}
|
|
391
|
-
],
|
|
398
|
+
], C = g[0], W = g[1], _ = g[2], q = g[3], N = g[4];
|
|
392
399
|
function ir(o) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
+
try {
|
|
401
|
+
return {
|
|
402
|
+
patronus: C,
|
|
403
|
+
turqui: W,
|
|
404
|
+
grass: _,
|
|
405
|
+
candy: q,
|
|
406
|
+
blaze: N
|
|
407
|
+
}[o];
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
410
|
+
return C;
|
|
400
411
|
}
|
|
401
412
|
const nr = (o, e) => {
|
|
402
413
|
let a = {};
|
|
@@ -544,14 +555,14 @@ function p({ sm: o, md: e, lg: a }) {
|
|
|
544
555
|
};
|
|
545
556
|
}
|
|
546
557
|
function j() {
|
|
547
|
-
return [...
|
|
548
|
-
const v =
|
|
558
|
+
return [...R().breakpoints.keys].reverse().reduce((a, i) => {
|
|
559
|
+
const v = $("up", i);
|
|
549
560
|
return !a && v ? i : a;
|
|
550
561
|
}, null) || "xs";
|
|
551
562
|
}
|
|
552
563
|
function pr(o) {
|
|
553
|
-
const e =
|
|
554
|
-
return { fontSize: B, lineHeight:
|
|
564
|
+
const e = R(), a = j(), i = e.breakpoints.up(a === "xl" ? "lg" : a), S = (o === "h1" || o === "h2" || o === "h3" || o === "h4" || o === "h5" || o === "h6") && e.typography[o][i] ? e.typography[o][i] : e.typography[o], B = Y(S.fontSize), L = Number(e.typography[o].lineHeight) * B, { fontWeight: O, letterSpacing: w } = e.typography[o];
|
|
565
|
+
return { fontSize: B, lineHeight: L, fontWeight: O, letterSpacing: w };
|
|
555
566
|
}
|
|
556
567
|
const V = "Poppins, sans-serif", U = {
|
|
557
568
|
fontFamily: V,
|
|
@@ -666,7 +677,7 @@ const V = "Poppins, sans-serif", U = {
|
|
|
666
677
|
}
|
|
667
678
|
}, lr = {
|
|
668
679
|
typography: U
|
|
669
|
-
}, K = d.light.grey[500], J = "#000000",
|
|
680
|
+
}, K = d.light.grey[500], J = "#000000", m = (o) => {
|
|
670
681
|
const e = t(o, 0.2), a = t(o, 0.14), i = t(o, 0.12);
|
|
671
682
|
return [
|
|
672
683
|
"none",
|
|
@@ -702,9 +713,15 @@ const V = "Poppins, sans-serif", U = {
|
|
|
702
713
|
success: `0px 2px 8px 0px ${t(r.acidGreen[50], 0.2)}`,
|
|
703
714
|
warning: `0px 2px 8px 0px ${t(r.middleYellow[50], 0.2)}`,
|
|
704
715
|
error: `0px 2px 8px 0px ${t(r.flameRed[50], 0.2)}`,
|
|
705
|
-
card: `0 0 2px 0 ${t(d.light.grey[500], 0.2)}, 0 12px 24px -4px ${t(
|
|
716
|
+
card: `0 0 2px 0 ${t(d.light.grey[500], 0.2)}, 0 12px 24px -4px ${t(
|
|
717
|
+
d.light.grey[500],
|
|
718
|
+
0.12
|
|
719
|
+
)}`,
|
|
706
720
|
dialog: `-40px 40px 80px -8px ${t(d.light.common.black, 0.24)}`,
|
|
707
|
-
dropdown: `0 0 2px 0 ${t(d.light.grey[500], 0.24)}, -20px 20px 40px -4px ${t(
|
|
721
|
+
dropdown: `0 0 2px 0 ${t(d.light.grey[500], 0.24)}, -20px 20px 40px -4px ${t(
|
|
722
|
+
d.light.grey[500],
|
|
723
|
+
0.24
|
|
724
|
+
)}`
|
|
708
725
|
};
|
|
709
726
|
return o === "light" ? {
|
|
710
727
|
z1: `0px 1px 2px ${t(r.coolGrey[70], 0.12)}`,
|
|
@@ -720,8 +737,8 @@ const V = "Poppins, sans-serif", U = {
|
|
|
720
737
|
...e
|
|
721
738
|
};
|
|
722
739
|
}, dr = {
|
|
723
|
-
light:
|
|
724
|
-
dark:
|
|
740
|
+
light: m(K),
|
|
741
|
+
dark: m(J)
|
|
725
742
|
};
|
|
726
743
|
function Q(o) {
|
|
727
744
|
return {
|
|
@@ -2323,16 +2340,11 @@ const cr = {
|
|
|
2323
2340
|
};
|
|
2324
2341
|
export {
|
|
2325
2342
|
r as PATRONUSCOLORS,
|
|
2326
|
-
yr as StyledEngineProvider,
|
|
2327
|
-
fr as Theme,
|
|
2328
|
-
hr as ThemeOptions,
|
|
2329
|
-
Mr as ThemeProvider,
|
|
2330
2343
|
N as blaze,
|
|
2331
2344
|
q as candy,
|
|
2332
2345
|
g as colorPresets,
|
|
2333
2346
|
sr as createCustomShadows,
|
|
2334
|
-
|
|
2335
|
-
P as defaultPreset,
|
|
2347
|
+
C as defaultPreset,
|
|
2336
2348
|
lr as defaultThemeOptions,
|
|
2337
2349
|
ur as fnComponentsOverrides,
|
|
2338
2350
|
ir as getColorPresets,
|
|
@@ -2346,7 +2358,6 @@ export {
|
|
|
2346
2358
|
Y as remToPx,
|
|
2347
2359
|
p as responsiveFontSizes,
|
|
2348
2360
|
dr as shadows,
|
|
2349
|
-
Br as styled,
|
|
2350
2361
|
W as turqui,
|
|
2351
2362
|
U as typography
|
|
2352
2363
|
};
|
package/package.json
CHANGED
package/theme/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export type { CustomShadowOptions } from './shadows';
|
|
|
2
2
|
export { defaultThemeOptions } from './defaultThemeOptions';
|
|
3
3
|
export { shadows, createCustomShadows } from './shadows';
|
|
4
4
|
export { palette, PATRONUSCOLORS } from './palette';
|
|
5
|
+
export type { PatronusConstantColors } from './palette';
|
|
5
6
|
export type { ColorSchema, StateDefault, StateSkeleton } from './palette';
|
|
7
|
+
export type { ColorStateOptions } from '../utils/getColorState';
|
|
6
8
|
export { typography } from './typography';
|
|
7
9
|
export { fnComponentsOverrides } from './overrides';
|
|
@@ -31,12 +31,12 @@ export declare const M4LImageButton: (theme: Theme) => {
|
|
|
31
31
|
borderRadius: string;
|
|
32
32
|
};
|
|
33
33
|
'.MuiButtonBase-root:hover': {
|
|
34
|
-
backgroundColor:
|
|
34
|
+
backgroundColor: any;
|
|
35
35
|
};
|
|
36
36
|
'.MuiButtonBase-root:focus': {
|
|
37
|
-
backgroundColor:
|
|
37
|
+
backgroundColor: any;
|
|
38
38
|
border: string;
|
|
39
|
-
borderColor:
|
|
39
|
+
borderColor: any;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
};
|
|
@@ -34,20 +34,20 @@ export declare const M4LRHFCheckbox: (theme: Theme) => {
|
|
|
34
34
|
borderRadius: string;
|
|
35
35
|
};
|
|
36
36
|
'.MuiButtonBase-root:hover': {
|
|
37
|
-
backgroundColor:
|
|
37
|
+
backgroundColor: any;
|
|
38
38
|
};
|
|
39
39
|
'.Mui-focusVisible': {
|
|
40
40
|
border: string;
|
|
41
|
-
borderColor:
|
|
41
|
+
borderColor: any;
|
|
42
42
|
};
|
|
43
43
|
'.MuiButtonBase-root:hover .MuiSvgIcon-root': {
|
|
44
|
-
fill:
|
|
44
|
+
fill: any;
|
|
45
45
|
};
|
|
46
46
|
'.M4LRHFCheckbox-checkTypography .MuiTypography-root': {
|
|
47
47
|
[x: string]: any;
|
|
48
48
|
};
|
|
49
49
|
'.M4LRHFCheckbox-stateDisabled .MuiSvgIcon-root': {
|
|
50
|
-
fill:
|
|
50
|
+
fill: any;
|
|
51
51
|
};
|
|
52
52
|
'.M4LRHFCheckbox-stateDisabled .MuiTypography-root': {
|
|
53
53
|
color: string;
|
|
@@ -23,17 +23,17 @@ export default function Paper(theme: Theme): {
|
|
|
23
23
|
borderRadius: string;
|
|
24
24
|
};
|
|
25
25
|
'& .MuiStack-root .MuiMenuItem-root:hover': {
|
|
26
|
-
color:
|
|
26
|
+
color: any;
|
|
27
27
|
transition: string;
|
|
28
|
-
backgroundColor:
|
|
28
|
+
backgroundColor: any;
|
|
29
29
|
};
|
|
30
30
|
'& .MuiStack-root .MuiMenuItem-root.Mui-selected': {
|
|
31
|
-
color:
|
|
31
|
+
color: any;
|
|
32
32
|
transition: string;
|
|
33
|
-
backgroundColor:
|
|
33
|
+
backgroundColor: any;
|
|
34
34
|
};
|
|
35
35
|
'& .MuiStack-root .MuiMenuItem-root:focus': {
|
|
36
|
-
color:
|
|
36
|
+
color: any;
|
|
37
37
|
transition: string;
|
|
38
38
|
backgroundColor: string;
|
|
39
39
|
boxShadow: string;
|
|
@@ -44,17 +44,17 @@ export default function Paper(theme: Theme): {
|
|
|
44
44
|
borderRadius: string;
|
|
45
45
|
};
|
|
46
46
|
'& .MuiAutocomplete-listbox .MuiAutocomplete-option:hover': {
|
|
47
|
-
color:
|
|
47
|
+
color: any;
|
|
48
48
|
transition: string;
|
|
49
|
-
backgroundColor:
|
|
49
|
+
backgroundColor: any;
|
|
50
50
|
};
|
|
51
51
|
'& .MuiAutocomplete-listbox .MuiAutocomplete-option.Mui-selected': {
|
|
52
|
-
color:
|
|
52
|
+
color: any;
|
|
53
53
|
transition: string;
|
|
54
|
-
backgroundColor:
|
|
54
|
+
backgroundColor: any;
|
|
55
55
|
};
|
|
56
56
|
'& .MuiAutocomplete-listbox .MuiAutocomplete-option:active': {
|
|
57
|
-
color:
|
|
57
|
+
color: any;
|
|
58
58
|
transition: string;
|
|
59
59
|
backgroundColor: string;
|
|
60
60
|
boxShadow: string;
|
package/theme/palette.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare type ColorSchema = 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error';
|
|
2
|
-
declare type PatronusColors =
|
|
3
|
-
declare type PatronusOpacityColors =
|
|
2
|
+
declare type PatronusColors = 'patronusBlue' | 'crayonBlue' | 'middleYellow' | 'acidGreen' | 'grassGreen' | 'candyRed' | 'turquiBlue' | 'blazeOrange' | 'flameRed' | 'coolGrey' | 'marbleLight' | 'ashBlak';
|
|
3
|
+
declare type PatronusOpacityColors = 'patronus' | 'turqui' | 'grass' | 'candy' | 'blaze' | 'cool' | 'marbel';
|
|
4
4
|
interface PatronusColorOptions {
|
|
5
5
|
10: string;
|
|
6
6
|
20: string;
|
package/types/augmentations.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { PatronusConstantColors } from '../theme/palette';
|
|
2
2
|
import { CustomShadowOptions } from '../theme';
|
|
3
3
|
import { ChartPaletteOptions, GradientsPaletteOptions, GridPaletteOptions } from './types';
|
|
4
|
-
import { ColorStateOptions } from '
|
|
5
|
-
export {
|
|
6
|
-
styled,
|
|
7
|
-
Theme,
|
|
8
|
-
ThemeOptions,
|
|
9
|
-
createTheme,
|
|
10
|
-
ThemeProvider,
|
|
11
|
-
StyledEngineProvider,
|
|
12
|
-
} from '@mui/material/styles';
|
|
4
|
+
import { ColorStateOptions } from '../../utils/getColorState';
|
|
13
5
|
|
|
14
6
|
declare module '@mui/material' {
|
|
15
7
|
interface Color {
|
package/utils/getColorState.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StateDefault, StateSkeleton } from
|
|
2
|
-
import { ThemeColorPresets } from
|
|
1
|
+
import { StateDefault, StateSkeleton } from '../theme';
|
|
2
|
+
import { ThemeColorPresets } from '../types';
|
|
3
3
|
export interface ColorStateOptions {
|
|
4
4
|
active12: string;
|
|
5
5
|
active: string;
|