@m4l/components 9.2.60-19062025.beta.1 → 9.2.60-24062025.beta.1
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/components/Chip/Chip.js +9 -10
- package/components/Chip/ChipStyles.js +13 -2
- package/components/Chip/constants.d.ts +9 -0
- package/components/Chip/constants.js +6 -2
- package/components/Chip/slots/ChipEnum.d.ts +3 -0
- package/components/Chip/slots/ChipEnum.js +6 -1
- package/components/Chip/slots/ChipSlots.js +1 -1
- package/components/DataGrid/Datagrid.styles.js +3 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +2 -2
- package/components/DynamicSort/DynamicSort.styles.js +2 -2
- package/components/hook-form/RHFTextField/RHFTextField.js +1 -0
- package/components/mui_extended/Button/Button.js +3 -1
- package/components/mui_extended/Button/ButtonStyles.js +6 -1
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/NavLink/NavLink.js +3 -1
- package/components/mui_extended/NavLink/NavLink.styles.js +2 -1
- package/components/mui_extended/NavLink/types.d.ts +3 -1
- package/components/mui_extended/TextField/TextField.styles.js +3 -3
- package/package.json +3 -3
package/components/Chip/Chip.js
CHANGED
|
@@ -28,16 +28,14 @@ const Chip = forwardRef((props, ref) => {
|
|
|
28
28
|
const { currentSize } = useComponentSize(size);
|
|
29
29
|
const isSkeleton = useModuleSkeleton();
|
|
30
30
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
31
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
32
31
|
const ownerState = useMemo(() => ({
|
|
33
32
|
interactive: !!onClick,
|
|
34
|
-
size:
|
|
35
|
-
chipSize: adjustedSize,
|
|
33
|
+
size: currentSize,
|
|
36
34
|
variant,
|
|
37
35
|
color,
|
|
38
36
|
opacity,
|
|
39
37
|
externalColor
|
|
40
|
-
}), [
|
|
38
|
+
}), [currentSize, variant, color, opacity, externalColor, onClick]);
|
|
41
39
|
const renderIcon = useMemo(() => (icon, instaceDataTestId) => {
|
|
42
40
|
if (!icon) {
|
|
43
41
|
return null;
|
|
@@ -50,12 +48,12 @@ const Chip = forwardRef((props, ref) => {
|
|
|
50
48
|
{
|
|
51
49
|
ownerState: { ...ownerState },
|
|
52
50
|
src: icon,
|
|
53
|
-
size:
|
|
51
|
+
size: currentSize,
|
|
54
52
|
instaceDataTestId
|
|
55
53
|
}
|
|
56
54
|
);
|
|
57
55
|
}
|
|
58
|
-
}, [ownerState,
|
|
56
|
+
}, [ownerState, currentSize]);
|
|
59
57
|
if (isSkeleton) {
|
|
60
58
|
return /* @__PURE__ */ jsx(
|
|
61
59
|
SkeletonChipStyled,
|
|
@@ -75,7 +73,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
75
73
|
ChipRootStyled,
|
|
76
74
|
{
|
|
77
75
|
role: "button-chip",
|
|
78
|
-
size:
|
|
76
|
+
size: currentSize,
|
|
79
77
|
onClick,
|
|
80
78
|
ownerState: { ...ownerState },
|
|
81
79
|
className: clsx(className, CHIP_CLASSES.root),
|
|
@@ -85,17 +83,18 @@ const Chip = forwardRef((props, ref) => {
|
|
|
85
83
|
...others,
|
|
86
84
|
children: [
|
|
87
85
|
renderIcon(startIcon, "ChipStartIcon"),
|
|
88
|
-
/* @__PURE__ */ jsx(TextChipStyled, { size:
|
|
86
|
+
/* @__PURE__ */ jsx(TextChipStyled, { size: currentSize, ownerState: { ...ownerState }, color, children: label }),
|
|
89
87
|
renderIcon(endIcon, "ChipEndIcon"),
|
|
90
88
|
onDeleted && /* @__PURE__ */ jsx(
|
|
91
89
|
IconButtonStyled,
|
|
92
90
|
{
|
|
93
91
|
...iconButtonProps,
|
|
94
92
|
src: iconClose,
|
|
95
|
-
size:
|
|
93
|
+
size: currentSize,
|
|
96
94
|
ownerState: { ...ownerState },
|
|
97
95
|
onClick: handleDelete,
|
|
98
|
-
disabled: disabledDeleteButton
|
|
96
|
+
disabled: disabledDeleteButton,
|
|
97
|
+
className: CHIP_CLASSES.closeIcon
|
|
99
98
|
}
|
|
100
99
|
)
|
|
101
100
|
]
|
|
@@ -43,8 +43,8 @@ const chipStyles = {
|
|
|
43
43
|
display: "flex",
|
|
44
44
|
alignItems: "center",
|
|
45
45
|
padding: theme.vars.size.baseSpacings.sp1,
|
|
46
|
-
paddingRight: 0,
|
|
47
46
|
borderRadius: theme.vars.size.borderRadius["r0-5"],
|
|
47
|
+
gap: theme.vars.size.baseSpacings["sp0-5"],
|
|
48
48
|
width: "max-content",
|
|
49
49
|
cursor: "pointer",
|
|
50
50
|
color,
|
|
@@ -72,6 +72,17 @@ const chipStyles = {
|
|
|
72
72
|
border: `${theme.vars.size.borderStroke.container}`,
|
|
73
73
|
borderColor: bgColor
|
|
74
74
|
},
|
|
75
|
+
"&&& .M4LChip-closeIcon": {
|
|
76
|
+
...getSizeStyles(
|
|
77
|
+
theme,
|
|
78
|
+
ownerState?.size || "medium",
|
|
79
|
+
"base",
|
|
80
|
+
(size) => ({
|
|
81
|
+
height: size,
|
|
82
|
+
width: size
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
},
|
|
75
86
|
variants: []
|
|
76
87
|
};
|
|
77
88
|
},
|
|
@@ -81,7 +92,7 @@ const chipStyles = {
|
|
|
81
92
|
textChip: ({ theme }) => ({
|
|
82
93
|
whiteSpace: "nowrap",
|
|
83
94
|
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
84
|
-
paddingRight: theme.vars.size.baseSpacings.
|
|
95
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
85
96
|
}),
|
|
86
97
|
/**
|
|
87
98
|
* Styles for the chip icon element.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChipSlots, ChipComplementaryClasses } from './slots/ChipEnum';
|
|
1
2
|
/**
|
|
2
3
|
* Clave de identificación del componente Chip dentro del sistema.
|
|
3
4
|
*
|
|
@@ -6,6 +7,14 @@
|
|
|
6
7
|
* @default 'M4LChip'
|
|
7
8
|
*/
|
|
8
9
|
export declare const CHIP_KEY_COMPONENT = "M4LChip";
|
|
10
|
+
export declare const COMBINED_CHIP_ENUMS: {
|
|
11
|
+
closeIcon: ChipComplementaryClasses.closeIcon;
|
|
12
|
+
root: ChipSlots.root;
|
|
13
|
+
skeletonChip: ChipSlots.skeletonChip;
|
|
14
|
+
chipIcon: ChipSlots.chipIcon;
|
|
15
|
+
textChip: ChipSlots.textChip;
|
|
16
|
+
iconButton: ChipSlots.iconButton;
|
|
17
|
+
};
|
|
9
18
|
/**
|
|
10
19
|
* Inventario de clases CSS para el componente Chip
|
|
11
20
|
*/
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
-
import { C as ChipSlots } from "./slots/ChipEnum.js";
|
|
2
|
+
import { C as ChipComplementaryClasses, a as ChipSlots } from "./slots/ChipEnum.js";
|
|
3
3
|
const CHIP_KEY_COMPONENT = "M4LChip";
|
|
4
|
-
const
|
|
4
|
+
const COMBINED_CHIP_ENUMS = {
|
|
5
|
+
...ChipSlots,
|
|
6
|
+
...ChipComplementaryClasses
|
|
7
|
+
};
|
|
8
|
+
const CHIP_CLASSES = getComponentClasses(CHIP_KEY_COMPONENT, COMBINED_CHIP_ENUMS);
|
|
5
9
|
export {
|
|
6
10
|
CHIP_CLASSES as C,
|
|
7
11
|
CHIP_KEY_COMPONENT as a
|
|
@@ -6,6 +6,11 @@ var ChipSlots = /* @__PURE__ */ ((ChipSlots2) => {
|
|
|
6
6
|
ChipSlots2["iconButton"] = "iconButton";
|
|
7
7
|
return ChipSlots2;
|
|
8
8
|
})(ChipSlots || {});
|
|
9
|
+
var ChipComplementaryClasses = /* @__PURE__ */ ((ChipComplementaryClasses2) => {
|
|
10
|
+
ChipComplementaryClasses2["closeIcon"] = "closeIcon";
|
|
11
|
+
return ChipComplementaryClasses2;
|
|
12
|
+
})(ChipComplementaryClasses || {});
|
|
9
13
|
export {
|
|
10
|
-
|
|
14
|
+
ChipComplementaryClasses as C,
|
|
15
|
+
ChipSlots as a
|
|
11
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { c as chipStyles } from "../ChipStyles.js";
|
|
3
3
|
import { a as CHIP_KEY_COMPONENT } from "../constants.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as ChipSlots } from "./ChipEnum.js";
|
|
5
5
|
import { S as Skeleton } from "../../mui_extended/Skeleton/Skeleton.js";
|
|
6
6
|
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
7
7
|
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
@@ -68,6 +68,9 @@ const dataGridStyles = {
|
|
|
68
68
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
69
69
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
70
70
|
height: "fit-content",
|
|
71
|
+
...theme.generalSettings.isMobile && {
|
|
72
|
+
minHeight: theme.vars.size.baseSpacings.sp10
|
|
73
|
+
},
|
|
71
74
|
"& .mobile-menu-actions": {
|
|
72
75
|
marginRight: "auto"
|
|
73
76
|
}
|
|
@@ -33,7 +33,7 @@ const dynamicFilterStyles = {
|
|
|
33
33
|
height: "fit-content",
|
|
34
34
|
borderRadius: theme.vars.size.borderRadius.r2,
|
|
35
35
|
background: theme.vars.palette.background.default,
|
|
36
|
-
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1px ${theme.vars.palette.border.
|
|
36
|
+
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1px ${theme.vars.palette.border.default}` : `inset 0px 0px 0px 1px ${theme.vars.palette.error.enabled}`,
|
|
37
37
|
overflow: "hidden",
|
|
38
38
|
'&:has([aria-expanded="true"])': {
|
|
39
39
|
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1.3px ${theme.vars.palette.border.main}` : `inset 0px 0px 0px 1px ${theme.vars.palette.error.enabled}`
|
|
@@ -173,7 +173,7 @@ const dynamicFilterStyles = {
|
|
|
173
173
|
alignItems: "center",
|
|
174
174
|
borderTopRightRadius: theme.vars.size.borderRadius.r1,
|
|
175
175
|
borderBottomRightRadius: theme.vars.size.borderRadius.r1,
|
|
176
|
-
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.border.
|
|
176
|
+
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.border.default}`,
|
|
177
177
|
...!ownerState?.visibleRefresh && !ownerState?.isDirty && {
|
|
178
178
|
display: "none"
|
|
179
179
|
},
|
|
@@ -33,7 +33,7 @@ const dynamicSortStyles = {
|
|
|
33
33
|
height: "fit-content",
|
|
34
34
|
borderRadius: theme.vars.size.borderRadius.r2,
|
|
35
35
|
background: theme.vars.palette.background.default,
|
|
36
|
-
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1px ${theme.vars.palette.border.
|
|
36
|
+
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1px ${theme.vars.palette.border.default}` : `inset 0px 0px 0px 1px ${theme.vars.palette.error.enabled}`,
|
|
37
37
|
overflow: "hidden",
|
|
38
38
|
'&:has([aria-expanded="true"])': {
|
|
39
39
|
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1.3px ${theme.vars.palette.border.main}` : `inset 0px 0px 0px 1px ${theme.vars.palette.error.enabled}`
|
|
@@ -172,7 +172,7 @@ const dynamicSortStyles = {
|
|
|
172
172
|
alignItems: "center",
|
|
173
173
|
borderTopRightRadius: theme.vars.size.borderRadius.r1,
|
|
174
174
|
borderBottomRightRadius: theme.vars.size.borderRadius.r1,
|
|
175
|
-
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.border.
|
|
175
|
+
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.border.default}`,
|
|
176
176
|
...!ownerState?.visibleRefresh && !ownerState?.isDirty && {
|
|
177
177
|
display: "none"
|
|
178
178
|
},
|
|
@@ -87,6 +87,7 @@ const RHFTextField = forwardRef((props, ref) => {
|
|
|
87
87
|
InputLabelProps: { shrink: true },
|
|
88
88
|
autoComplete,
|
|
89
89
|
onChange: onInternalChange,
|
|
90
|
+
variant,
|
|
90
91
|
value: type === "number" ? isNaN(parseFloat(value)) ? "" : value : value || "",
|
|
91
92
|
fullWidth: true,
|
|
92
93
|
error: !!error,
|
|
@@ -16,6 +16,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
16
16
|
size,
|
|
17
17
|
variant = "contained",
|
|
18
18
|
skeletonWidth = "15%",
|
|
19
|
+
fullWidth = false,
|
|
19
20
|
...others
|
|
20
21
|
} = props;
|
|
21
22
|
const { currentSize } = useComponentSize(size);
|
|
@@ -31,7 +32,8 @@ const Button = forwardRef((props, ref) => {
|
|
|
31
32
|
variant,
|
|
32
33
|
disabled,
|
|
33
34
|
paletteColor,
|
|
34
|
-
color
|
|
35
|
+
color,
|
|
36
|
+
fullWidth
|
|
35
37
|
};
|
|
36
38
|
if (isSkeleton) {
|
|
37
39
|
return /* @__PURE__ */ jsx(SkeletonButtonStyled, { "data-testid": "SkeletonButton", width: skeletonWidth, ownerState: { ...ownerState } });
|
|
@@ -21,7 +21,7 @@ export interface ButtonProps extends Omit<MUIButtonProps, 'size' | 'variant' | '
|
|
|
21
21
|
/**
|
|
22
22
|
* Owner state of the `Button` used to define internal style and behavior properties.
|
|
23
23
|
*/
|
|
24
|
-
export interface ButtonOwnerState extends Pick<ButtonProps, 'size' | 'variant' | 'color' | 'disabled'> {
|
|
24
|
+
export interface ButtonOwnerState extends Pick<ButtonProps, 'size' | 'variant' | 'color' | 'disabled' | 'fullWidth'> {
|
|
25
25
|
disabled?: boolean;
|
|
26
26
|
paletteColor: PaletteColor;
|
|
27
27
|
}
|
|
@@ -15,6 +15,7 @@ const NavLink = (props) => {
|
|
|
15
15
|
skeletonWidth,
|
|
16
16
|
color,
|
|
17
17
|
dataTestId,
|
|
18
|
+
whiteSpace = false,
|
|
18
19
|
...others
|
|
19
20
|
} = props;
|
|
20
21
|
const isSkeleton = useModuleSkeleton();
|
|
@@ -22,7 +23,8 @@ const NavLink = (props) => {
|
|
|
22
23
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
23
24
|
const ownerState = {
|
|
24
25
|
disabled,
|
|
25
|
-
size
|
|
26
|
+
size,
|
|
27
|
+
whiteSpace
|
|
26
28
|
};
|
|
27
29
|
return /* @__PURE__ */ jsx(
|
|
28
30
|
RouterNavLinkRootStyled,
|
|
@@ -22,9 +22,11 @@ export interface NavLinkProps extends RouterNavLinkProps, Pick<TypographyProps,
|
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
/** Estilos personalizados para el componente. */
|
|
24
24
|
dataTestId?: string;
|
|
25
|
+
/** Define el white space del texto. Por defecto es 'normal'. */
|
|
26
|
+
whiteSpace?: boolean;
|
|
25
27
|
}
|
|
26
28
|
/** Estado del propietario del NavLink.*/
|
|
27
|
-
export type NavLinkOwnerState = Pick<NavLinkProps, 'color'> & {
|
|
29
|
+
export type NavLinkOwnerState = Pick<NavLinkProps, 'color' | 'whiteSpace'> & {
|
|
28
30
|
/** Indica si el NavLink está deshabilitado. */
|
|
29
31
|
disabled?: boolean;
|
|
30
32
|
/** Define el tamaño de la etiqueta. Puede ser 'small' o 'medium'. Por defecto es 'medium'.*/
|
|
@@ -92,7 +92,7 @@ const textFieldStyles = {
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"&:not(.M4LTextField-readOnly ) .MuiInputBase-root:hover": {
|
|
95
|
-
backgroundColor:
|
|
95
|
+
backgroundColor: theme.vars.palette.default.hoverOpacity,
|
|
96
96
|
...ownerState?.error && {
|
|
97
97
|
borderColor: `${ownerState?.paletteColor?.hover}!important`,
|
|
98
98
|
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
@@ -127,13 +127,13 @@ const textFieldStyles = {
|
|
|
127
127
|
...ownerState?.variant === "contained" && {
|
|
128
128
|
[`&.${TEXT_FIELD_CLASSES.contained} .MuiInputBase-root`]: {
|
|
129
129
|
border: "none",
|
|
130
|
-
backgroundColor: ownerState?.readOnly ? theme.vars.palette.background.neutral : theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "
|
|
130
|
+
backgroundColor: ownerState?.readOnly ? theme.vars.palette.background.neutral : theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "enabledOpacity"]
|
|
131
131
|
},
|
|
132
132
|
...ownerState?.error && !ownerState?.readOnly && {
|
|
133
133
|
border: theme.vars.size.borderStroke.actionInput,
|
|
134
134
|
borderColor: `${ownerState?.paletteColor?.enabled}!important`
|
|
135
135
|
},
|
|
136
|
-
"&:not(.M4LTextField-readOnly
|
|
136
|
+
"&:not(.M4LTextField-readOnly) .MuiInputBase-root:focus-within": {
|
|
137
137
|
border: theme.vars.size.borderStroke.actionInput,
|
|
138
138
|
borderColor: `${ownerState?.paletteColor?.enabled}!important`
|
|
139
139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.2.60-
|
|
3
|
+
"version": "9.2.60-24062025.beta.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "M4L Components",
|
|
6
6
|
"lint-staged": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@googlemaps/js-api-loader": "^1.16.6",
|
|
12
12
|
"@hookform/resolvers": "2.9.11",
|
|
13
13
|
"@m4l/core": "^2.0.0",
|
|
14
|
-
"@m4l/graphics": "7.1.2-
|
|
15
|
-
"@m4l/styles": "7.1.29-
|
|
14
|
+
"@m4l/graphics": "7.1.2-24062025.beta.1",
|
|
15
|
+
"@m4l/styles": "7.1.29-24062025.beta.1",
|
|
16
16
|
"@microlink/react-json-view": "^1.23.3",
|
|
17
17
|
"@mui/lab": "5.0.0-alpha.173",
|
|
18
18
|
"@mui/material": "5.16.7",
|