@m4l/components 9.1.67 → 9.1.68

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.
@@ -7,7 +7,7 @@ import { MenuItemProps } from './types';
7
7
  * @returns
8
8
  * @author Bruce Escobar - automatic
9
9
  * @createdAt 2024-10-22 19:53:39 - automatic
10
- * @updatedAt 2025-01-08 10:36:41 - automatic
11
- * @updatedUser Andrés Quintero - automatic
10
+ * @updatedAt 2025-01-14 11:50:41 - automatic
11
+ * @updatedUser cesar - automatic
12
12
  */
13
13
  export declare const MenuItem: (props: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
2
+ import { useModuleSkeleton, useEnvironment, getPropertyByString } from "@m4l/core";
3
3
  import { useTheme } from "@mui/material";
4
4
  import clsx from "clsx";
5
5
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
@@ -18,12 +18,14 @@ const MenuItem = (props) => {
18
18
  disabled = false,
19
19
  size = "medium",
20
20
  checked = false,
21
+ checkable = false,
21
22
  className,
22
23
  ...other
23
24
  } = props;
24
25
  const { currentSize } = useComponentSize(size);
25
26
  const isSkeleton = useModuleSkeleton();
26
27
  const theme = useTheme();
28
+ const { host_static_assets, environment_assets } = useEnvironment();
27
29
  const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
28
30
  const paletteColor = getPropertyByString(
29
31
  theme.vars.palette,
@@ -35,7 +37,9 @@ const MenuItem = (props) => {
35
37
  disabled,
36
38
  selected,
37
39
  paletteColor,
38
- color
40
+ color,
41
+ checkable,
42
+ checked
39
43
  };
40
44
  if (isSkeleton) {
41
45
  return /* @__PURE__ */ jsx(
@@ -69,8 +73,7 @@ const MenuItem = (props) => {
69
73
  );
70
74
  }
71
75
  };
72
- const checkedIcon = "https://s3.us-east-1.amazonaws.com/static.made4labs/environments/d1/frontend/components/menu_item/checked.svg";
73
- const hasCheckedIcon = checked && checkedIcon;
76
+ const checkedIcon = `${host_static_assets}/${environment_assets}/frontend/components/menu_item/checked.svg`;
74
77
  return /* @__PURE__ */ jsxs(
75
78
  MenuItemRootStyled,
76
79
  {
@@ -83,7 +86,7 @@ const MenuItem = (props) => {
83
86
  className: clsx(className, MENUITEM_CLASSES.root),
84
87
  "data-testid": "MenuItemRoot",
85
88
  children: [
86
- hasCheckedIcon && /* @__PURE__ */ jsx(
89
+ checkable && /* @__PURE__ */ jsx(
87
90
  MenuItemIconCheckedStyled,
88
91
  {
89
92
  src: checkedIcon,
@@ -2,6 +2,7 @@ import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js"
2
2
  const menuItemStyles = {
3
3
  /**
4
4
  * Estilos para el contenedor de los items del menú
5
+ * <<<<<<< HEAD
5
6
  * @updatedUser Andrés Quintero - automatic
6
7
  * @updatedAt 2025-01-08 10:36:41 - automatic
7
8
  * @createdAt 2025-01-08 10:36:40 - automatic
@@ -20,6 +21,22 @@ const menuItemStyles = {
20
21
  * @author Andrés Quintero - automatic
21
22
  * @updatedUser Andrés Quintero - automatic
22
23
  * @updatedAt 2025-01-08 10:36:41 - automatic
24
+ * =======
25
+ * @updatedUser cesar - automatic
26
+ * @updatedAt 2025-01-10 16:51:28 - automatic
27
+ * @createdAt 2025-01-10 16:51:28 - automatic
28
+ * @author cesar - automatic
29
+ * @updatedUser cesar - automatic
30
+ * @updatedAt 2025-01-10 16:51:28 - automatic
31
+ * @createdAt 2024-12-31 11:23:51 - automatic
32
+ * @author Andrés Quintero - automatic
33
+ * @updatedUser cesar - automatic
34
+ * @updatedAt 2025-01-10 16:51:28 - automatic
35
+ * @createdAt 2024-12-30 14:36:06 - automatic
36
+ * @author Andrés Quintero - automatic
37
+ * @updatedUser cesar - automatic
38
+ * @updatedAt 2025-01-10 16:51:28 - automatic
39
+ * >>>>>>> c15c4888 (Add checkable prop to MenuItem and update checked icon visibility logic)
23
40
  * @createdAt 2024-12-27 08:28:33 - automatic
24
41
  * @author Andrés Quintero - automatic
25
42
  */
@@ -107,8 +124,8 @@ const menuItemStyles = {
107
124
  * Estilos para el icono de los items del menú
108
125
  * @author SebastianM - automatic
109
126
  * @createdAt 2024-12-02 19:12:14 - automatic
110
- * @updatedAt 2025-01-08 10:36:41 - automatic
111
- * @updatedUser Andrés Quintero - automatic
127
+ * @updatedAt 2025-01-10 16:51:28 - automatic
128
+ * @updatedUser cesar - automatic
112
129
  */
113
130
  menuItemIcon: () => ({
114
131
  "&.MenuItemEndIcon-root": {
@@ -119,22 +136,24 @@ const menuItemStyles = {
119
136
  * Estilos para el icono de los items del menú cuando están seleccionados
120
137
  * @author SebastianM - automatic
121
138
  * @createdAt 2024-12-13 12:45:48 - automatic
122
- * @updatedAt 2025-01-08 10:36:41 - automatic
123
- * @updatedUser Andrés Quintero - automatic
139
+ * @updatedAt 2025-01-10 16:51:28 - automatic
140
+ * @updatedUser cesar - automatic
124
141
  */
125
142
  menuItemIconChecked: ({ ownerState }) => ({
143
+ visibility: ownerState.checkable ? ownerState.checked ? "visible" : "hidden" : "hidden",
126
144
  ...ownerState.selected && {
127
145
  "& .M4LIcon-icon": {
128
146
  backgroundColor: ownerState.paletteColor?.main
129
147
  }
130
- }
148
+ },
149
+ variants: []
131
150
  }),
132
151
  /**
133
152
  * Estilos para la tipografía del menú item
134
153
  * @author SebastianM - automatic
135
154
  * @createdAt 2024-12-13 12:45:48 - automatic
136
- * @updatedAt 2025-01-08 10:36:41 - automatic
137
- * @updatedUser Andrés Quintero - automatic
155
+ * @updatedAt 2025-01-10 16:51:28 - automatic
156
+ * @updatedUser cesar - automatic
138
157
  */
139
158
  menuItemTypography: () => ({}),
140
159
  /**
@@ -150,8 +169,8 @@ const menuItemStyles = {
150
169
  * Estilos para el contenedor de los items del menú en skeleton
151
170
  * @author Bruce Escobar - automatic
152
171
  * @createdAt 2024-10-22 10:38:00 - automatic
153
- * @updatedAt 2025-01-08 10:36:41 - automatic
154
- * @updatedUser Andrés Quintero - automatic
172
+ * @updatedAt 2025-01-10 16:51:28 - automatic
173
+ * @updatedUser cesar - automatic
155
174
  */
156
175
  skeletonMenuItem: ({ theme, ownerState }) => ({
157
176
  width: "100%",
@@ -48,13 +48,17 @@ export interface MenuItemProps extends Omit<MUIMenuItemProps, 'size' | 'color'>
48
48
  * Define si el ícono de check está activo
49
49
  */
50
50
  checked?: boolean;
51
+ /**
52
+ * indica si debe aparecer el icono de check
53
+ */
54
+ checkable?: boolean;
51
55
  }
52
56
  /**
53
57
  * Estado del propietario del `MenuItem` utilizado para definir propiedades internas de estilo y comportamiento.
54
58
  * Pick<MenuItemProps, 'size' | 'componentPaletteColor' | 'disabled' | 'selected'>
55
59
  * paletteColor - Define el color de la paleta aplicada al `MenuItem`.
56
60
  */
57
- export interface MenuItemOwnerState extends Pick<MenuItemProps, 'size' | 'componentPaletteColor' | 'disabled' | 'selected' | 'color'> {
61
+ export interface MenuItemOwnerState extends Pick<MenuItemProps, 'checked' | 'checkable' | 'size' | 'componentPaletteColor' | 'disabled' | 'selected' | 'color'> {
58
62
  paletteColor: PaletteColor;
59
63
  }
60
64
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.67",
3
+ "version": "9.1.68",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"