@m4l/styles 2.0.4 → 3.0.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.
Files changed (64) hide show
  1. package/index.js +27 -39
  2. package/package.json +1 -1
  3. package/theme/defaultThemeOptions-BlJvKCE6.js +24 -0
  4. package/theme/index.d.ts +0 -3
  5. package/theme/overrides/M4LExtendedComponents/M4LAccordion.d.ts +1 -1
  6. package/theme/overrides/M4LExtendedComponents/M4LAccountPopover.d.ts +17 -17
  7. package/theme/overrides/M4LExtendedComponents/M4LAppBar.d.ts +7 -12
  8. package/theme/overrides/M4LExtendedComponents/M4LAppBarCommercial.d.ts +1 -1
  9. package/theme/overrides/M4LExtendedComponents/M4LAreasAdmin.d.ts +33 -33
  10. package/theme/overrides/M4LExtendedComponents/M4LBadge.d.ts +2 -2
  11. package/theme/overrides/M4LExtendedComponents/M4LButton.d.ts +7 -7
  12. package/theme/overrides/M4LExtendedComponents/M4LCommonActions.d.ts +1 -1
  13. package/theme/overrides/M4LExtendedComponents/M4LErrorLabel.d.ts +1 -1
  14. package/theme/overrides/M4LExtendedComponents/M4LFieldLabel.d.ts +1 -1
  15. package/theme/overrides/M4LExtendedComponents/M4LGridLayout.d.ts +1 -1
  16. package/theme/overrides/M4LExtendedComponents/M4LHamburgerMenuCommercial.d.ts +1 -1
  17. package/theme/overrides/M4LExtendedComponents/M4LIconButton.d.ts +4 -4
  18. package/theme/overrides/M4LExtendedComponents/M4LImageButton.d.ts +1 -1
  19. package/theme/overrides/M4LExtendedComponents/M4LPaperForm.d.ts +6 -6
  20. package/theme/overrides/M4LExtendedComponents/M4LPeriod.d.ts +41 -41
  21. package/theme/overrides/M4LExtendedComponents/M4LPopover.d.ts +1 -1
  22. package/theme/overrides/M4LExtendedComponents/M4LScrollBar.d.ts +1 -1
  23. package/theme/overrides/M4LExtendedComponents/M4LTab.d.ts +7 -7
  24. package/theme/overrides/M4LExtendedComponents/M4LTabs.d.ts +1 -1
  25. package/theme/overrides/M4LExtendedComponents/M4LTooltip.d.ts +2 -2
  26. package/theme/overrides/M4LExtendedComponents/M4LanguagePopover.d.ts +1 -1
  27. package/theme/overrides/M4LExtendedComponents/M4LoadingButton.d.ts +15 -15
  28. package/theme/overrides/M4LExtendedComponents/M4LoadingError.d.ts +1 -1
  29. package/theme/overrides/M4LExtendedComponents/{index-CyXBfJc_.js → index-Cf72RC_D.js} +478 -523
  30. package/theme/overrides/M4LRHFComponents/M4LRHFCheckbox.d.ts +1 -1
  31. package/theme/overrides/M4LRHFComponents/M4LRHFColorPicker.d.ts +1 -1
  32. package/theme/overrides/M4LRHFComponents/M4LRHFDateTime.d.ts +1 -1
  33. package/theme/overrides/M4LRHFComponents/M4LRHFTextField.d.ts +2 -2
  34. package/theme/overrides/M4LRHFComponents/{index-D-E6fugB.js → index-BRZVeOM5.js} +161 -155
  35. package/theme/overrides/MUIComponents/Avatar.d.ts +1 -1
  36. package/theme/overrides/MUIComponents/Button.d.ts +1 -1
  37. package/theme/overrides/MUIComponents/ButtonGroup.d.ts +1 -1
  38. package/theme/overrides/MUIComponents/Pagination.d.ts +1 -1
  39. package/theme/overrides/MUIComponents/Paper.d.ts +1 -1
  40. package/theme/overrides/MUIComponents/ToggleButton.d.ts +2 -2
  41. package/theme/overrides/MUIComponents/{index-oLVtA5nq.js → index-XoLdmZP6.js} +74 -71
  42. package/theme/overrides/{index-DeiTY8li.js → index-DrDgOdnk.js} +3 -3
  43. package/theme/palette/baseColors.d.ts +2 -0
  44. package/theme/palette/baseOpacityColors.d.ts +2 -0
  45. package/theme/palette/commonColors.d.ts +2 -0
  46. package/theme/palette/greyPalette.d.ts +2 -0
  47. package/theme/palette/index.d.ts +6 -0
  48. package/theme/palette/palette.d.ts +6 -0
  49. package/theme/palette/presetColors.d.ts +5 -0
  50. package/theme/palette/stateColors.d.ts +2 -0
  51. package/theme/palette-DM0gXxA2.js +584 -0
  52. package/theme/{shadows-C9Ji2xrX.js → shadows-GTYqExFA.js} +18 -20
  53. package/types/augmentations.d.ts +144 -137
  54. package/types/types.d.ts +48 -25
  55. package/utils/getColorPresets-CXZaM9oS.js +14 -0
  56. package/utils/getColorPresets.d.ts +4 -9
  57. package/utils/index.d.ts +0 -1
  58. package/vite-env.d.ts +3 -3
  59. package/theme/defaultThemeOptions-CNJ2UmWH.js +0 -31
  60. package/theme/palette-CR1CkF2l.js +0 -439
  61. package/theme/palette.d.ts +0 -231
  62. package/utils/getColorPresets-B12zVrZ8.js +0 -85
  63. package/utils/getColorState-CGc0yrt5.js +0 -263
  64. package/utils/getColorState.d.ts +0 -26
@@ -1,137 +1,144 @@
1
- import {
2
- PatronusConstantColors,
3
- PatronusOpacityColors,
4
- PatronusOpacityOptions,
5
- } from '../theme/palette';
6
- import { ColorStateOptions, CustomShadowOptions } from '../theme';
7
- import { ChartPaletteOptions, GradientsPaletteOptions, GridPaletteOptions } from './types';
8
- import { Breakpoints } from '@mui/material';
9
- import { CssVarsTheme } from '@mui/material/styles';
10
-
11
- declare module '@mui/material' {
12
- interface Color {
13
- 0: string;
14
- 500_8: string;
15
- 500_12: string;
16
- 500_16: string;
17
- 500_24: string;
18
- 500_32: string;
19
- 500_48: string;
20
- 500_56: string;
21
- 500_80: string;
22
- }
23
- }
24
-
25
- declare module '@mui/material/styles/createPalette' {}
26
-
27
- // declare module '@mui/core/Typography' {
28
- // interface TypographyProps {
29
- // variant?: 'subtitle';
30
- // }
31
- // }
32
-
33
- declare module '@mui/material/styles' {
34
- interface SimplePaletteColorOptions {
35
- lighter?: string;
36
- darker?: string;
37
- LightSelected?: string;
38
- LightSelectedHover?: string;
39
- DarkSelected?: string;
40
- DarkSelectedHover?: string;
41
- }
42
- interface PaletteColor {
43
- lighter?: string;
44
- darker?: string;
45
- LightSelected?: string;
46
- LightSelectedHover?: string;
47
- DarkSelected?: string;
48
- DarkSelectedHover?: string;
49
- opacity?: string;
50
- name?: string;
51
- }
52
- interface Palette {
53
- gradients?: GradientsPaletteOptions;
54
- chart: ChartPaletteOptions;
55
- grid?: GridPaletteOptions;
56
- patronus?: PatronusConstantColors;
57
- opacity: Record<PatronusOpacityColors, PatronusOpacityOptions>;
58
- state: ColorStateOptions /* Organizar cada caso con los valores específicos. */;
59
- representative: string;
60
- mode: 'light' | 'dark';
61
- /* info: AgumentationInfoOptions; */
62
- }
63
-
64
- interface TypeText {
65
- bgPrimary: string;
66
- }
67
- interface PaletteOptions {
68
- gradients?: GradientsPaletteOptions;
69
- chart?: ChartPaletteOptions;
70
- grid?: GridPaletteOptions;
71
- patronus?: PatronusConstantColors;
72
- opacity: Record<PatronusOpacityColors, PatronusOpacityOptions>;
73
- state: ColorStateOptions /* Organizar cada caso con los valores específicos. */;
74
- representative: string;
75
- mode: 'light' | 'dark';
76
- }
77
-
78
- interface ColorSchemeOverrides {
79
- finalTheme?: true;
80
- }
81
-
82
- interface Theme extends CssVarsTheme {
83
- stretch: boolean;
84
- customShadows: CustomShadowOptions;
85
- breakpoints: Breakpoints;
86
- }
87
-
88
- interface ThemeVars {
89
- customShadows: CustomShadowOptions;
90
- }
91
-
92
- interface ColorSystem {
93
- typography: TypographyVariants;
94
- }
95
-
96
- interface TypeBackground {
97
- neutral: string;
98
- autofill: string;
99
- header: string;
100
- background: string;
101
- }
102
- }
103
-
104
- declare module '@mui/material/styles' {
105
- interface TypographyVariants {
106
- subtitle: Record<string, any>;
107
- subtitleDens: Record<string, any>;
108
- paragraph: Record<string, any>;
109
- paragraphDens: Record<string, any>;
110
- body: Record<string, any>;
111
- bodyDens: Record<string, any>;
112
- action: Record<string, any>;
113
- }
114
-
115
- // allow configuration using `createTheme`
116
- interface TypographyVariantsOptions {
117
- subtitle: React.CSSProperties;
118
- subtitleDens: React.CSSProperties;
119
- paragraph: React.CSSProperties;
120
- paragraphDens: React.CSSProperties;
121
- body: React.CSSProperties;
122
- bodyDens: React.CSSProperties;
123
- action: React.CSSProperties;
124
- }
125
- }
126
-
127
- declare module '@mui/material/Typography' {
128
- interface TypographyPropsVariantOverrides {
129
- subtitle: true;
130
- subtitleDens: true;
131
- paragraph: true;
132
- paragraphDens: true;
133
- body: true;
134
- bodyDens: true;
135
- action: true;
136
- }
137
- }
1
+ import { Breakpoints } from '@mui/material';
2
+ import { CssVarsTheme } from '@mui/material/styles';
3
+
4
+ import type { CustomShadowOptions } from '../theme';
5
+
6
+ declare module '@mui/material' {
7
+ interface Color {
8
+ 0: string;
9
+ 500_8: string;
10
+ 500_12: string;
11
+ 500_16: string;
12
+ 500_24: string;
13
+ 500_32: string;
14
+ 500_48: string;
15
+ 500_56: string;
16
+ 500_80: string;
17
+ }
18
+ }
19
+
20
+ declare module '@mui/material/styles' {
21
+ interface PaletteColor {
22
+ lighter?: string;
23
+ darker?: string;
24
+ active: string;
25
+ activeOpacity: string;
26
+ hover: string;
27
+ focus: string;
28
+ selected: string;
29
+ toneOpacity: string;
30
+ }
31
+
32
+ interface SimplePaletteColorOptions {
33
+ lighter?: string;
34
+ darker?: string;
35
+ active: string;
36
+ activeOpacity: string;
37
+ hover: string;
38
+ focus: string;
39
+ selected: string;
40
+ toneOpacity: string;
41
+ }
42
+
43
+ interface Palette {
44
+ mode: 'light' | 'dark';
45
+ secondary: never;
46
+ skeleton: { default: string; transition: string };
47
+ border: {
48
+ active: string;
49
+ selected: string;
50
+ default: string;
51
+ primary: string;
52
+ secondary: string;
53
+ disabled: string;
54
+ dense: string;
55
+ line: string;
56
+ };
57
+ general: {
58
+ scrollBar: string;
59
+ gridHover: string;
60
+ };
61
+ }
62
+
63
+ interface PaletteOptions {
64
+ mode: 'light' | 'dark';
65
+ secondary: never;
66
+ skeleton: { default: string; transition: string };
67
+ border: {
68
+ active: string;
69
+ selected: string;
70
+ default: string;
71
+ primary: string;
72
+ secondary: string;
73
+ disabled: string;
74
+ dense: string;
75
+ line: string;
76
+ };
77
+ general: {
78
+ scrollBar: string;
79
+ gridHover: string;
80
+ };
81
+ }
82
+
83
+ interface ColorSchemeOverrides {
84
+ finalTheme?: true;
85
+ }
86
+
87
+ interface Theme extends CssVarsTheme {
88
+ stretch: boolean;
89
+ customShadows: CustomShadowOptions;
90
+ breakpoints: Breakpoints;
91
+ }
92
+
93
+ interface ThemeVars {
94
+ customShadows: CustomShadowOptions;
95
+ }
96
+
97
+ interface ColorSystem {
98
+ typography: TypographyVariants;
99
+ }
100
+
101
+ interface TypeBackground {
102
+ default: string;
103
+ hover: string;
104
+ surface: string;
105
+ subtle: string;
106
+ main: string;
107
+ bold: string;
108
+ backdrop: string;
109
+ reverse: string;
110
+ header: string;
111
+ }
112
+
113
+ interface TypographyVariants {
114
+ subtitle: Record<string, any>;
115
+ subtitleDens: Record<string, any>;
116
+ paragraph: Record<string, any>;
117
+ paragraphDens: Record<string, any>;
118
+ body: Record<string, any>;
119
+ bodyDens: Record<string, any>;
120
+ action: Record<string, any>;
121
+ }
122
+
123
+ interface TypographyVariantsOptions {
124
+ subtitle: React.CSSProperties;
125
+ subtitleDens: React.CSSProperties;
126
+ paragraph: React.CSSProperties;
127
+ paragraphDens: React.CSSProperties;
128
+ body: React.CSSProperties;
129
+ bodyDens: React.CSSProperties;
130
+ action: React.CSSProperties;
131
+ }
132
+ }
133
+
134
+ declare module '@mui/material/Typography' {
135
+ interface TypographyPropsVariantOverrides {
136
+ subtitle: true;
137
+ subtitleDens: true;
138
+ paragraph: true;
139
+ paragraphDens: true;
140
+ body: true;
141
+ bodyDens: true;
142
+ action: true;
143
+ }
144
+ }
package/types/types.d.ts CHANGED
@@ -1,29 +1,52 @@
1
+ import { PaletteColor } from '@mui/material/styles';
1
2
  export declare type ThemeColorPresets = 'patronus' | 'turqui' | 'grass' | 'brown' | 'blaze';
2
- export interface GridPaletteOptions {
3
- sectionHeader: string;
4
- rowHover: string;
5
- divider: string;
3
+ export declare type StateColorSchema = 'info' | 'success' | 'warning' | 'error';
4
+ export declare type ColorSchema = 'primary' | 'secondary' | StateColorSchema;
5
+ export declare type BasePalettes = 'patronusBlue' | 'crayonBlue' | 'middleYellow' | 'acidGreen' | 'grassGreen' | 'desertBeige' | 'turquiBlue' | 'blazeOrange' | 'flameRed' | 'coolGrey' | 'brown' | 'marbleLight' | 'onyx' | 'mint' | 'oxford';
6
+ export declare type BaseOpacityPalettes = 'patronus' | 'turqui' | 'grass' | 'brown' | 'beige' | 'orange' | 'cool' | 'marble' | 'mint' | 'oxford';
7
+ export interface Colors {
8
+ '00': string;
9
+ 10: string;
10
+ 20: string;
11
+ 30: string;
12
+ 40: string;
13
+ 50: string;
14
+ 60: string;
15
+ 70: string;
16
+ 80: string;
17
+ 90: string;
18
+ 100: string;
6
19
  }
7
- export interface ChartPaletteOptions {
8
- violet: string[];
9
- blue: string[];
10
- green: string[];
11
- yellow: string[];
12
- red: string[];
20
+ export interface OpacityColors {
21
+ 4: string;
22
+ 6: string;
23
+ 8: string;
24
+ 10: string;
25
+ 12: string;
26
+ 14: string;
27
+ 16: string;
28
+ 18: string;
29
+ 28: string;
30
+ 31: string;
31
+ 32: string;
32
+ 48: string;
33
+ 60?: string;
34
+ 72?: string;
13
35
  }
14
- export interface GradientsPaletteOptions {
15
- primary: string;
16
- info: string;
17
- success: string;
18
- warning: string;
19
- error: string;
36
+ export interface ActionsPaletteColors {
37
+ active: string;
38
+ activeOpacity: string;
39
+ hover: string;
40
+ focus: string;
41
+ selected: string;
42
+ toneOpacity: string;
20
43
  }
21
- export declare type ColorVariants = {
22
- name: string;
23
- lighter: string;
24
- light: string;
25
- main: string;
26
- dark: string;
27
- darker: string;
28
- contrastText: string;
29
- };
44
+ export declare type BaseConstantColors = Record<BasePalettes, Colors>;
45
+ export declare type BasePresetColors = Record<keyof PaletteColor, string>;
46
+ export declare type PresetPalettes = Record<ThemeColorPresets, BasePresetColors>;
47
+ export declare type StatePalettes = Record<StateColorSchema, BasePresetColors>;
48
+ export declare type PresetActionsPalettes = Record<ThemeColorPresets, ActionsPaletteColors>;
49
+ export declare type PresetsOptions = Array<{
50
+ name: string | undefined;
51
+ value: string;
52
+ }>;
@@ -0,0 +1,14 @@
1
+ import { P as r } from "../theme/palette-DM0gXxA2.js";
2
+ const o = "patronus", s = r[o];
3
+ function n(t) {
4
+ try {
5
+ return r?.[t];
6
+ } catch {
7
+ }
8
+ return s;
9
+ }
10
+ export {
11
+ o as D,
12
+ s as d,
13
+ n as g
14
+ };
@@ -1,10 +1,5 @@
1
- import { ThemeColorPresets } from '../types';
2
- import { PaletteColor } from '@mui/material';
3
- export declare const colorPresets: Array<PaletteColor>;
4
- export declare const defaultPreset: PaletteColor;
5
- export declare const turqui: PaletteColor;
6
- export declare const grass: PaletteColor;
7
- export declare const brown: PaletteColor;
8
- export declare const blaze: PaletteColor;
9
- export declare function getColorPresets(presetsKey: ThemeColorPresets): any;
1
+ import { BasePresetColors, ThemeColorPresets } from '../types';
2
+ export declare const DEFAULT_PRESET: ThemeColorPresets;
3
+ export declare const defaultPresetColors: BasePresetColors;
4
+ export declare function getColorPresets(presetsKey: ThemeColorPresets): BasePresetColors;
10
5
  export default getColorPresets;
package/utils/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export { useResponsive } from './useResponsive';
2
2
  export * from './getColorPresets';
3
- export { getColorState } from './getColorState';
4
3
  export * from './getFontValue';
package/vite-env.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vitest" />
3
- /// <reference types="vitest/importMeta" />
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vitest/importMeta" />
@@ -1,31 +0,0 @@
1
- import { t as a } from "./typography-BsOO459U.js";
2
- import { p as e } from "./palette-CR1CkF2l.js";
3
- import { createTheme as o, alpha as s } from "@mui/material";
4
- import { s as p, c as m } from "./shadows-C9Ji2xrX.js";
5
- import { g as t } from "../utils/getColorPresets-B12zVrZ8.js";
6
- import { g as i } from "../utils/getColorState-CGc0yrt5.js";
7
- const r = o(), f = {
8
- ...r,
9
- typography: a,
10
- palette: {
11
- ...r.palette,
12
- ...e.dark,
13
- primary: {
14
- ...r.palette.primary,
15
- ...t("patronus")
16
- },
17
- state: i("patronus", "light"),
18
- representative: t("patronus").darker,
19
- mode: "light"
20
- },
21
- shape: { borderRadius: 8 },
22
- shadows: p.dark,
23
- customShadows: {
24
- primary: `0 8px 16px 0 ${s(t("patronus").main, 0.2)}`,
25
- ...m("dark")
26
- },
27
- stretch: !0
28
- };
29
- export {
30
- f as d
31
- };