@m4l/styles 6.5.1 → 7.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.
package/index.js CHANGED
@@ -1,39 +1,39 @@
1
1
  import { D as r, g as s, m as t } from "./config.js";
2
- import { O as p } from "./theme/ourTheme.js";
3
- import { c as f, s as x } from "./theme/shadows.js";
4
- import { t as E } from "./theme/typography.js";
5
- import { f as S } from "./theme/overrides/index.js";
6
- import { B as R } from "./theme/palette/baseColors.js";
7
- import { B as i } from "./theme/palette/baseOpacityColors.js";
8
- import { C as n } from "./theme/palette/commonColors.js";
9
- import { G as _ } from "./theme/palette/greyPalette.js";
10
- import { p as A } from "./theme/palette/presetColors.js";
11
- import { u as L } from "./utils/useResponsive.js";
12
- import { D, d as h, g as v } from "./utils/getColorPresets.js";
13
- import { p as F, r as M, a as U } from "./utils/getFontValue.js";
14
- import { g as w } from "./utils/getColorState.js";
15
- import { g as G } from "./utils/getPaletteByPreset.js";
2
+ import { c as p, s as m } from "./theme/shadows.js";
3
+ import { t as x } from "./theme/typography.js";
4
+ import { f as O } from "./theme/overrides/index.js";
5
+ import { B as S } from "./theme/palette/baseColors.js";
6
+ import { B as n } from "./theme/palette/baseOpacityColors.js";
7
+ import { C as l } from "./theme/palette/commonColors.js";
8
+ import { G as P } from "./theme/palette/greyPalette.js";
9
+ import { p as _ } from "./theme/palette/presetColors.js";
10
+ import { u as A } from "./utils/useResponsive.js";
11
+ import { D as L, d, g as h } from "./utils/getColorPresets.js";
12
+ import { p as v, r as y, a as F } from "./utils/getFontValue.js";
13
+ import { g as U } from "./utils/getColorState.js";
14
+ import { g as w } from "./utils/getPaletteByPreset.js";
15
+ import { g as G } from "./utils/getUserThemeOptions.js";
16
16
  export {
17
- R as BASE_COLORS,
18
- i as BASE_OPACITY_COLORS,
19
- n as COMMON_COLORS,
20
- D as DEFAULT_PRESET,
17
+ S as BASE_COLORS,
18
+ n as BASE_OPACITY_COLORS,
19
+ l as COMMON_COLORS,
20
+ L as DEFAULT_PRESET,
21
21
  r as DEFAULT_SIZE,
22
- _ as GREY_PALETTE,
23
- p as OUR_THEME,
24
- f as createCustomShadows,
25
- h as defaultPresetColors,
26
- S as fnComponentsOverrides,
27
- v as getColorPresets,
28
- w as getColorState,
29
- G as getPaletteByPreset,
22
+ P as GREY_PALETTE,
23
+ p as createCustomShadows,
24
+ d as defaultPresetColors,
25
+ O as fnComponentsOverrides,
26
+ h as getColorPresets,
27
+ U as getColorState,
28
+ w as getPaletteByPreset,
29
+ G as getUserThemeOptions,
30
30
  s as globalRemSize,
31
31
  t as muiBreakpointsValues,
32
- A as presetsOptions,
33
- F as pxToRem,
34
- M as remToPx,
35
- U as responsiveFontSizes,
36
- x as shadows,
37
- E as typography,
38
- L as useResponsive
32
+ _ as presetsOptionsMainColor,
33
+ v as pxToRem,
34
+ y as remToPx,
35
+ F as responsiveFontSizes,
36
+ m as shadows,
37
+ x as typography,
38
+ A as useResponsive
39
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/styles",
3
- "version": "6.5.1",
3
+ "version": "7.0.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": "m4l team",
6
6
  "publishConfig": {
package/theme/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export type { CustomShadowOptions } from './shadows';
2
- export { OUR_THEME } from './ourTheme';
3
2
  export { shadows, createCustomShadows } from './shadows';
4
3
  export * from './palette';
5
4
  export { typography } from './typography';
@@ -2,4 +2,4 @@ export { BASE_COLORS } from './baseColors';
2
2
  export { BASE_OPACITY_COLORS } from './baseOpacityColors';
3
3
  export { COMMON_COLORS } from './commonColors';
4
4
  export { GREY_PALETTE } from './greyPalette';
5
- export { presetsOptions } from './presetColors';
5
+ export { presetsOptionsMainColor } from './presetColors';
@@ -1,19 +1,22 @@
1
- import { ThemePaletteColors, ThemePaletteColors as OursColorPalette, ThemePresetColors, PresetsOptions } from '../../types';
1
+ import { ThemePaletteColors, ThemePaletteColors as OursColorPalette, ThemePresetColors, PresetsOptionsColorMain } from '../../types';
2
2
  /**
3
3
  * Conjunto de paletas de colores usados para construir el tema seleccionado por el usario en la aplación.
4
4
  * Sus opciones pueden ser patronus, turqui, grass, brown y blaze.
5
+ * @createdAt 2024-10-08 13:31:22 - automatic
5
6
  */
6
7
  export declare const PRESET_COLORS: ThemePresetColors;
7
8
  /**
8
9
  * Colección de temas de color en modo light, se usan para aportar el color en los componentes de la apliación web.
9
10
  * Se tiene en cuanta cuando la variable semántica aplicada al componente es de tipo primary.
10
11
  * Sus opciones pueden ser patronus, turqui, grass, brown y blaze.
12
+ * @createdAt 2024-10-08 13:31:22 - automatic
11
13
  */
12
14
  export declare const PRIMARY_COLORS_LIGHT: ThemePaletteColors;
13
15
  /**
14
16
  * Colección de temas de color en modo dark, se usan para aportar el color en los componentes de la apliación web.
15
17
  * Se tiene en cuanta cuando la variable semántica aplicada al componente es de tipo primary.
16
18
  * Sus opciones pueden ser patronus, turqui, grass, brown y blaze.
19
+ * @createdAt 2024-10-08 13:31:22 - automatic
17
20
  */
18
21
  export declare const PRIMARY_COLORS_DARK: OursColorPalette;
19
- export declare const presetsOptions: PresetsOptions;
22
+ export declare const presetsOptionsMainColor: PresetsOptionsColorMain;
@@ -1,2 +1,6 @@
1
1
  import { Size } from './types';
2
+ /**
3
+ * Tamaño de los elementos de la aplicación
4
+ * utilizado para tokenizar las medidas con el sistema de diseño
5
+ */
2
6
  export declare const SIZE: Size;
@@ -92,7 +92,10 @@ declare module '@mui/material/styles' {
92
92
  interface Theme extends CssVarsTheme {
93
93
  stretch: boolean;
94
94
  customShadows: CustomShadowOptions;
95
- breakpoints: Breakpoints;
95
+ /**
96
+ *
97
+ */
98
+ // breakpoints: Breakpoints;
96
99
  /**
97
100
  * Colección de tamaños y espaciados base en el sistema de diseño
98
101
  */
package/types/types.d.ts CHANGED
@@ -1,8 +1,12 @@
1
- import { PaletteColor, Theme } from '@mui/material/styles';
1
+ import { PaletteColor } from '@mui/material/styles';
2
+ /**
3
+ * Modo de color seleccionable por un usuario con el que se puede pintar la aplicación.
4
+ */
5
+ export type ThemeUserMode = 'light' | 'dark';
2
6
  /**
3
7
  * Opciones de color seleccionables por un usuario con los que se puede pintar la aplicación.
4
8
  */
5
- export type ThemeColorOptionsType = 'patronus' | 'turqui' | 'grass' | 'brown' | 'blaze';
9
+ export type ThemeUserColor = 'patronus' | 'turqui' | 'grass' | 'brown' | 'blaze';
6
10
  /**
7
11
  * Lista de colores semánticos disponibles en la aplicación.
8
12
  */
@@ -67,7 +71,7 @@ export type BaseConstantColors = Record<BasePalettes, Colors>;
67
71
  /**
68
72
  * Son los colores de las las ocpiones del tema, en formato PresetColor (Mas amplio que el PaletteColor)
69
73
  */
70
- export type ThemePresetColors = Record<ThemeColorOptionsType, PresetColor>;
74
+ export type ThemePresetColors = Record<ThemeUserColor, PresetColor>;
71
75
  /**
72
76
  * Son los colores semanticos en formato PresetColor
73
77
  */
@@ -75,7 +79,7 @@ export type SemanticPresetColors = Record<SemanticColorOptionsType, PresetColor>
75
79
  /**
76
80
  * Son los colores de las ocpiones del tema, en formato PalletColor
77
81
  */
78
- export type ThemePaletteColors = Record<ThemeColorOptionsType, PaletteColor>;
82
+ export type ThemePaletteColors = Record<ThemeUserColor, PaletteColor>;
79
83
  /**
80
84
  * Son las opcines de paleta de colores semánticos en formato PaletteColor
81
85
  */
@@ -87,9 +91,8 @@ export type DefaultPresetColor = Omit<PresetColor, 'borderMainDark' | 'borderMai
87
91
  mainLight: string;
88
92
  mainDark: string;
89
93
  };
90
- export type PresetsOptions = Array<{
94
+ export type PresetsOptionsColorMain = Array<{
91
95
  name: string | undefined;
92
96
  value: string;
93
97
  }>;
94
98
  export type ColorState = 'warning' | 'delete' | 'info' | 'success';
95
- export type OurTheme = Pick<Theme, 'palette' | 'typography' | 'customShadows' | 'stretch' | 'size' | 'typography'>;
@@ -1,12 +1,12 @@
1
- import { PresetColor, ThemeColorOptionsType } from '../types';
2
- export declare const DEFAULT_PRESET: ThemeColorOptionsType;
1
+ import { PresetColor, ThemeUserColor } from '../types';
2
+ export declare const DEFAULT_PRESET: ThemeUserColor;
3
3
  export declare const defaultPresetColors: PresetColor;
4
4
  /**
5
5
  * Función que retorna los colores de un preset
6
6
  * @author Juan Escobar - automatic
7
7
  * @createdAt 2024-10-06 13:47:24 - automatic
8
- * @updatedAt 2024-10-06 13:47:25 - automatic
8
+ * @updatedAt 2024-10-08 13:31:22 - automatic
9
9
  * @updatedUser Juan Escobar - automatic
10
10
  */
11
- export declare function getColorPresets(presetsKey: ThemeColorOptionsType): PresetColor;
11
+ export declare function getColorPresets(presetsKey: ThemeUserColor): PresetColor;
12
12
  export default getColorPresets;
@@ -1,12 +1,12 @@
1
- import { ThemeColorOptionsType } from '../types';
1
+ import { ThemeUserColor } from '../types';
2
2
  /**
3
3
  * Función que retorna la paleta de colores según el preset seleccionado
4
4
  * @author Juan Escobar - automatic
5
5
  * @createdAt 2024-10-06 13:47:24 - automatic
6
- * @updatedAt 2024-10-06 13:47:26 - automatic
6
+ * @updatedAt 2024-10-08 13:31:22 - automatic
7
7
  * @updatedUser Juan Escobar - automatic
8
8
  */
9
- export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) => {
9
+ export declare const getPaletteByPreset: (themeUserColor: ThemeUserColor) => {
10
10
  readonly light: {
11
11
  readonly mode: "light";
12
12
  readonly common: import('@mui/material').CommonColors;
@@ -26,8 +26,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
26
26
  readonly focusVisible: string;
27
27
  readonly contrastText: string;
28
28
  readonly light: string;
29
- readonly main: string;
30
29
  readonly dark: string;
30
+ readonly main: string;
31
31
  readonly focusActive: string;
32
32
  readonly hover: string;
33
33
  readonly hoverOpacity: string;
@@ -45,7 +45,7 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
45
45
  readonly neutral: string;
46
46
  readonly surface: string;
47
47
  readonly hover: string;
48
- readonly paper: "";
48
+ readonly paper: "#00000000";
49
49
  };
50
50
  readonly border: {
51
51
  readonly main: string;
@@ -67,8 +67,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
67
67
  readonly info: {
68
68
  readonly focusVisible: string;
69
69
  readonly light: string;
70
- readonly main: string;
71
70
  readonly dark: string;
71
+ readonly main: string;
72
72
  readonly contrastText: string;
73
73
  readonly focusActive: string;
74
74
  readonly hover: string;
@@ -79,8 +79,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
79
79
  readonly success: {
80
80
  readonly focusVisible: string;
81
81
  readonly light: string;
82
- readonly main: string;
83
82
  readonly dark: string;
83
+ readonly main: string;
84
84
  readonly contrastText: string;
85
85
  readonly focusActive: string;
86
86
  readonly hover: string;
@@ -91,8 +91,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
91
91
  readonly warning: {
92
92
  readonly focusVisible: string;
93
93
  readonly light: string;
94
- readonly main: string;
95
94
  readonly dark: string;
95
+ readonly main: string;
96
96
  readonly contrastText: string;
97
97
  readonly focusActive: string;
98
98
  readonly hover: string;
@@ -103,8 +103,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
103
103
  readonly error: {
104
104
  readonly focusVisible: string;
105
105
  readonly light: string;
106
- readonly main: string;
107
106
  readonly dark: string;
107
+ readonly main: string;
108
108
  readonly contrastText: string;
109
109
  readonly focusActive: string;
110
110
  readonly hover: string;
@@ -132,8 +132,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
132
132
  readonly focusVisible: string;
133
133
  readonly contrastText: string;
134
134
  readonly light: string;
135
- readonly main: string;
136
135
  readonly dark: string;
136
+ readonly main: string;
137
137
  readonly focusActive: string;
138
138
  readonly hover: string;
139
139
  readonly hoverOpacity: string;
@@ -151,7 +151,7 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
151
151
  readonly neutral: string;
152
152
  readonly surface: string;
153
153
  readonly hover: string;
154
- readonly paper: "";
154
+ readonly paper: "#00000000";
155
155
  };
156
156
  readonly border: {
157
157
  readonly main: string;
@@ -173,8 +173,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
173
173
  readonly info: {
174
174
  readonly focusVisible: string;
175
175
  readonly light: string;
176
- readonly main: string;
177
176
  readonly dark: string;
177
+ readonly main: string;
178
178
  readonly contrastText: string;
179
179
  readonly focusActive: string;
180
180
  readonly hover: string;
@@ -185,8 +185,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
185
185
  readonly success: {
186
186
  readonly focusVisible: string;
187
187
  readonly light: string;
188
- readonly main: string;
189
188
  readonly dark: string;
189
+ readonly main: string;
190
190
  readonly contrastText: string;
191
191
  readonly focusActive: string;
192
192
  readonly hover: string;
@@ -197,8 +197,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
197
197
  readonly warning: {
198
198
  readonly focusVisible: string;
199
199
  readonly light: string;
200
- readonly main: string;
201
200
  readonly dark: string;
201
+ readonly main: string;
202
202
  readonly contrastText: string;
203
203
  readonly focusActive: string;
204
204
  readonly hover: string;
@@ -209,8 +209,8 @@ export declare const getPaletteByPreset: (presetColor: ThemeColorOptionsType) =>
209
209
  readonly error: {
210
210
  readonly focusVisible: string;
211
211
  readonly light: string;
212
- readonly main: string;
213
212
  readonly dark: string;
213
+ readonly main: string;
214
214
  readonly contrastText: string;
215
215
  readonly focusActive: string;
216
216
  readonly hover: string;
@@ -40,7 +40,7 @@ const t = {
40
40
  surface: r.marbleLight[50],
41
41
  hover: f.hover,
42
42
  //por compatibilidad de mui
43
- paper: ""
43
+ paper: "#00000000"
44
44
  },
45
45
  border: {
46
46
  main: c[l]?.borderMainLight,
@@ -99,7 +99,7 @@ const t = {
99
99
  surface: r.marbleLight[60],
100
100
  hover: m.hover,
101
101
  //por compatibilidad de mui
102
- paper: ""
102
+ paper: "#00000000"
103
103
  },
104
104
  border: {
105
105
  main: c[l]?.borderMainDark,
@@ -0,0 +1,10 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ import { ThemeUserColor, ThemeUserMode } from '../types/types';
3
+ /**
4
+ * Obtiene el tema de la aplicación basado en el color y modo seleccionado por el usuario.
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-08 13:31:22 - automatic
7
+ * @updatedAt 2024-10-08 13:31:22 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
10
+ export declare function getUserThemeOptions(themeUserMode: ThemeUserMode, themeUserColor: ThemeUserColor): Theme;
@@ -0,0 +1,25 @@
1
+ import { createTheme as s, alpha as e } from "@mui/material/styles";
2
+ import { t as a } from "../theme/typography.js";
3
+ import { s as m, c as p } from "../theme/shadows.js";
4
+ import { S as i } from "../theme/sizes/size.js";
5
+ import { g as c } from "./getColorPresets.js";
6
+ import { g as f } from "./getPaletteByPreset.js";
7
+ const o = s();
8
+ function S(t, r) {
9
+ return {
10
+ ...o,
11
+ ...a,
12
+ ...m[t],
13
+ customShadows: {
14
+ primary: `0 8px 16px 0 ${e(c(r).main, 0.2)}`,
15
+ ...p(t)
16
+ },
17
+ stretch: !0,
18
+ palette: { ...o.palette, ...f(r)[t] },
19
+ typography: a,
20
+ size: i
21
+ };
22
+ }
23
+ export {
24
+ S as g
25
+ };
package/utils/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './getColorPresets';
3
3
  export * from './getFontValue';
4
4
  export * from './getColorState';
5
5
  export * from './getPaletteByPreset';
6
+ export * from './getUserThemeOptions';
@@ -1,2 +0,0 @@
1
- import { OurTheme } from '../types/types';
2
- export declare const OUR_THEME: OurTheme;
package/theme/ourTheme.js DELETED
@@ -1,25 +0,0 @@
1
- import { createTheme as o, alpha as s } from "@mui/material/styles";
2
- import { t } from "./typography.js";
3
- import { s as a, c as r } from "./shadows.js";
4
- import { S as m } from "./sizes/size.js";
5
- import { g as p } from "../utils/getPaletteByPreset.js";
6
- import { g as i } from "../utils/getColorPresets.js";
7
- const h = o(), e = p("patronus"), P = {
8
- ...t,
9
- ...a.light,
10
- ...e,
11
- customShadows: {
12
- primary: `0 8px 16px 0 ${s(i("patronus").main, 0.2)}`,
13
- ...r("light")
14
- },
15
- stretch: !0,
16
- palette: {
17
- ...h.palette,
18
- ...e.light
19
- },
20
- typography: t,
21
- size: m
22
- };
23
- export {
24
- P as O
25
- };