@m4l/components 9.1.54 → 9.1.56

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 (55) hide show
  1. package/components/Chip/Chip.js +6 -2
  2. package/components/Chip/ChipStyles.js +7 -7
  3. package/components/Chip/constants.d.ts +4 -0
  4. package/components/Chip/constants.js +5 -1
  5. package/components/Chip/slots/ChipEnum.d.ts +7 -7
  6. package/components/Chip/slots/ChipEnum.js +8 -7
  7. package/components/Chip/slots/ChipSlots.js +3 -3
  8. package/components/Chip/types.d.ts +41 -11
  9. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +9 -21
  10. package/components/formatters/PeriodFormatter/PeriodFormatter.d.ts +25 -0
  11. package/components/formatters/PeriodFormatter/PeriodFormatter.js +87 -0
  12. package/components/formatters/PeriodFormatter/PeriodFormatter.styles.d.ts +2 -0
  13. package/components/formatters/PeriodFormatter/PeriodFormatter.styles.js +29 -0
  14. package/components/formatters/PeriodFormatter/constants.d.ts +1 -0
  15. package/components/formatters/PeriodFormatter/constants.js +4 -0
  16. package/components/formatters/PeriodFormatter/dictionary.d.ts +6 -9
  17. package/components/formatters/PeriodFormatter/slots/PeriodFomatterEnum.d.ts +4 -0
  18. package/components/formatters/PeriodFormatter/slots/PeriodFomatterEnum.js +8 -0
  19. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +2 -0
  20. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +18 -0
  21. package/components/formatters/PeriodFormatter/slots/index.d.ts +2 -0
  22. package/components/formatters/PeriodFormatter/slots/index.js +1 -0
  23. package/components/formatters/PeriodFormatter/tests/PeriodFormatter.test.d.ts +1 -0
  24. package/components/formatters/PeriodFormatter/types.d.ts +22 -2
  25. package/components/formatters/index.d.ts +1 -1
  26. package/components/mui_extended/Autocomplete/Autocomplete.js +13 -9
  27. package/components/mui_extended/Autocomplete/AutocompleteStyles.js +18 -58
  28. package/components/mui_extended/Autocomplete/dictionary.d.ts +0 -2
  29. package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +1 -1
  30. package/components/mui_extended/Autocomplete/renderOptions/index.js +3 -2
  31. package/components/mui_extended/Autocomplete/slots /AutocompleteSlots.js +3 -2
  32. package/components/mui_extended/MenuItem/MenuItem.js +7 -6
  33. package/components/mui_extended/MenuItem/MenuItem.styles.js +55 -64
  34. package/components/mui_extended/MenuItem/constants.d.ts +4 -0
  35. package/components/mui_extended/MenuItem/constants.js +5 -1
  36. package/components/mui_extended/MenuItem/slots/MenuItemEnum.d.ts +1 -1
  37. package/components/mui_extended/MenuItem/slots/MenuItemEnum.js +1 -1
  38. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +3 -3
  39. package/components/mui_extended/MenuItem/types.d.ts +32 -11
  40. package/components/mui_extended/TextField/TextField.js +2 -1
  41. package/components/mui_extended/TextField/TextField.styles.js +26 -10
  42. package/components/mui_extended/TextField/constants.d.ts +3 -3
  43. package/components/mui_extended/TextField/constants.js +2 -2
  44. package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
  45. package/components/mui_extended/TextField/slots/TextFieldEnum.js +6 -6
  46. package/components/mui_extended/Typography/Typography.js +4 -3
  47. package/components/mui_extended/Typography/constants.d.ts +4 -0
  48. package/components/mui_extended/Typography/constants.js +5 -1
  49. package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
  50. package/index.js +1 -1
  51. package/package.json +1 -1
  52. package/utils/getHeightSizeStyles.js +1 -1
  53. package/components/formatters/PeriodFormatter/index.d.ts +0 -15
  54. package/components/formatters/PeriodFormatter/index.js +0 -60
  55. package/components/formatters/PeriodFormatter/index.test.d.ts +0 -4
@@ -18,8 +18,8 @@ const textFieldStyles = {
18
18
  // Estilos globales del TextField 🌎
19
19
  "& .MuiInputBase-root": {
20
20
  // Paddings
21
- paddingRight: theme.vars.size.baseSpacings.sp1,
22
21
  paddingLeft: theme.vars.size.baseSpacings.sp1,
22
+ paddingRight: 0,
23
23
  paddingTop: 0,
24
24
  paddingBottom: 0,
25
25
  // Estilo de los bordes
@@ -29,25 +29,30 @@ const textFieldStyles = {
29
29
  borderRadius: theme.vars.size.borderRadius.r1,
30
30
  // Altura
31
31
  height: "100%",
32
- // Estilos de cuando esta deshabilitado
33
- ...ownerState.disabled && {
34
- borderColor: `${theme.vars.palette.border.disabled}!important`
35
- // pointerEvents: ownerState.disabled ? 'none' : 'auto',
36
- },
32
+ // transición
33
+ transition: "all 0.2s ease",
34
+ // Espaciado entre elementos
37
35
  ...getHeightSizeStyles(
38
36
  theme.generalSettings.isMobile,
39
37
  ownerState.size || "medium",
40
- "action"
38
+ "action",
39
+ (height) => {
40
+ return {
41
+ height: "auto",
42
+ minHeight: height
43
+ };
44
+ }
41
45
  ),
42
46
  // ↴ Overrides ❌
43
47
  // Estilos del input
44
48
  "& > .MuiInputBase-input": {
45
49
  // ↴ Overrides ❌
46
- paddingTop: 0,
47
- paddingBottom: 0,
48
50
  paddingLeft: theme.vars.size.baseSpacings.sp1,
49
51
  paddingRight: theme.vars.size.baseSpacings.sp1,
52
+ paddingTop: 0,
53
+ paddingBottom: 0,
50
54
  fontFamily: theme.typography.fontFamily,
55
+ color: ownerState.disabled ? theme.vars.palette.text.disabled : theme.vars.palette.text.primary,
51
56
  ...getTypographyStyles(
52
57
  theme.generalSettings.isMobile,
53
58
  ownerState.size || "medium",
@@ -55,8 +60,16 @@ const textFieldStyles = {
55
60
  ),
56
61
  "&::placeholder": {
57
62
  color: theme.palette.text.disabled
63
+ },
64
+ "&:-webkit-autofill": {
65
+ backgroundColor: "transparent!important"
58
66
  }
59
67
  },
68
+ // Estilos de cuando esta deshabilitado
69
+ ...ownerState.disabled && {
70
+ borderColor: `${theme.vars.palette.border.disabled}!important`,
71
+ pointerEvents: ownerState.disabled ? "none" : "auto"
72
+ },
60
73
  // Estilos del los adorments
61
74
  "& .MuiInputAdornment-root": {
62
75
  height: "auto",
@@ -71,7 +84,10 @@ const textFieldStyles = {
71
84
  display: "none"
72
85
  },
73
86
  "& .MuiInputAdornment-root .M4LIcon-icon": {
74
- backgroundColor: ownerState.error ? ownerState.paletteColor?.enabled : theme.vars.palette.text.primary
87
+ backgroundColor: ownerState.error ? ownerState.paletteColor?.enabled : theme.vars.palette.text.primary,
88
+ ...ownerState.disabled && {
89
+ backgroundColor: theme.vars.palette.text.disabled
90
+ }
75
91
  },
76
92
  "&:hover": {
77
93
  backgroundColor: ownerState.paletteColor?.hoverOpacity,
@@ -1,8 +1,8 @@
1
- import { TexFieldVariants, TextFieldSlots } from './slots';
1
+ import { TexFieldComplementaryClasses, TextFieldSlots } from './slots';
2
2
  export declare const TEXT_FIELD_KEY_COMPONENT = "M4LTextField";
3
3
  export declare const COMBINATED_TEXTFIELD_ENUMS: {
4
- outlined: TexFieldVariants.outlined;
5
- text: TexFieldVariants.text;
4
+ outlined: TexFieldComplementaryClasses.outlined;
5
+ text: TexFieldComplementaryClasses.text;
6
6
  root: TextFieldSlots.root;
7
7
  skeleton: TextFieldSlots.skeleton;
8
8
  };
@@ -1,9 +1,9 @@
1
1
  import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
2
- import { T as TextFieldSlots, a as TexFieldVariants } from "./slots/TextFieldEnum.js";
2
+ import { T as TextFieldSlots, a as TexFieldComplementaryClasses } from "./slots/TextFieldEnum.js";
3
3
  const TEXT_FIELD_KEY_COMPONENT = "M4LTextField";
4
4
  const COMBINATED_TEXTFIELD_ENUMS = {
5
5
  ...TextFieldSlots,
6
- ...TexFieldVariants
6
+ ...TexFieldComplementaryClasses
7
7
  };
8
8
  const TEXT_FIELD_CLASSES = getComponentClasses(TEXT_FIELD_KEY_COMPONENT, COMBINATED_TEXTFIELD_ENUMS);
9
9
  export {
@@ -2,7 +2,7 @@ export declare enum TextFieldSlots {
2
2
  root = "root",
3
3
  skeleton = "skeleton"
4
4
  }
5
- export declare enum TexFieldVariants {
5
+ export declare enum TexFieldComplementaryClasses {
6
6
  outlined = "outlined",
7
7
  text = "text"
8
8
  }
@@ -3,12 +3,12 @@ var TextFieldSlots = /* @__PURE__ */ ((TextFieldSlots2) => {
3
3
  TextFieldSlots2["skeleton"] = "skeleton";
4
4
  return TextFieldSlots2;
5
5
  })(TextFieldSlots || {});
6
- var TexFieldVariants = /* @__PURE__ */ ((TexFieldVariants2) => {
7
- TexFieldVariants2["outlined"] = "outlined";
8
- TexFieldVariants2["text"] = "text";
9
- return TexFieldVariants2;
10
- })(TexFieldVariants || {});
6
+ var TexFieldComplementaryClasses = /* @__PURE__ */ ((TexFieldComplementaryClasses2) => {
7
+ TexFieldComplementaryClasses2["outlined"] = "outlined";
8
+ TexFieldComplementaryClasses2["text"] = "text";
9
+ return TexFieldComplementaryClasses2;
10
+ })(TexFieldComplementaryClasses || {});
11
11
  export {
12
12
  TextFieldSlots as T,
13
- TexFieldVariants as a
13
+ TexFieldComplementaryClasses as a
14
14
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import { useModuleSkeleton } from "@m4l/core";
4
- import { T as TYPOGRAPHY_CLASS_NAME_SPECIFY, a as TYPOGRAPHY_KEY_COMPONENT } from "./constants.js";
4
+ import { T as TYPOGRAPHY_CLASS_NAME_SPECIFY, a as TYPOGRAPHY_CLASSES, b as TYPOGRAPHY_KEY_COMPONENT } from "./constants.js";
5
5
  import { T as TypographySlots } from "./slots/typographyEnum.js";
6
6
  import { S as StyledMUITypography, a as StyledSkeleton } from "./slots/typographySlots.js";
7
7
  import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
@@ -30,7 +30,7 @@ function Typography(props) {
30
30
  return /* @__PURE__ */ jsx(
31
31
  StyledMUITypography,
32
32
  {
33
- className: clsx(className, TYPOGRAPHY_CLASS_NAME_SPECIFY),
33
+ className: clsx(className, TYPOGRAPHY_CLASS_NAME_SPECIFY, TYPOGRAPHY_CLASSES.root),
34
34
  variant,
35
35
  ownerState: { ...ownerState },
36
36
  ...getPropDataTestId(TYPOGRAPHY_KEY_COMPONENT, TypographySlots.root, dataTestid),
@@ -40,7 +40,8 @@ function Typography(props) {
40
40
  {
41
41
  width: index === skeletonRows - 1 ? skeletonWidth : "100%",
42
42
  variant: "text",
43
- ownerState: { ...ownerState }
43
+ ownerState: { ...ownerState },
44
+ className: TYPOGRAPHY_CLASSES.skeleton
44
45
  },
45
46
  index
46
47
  ))
@@ -7,3 +7,7 @@ export declare const TYPOGRAPHY_KEY_COMPONENT = "M4LTypography";
7
7
  * tener la necesidad de agregar valores en !important.
8
8
  */
9
9
  export declare const TYPOGRAPHY_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
10
+ /**
11
+ * Inventario de clases CSS para el componente Typography.
12
+ */
13
+ export declare const TYPOGRAPHY_CLASSES: Record<string, string>;
@@ -1,6 +1,10 @@
1
+ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
2
+ import { T as TypographySlots } from "./slots/typographyEnum.js";
1
3
  const TYPOGRAPHY_KEY_COMPONENT = "M4LTypography";
2
4
  const TYPOGRAPHY_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
5
+ const TYPOGRAPHY_CLASSES = getComponentClasses(TYPOGRAPHY_KEY_COMPONENT, TypographySlots);
3
6
  export {
4
7
  TYPOGRAPHY_CLASS_NAME_SPECIFY as T,
5
- TYPOGRAPHY_KEY_COMPONENT as a
8
+ TYPOGRAPHY_CLASSES as a,
9
+ TYPOGRAPHY_KEY_COMPONENT as b
6
10
  };
@@ -1,6 +1,6 @@
1
1
  import { Typography } from "@mui/material";
2
2
  import { styled } from "@mui/material/styles";
3
- import { a as TYPOGRAPHY_KEY_COMPONENT } from "../constants.js";
3
+ import { b as TYPOGRAPHY_KEY_COMPONENT } from "../constants.js";
4
4
  import { T as TypographySlots } from "./typographyEnum.js";
5
5
  import { t as typographyStyles } from "../typography.styles.js";
6
6
  import { S as Skeleton } from "../../Skeleton/Skeleton.js";
package/index.js CHANGED
@@ -46,7 +46,7 @@ import { D as D2, u as u4 } from "./components/formatters/DateFormatter/index.js
46
46
  import { U, g as g7 } from "./components/formatters/UncertaintyFormatter/index.js";
47
47
  import { P as P2, g as g8 } from "./components/formatters/PointsFormatter/index.js";
48
48
  import { C, g as g9 } from "./components/formatters/ConcatenatedFormatter/index.js";
49
- import { P as P3, u as u5 } from "./components/formatters/PeriodFormatter/index.js";
49
+ import { P as P3, u as u5 } from "./components/formatters/PeriodFormatter/PeriodFormatter.js";
50
50
  import { P as P4, g as g10 } from "./components/formatters/PriceFormatter/index.js";
51
51
  import { g as g11 } from "./components/formatters/DistanceToNowFormatter/dictionary.js";
52
52
  import { D as D3 } from "./components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.54",
3
+ "version": "9.1.56",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -2,7 +2,7 @@ import { POINTER_QR_MOBILE_SIZES, POINTER_QR_DESKTOP_SIZES } from "@m4l/styles";
2
2
  const getHeightSizeStyles = (isMobile, size, variantSize, css) => {
3
3
  const pointerQrSource = isMobile ? POINTER_QR_MOBILE_SIZES : POINTER_QR_DESKTOP_SIZES;
4
4
  const heightSize = pointerQrSource[size][variantSize];
5
- const resolvedCss = css;
5
+ const resolvedCss = typeof css === "function" ? css(heightSize) : css;
6
6
  return {
7
7
  height: heightSize,
8
8
  ...resolvedCss
@@ -1,15 +0,0 @@
1
- import { PeriodFormatterProps } from './types';
2
- /**
3
- * Muestra un periodo de tiempo en años, meses y días. Retorna un string
4
- * @param years Cantidad de años
5
- * @param months Cantidad de meses
6
- * @param days Cantidad de días
7
- * @returns string
8
- */
9
- export declare function useFormatPeriod(years: number, months: number, days: number): string;
10
- /**
11
- * Muestra un periodo de tiempo en años, meses y días. Retorna un JSX
12
- * @param props
13
- * @returns
14
- */
15
- export declare function PeriodFormatter(props: PeriodFormatterProps): JSX.Element;
@@ -1,60 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { W as WrapperComponent } from "../../WrapperComponent/index.js";
3
- import { d as dictionary } from "./dictionary.js";
4
- import { useModuleDictionary } from "@m4l/core";
5
- function useFormatPeriod(years, months, days) {
6
- const { getLabel } = useModuleDictionary();
7
- let period = "";
8
- const separator = ", ";
9
- switch (years) {
10
- case 0:
11
- break;
12
- case 1:
13
- period = "1 " + getLabel(dictionary.LABEL_YEAR);
14
- break;
15
- default:
16
- period = years.toString() + " " + getLabel(dictionary.LABEL_YEARS);
17
- }
18
- switch (months) {
19
- case 0:
20
- break;
21
- case 1:
22
- if (years > 0) {
23
- period += separator;
24
- }
25
- period += "1 " + getLabel(dictionary.LABEL_MONTH);
26
- break;
27
- default:
28
- if (years > 0) {
29
- period += separator;
30
- }
31
- period += months.toString() + " " + getLabel(dictionary.LABEL_MONTHS);
32
- }
33
- switch (days) {
34
- case 0:
35
- break;
36
- case 1:
37
- if (years > 0 || months > 0) {
38
- period += separator;
39
- }
40
- period += "1 " + getLabel(dictionary.LABEL_DAY);
41
- break;
42
- default:
43
- if (years > 0 || months > 0) {
44
- period += separator;
45
- }
46
- period += days.toString() + " " + getLabel(dictionary.LABEL_DAYS);
47
- }
48
- if (period === "") {
49
- period = "-";
50
- }
51
- return period;
52
- }
53
- function PeriodFormatter(props) {
54
- const { years = 0, months = 0, days = 0, Component = WrapperComponent } = props;
55
- return /* @__PURE__ */ jsx(Component, { children: useFormatPeriod(years, months, days) });
56
- }
57
- export {
58
- PeriodFormatter as P,
59
- useFormatPeriod as u
60
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- export {};