@m4l/components 9.1.112 → 9.1.114

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 (23) hide show
  1. package/components/Chip/ChipStyles.js +1 -1
  2. package/components/Label/Label.styles.js +2 -2
  3. package/components/Label/types.d.ts +10 -14
  4. package/components/NumberInput/NumberInput.styles.js +1 -1
  5. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
  6. package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +1 -1
  7. package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.styles.js +1 -1
  8. package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +1 -1
  9. package/components/mui_extended/Autocomplete/Autocomplete.styles.js +1 -1
  10. package/components/mui_extended/CheckBox/CheckBox.styles.js +1 -1
  11. package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +1 -1
  12. package/components/mui_extended/MenuDivider/MenuDivider.styles.js +1 -1
  13. package/components/mui_extended/MenuItem/MenuItem.styles.js +1 -1
  14. package/components/mui_extended/NavLink/NavLink.styles.js +1 -1
  15. package/components/mui_extended/Select/Select.styles.js +9 -5
  16. package/components/mui_extended/TextField/TextField.styles.js +1 -1
  17. package/components/mui_extended/Typography/typography.styles.js +3 -2
  18. package/package.json +1 -1
  19. package/utils/getSizeStyles/_test_/getSizeStyles.test.d.ts +1 -0
  20. package/utils/{getHeightSizeStyles.d.ts → getSizeStyles/getSizeStyles.d.ts} +5 -1
  21. package/utils/{getHeightSizeStyles.js → getSizeStyles/getSizeStyles.js} +9 -0
  22. package/utils/getSizeStyles/index.d.ts +1 -0
  23. package/utils/getSizeStyles/index.js +1 -0
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const chipStyles = {
3
3
  /**
4
4
  * Styles for the root element of the chip.
@@ -1,5 +1,5 @@
1
1
  import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
2
- import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
2
+ import { g as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
3
3
  const labelStyles = {
4
4
  /**
5
5
  * Estilos para el contenedor raíz del Label 🏷️
@@ -81,7 +81,7 @@ const labelStyles = {
81
81
  iconHelperMessageStyled: ({ theme, ownerState }) => ({
82
82
  borderRadius: theme.vars.size.borderRadius.r1,
83
83
  '&:hover > [class*="M4LIcon-icon"]': {
84
- backgroundColor: theme.vars.palette.info.selected
84
+ backgroundColor: theme.vars.palette.info.hover
85
85
  },
86
86
  '& > [class*="M4LIcon-icon"]': {
87
87
  backgroundColor: theme.vars.palette.info.enabled
@@ -6,27 +6,23 @@ import { Sizes } from '@m4l/styles';
6
6
  import { TypographyProps } from '../mui_extended/Typography/types';
7
7
  export type LabelVariants = 'standard';
8
8
  export interface LabelProps extends Pick<TypographyProps, 'skeletonWidth'> {
9
- /** Mesanje de ayuda opcional que se visualiza cuando se interactua con el tooltip del Icono de informacion */
9
+ /** Mensaje de ayuda opcional que se visualiza cuando se interactúa con el tooltip del Icono de información. */
10
10
  helperMessage?: string | undefined;
11
- /** Es la etiqueta de texto principal del componente.*/
11
+ /** Es la etiqueta de texto principal del componente. */
12
12
  label?: string;
13
- /** Es una propiedad que permite visualizar el texto que acompaña a la etiqueta `label` Por defecto es `false`.*/
13
+ /** Es una propiedad que permite visualizar el texto que acompaña a la etiqueta `label`. Por defecto es `false`. */
14
14
  mandatory?: boolean;
15
- /** Es una etiqueta de texto que define si el campo es obligatorio, por defecto se visualiza un `*` de lo contrario se va a mostrar el valor que se proporciona .*/
15
+ /** Es una etiqueta de texto que define si el campo es obligatorio, por defecto se visualiza un `*` de lo contrario se va a mostrar el valor que se proporciona. */
16
16
  mandatoryMessage?: string;
17
- /** Sirve para vincular un elemento de etiqueta con un elemento de formulario, como un campo de entrada, lo que permite que al hacer clic en el texto de la etiqueta, se active el campo correspondiente*/
17
+ /** Sirve para vincular un elemento de etiqueta con un elemento de formulario, como un campo de entrada, lo que permite que al hacer clic en el texto de la etiqueta, se active el campo correspondiente. */
18
18
  htmlFor?: string | undefined;
19
- /** Identificador único para la etiqueta html que envuelve al componente, útil para referencias en CSS o JavaScript.*/
19
+ /** Identificador único para la etiqueta html que envuelve al componente, útil para referencias en CSS o JavaScript. */
20
20
  id?: string;
21
- /** Define el tamaño de la etiqueta. Puede ser 'small' o 'medium'. Por defecto es 'medium'. */
21
+ /** Define el tamaño de la etiqueta. Puede ser 'small' o 'medium'. Por defecto es 'medium'. */
22
22
  size?: Extract<Sizes, 'small' | 'medium'>;
23
- /**
24
- * Los elementos secundarios que se renderizarán dentro del componente.
25
- */
23
+ /** Los elementos secundarios que se renderizarán dentro del componente. */
26
24
  children?: React.ReactNode;
27
- /**
28
- * Clase CSS personalizada que se aplicará al componente.
29
- */
25
+ /** Clase CSS personalizada que se aplicará al componente. */
30
26
  className?: string;
31
27
  /** Indica si hay un error en el campo asociado a la etiqueta. */
32
28
  error?: boolean;
@@ -39,7 +35,7 @@ export type OwnerState = Pick<LabelProps, 'size'>;
39
35
  export interface LabelOwnerState extends LabelProps, OwnerState {
40
36
  /** Indica si el componente está deshabilitado. */
41
37
  disabled?: boolean;
42
- /** Define el tamaño del componente */
38
+ /** Define el tamaño del componente. */
43
39
  size?: Extract<Sizes, 'small' | 'medium'>;
44
40
  }
45
41
  export type LabelSlotsType = keyof typeof LabelSlots;
@@ -1,5 +1,5 @@
1
1
  import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
2
- import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
2
+ import { g as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
3
3
  const numberInputStyles = {
4
4
  /**
5
5
  * Estilos aplicados al contenedor principal (root).
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  import { a as ITEM_IN_TREE_ACTIVE, I as ITEM_ACTIVE } from "../../../../constants.js";
3
3
  const containerMenuItemsMainStyles = {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const areasAdminStyles = {
3
3
  /**
4
4
  * Root areas admin Styles
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const propagateLoaderSpinnerStyles = {
3
3
  /**
4
4
  * Estilos del componente raíz del contenedor de la ventana.
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const rhfTextFieldPasswordStyles = {
3
3
  /**
4
4
  * Elemento Root
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const autocompleteSyles = {
3
3
  /**
4
4
  * Styles for the root component.
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const checkBoxStyles = {
3
3
  /**
4
4
  * Estilos generales para el checkbox 🟦
@@ -1,5 +1,5 @@
1
1
  import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
2
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
2
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
3
3
  const dateTimePickerStyles = {
4
4
  /**
5
5
  * Estilos para el root cuando esta en Desktop 💻
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const menuDividerStyles = {
3
3
  /**
4
4
  * MenuDivider Styles
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  const menuItemStyles = {
3
3
  /**
4
4
  * Estilos para el contenedor de los items del menú contenedor
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
3
3
  const navLinkStyles = {
4
4
  /* *
@@ -1,5 +1,5 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
2
1
  import { S as SELECT_CLASSES } from "./constants.js";
2
+ import { a as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
3
3
  const selectStyles = {
4
4
  /**
5
5
  * Estilos para el componente Select
@@ -20,7 +20,8 @@ const selectStyles = {
20
20
  display: "none"
21
21
  },
22
22
  "& .M4LImage-root": {
23
- ...getHeightSizeStyles(
23
+ ...getSizeStyles(
24
+ theme,
24
25
  theme.generalSettings.isMobile,
25
26
  ownerState.size || "medium",
26
27
  "base",
@@ -34,7 +35,8 @@ const selectStyles = {
34
35
  },
35
36
  "& .MuiButtonBase-root": {
36
37
  // Tamaño del componente
37
- ...getHeightSizeStyles(
38
+ ...getSizeStyles(
39
+ theme,
38
40
  theme.generalSettings.isMobile,
39
41
  ownerState.size || "medium",
40
42
  "action",
@@ -78,7 +80,8 @@ const selectStyles = {
78
80
  }
79
81
  },
80
82
  // Tamaño del componente
81
- ...getHeightSizeStyles(
83
+ ...getSizeStyles(
84
+ theme,
82
85
  theme.generalSettings.isMobile,
83
86
  ownerState.size || "medium",
84
87
  "action",
@@ -143,7 +146,8 @@ const selectStyles = {
143
146
  alignItems: "center",
144
147
  background: theme.vars.palette.skeleton.transition,
145
148
  // Estilos específicos para el tamaño small
146
- ...getHeightSizeStyles(
149
+ ...getSizeStyles(
150
+ theme,
147
151
  theme.generalSettings.isMobile,
148
152
  ownerState.size || "medium",
149
153
  "action",
@@ -1,5 +1,5 @@
1
1
  import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
2
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
2
+ import { g as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
3
3
  import { T as TEXT_FIELD_CLASSES } from "./constants.js";
4
4
  const textFieldStyles = {
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
1
+ import { a as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
2
  import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
3
3
  const typographyStyles = {
4
4
  /**
@@ -39,7 +39,8 @@ const typographyStyles = {
39
39
  * Slot: skeleton
40
40
  */
41
41
  skeleton: ({ theme, ownerState }) => ({
42
- ...getHeightSizeStyles(
42
+ ...getSizeStyles(
43
+ theme,
43
44
  theme.generalSettings.isMobile,
44
45
  ownerState.size || "medium",
45
46
  "base"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.112",
3
+ "version": "9.1.114",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,8 @@
1
1
  import { Sizes, SizesComponentsTypes } from '@m4l/styles';
2
+ import { Theme } from '@mui/material';
2
3
  /**
4
+ * Gets height size styles for component CSS.
5
+ * @deprecated Use getSizeStyles instead. This function will be removed in a future version, use getSizeStyles instead.
3
6
  * Utilidad que se encarga de obtener los estilos de tamaño de altura para ser usados en el css de los componentes.
4
7
  * @param isMobile - Modalidad de dispositivo en el que se encuentra la aplicación (Escritorio y móvil). Se espera que se obtenga del objeto
5
8
  * theme.generalSettings.isMobile.
@@ -12,6 +15,7 @@ import { Sizes, SizesComponentsTypes } from '@m4l/styles';
12
15
  export declare const getHeightSizeStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variantSize: SizesComponentsTypes, css?: Record<string, any> | ((heightSize: string | number) => Record<string, any>)) => any;
13
16
  /**
14
17
  * Utilidad que se encarga de obtener los estilos de tamaño para ser usados en el css de los componentes.
18
+ * @param theme - Objeto de tema de MUI.
15
19
  * @param isMobile - Modalidad de dispositivo en el que se encuentra la aplicación (Escritorio y móvil). Se espera que se obtenga del objeto
16
20
  * theme.generalSettings.isMobile.
17
21
  * @param size - Formato de tamaño definido por el componente o el contexto de AppearanceComponentProvider, puede ser small,
@@ -21,4 +25,4 @@ export declare const getHeightSizeStyles: (isMobile: boolean, size: Extract<Size
21
25
  * @param property - Propiedad CSS que se desea aplicar (por defecto es 'height').
22
26
  * @returns Objeto con los estilos calculados.
23
27
  */
24
- export declare const getSizeStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variantSize: SizesComponentsTypes, css?: Record<string, any> | ((sizeValue: string | number) => Record<string, any>), property?: "height" | "width") => any;
28
+ export declare const getSizeStyles: (theme: Theme, isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variantSize: SizesComponentsTypes, css?: Record<string, any> | ((sizeValue: string | number) => Record<string, any>), property?: "height" | "width") => any;
@@ -8,6 +8,15 @@ const getHeightSizeStyles = (isMobile, size, variantSize, css) => {
8
8
  ...resolvedCss
9
9
  };
10
10
  };
11
+ const getSizeStyles = (theme, isMobile, size, variantSize, css, property = "height") => {
12
+ const sizeValue = theme.vars.size[isMobile ? "mobile" : "desktop"][size][variantSize];
13
+ const resolvedCss = typeof css === "function" ? css(sizeValue) : css;
14
+ return {
15
+ [property]: sizeValue,
16
+ ...resolvedCss
17
+ };
18
+ };
11
19
  export {
20
+ getSizeStyles as a,
12
21
  getHeightSizeStyles as g
13
22
  };
@@ -0,0 +1 @@
1
+ export * from './getSizeStyles';
@@ -0,0 +1 @@
1
+