@m4l/components 9.1.52 → 9.1.53
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/@types/export.d.ts +0 -6
- package/@types/types.d.ts +31 -26
- package/components/Color/Color.d.ts +7 -0
- package/components/Color/Color.js +58 -0
- package/components/Color/Color.styles.d.ts +8 -0
- package/components/Color/Color.styles.js +130 -0
- package/components/Color/Color.test.d.ts +1 -0
- package/components/Color/constants.d.ts +3 -0
- package/components/Color/constants.js +6 -0
- package/components/Color/index.d.ts +1 -0
- package/components/Color/index.js +1 -0
- package/components/Color/slots/ColorEnum.d.ts +5 -0
- package/components/Color/slots/ColorEnum.js +9 -0
- package/components/Color/slots/ColorSlots.d.ts +23 -0
- package/components/Color/slots/ColorSlots.js +23 -0
- package/components/Color/slots/index.d.ts +2 -0
- package/components/Color/slots/index.js +1 -0
- package/components/Color/types.d.ts +64 -0
- package/components/HelperError/HelperError.js +6 -3
- package/components/HelperError/HelperError.styles.js +2 -2
- package/components/HelperError/constant.d.ts +2 -1
- package/components/HelperError/constant.js +6 -3
- package/components/HelperError/slots/HelperErrorSlots.js +1 -1
- package/components/HelperError/types.d.ts +1 -1
- package/components/Label/Label.js +42 -27
- package/components/Label/types.d.ts +1 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/index.js +0 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +0 -2
- package/components/hook-form/RHFColorPicker/RFHColorPicker.js +90 -68
- package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.d.ts +5 -0
- package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.js +105 -0
- package/components/hook-form/RHFColorPicker/RHFColorPicker.test.d.ts +1 -0
- package/components/hook-form/RHFColorPicker/constants.d.ts +5 -0
- package/components/hook-form/RHFColorPicker/constants.js +6 -0
- package/components/hook-form/RHFColorPicker/index.d.ts +0 -1
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerEnum.d.ts +5 -0
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerEnum.js +9 -0
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +24 -0
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.js +23 -0
- package/components/hook-form/RHFColorPicker/slots/index.d.ts +2 -0
- package/components/hook-form/RHFColorPicker/types.d.ts +51 -7
- package/components/hook-form/RHFTextField/RHFTextField.js +18 -29
- package/components/hook-form/RHFTextField/RHFTextField.styles.js +3 -1
- package/components/hook-form/RHFTextField/types.d.ts +11 -11
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +0 -4
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/index.js +0 -6
- package/components/mui_extended/TextField/TextField.js +4 -0
- package/components/mui_extended/Typography/types.d.ts +3 -1
- package/components/mui_extended/Typography/typography.styles.js +1 -0
- package/hooks/useFormFocus/index.d.ts +1 -0
- package/index.js +42 -44
- package/package.json +1 -1
- package/test/TestFormAutoValidation.d.ts +4 -0
- package/components/hook-form/RHFColorPicker/classes/constants.d.ts +0 -1
- package/components/hook-form/RHFColorPicker/classes/constants.js +0 -4
- package/components/hook-form/RHFColorPicker/classes/index.d.ts +0 -15
- package/components/hook-form/RHFColorPicker/classes/index.js +0 -44
- package/components/hook-form/RHFColorPicker/classes/types.d.ts +0 -15
- package/components/hook-form/RHFColorPicker/dictionary.d.ts +0 -1
- package/components/hook-form/RHFColorPicker/dictionary.js +0 -6
- package/components/hook-form/RHFColorPicker/styles.d.ts +0 -1
- package/components/hook-form/RHFColorPicker/styles.js +0 -7
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/indext.d.ts +0 -5
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/indext.js +0 -21
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/types.d.ts +0 -2
package/@types/export.d.ts
CHANGED
|
@@ -59,12 +59,6 @@ declare module '@mui/material/styles' {
|
|
|
59
59
|
M4LRHFCheckbox?: {
|
|
60
60
|
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFCheckbox'];
|
|
61
61
|
};
|
|
62
|
-
M4LRHFColorPicker?: {
|
|
63
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFColorPicker'];
|
|
64
|
-
};
|
|
65
|
-
M4LRHFColorPickerPopoverRoot?: {
|
|
66
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFColorPickerPopoverRoot'];
|
|
67
|
-
};
|
|
68
62
|
M4LCheckBox?: {
|
|
69
63
|
styleOverrides?: ComponentsOverrides<Theme>['M4LCheckBox'];
|
|
70
64
|
};
|
package/@types/types.d.ts
CHANGED
|
@@ -52,27 +52,13 @@ import type {
|
|
|
52
52
|
IconButtonSlotsType,
|
|
53
53
|
} from '../components/mui_extended/IconButton/types';
|
|
54
54
|
|
|
55
|
-
import type {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} from '../components/
|
|
59
|
-
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} from '../components/ControlIncrement/types';
|
|
63
|
-
import {
|
|
64
|
-
SkeletonOwnerState,
|
|
65
|
-
SkeletonSlotsType,
|
|
66
|
-
} from '../components/mui_extended/Skeleton/types';
|
|
67
|
-
import {
|
|
68
|
-
InputNumberSpinnerOwnerState,
|
|
69
|
-
InputNumberSpinnerSlotsType,
|
|
70
|
-
} from '../components/InputNumberSpinner/types';
|
|
71
|
-
import {
|
|
72
|
-
TypographyOwnerState,
|
|
73
|
-
TypographySlotsType,
|
|
74
|
-
} from '../components/mui_extended/Typography/types';
|
|
75
|
-
|
|
55
|
+
import type { BadgeSlotsType, BadgeOwnerState } from '../components/mui_extended/Badge/types';
|
|
56
|
+
import { ControlIncrementOwnerState, ControlIncrementSlotsType } from '../components/ControlIncrement/types';
|
|
57
|
+
import { SkeletonOwnerState, SkeletonSlotsType } from '../components/mui_extended/Skeleton/types';
|
|
58
|
+
import { InputNumberSpinnerOwnerState, InputNumberSpinnerSlotsType } from '../components/InputNumberSpinner/types';
|
|
59
|
+
import { TypographyOwnerState, TypographySlotsType } from '../components/mui_extended/Typography/types';
|
|
60
|
+
import { ColorOwnerState, ColorSlotsType } from '../components/Color/types';
|
|
61
|
+
import { RHFColorPickerOwnerState, RHFColorPickerSlotsType } from '../components/hook-form/RHFColorPicker/types';
|
|
76
62
|
import type {
|
|
77
63
|
MenuItemSlotsType,
|
|
78
64
|
MenuItemOwnerState,
|
|
@@ -180,6 +166,8 @@ declare module '@mui/material/styles' {
|
|
|
180
166
|
M4LButton: ButtonSlotsType;
|
|
181
167
|
M4LActionIntro: ActionIntroSlotsType;
|
|
182
168
|
M4LActionCancel: ActionCancelSlotsType;
|
|
169
|
+
M4LColor: ColorSlotsType;
|
|
170
|
+
M4LRHFColorPicker: RHFColorPickerSlotsType;
|
|
183
171
|
M4LPopover: PopoverSlotsType;
|
|
184
172
|
M4LImage: ImageSlotsType;
|
|
185
173
|
M4LSideBar: SideBarSlotsType;
|
|
@@ -250,6 +238,8 @@ declare module '@mui/material/styles' {
|
|
|
250
238
|
M4LToggleIconButton: Partial<ToggleIconButtonOwnerState>;
|
|
251
239
|
M4LAccountPopover: Partial<AccountPopoverOwnerState>;
|
|
252
240
|
M4LPropertyValue: Partial<PropertyVaLueOwnerState>;
|
|
241
|
+
M4LColor: Partial<ColorOwnerState>;
|
|
242
|
+
M4LRHFColorPicker: Partial<RHFColorPickerOwnerState>;
|
|
253
243
|
}
|
|
254
244
|
|
|
255
245
|
interface Components {
|
|
@@ -542,7 +532,7 @@ declare module '@mui/material/styles' {
|
|
|
542
532
|
defaultProps?: ComponentsPropsList['M4LAvatar'];
|
|
543
533
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAvatar'];
|
|
544
534
|
variants?: ComponentsVariants['M4LAvatar'];
|
|
545
|
-
}
|
|
535
|
+
}
|
|
546
536
|
M4LAccordion?: {
|
|
547
537
|
defaultProps?: ComponentsPropsList['M4LAccordion'];
|
|
548
538
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAccordion'];
|
|
@@ -567,11 +557,26 @@ declare module '@mui/material/styles' {
|
|
|
567
557
|
defaultProps?: ComponentsPropsList['M4LToggleIconButton'];
|
|
568
558
|
styleOverrides?: ComponentsOverrides<Theme>['M4LToggleIconButton'];
|
|
569
559
|
variants?: ComponentsVariants['M4LToggleIconButton'];
|
|
560
|
+
}
|
|
561
|
+
M4LPropertyValue?: {
|
|
562
|
+
defaultProps?: ComponentsPropsList['M4LPropertyValue'];
|
|
563
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LPropertyValue'];
|
|
564
|
+
variants?: ComponentsVariants['M4LPropertyValue'];
|
|
565
|
+
};
|
|
566
|
+
M4LColor?: {
|
|
567
|
+
defaultProps?: ComponentsPropsList['M4LColor'];
|
|
568
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LColor'];
|
|
569
|
+
variants?: ComponentsVariants['M4LColor'];
|
|
570
|
+
};
|
|
571
|
+
M4LRHFColorPicker?: {
|
|
572
|
+
defaultProps?: ComponentsPropsList['M4LRHFColorPicker'];
|
|
573
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFColorPicker'];
|
|
574
|
+
variants?: ComponentsVariants['M4LRHFColorPicker'];
|
|
570
575
|
};
|
|
571
576
|
M4LAccountPopover?: {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
577
|
+
defaultProps?: ComponentsPropsList['M4LAccountPopover'];
|
|
578
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAccountPopover'];
|
|
579
|
+
variants?: ComponentsVariants['M4LAccountPopover'];
|
|
580
|
+
};
|
|
576
581
|
}
|
|
577
582
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColorProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente `Color`
|
|
4
|
+
*
|
|
5
|
+
* Este componente muestra un color específico (si se pasa un valor en la propiedad `value`) o un ícono predeterminado
|
|
6
|
+
*/
|
|
7
|
+
export declare const Color: (props: ColorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
3
|
+
import { N as NOTCOLOR } from "./constants.js";
|
|
4
|
+
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
5
|
+
import { R as RootStyled, C as ColorPickerStyled, I as IconStyled } from "./slots/ColorSlots.js";
|
|
6
|
+
const Color = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
onClick,
|
|
9
|
+
size,
|
|
10
|
+
disabled,
|
|
11
|
+
value,
|
|
12
|
+
role,
|
|
13
|
+
color = "default",
|
|
14
|
+
["aria-errormessage"]: ariaErrorMessage
|
|
15
|
+
} = props;
|
|
16
|
+
const { currentSize } = useComponentSize(size);
|
|
17
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
18
|
+
const isSkeleton = useModuleSkeleton();
|
|
19
|
+
const ownerState = {
|
|
20
|
+
size: adjustedSize,
|
|
21
|
+
disabled,
|
|
22
|
+
color,
|
|
23
|
+
value
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
RootStyled,
|
|
27
|
+
{
|
|
28
|
+
role,
|
|
29
|
+
"aria-busy": isSkeleton,
|
|
30
|
+
"aria-errormessage": ariaErrorMessage,
|
|
31
|
+
disabled: isSkeleton || disabled,
|
|
32
|
+
onClick,
|
|
33
|
+
ownerState: { ...ownerState },
|
|
34
|
+
disableRipple: true,
|
|
35
|
+
children: value ? /* @__PURE__ */ jsx(
|
|
36
|
+
ColorPickerStyled,
|
|
37
|
+
{
|
|
38
|
+
role: "status",
|
|
39
|
+
"aria-live": "polite",
|
|
40
|
+
ownerState: { ...ownerState },
|
|
41
|
+
disabled,
|
|
42
|
+
size: adjustedSize
|
|
43
|
+
}
|
|
44
|
+
) : /* @__PURE__ */ jsx(
|
|
45
|
+
IconStyled,
|
|
46
|
+
{
|
|
47
|
+
ownerState: { ownerState },
|
|
48
|
+
src: NOTCOLOR,
|
|
49
|
+
disabled,
|
|
50
|
+
size: adjustedSize
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
Color as C
|
|
58
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColorStyles } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Definición de los estilos para los diferentes componentes relacionados con el selector de color.
|
|
4
|
+
*
|
|
5
|
+
* El objeto `colorStyles` contiene tres funciones principales para estilizar diferentes partes del componente:
|
|
6
|
+
* `root`, `icon`, y `colorPicker`. Cada función utiliza un estilo dinámico basado en el estado y el tema del componente.
|
|
7
|
+
*/
|
|
8
|
+
export declare const colorStyles: ColorStyles;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const colorStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Estilos para el contenedor raíz del componente de color.
|
|
4
|
+
* Establece los estilos para el contenedor raíz del selector de color.
|
|
5
|
+
*/
|
|
6
|
+
root: ({ theme, ownerState }) => ({
|
|
7
|
+
// Estructura y layout básico
|
|
8
|
+
display: "flex",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
width: "fit-content",
|
|
11
|
+
height: "fit-content",
|
|
12
|
+
cursor: ownerState.disabled ? "not-allowed" : "pointer",
|
|
13
|
+
color: theme.vars.palette.text.primary,
|
|
14
|
+
pointerEvents: ownerState.disabled ? "none" : "auto",
|
|
15
|
+
//Espaciado
|
|
16
|
+
padding: 0,
|
|
17
|
+
// Radio de borde
|
|
18
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
19
|
+
/**
|
|
20
|
+
* **Pseudoclases**:
|
|
21
|
+
* - Estilos para los estados hover, focus-visible y active.
|
|
22
|
+
*/
|
|
23
|
+
"&:hover": {
|
|
24
|
+
display: "flex",
|
|
25
|
+
background: theme.vars.palette[ownerState.color || "default"].hoverOpacity
|
|
26
|
+
},
|
|
27
|
+
"&:active": {
|
|
28
|
+
background: theme.vars.palette[ownerState.color || "default"].active
|
|
29
|
+
},
|
|
30
|
+
"&:focus-visible": {
|
|
31
|
+
"&::before": {
|
|
32
|
+
content: '""',
|
|
33
|
+
position: "absolute",
|
|
34
|
+
inset: "-2px",
|
|
35
|
+
boxSizing: "border-box",
|
|
36
|
+
border: theme.vars.size.borderStroke.container,
|
|
37
|
+
borderColor: theme.vars.palette.border.main,
|
|
38
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
// //Estilos para Error
|
|
42
|
+
...ownerState.color !== "default" && {
|
|
43
|
+
// Borde
|
|
44
|
+
border: `1px solid ${theme.vars.palette[ownerState.color || "primary"].main}`,
|
|
45
|
+
/**
|
|
46
|
+
* **Pseudoclases**:
|
|
47
|
+
* - Estilos para los estados hover, focus-visible y active.
|
|
48
|
+
*/
|
|
49
|
+
"&:active": {
|
|
50
|
+
border: `1px solid ${theme.vars.palette[ownerState.color || "primary"].active}`,
|
|
51
|
+
background: theme.vars.palette[ownerState.color || "primary"].hoverOpacity
|
|
52
|
+
},
|
|
53
|
+
"&:focus-visible": {
|
|
54
|
+
"&::before": {
|
|
55
|
+
content: '""',
|
|
56
|
+
position: "absolute",
|
|
57
|
+
inset: "-4px",
|
|
58
|
+
boxSizing: "border-box",
|
|
59
|
+
border: theme.vars.size.borderStroke.container,
|
|
60
|
+
borderColor: theme.vars.palette.border.main,
|
|
61
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
// Sizes medium
|
|
66
|
+
...ownerState.size === "medium" && {
|
|
67
|
+
...theme.generalSettings.isMobile ? {
|
|
68
|
+
width: theme.vars.size.mobile.medium.action,
|
|
69
|
+
height: theme.vars.size.mobile.medium.action
|
|
70
|
+
} : {
|
|
71
|
+
width: theme.vars.size.desktop.medium.action,
|
|
72
|
+
height: theme.vars.size.desktop.medium.action
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
// Sizes small
|
|
76
|
+
...ownerState.size === "small" && {
|
|
77
|
+
...theme.generalSettings.isMobile ? {
|
|
78
|
+
width: theme.vars.size.mobile.small.action,
|
|
79
|
+
height: theme.vars.size.mobile.small.action
|
|
80
|
+
} : {
|
|
81
|
+
width: theme.vars.size.desktop.small.action,
|
|
82
|
+
height: theme.vars.size.desktop.small.action
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
/**
|
|
87
|
+
* Estilos para el icono dentro del componente de color.
|
|
88
|
+
* Actualmente no se aplican estilos al icono. Este espacio está reservado para futuros estilos si es necesario.
|
|
89
|
+
*/
|
|
90
|
+
icon: {},
|
|
91
|
+
/**
|
|
92
|
+
* Estilos para el selector de color.
|
|
93
|
+
* Establece los estilos para el selector de color, incluyendo su tamaño, posición y color de fondo.
|
|
94
|
+
* El tamaño del selector puede cambiar dependiendo de la propiedad `size` en el estado del componente.
|
|
95
|
+
* Además, el color de fondo se ajusta con base en el valor seleccionado.
|
|
96
|
+
*/
|
|
97
|
+
colorPicker: ({ theme, ownerState }) => ({
|
|
98
|
+
//Estilos generales
|
|
99
|
+
right: 0,
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexDirection: "column",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
backgroundColor: ownerState.value,
|
|
104
|
+
borderRadius: theme.size.borderRadius["r0-5"],
|
|
105
|
+
// Sizes medium
|
|
106
|
+
...ownerState.size === "medium" && {
|
|
107
|
+
...theme.generalSettings.isMobile ? {
|
|
108
|
+
width: theme.vars.size.mobile.medium.base,
|
|
109
|
+
height: theme.vars.size.mobile.medium.base
|
|
110
|
+
} : {
|
|
111
|
+
width: theme.vars.size.desktop.medium.base,
|
|
112
|
+
height: theme.vars.size.desktop.medium.base
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
// Sizes small
|
|
116
|
+
...ownerState.size === "small" && {
|
|
117
|
+
...theme.generalSettings.isMobile ? {
|
|
118
|
+
width: theme.vars.size.mobile.small.base,
|
|
119
|
+
height: theme.vars.size.mobile.small.base
|
|
120
|
+
} : {
|
|
121
|
+
width: theme.vars.size.desktop.small.base,
|
|
122
|
+
height: theme.vars.size.desktop.small.base
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
variants: []
|
|
126
|
+
})
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
colorStyles as c
|
|
130
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Color';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Componente estilizado de IconButton como el contenedor raíz del componente de color.
|
|
3
|
+
* Este componente es utilizado como el contenedor principal del IconButton de materialUI.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').IconButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
7
|
+
}, "children" | "size" | "action" | "color" | "style" | "disabled" | "sx" | "classes" | "className" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge">, "children" | "value" | "ref" | "title" | "size" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "key" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ColorOwnerState> & Record<string, unknown> & {
|
|
8
|
+
ownerState: Partial<import('../types').ColorOwnerState> & Record<string, unknown>;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
/**
|
|
11
|
+
* Componente estilizado para representar el selector de color.
|
|
12
|
+
* Este componente se utiliza para mostrar el área del picker de color.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ColorPickerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ColorOwnerState> & Record<string, unknown> & {
|
|
15
|
+
ownerState: Partial<import('../types').ColorOwnerState> & Record<string, unknown>;
|
|
16
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
17
|
+
/**
|
|
18
|
+
* Componente estilizado para representar el icono dentro del componente de color.
|
|
19
|
+
* Este es el área del componente donde se coloca el icono de selección de color.
|
|
20
|
+
*/
|
|
21
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ColorOwnerState> & Record<string, unknown> & {
|
|
22
|
+
ownerState: Partial<import('../types').ColorOwnerState> & Record<string, unknown>;
|
|
23
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { C as ColorSlots } from "./ColorEnum.js";
|
|
3
|
+
import { IconButton } from "@mui/material";
|
|
4
|
+
import { c as colorStyles } from "../Color.styles.js";
|
|
5
|
+
import { C as COLOR_KEY_COMPONENT } from "../constants.js";
|
|
6
|
+
import { I as Icon } from "../../Icon/Icon.js";
|
|
7
|
+
const RootStyled = styled(IconButton, {
|
|
8
|
+
name: COLOR_KEY_COMPONENT,
|
|
9
|
+
slot: ColorSlots.root
|
|
10
|
+
})(colorStyles?.root);
|
|
11
|
+
const ColorPickerStyled = styled("div", {
|
|
12
|
+
name: COLOR_KEY_COMPONENT,
|
|
13
|
+
slot: ColorSlots.colorPicker
|
|
14
|
+
})(colorStyles?.colorPicker);
|
|
15
|
+
const IconStyled = styled(Icon, {
|
|
16
|
+
name: COLOR_KEY_COMPONENT,
|
|
17
|
+
slot: ColorSlots.icon
|
|
18
|
+
})(colorStyles?.icon);
|
|
19
|
+
export {
|
|
20
|
+
ColorPickerStyled as C,
|
|
21
|
+
IconStyled as I,
|
|
22
|
+
RootStyled as R
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
|
+
import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
|
|
3
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
|
+
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
5
|
+
import { IconProps } from '../Icon/types';
|
|
6
|
+
import { COLOR_KEY_COMPONENT } from './constants';
|
|
7
|
+
import { ColorSlots } from './slots';
|
|
8
|
+
/**
|
|
9
|
+
* Propiedades del componente `Color`
|
|
10
|
+
*
|
|
11
|
+
* Esta interfaz define las propiedades que el componente `Color` acepta. Se basa en las propiedades de `IconProps`
|
|
12
|
+
* y `MUIIconButtonProps`, pero omite algunas propiedades para ajustarse a los requisitos específicos del componente `Color`.
|
|
13
|
+
*/
|
|
14
|
+
export interface ColorProps extends Omit<IconProps, 'size' | 'color' | 'src'>, // Se omiten las propiedades 'size', 'color' y 'src' de IconProps
|
|
15
|
+
Omit<MUIIconButtonProps, 'size' | 'color' | 'disabled' | 'value'> {
|
|
16
|
+
/**
|
|
17
|
+
* Define el color que tendrá el componente.
|
|
18
|
+
* Puede ser un color en formato de string o `null`/`undefined` para mostrar un ícono predeterminado.
|
|
19
|
+
*/
|
|
20
|
+
value?: string | null | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Define el tamaño del componente.
|
|
23
|
+
* Puede ser 'small', 'medium', o 'large'.
|
|
24
|
+
*/
|
|
25
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
26
|
+
/**
|
|
27
|
+
* Representa si el componente está deshabilitado.
|
|
28
|
+
* Si es `true`, el componente no será interactivo.
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Opciones de color personalizadas del componente.
|
|
33
|
+
* Define el color de la paleta a utilizar para el componente.
|
|
34
|
+
*/
|
|
35
|
+
color?: ComponentPalletColor;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Tipo para las ranuras del componente `Color`.
|
|
39
|
+
* Este tipo se refiere a las claves dentro de `ColorSlots`, que determinan los diferentes elementos
|
|
40
|
+
* estilizados dentro del componente, como el `colorPicker`, `icon`, etc.
|
|
41
|
+
*/
|
|
42
|
+
export type ColorSlotsType = keyof typeof ColorSlots;
|
|
43
|
+
/**
|
|
44
|
+
* Combinación de las propiedades del componente `Color` y su estado propietario.
|
|
45
|
+
* Este tipo se utiliza para describir el estado completo del componente `Color`, incluyendo
|
|
46
|
+
* las propiedades pasadas al componente y el estado calculado como el color de la paleta y el estado de esqueleto.
|
|
47
|
+
*/
|
|
48
|
+
export interface ColorOwnerState extends Pick<ColorProps, 'size' | 'color' | 'value'> {
|
|
49
|
+
/**
|
|
50
|
+
* Define si el componente está deshabilitado.
|
|
51
|
+
*/
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* El color de la paleta basado en el tema de MUI.
|
|
55
|
+
* Se usa para aplicar el color al componente.
|
|
56
|
+
*/
|
|
57
|
+
color?: ComponentPalletColor;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Tipos de estilos para el componente `Color`.
|
|
61
|
+
* Esta interfaz extiende las reglas de estilo personalizadas para las ranuras del componente (`ColorSlots`)
|
|
62
|
+
* y permite su sobrescritura.
|
|
63
|
+
*/
|
|
64
|
+
export type ColorStyles = Partial<OverridesStyleRules<ColorSlots, typeof COLOR_KEY_COMPONENT, Theme> | undefined> | undefined;
|
|
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTheme } from "@mui/material";
|
|
3
3
|
import { getPropertyByString } from "@m4l/core";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
import { H as
|
|
5
|
+
import { H as HELPER_ERROR_KEY_COMPONENT, c as classHelperErrorRoot, a as HELPER_ERROR_CLASS_SPECIFY } from "./constant.js";
|
|
6
6
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
7
7
|
import { T as TypographyStyled } from "./slots/HelperErrorSlots.js";
|
|
8
8
|
const HelperError = (props) => {
|
|
9
|
-
const { message = "", skeletonWidth, size = "medium", className } = props;
|
|
9
|
+
const { message = "", skeletonWidth, size = "medium", className, ...other } = props;
|
|
10
10
|
const { currentSize } = useComponentSize(size);
|
|
11
11
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
12
12
|
const theme = useTheme();
|
|
@@ -22,11 +22,14 @@ const HelperError = (props) => {
|
|
|
22
22
|
return /* @__PURE__ */ jsx(
|
|
23
23
|
TypographyStyled,
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
"aria-errormessage": HELPER_ERROR_KEY_COMPONENT,
|
|
26
|
+
className: clsx(classHelperErrorRoot, HELPER_ERROR_CLASS_SPECIFY, className),
|
|
26
27
|
ownerState: { ...ownerState, size: currentSize },
|
|
27
28
|
size: adjustedSize,
|
|
28
29
|
variant: "body",
|
|
29
30
|
skeletonWidth,
|
|
31
|
+
component: "label",
|
|
32
|
+
...other,
|
|
30
33
|
children: message
|
|
31
34
|
}
|
|
32
35
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as HELPER_ERROR_CLASS_SPECIFY } from "./constant.js";
|
|
2
2
|
const helperErrorStyles = {
|
|
3
3
|
/**
|
|
4
4
|
* Estilos para el slot del root HelperError
|
|
@@ -8,7 +8,7 @@ const helperErrorStyles = {
|
|
|
8
8
|
* @updatedUser Bruce Escobar - automatic
|
|
9
9
|
*/
|
|
10
10
|
root: ({ theme, ownerState }) => ({
|
|
11
|
-
[`&.${
|
|
11
|
+
[`&.${HELPER_ERROR_CLASS_SPECIFY}`]: {
|
|
12
12
|
color: ownerState.helperErrorPaletteColor?.main,
|
|
13
13
|
...ownerState.size === "small" && {
|
|
14
14
|
...theme.generalSettings.isMobile ? { height: theme.size.typography.mobile.small } : { height: theme.size.typography.desktop.small }
|
|
@@ -7,4 +7,5 @@ export declare const HELPER_ERROR_KEY_COMPONENT = "M4LHelperError";
|
|
|
7
7
|
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
8
8
|
* tener la necesidad de agregar valores en !important.
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
|
|
11
|
+
export declare const classHelperErrorRoot: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
1
2
|
const HELPER_ERROR_KEY_COMPONENT = "M4LHelperError";
|
|
2
|
-
const
|
|
3
|
+
const HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
|
|
4
|
+
const classHelperErrorRoot = getComponentSlotRoot(HELPER_ERROR_KEY_COMPONENT);
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
HELPER_ERROR_KEY_COMPONENT as H,
|
|
7
|
+
HELPER_ERROR_CLASS_SPECIFY as a,
|
|
8
|
+
classHelperErrorRoot as c
|
|
6
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { H as HelperErrorSlots } from "./HelperErrorEnum.js";
|
|
3
|
-
import {
|
|
3
|
+
import { H as HELPER_ERROR_KEY_COMPONENT } from "../constant.js";
|
|
4
4
|
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
5
5
|
import { h as helperErrorStyles } from "../HelperError.styles.js";
|
|
6
6
|
import { S as Skeleton } from "../../mui_extended/Skeleton/Skeleton.js";
|
|
@@ -8,7 +8,7 @@ import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
|
8
8
|
* Extiende de TypographyProps para incluir propiedades de esqueleto y añade la propiedad `message`.
|
|
9
9
|
* `message` es el mensaje de error a mostrar.
|
|
10
10
|
*/
|
|
11
|
-
export interface HelperErrorProps extends Pick<TypographyProps, 'skeletonWidth'> {
|
|
11
|
+
export interface HelperErrorProps extends Pick<TypographyProps, 'skeletonWidth' | 'htmlFor'> {
|
|
12
12
|
/**
|
|
13
13
|
* Mensaje que se visualiza en el componente HelperError.
|
|
14
14
|
*/
|