@m4l/components 9.3.15-BE091725-beta.1 → 9.3.15-BE091725-beta.3

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 (40) hide show
  1. package/components/Card/Card.js +2 -2
  2. package/components/Card/Card.styles.js +39 -43
  3. package/components/Card/constants.js +7 -1
  4. package/components/Card/helpers/getSizeSpacing.d.ts +3 -4
  5. package/components/Card/helpers/getSizeSpacing.js +5 -5
  6. package/components/Card/slots/CardSlots.js +1 -1
  7. package/components/Card/types.d.ts +3 -5
  8. package/components/areas/icons.js +1 -1
  9. package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +3 -35
  10. package/components/hook-form/RHFAutocomplete/types.d.ts +1 -6
  11. package/components/index.d.ts +1 -1
  12. package/components/mui_extended/Autocomplete/Autocomplete.js +12 -6
  13. package/components/mui_extended/Autocomplete/Autocomplete.styles.js +48 -5
  14. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +1 -0
  15. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +4 -3
  16. package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +4 -4
  17. package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +39 -4
  18. package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.d.ts +3 -1
  19. package/components/mui_extended/Autocomplete/slots/AutocompleteEnum.js +2 -0
  20. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +6 -0
  21. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +11 -1
  22. package/components/mui_extended/Autocomplete/types.d.ts +1 -1
  23. package/components/mui_extended/Button/ButtonStyles.js +3 -6
  24. package/components/mui_extended/Popper/Popper.js +9 -2
  25. package/components/mui_extended/Popper/types.d.ts +1 -0
  26. package/components/mui_extended/Select/Select.js +17 -10
  27. package/components/mui_extended/Select/Select.styles.js +17 -10
  28. package/components/mui_extended/Select/types.d.ts +1 -1
  29. package/components/mui_extended/TextField/TextField.d.ts +2 -1
  30. package/components/mui_extended/TextField/TextField.js +25 -4
  31. package/components/mui_extended/TextField/TextField.styles.js +132 -125
  32. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +3 -9
  33. package/components/mui_extended/TextField/slots/TextFieldSlots.js +2 -1
  34. package/components/mui_extended/Typography/Typography.js +2 -4
  35. package/components/mui_extended/Typography/constants.d.ts +0 -4
  36. package/components/mui_extended/Typography/types.d.ts +0 -6
  37. package/components/mui_extended/Typography/typography.styles.js +0 -1
  38. package/index.js +4 -4
  39. package/package.json +1 -1
  40. package/test/mocks/dictionary-mock.d.ts +433 -0
@@ -8,14 +8,14 @@ const buttonStyles = {
8
8
  flexWrap: "nowrap",
9
9
  alignItems: "center",
10
10
  gap: theme.vars.size.baseSpacings.sp1,
11
- padding: `0px ${theme.vars.size.baseSpacings.sp1}`,
11
+ padding: `0px ${theme.vars.size.baseSpacings.sp2}`,
12
12
  boxShadow: "none",
13
- borderRadius: theme.vars.size.borderRadius.r1,
13
+ borderRadius: theme.vars.size.borderRadius["r1-5"],
14
14
  maxWidth: "200px",
15
15
  minWidth: "0",
16
16
  flexShrink: 0,
17
17
  "&:hover": {
18
- backgroundColor: ownerState?.paletteColor?.hoverOpacity,
18
+ backgroundColor: ownerState?.color === "default" ? ownerState?.paletteColor?.hover : ownerState?.paletteColor?.hoverOpacity,
19
19
  borderColor: ownerState?.paletteColor?.hover
20
20
  },
21
21
  "&:active": {
@@ -25,9 +25,6 @@ const buttonStyles = {
25
25
  },
26
26
  "&:focus-visible": {
27
27
  boxShadow: "none",
28
- outline: theme.vars.size.borderStroke.container,
29
- outlineColor: theme.vars.palette.border.main,
30
- outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
31
28
  backgroundColor: ownerState?.paletteColor?.activeOpacity
32
29
  },
33
30
  "&:disabled": {
@@ -25,7 +25,8 @@ const Popper = forwardRef((props, ref) => {
25
25
  const ownerState = {
26
26
  paletteColor,
27
27
  popperColor: color,
28
- arrow
28
+ arrow,
29
+ variant
29
30
  };
30
31
  return /* @__PURE__ */ jsx(
31
32
  PopperRootStyled,
@@ -34,12 +35,18 @@ const Popper = forwardRef((props, ref) => {
34
35
  placement: props.placement || initialPlacement,
35
36
  "data-testid": "popper-root",
36
37
  className: getComponentSlotRoot("M4LPopperClass"),
37
- variant,
38
38
  ownerState: { ...ownerState },
39
39
  anchorEl,
40
40
  color,
41
41
  ref,
42
42
  modifiers: [
43
+ {
44
+ name: "preventOverflow",
45
+ options: {
46
+ boundary: "viewport",
47
+ padding: 8
48
+ }
49
+ },
43
50
  {
44
51
  name: "flip",
45
52
  options: {
@@ -23,6 +23,7 @@ export interface PopperOwnerState extends Pick<PopperProps, 'placement'> {
23
23
  popperColor: PopperProps['color'];
24
24
  arrow: boolean;
25
25
  paletteColor: PaletteColor;
26
+ variant: PopperProps['variant'];
26
27
  }
27
28
  /**
28
29
  * Defines the types of Slots available for the `Popper`.
@@ -32,14 +32,15 @@ const Select = forwardRef(
32
32
  const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
33
33
  const arrowDropDownIcon = `${host_static_assets}/${environment_assets}/${ICON_ARROW_DOWN}`;
34
34
  const selectedValue = useMemo(() => value, [value]);
35
- const [open, setOpen] = useState(false);
35
+ const [openLocal, setOpenLocal] = useState(false);
36
36
  const theme = useTheme();
37
37
  const ownerState = useMemo(() => ({
38
38
  size: adjustedSize,
39
39
  disabled,
40
40
  error,
41
- variant
42
- }), [adjustedSize, disabled, error, variant]);
41
+ variant,
42
+ multiple
43
+ }), [adjustedSize, disabled, error, variant, multiple]);
43
44
  const handleLocalChange = useCallback((event) => {
44
45
  const newValue = event.target.value;
45
46
  if (!onChange) {
@@ -72,12 +73,12 @@ const Select = forwardRef(
72
73
  disabled,
73
74
  size: adjustedSize,
74
75
  onClick: () => {
75
- !disabled && setOpen(!open);
76
+ !disabled && setOpenLocal(!openLocal);
76
77
  },
77
- rotationAngle: open ? 180 : 0
78
+ rotationAngle: openLocal ? 180 : 0
78
79
  }
79
80
  );
80
- }, [ownerState, arrowDropDownIcon, disabled, adjustedSize, open]);
81
+ }, [ownerState, arrowDropDownIcon, disabled, adjustedSize, openLocal]);
81
82
  const RenderIcon = useCallback((icon) => {
82
83
  if (!icon) {
83
84
  return null;
@@ -139,10 +140,10 @@ const Select = forwardRef(
139
140
  }
140
141
  };
141
142
  const onOpen = useCallback(() => {
142
- setOpen(true);
143
+ setOpenLocal(true);
143
144
  }, []);
144
145
  const onClose = useCallback(() => {
145
- setOpen(false);
146
+ setOpenLocal(false);
146
147
  }, []);
147
148
  const StyledSelect = useMemo(() => SelectRootStyled(), []);
148
149
  if (isSkeleton) {
@@ -164,12 +165,13 @@ const Select = forwardRef(
164
165
  disabled,
165
166
  error,
166
167
  renderValue,
167
- open,
168
+ open: openLocal,
168
169
  native: false,
169
170
  onOpen,
170
171
  onClose,
171
172
  displayEmpty: true,
172
173
  MenuProps: {
174
+ disableScrollLock: true,
173
175
  sx: {
174
176
  "& .MuiPaper-root": {
175
177
  paddingTop: theme.vars.size.baseSpacings.sp3,
@@ -177,11 +179,16 @@ const Select = forwardRef(
177
179
  paddingLeft: 0,
178
180
  paddingRight: 0,
179
181
  maxHeight: "200px",
182
+ overflow: "auto",
180
183
  "& .MuiList-root": {
181
184
  padding: 0,
182
185
  display: "flex",
183
186
  flexDirection: "column",
184
- gap: theme.vars.size.baseSpacings.sp1
187
+ gap: theme.vars.size.baseSpacings.sp1,
188
+ width: "fit-content",
189
+ "& .MuiMenuItem-root": {
190
+ width: "fit-content"
191
+ }
185
192
  }
186
193
  }
187
194
  }
@@ -9,7 +9,7 @@ const selectStyles = {
9
9
  return {
10
10
  [`&.${SELECT_CLASSES.root}`]: {
11
11
  width: "100%",
12
- borderRadius: theme.vars.size.borderRadius.r1,
12
+ borderRadius: theme.vars.size.borderRadius["r1-5"],
13
13
  border: theme.vars.size.borderStroke.actionInput,
14
14
  borderColor: ownerState?.error ? theme.vars.palette[color].enabled : theme.vars.palette.border.default,
15
15
  padding: 0,
@@ -18,7 +18,7 @@ const selectStyles = {
18
18
  display: "none"
19
19
  },
20
20
  '&:has(.MuiSelect-select[aria-expanded="true"])': {
21
- border: `1px solid ${theme.vars.palette[color].focus}`
21
+ border: `1px solid ${theme.vars.palette[color].enabled}`
22
22
  },
23
23
  "& .M4LImage-root": {
24
24
  ...getHeightSizeStyles(
@@ -40,21 +40,26 @@ const selectStyles = {
40
40
  overflow: "auto",
41
41
  boxSizing: "border-box",
42
42
  display: "flex",
43
- flexDirection: "column"
43
+ flexDirection: "column",
44
+ flexWrap: "unset"
44
45
  },
45
46
  // Estilos para la variante text
46
- [`&.${SELECT_CLASSES.text}`]: {
47
+ [`&&&.${SELECT_CLASSES.text}`]: {
47
48
  borderTop: 0,
48
49
  borderRight: 0,
49
- borderBottom: theme.vars.size.borderStroke.actionInput,
50
50
  borderLeft: 0,
51
- borderColor: ownerState?.error ? theme.vars.palette[color].enabled : theme.vars.palette.border.default
51
+ borderRadius: "unset"
52
52
  },
53
53
  "&:hover": {
54
54
  backgroundColor: ownerState?.disabled ? "unset" : theme.vars.palette[color].hoverOpacity
55
55
  },
56
56
  "&:focus-within": {
57
- borderColor: theme.vars.palette[color].focus
57
+ borderColor: theme.vars.palette[color].enabled,
58
+ ...ownerState?.variant === "text" ? {
59
+ boxShadow: `0px 1.5px 0px 0px ${theme.vars.palette[color].selectedOpacity} !important`
60
+ } : {
61
+ boxShadow: `0px 0px 0px 1.5px ${theme.vars.palette[color].selectedOpacity} !important`
62
+ }
58
63
  },
59
64
  '&[aria-hidden="true"]': {
60
65
  pointerEvents: "none"
@@ -90,13 +95,15 @@ const selectStyles = {
90
95
  * Styles for the render option container
91
96
  * @returns {object} The styles for the render option container
92
97
  */
93
- renderValueContainer: ({ theme }) => ({
98
+ renderValueContainer: ({ theme, ownerState }) => ({
94
99
  display: "flex",
95
100
  alignItems: "center",
96
101
  gap: theme.vars.size.baseSpacings.sp1,
97
- flexWrap: "wrap",
98
102
  overflow: "auto",
99
- flexShrink: 1
103
+ flexShrink: 1,
104
+ ...ownerState?.multiple && {
105
+ flexWrap: "wrap"
106
+ }
100
107
  }),
101
108
  arrowDown: {},
102
109
  renderValueTypography: () => ({
@@ -72,7 +72,7 @@ export interface SelectProps<T extends string | number, Multiple extends boolean
72
72
  * Propiedades internas que definen el estado del componente `Select`.
73
73
  * paletteColor - Color de la paleta aplicado al Select.
74
74
  */
75
- export interface SelectOwnerState<T extends string | number> extends Pick<SelectProps<T>, 'classes' | 'size' | 'error' | 'variant' | 'disabled'> {
75
+ export interface SelectOwnerState<T extends string | number, Multiple extends boolean | undefined = false> extends Pick<SelectProps<T, Multiple>, 'classes' | 'size' | 'error' | 'variant' | 'disabled' | 'multiple'> {
76
76
  disabled?: boolean;
77
77
  }
78
78
  /**
@@ -1,5 +1,6 @@
1
1
  import { TextFieldProps } from './types';
2
+ import { default as React } from 'react';
2
3
  /**
3
4
  * Componente TextField extended de MUI-MATERIAL componente de entrada de datos en una interfaz de usuario que permite a los usuarios ingresar y editar texto. Es comúnmente utilizado en formularios y otros contextos donde se requiere la entrada de texto por parte del usuario.
4
5
  */
5
- export declare const TextField: import('react').ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
6
+ export declare const TextField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -6,8 +6,9 @@ import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
6
6
  import { T as TEXT_FIELD_CLASSES, a as TEXT_FIELD_KEY_COMPONENT } from "./constants.js";
7
7
  import { T as TextFieldSlots } from "./slots/TextFieldEnum.js";
8
8
  import { useTheme } from "@mui/material";
9
- import { forwardRef } from "react";
9
+ import React, { forwardRef, useMemo, cloneElement } from "react";
10
10
  import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
11
+ import { I as IconButton } from "../IconButton/IconButton.js";
11
12
  const TextField = forwardRef(function TextField2(props, ref) {
12
13
  const {
13
14
  value,
@@ -37,6 +38,24 @@ const TextField = forwardRef(function TextField2(props, ref) {
37
38
  color: error ? "error" : "default",
38
39
  readOnly: InputProps?.readOnly
39
40
  };
41
+ const renderStartAdornment = useMemo(() => {
42
+ if (InputProps?.startAdornment && React.isValidElement(InputProps?.startAdornment)) {
43
+ return cloneElement(InputProps?.startAdornment, {
44
+ size: adjustedSize
45
+ });
46
+ } else {
47
+ return InputProps?.startAdornment;
48
+ }
49
+ }, [InputProps?.startAdornment, adjustedSize]);
50
+ const renderEndAdornment = useMemo(() => {
51
+ if (InputProps?.endAdornment && React.isValidElement(InputProps?.endAdornment) && InputProps?.endAdornment.type === IconButton) {
52
+ return cloneElement(InputProps?.endAdornment, {
53
+ size: adjustedSize
54
+ });
55
+ } else {
56
+ return InputProps?.endAdornment;
57
+ }
58
+ }, [InputProps?.endAdornment, adjustedSize]);
40
59
  const isSkeleton = useModuleSkeleton();
41
60
  if (isSkeleton) {
42
61
  return /* @__PURE__ */ jsx(
@@ -68,11 +87,13 @@ const TextField = forwardRef(function TextField2(props, ref) {
68
87
  maxLength,
69
88
  InputProps: {
70
89
  ...InputProps,
90
+ startAdornment: renderStartAdornment,
91
+ endAdornment: renderEndAdornment,
71
92
  ...maxLength && {
72
93
  endAdornment: /* @__PURE__ */ jsxs(LimitContainerStyled, { children: [
73
- /* @__PURE__ */ jsx(LimitTextFirstStyled, { role: "text", "aria-label": "current characters", variant: "body", color: "text.secondary", ownerState: { percent }, children: value.length }),
74
- /* @__PURE__ */ jsx(LimitTextSeparatorStyled, { variant: "body", color: "text.secondary", ownerState: { percent }, children: "/" }),
75
- /* @__PURE__ */ jsx(LimitTextSecondStyled, { role: "text", "aria-label": "limit characters", variant: "body", color: "text.secondary", ownerState: { percent }, children: maxLength }),
94
+ /* @__PURE__ */ jsx(LimitTextFirstStyled, { size: adjustedSize, role: "text", "aria-label": "current characters", variant: "body", color: "text.secondary", ownerState: { percent }, children: value.length }),
95
+ /* @__PURE__ */ jsx(LimitTextSeparatorStyled, { size: adjustedSize, variant: "body", color: "text.secondary", ownerState: { percent }, children: "/" }),
96
+ /* @__PURE__ */ jsx(LimitTextSecondStyled, { size: adjustedSize, role: "text", "aria-label": "limit characters", variant: "body", color: "text.secondary", ownerState: { percent }, children: maxLength }),
76
97
  InputProps?.endAdornment
77
98
  ] })
78
99
  },
@@ -14,141 +14,148 @@ const textFieldStyles = {
14
14
  /**
15
15
  * Estilos personalizados para el componente TextField.
16
16
  */
17
- root: ({ ownerState, theme }) => ({
18
- width: "100%",
19
- height: "auto",
20
- padding: 0,
21
- borderRadius: theme.vars.size.borderRadius["r1-5"],
22
- display: "flex",
23
- "& .MuiInputBase-root": {
24
- // Estilos globales del TextField 🌎
25
- // Paddings
26
- paddingLeft: theme.vars.size.baseSpacings.sp1,
27
- paddingRight: 0,
28
- paddingTop: 0,
29
- paddingBottom: 0,
30
- overflow: "hidden",
31
- // Estilo de los bordes
32
- border: theme.vars.size.borderStroke.actionInput,
33
- borderColor: ownerState?.error && !ownerState?.readOnly ? `${ownerState?.paletteColor?.enabled}!important` : `${theme.vars.palette.border.secondary}!important`,
34
- // Redondeado de los bordes
17
+ root: ({ ownerState, theme }) => {
18
+ return {
19
+ width: "100%",
20
+ height: "fit-content!important",
21
+ minHeight: "fit-content!important",
22
+ padding: 0,
35
23
  borderRadius: theme.vars.size.borderRadius["r1-5"],
36
- // Altura
37
- height: "100%",
38
- // transición
39
- transition: "all 0.2s ease",
40
- // Espaciado entre elementos
41
- ...getSizeStyles(
42
- theme,
43
- ownerState?.size || "medium",
44
- "action",
45
- (size) => ({
46
- height: "auto",
47
- minHeight: size
48
- })
49
- ),
50
- "& .MuiInputBase-input.MuiInputBase-inputMultiline": {
51
- paddingTop: theme.vars.size.baseSpacings.sp1,
52
- paddingBottom: theme.vars.size.baseSpacings.sp1
24
+ display: "flex",
25
+ overflow: "visible",
26
+ "& .MuiInputBase-root": {
27
+ // Estilos globales del TextField 🌎
28
+ // Paddings
29
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
30
+ paddingRight: 0,
31
+ paddingTop: 0,
32
+ paddingBottom: 0,
33
+ overflow: "hidden",
34
+ // Redondeado de los bordes
35
+ borderRadius: theme.vars.size.borderRadius["r1-5"],
36
+ // Altura
37
+ height: "100%",
38
+ // transición
39
+ transition: "all 0.2s ease",
40
+ // Espaciado entre elementos
41
+ ...getSizeStyles(
42
+ theme,
43
+ ownerState?.size || "medium",
44
+ "action",
45
+ (size) => ({
46
+ height: "auto",
47
+ minHeight: size
48
+ })
49
+ ),
50
+ "& .MuiInputBase-input.MuiInputBase-inputMultiline": {
51
+ paddingTop: theme.vars.size.baseSpacings.sp1,
52
+ paddingBottom: theme.vars.size.baseSpacings.sp1
53
+ },
54
+ // Variant Outlined TextField
55
+ ...ownerState?.variant === "outlined" && {
56
+ // Estilos de borde
57
+ border: theme.vars.size.borderStroke.actionInput,
58
+ borderColor: theme.vars.palette.border.secondary,
59
+ borderRadius: theme.vars.size.borderRadius["r1-5"]
60
+ },
61
+ // Variant Text TextField
62
+ ...ownerState?.variant === "text" && {
63
+ // Estilos de borde por el formato de variante, solo se aplica para borde inferior.
64
+ borderBottom: theme.vars.size.borderStroke.actionInput,
65
+ borderColor: theme.vars.palette.border.secondary,
66
+ borderRadius: 0
67
+ },
68
+ // Variant Contained TextField
69
+ ...ownerState?.variant === "contained" && {
70
+ border: theme.vars.size.borderStroke.actionInput,
71
+ borderColor: "transparent",
72
+ backgroundColor: theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "enabledOpacity"]
73
+ },
74
+ // state readOnly
75
+ ...ownerState?.readOnly && {
76
+ backgroundColor: theme.vars.palette.default.enabledOpacity,
77
+ borderColor: `${theme.vars.palette.border.secondary}!important`,
78
+ "& .MuiInputBase-input": {
79
+ color: theme.vars.palette.text.primary
80
+ }
81
+ },
82
+ ...!ownerState?.readOnly && {
83
+ ...ownerState?.error && ownerState?.variant !== "contained" && {
84
+ borderColor: `${ownerState?.paletteColor?.enabled}`
85
+ },
86
+ /* State hover */
87
+ "&:hover": {
88
+ backgroundColor: ownerState?.error ? ownerState?.paletteColor?.hoverOpacity : theme.vars.palette.default.hoverOpacity,
89
+ ...ownerState?.error && ownerState?.variant !== "contained" && {
90
+ borderColor: `${ownerState?.paletteColor?.hover}`
91
+ }
92
+ },
93
+ /* State focus */
94
+ "&:focus-within": {
95
+ backgroundColor: theme.vars.palette.background.default,
96
+ borderColor: `${theme.vars.palette.primary.selected}`,
97
+ ...ownerState?.variant === "text" ? {
98
+ boxShadow: `0px 1.5px 0px 0px ${ownerState?.paletteColor?.selectedOpacity} !important`
99
+ } : {
100
+ boxShadow: `0px 0px 0px 1.5px ${ownerState?.paletteColor?.selectedOpacity} !important`
101
+ },
102
+ ...ownerState?.error && {
103
+ borderColor: `${ownerState?.paletteColor?.focus}`
104
+ }
105
+ }
106
+ }
53
107
  },
54
- ...ownerState?.readOnly ? {
55
- backgroundColor: theme.vars.palette.background.neutral
56
- } : {}
57
- },
58
- // ↴ Overrides ❌
59
- // Estilos del input
60
- "& .MuiInputBase-input": {
61
108
  // ↴ Overrides ❌
62
- paddingLeft: theme.vars.size.baseSpacings.sp1,
63
- paddingRight: theme.vars.size.baseSpacings.sp1,
64
- paddingTop: 0,
65
- paddingBottom: 0,
66
- fontFamily: theme.typography.fontFamily,
67
- color: ownerState?.disabled ? theme.vars.palette.text.disabled : theme.vars.palette.text.primary,
68
- ...getTypographyStyles(
69
- theme.generalSettings.isMobile,
70
- ownerState?.size || "medium",
71
- "body"
72
- ),
73
- "&::placeholder": {
74
- color: theme.vars.palette.text.disabled
109
+ // Estilos del input
110
+ "& .MuiInputBase-input": {
111
+ // ↴ Overrides ❌
112
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
113
+ paddingRight: theme.vars.size.baseSpacings.sp1,
114
+ paddingTop: 0,
115
+ paddingBottom: 0,
116
+ fontFamily: theme.typography.fontFamily,
117
+ color: ownerState?.disabled ? theme.vars.palette.text.disabled : theme.vars.palette.text.primary,
118
+ transition: "all 0.2s ease",
119
+ ...getTypographyStyles(
120
+ theme.generalSettings.isMobile,
121
+ ownerState?.size || "medium",
122
+ "body"
123
+ ),
124
+ "&::placeholder": {
125
+ color: `${theme.vars.palette.text.disabled}`
126
+ },
127
+ "&:focus": {
128
+ "&::placeholder": {
129
+ color: `${theme.vars.palette.text.primary}!important`
130
+ }
131
+ },
132
+ "&:-webkit-autofill": {
133
+ backgroundColor: "transparent!important"
134
+ }
75
135
  },
76
- "&:-webkit-autofill": {
77
- backgroundColor: "transparent!important"
78
- }
79
- },
80
- // Estilos de cuando esta deshabilitado
81
- ...ownerState?.disabled && {
82
- borderColor: `${theme.vars.palette.border.disabled}!important`,
83
- pointerEvents: ownerState?.disabled ? "none" : "auto"
84
- },
85
- // Estilos del los adorments
86
- "& .MuiInputAdornment-root": {
87
- height: "auto",
88
- width: "auto",
89
- // ↴ Overrides ❌
90
- margin: 0
91
- },
92
- // Estilos de la mascara fieldset, es un elemento interno del textfield, material lo usa como mascara para el estilo.
93
- // por practicidad se oculta en nuestra versión, sin embargo no se elimina porque es parte de la semántica del componente.
94
- "& .MuiOutlinedInput-notchedOutline": {
95
- all: "unset",
96
- display: "none"
97
- },
98
- "& .MuiInputAdornment-root .M4LIcon-icon": {
99
- backgroundColor: ownerState?.error ? ownerState?.paletteColor?.enabled : theme.vars.palette.text.primary,
136
+ // Estilos de cuando esta deshabilitado
100
137
  ...ownerState?.disabled && {
101
- backgroundColor: theme.vars.palette.text.disabled
102
- }
103
- },
104
- "&:not(.M4LTextField-readOnly ) .MuiInputBase-root:hover": {
105
- backgroundColor: theme.vars.palette.default.hoverOpacity,
106
- ...ownerState?.error && {
107
- borderColor: `${ownerState?.paletteColor?.hover}!important`,
138
+ borderColor: `${theme.vars.palette.border.disabled}!important`,
139
+ pointerEvents: ownerState?.disabled ? "none" : "auto",
108
140
  "& .MuiInputAdornment-root .M4LIcon-icon": {
109
- backgroundColor: ownerState?.paletteColor?.hover
141
+ backgroundColor: theme.vars.palette.text.disabled
110
142
  }
111
- }
112
- },
113
- "&:not(.M4LTextField-readOnly):focus": {
114
- borderColor: `${ownerState?.paletteColor?.enabled}!important`,
115
- "& .MuiInputAdornment-root .M4LIcon-icon": {
116
- backgroundColor: ownerState?.paletteColor?.active
117
- }
118
- },
119
- // Variant Outlined TextField
120
- ...ownerState?.variant === "outlined" && {
121
- [`&.${TEXT_FIELD_CLASSES.outlined} .MuiInputBase-root`]: {
122
- // Estilos de borde
123
- border: theme.vars.size.borderStroke.actionInput
124
- }
125
- },
126
- // Variant Text TextField
127
- ...ownerState?.variant === "text" && {
128
- [`&.${TEXT_FIELD_CLASSES.text} .MuiInputBase-root`]: {
129
- // Estilos de borde por el formato de variante, solo se aplica para borde inferior.
130
- borderTop: 0,
131
- borderLeft: 0,
132
- borderRight: 0,
133
- borderBottom: theme.vars.size.borderStroke.actionInput
134
- }
135
- },
136
- // Variant Contained TextField
137
- ...ownerState?.variant === "contained" && {
138
- [`&.${TEXT_FIELD_CLASSES.contained} .MuiInputBase-root`]: {
139
- border: "none",
140
- backgroundColor: ownerState?.readOnly ? theme.vars.palette.background.neutral : theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "enabledOpacity"]
141
143
  },
142
- ...ownerState?.error && !ownerState?.readOnly && {
143
- border: theme.vars.size.borderStroke.container,
144
- borderColor: `${ownerState?.paletteColor?.enabled}!important`
144
+ // Estilos del los adorments
145
+ "& .MuiInputAdornment-root": {
146
+ height: "auto",
147
+ width: "auto",
148
+ // ↴ Overrides ❌
149
+ margin: 0
145
150
  },
146
- "&:not(.M4LTextField-readOnly):focus-within": {
147
- border: theme.vars.size.borderStroke.container,
148
- borderColor: `${ownerState?.paletteColor?.active}!important`
151
+ // Estilos de la mascara fieldset, es un elemento interno del textfield, material lo usa como mascara para el estilo.
152
+ // por practicidad se oculta en nuestra versión, sin embargo no se elimina porque es parte de la semántica del componente.
153
+ "& .MuiOutlinedInput-notchedOutline": {
154
+ all: "unset",
155
+ display: "none"
149
156
  }
150
- }
151
- }),
157
+ };
158
+ },
152
159
  /**
153
160
  * Estilos personalizados para el componente Skeleton.
154
161
  */