@m4l/components 8.2.0-beta.devDaniel.RHFInputNumberSpinner → 8.2.0-beta.devManuela.RHFTextField

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 (25) hide show
  1. package/@types/types.d.ts +0 -8
  2. package/components/hook-form/RHFTextField/RHFTextField.js +13 -23
  3. package/components/hook-form/RHFTextField/RHFTextField.styles.js +104 -157
  4. package/components/hook-form/RHFTextField/stories/Error/RHFTextFieldErrorOutlined.stories.d.ts +29 -0
  5. package/components/hook-form/RHFTextField/stories/Error/RHFTextFieldErrorText.stories.d.ts +29 -0
  6. package/components/hook-form/RHFTextField/stories/Primary/RHFTextFieldOutlined.stories.d.ts +29 -0
  7. package/components/hook-form/RHFTextField/stories/Primary/RHFTextFieldText.stories.d.ts +32 -0
  8. package/components/hook-form/RHFTextField/types.d.ts +3 -0
  9. package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
  10. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +6 -6
  11. package/components/mui_extended/TextField/types.d.ts +54 -10
  12. package/package.json +1 -1
  13. package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts +0 -5
  14. package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts +0 -8
  15. package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +0 -4
  16. package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerEnum.d.ts +0 -10
  17. package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +0 -28
  18. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.defaultProps.stories.d.ts +0 -26
  19. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.error.stories.d.ts +0 -13
  20. package/components/hook-form/RHFInputNumberSpinner/stories/RHFInputNumberSpinner.variants.stories.d.ts +0 -23
  21. package/components/hook-form/RHFInputNumberSpinner/types.d.ts +0 -71
  22. package/components/hook-form/RHFTextField/stories/Error/TextFieldErrorOutlined.stories.d.ts +0 -9
  23. package/components/hook-form/RHFTextField/stories/Error/TextFieldErrorText.stories.d.ts +0 -9
  24. package/components/hook-form/RHFTextField/stories/Primary/TextFieldOutlined.stories.d.ts +0 -9
  25. package/components/hook-form/RHFTextField/stories/Primary/TextFieldText.stories.d.ts +0 -9
package/@types/types.d.ts CHANGED
@@ -52,7 +52,6 @@ import type {
52
52
  } from '../components/mui_extended/MenuItem/types';
53
53
 
54
54
  import { SelectOwnerState, SelectSlotsType } from '../components/mui_extended/Select/types';
55
- import { RHFInputNumberSpinnerOwnerState, RHFInputNumberSpinnerSlotsType } from '../components/hook-form/RHFInputNumberSpinner/types';
56
55
 
57
56
  declare module '@mui/material/styles' {
58
57
  // Define the slots in the theme
@@ -77,7 +76,6 @@ declare module '@mui/material/styles' {
77
76
  M4LSkeleton: SkeletonSlotsType;
78
77
  M4LSelect: SelectSlotsType;
79
78
  M4LTypography: TypographySlotsType;
80
- M4LRHFInputNumberSpinner: RHFInputNumberSpinnerSlotsType;
81
79
  }
82
80
 
83
81
  interface ComponentsPropsList {
@@ -102,7 +100,6 @@ declare module '@mui/material/styles' {
102
100
  M4LSkeleton: Partial<SkeletonOwnerState>;
103
101
  M4LSelect: Partial<SelectOwnerState>;
104
102
  M4LTypography: Partial<TypographyOwnerState>;
105
- M4LRHFInputNumberSpinner:Partial<RHFInputNumberSpinnerOwnerState>
106
103
  }
107
104
 
108
105
  interface Components {
@@ -205,11 +202,6 @@ declare module '@mui/material/styles' {
205
202
  styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
206
203
  variants?: ComponentsVariants['M4LTypography'];
207
204
  };
208
- M4LRHFInputNumberSpinner?: {
209
- defaultProps?: ComponentsPropsList['M4LRHFInputNumberSpinner'];
210
- styleOverrides?: ComponentsOverrides<Theme>['M4LRHFInputNumberSpinner'];
211
- variants?: ComponentsVariants['M4LRHFInputNumberSpinner'];
212
- };
213
205
  }
214
206
  }
215
207
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { forwardRef, useState, useEffect } from "react";
2
+ import { forwardRef } from "react";
3
3
  import { useFormContext, Controller } from "react-hook-form";
4
4
  import { useTheme, InputAdornment } from "@mui/material";
5
5
  import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
@@ -13,7 +13,7 @@ import { R as RHFTextFieldSlots } from "./slots/RHFTextFieldEnum.js";
13
13
  import { H as HelperError } from "../../HelperError/HelperError.js";
14
14
  const RHFTextField = forwardRef((props, ref) => {
15
15
  const {
16
- name: nameRHF,
16
+ name,
17
17
  autoComplete = "off",
18
18
  skeletonWidth = "100%",
19
19
  skeletonHeight = "18px",
@@ -30,42 +30,32 @@ const RHFTextField = forwardRef((props, ref) => {
30
30
  color = "primary",
31
31
  isInteger = true,
32
32
  mandatoryMessage,
33
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
33
  helperText = true,
35
34
  ...other
36
35
  } = props;
37
- const ariaLabelledById = `field-label-${nameRHF}`;
36
+ const ariaLabelledById = `field-label-${name}`;
38
37
  const {
39
38
  control,
40
39
  formState: { errors }
41
40
  } = useFormContext();
42
- const [currentVariant, setCurrentVariant] = useState(null);
43
41
  const { handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
44
42
  const isDesktop = useResponsiveDesktop();
45
43
  const isSkeleton = useModuleSkeleton();
46
- useEffect(() => {
47
- if (errors[nameRHF]) {
48
- setCurrentVariant("error");
49
- } else if (variant) {
50
- setCurrentVariant(variant);
51
- } else {
52
- setCurrentVariant(null);
53
- }
54
- }, [errors[nameRHF], variant, control]);
55
44
  const theme = useTheme();
56
45
  const paletteColor = getPropertyByString(
57
46
  theme.palette,
58
- disabled ? "default" : color,
47
+ disabled ? "default" : errors ? "error" : color,
59
48
  theme.palette.default
60
49
  );
61
50
  const ownerState = {
62
- name: nameRHF,
51
+ name,
63
52
  isInteger,
64
53
  paletteColor,
65
54
  type: type ?? "text",
66
55
  size: !isDesktop ? "medium" : size,
67
56
  disabled,
68
- variantRHFTextField: RHFvariants
57
+ variantRHFTextField: RHFvariants,
58
+ RHFtextFieldError: !!errors[name]
69
59
  };
70
60
  return (
71
61
  /* RHFTextFieldRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los overrides
@@ -79,14 +69,14 @@ const RHFTextField = forwardRef((props, ref) => {
79
69
  onBlur: handlerOnBlur,
80
70
  onKeyUp: handlerOnKeyUp,
81
71
  role: "textbox",
82
- htmlFor: nameRHF,
72
+ htmlFor: name,
83
73
  ...getPropDataTestId(RHF_TEXT_FIELD_KEY_COMPONENT, RHFTextFieldSlots.root),
84
74
  children: !isSkeleton ? (
85
75
  /* controller: Componente usado para suscribir el componente al contexto de hook-form */
86
76
  /* @__PURE__ */ jsx(
87
77
  Controller,
88
78
  {
89
- name: nameRHF,
79
+ name,
90
80
  control,
91
81
  render: ({ field: { onChange, value, ref: inputRef }, fieldState: { error } }) => {
92
82
  const onInternalChange = (event) => {
@@ -128,8 +118,8 @@ const RHFTextField = forwardRef((props, ref) => {
128
118
  className: "rhf-text-field-root",
129
119
  value: type === "number" ? isNaN(parseFloat(value)) ? "" : value : value || "",
130
120
  inputProps: {
131
- name: nameRHF,
132
- id: nameRHF,
121
+ name,
122
+ id: name,
133
123
  "aria-labelledby": ariaLabelledById,
134
124
  ...getPropDataTestId(RHF_TEXT_FIELD_KEY_COMPONENT, RHFTextFieldSlots.textField)
135
125
  },
@@ -151,10 +141,10 @@ const RHFTextField = forwardRef((props, ref) => {
151
141
  ...other
152
142
  }
153
143
  ),
154
- currentVariant ? /* @__PURE__ */ jsx(
144
+ error?.message ? /* @__PURE__ */ jsx(
155
145
  HelperError,
156
146
  {
157
- message: currentVariant !== "error" ? helperMessage : error?.message
147
+ message: error.message
158
148
  }
159
149
  ) : null
160
150
  ] });
@@ -1,265 +1,212 @@
1
1
  const rhfTextFieldStyles = {
2
2
  /**
3
3
  * Estilos personalizados para el componente RHFTextField.
4
- * @author Bruce Escobar - automatic
5
- * @createdAt 2024-10-22 09:41:31 - automatic
6
- * @updatedAt 2024-10-22 19:27:23 - automatic
7
- * @updatedUser Bruce Escobar - automatic
8
4
  */
9
5
  textField: ({ ownerState, theme }) => ({
10
6
  "&.rhf-text-field-root": {
11
7
  width: "100%",
12
8
  padding: 0,
13
- borderRadius: theme.size.borderRadius.r1,
14
- // Condiciones de tamaño Medium en el root
15
- ...ownerState.sizes === "medium" && {
16
- ...theme.generalSettings.isMobile ? {
17
- height: theme.vars.size.mobile.medium.action,
18
- width: theme.vars.size.mobile.medium.action
19
- } : {
20
- height: theme.vars.size.desktop.medium.action,
21
- width: theme.vars.size.desktop.medium.action
22
- }
23
- },
24
- // Condiciones de tamaño Small en el root
25
- ...ownerState.sizes === "small" && {
26
- ...theme.generalSettings.isMobile ? {
27
- height: theme.vars.size.mobile.small.action,
28
- width: theme.vars.size.mobile.small.action
29
- } : {
30
- height: theme.vars.size.desktop.medium.action,
31
- width: theme.vars.size.desktop.medium.action
32
- }
9
+ borderRadius: theme.vars.size.borderRadius.r1,
10
+ display: "flex",
11
+ '& [class*="M4LIcon-icon"]': {
12
+ backgroundColor: ownerState.paletteColor?.main
33
13
  },
34
14
  // Variant Outlined TextField
35
15
  ...ownerState.variantRHFTextField === "outlined" && {
36
16
  "& .MuiInputBase-root": {
37
17
  padding: 0,
38
18
  minHeight: 0,
19
+ height: "inherit",
39
20
  paddingLeft: theme.vars.size.baseSpacings.sp1,
40
21
  paddingRight: theme.vars.size.baseSpacings.sp1,
41
- borderRadius: theme.size.borderRadius.r1,
22
+ borderRadius: theme.vars.size.borderRadius.r1,
42
23
  "& .MuiOutlinedInput-notchedOutline": {
24
+ minHeight: 0,
43
25
  border: theme.vars.size.borderStroke.actionInput,
44
- borderColor: theme.vars.palette.border.default
26
+ borderColor: ownerState.error ? ownerState.paletteColor?.main : theme.vars.palette.border.default
45
27
  },
46
- //Active para primary para el icono y placeholder
47
- "&:active": {
48
- ":focus-within": {
49
- "&:focus-within .MuiInputBase-input::placeholder": {
50
- color: theme.vars.palette.primary.active
51
- },
52
- '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
53
- backgroundColor: theme.vars.palette.primary.active
54
- }
55
- }
28
+ //Estilo Hover para primary para el Icono e IconButton
29
+ "&:hover": {
30
+ backgroundColor: ownerState.paletteColor?.hoverOpacity
56
31
  },
57
- //Estilos de focus primary para el icono y placeholder
32
+ //Estilo Focus para primary para el Icono e IconButton
58
33
  ":focus-within": {
59
- "&:focus-within .MuiInputBase-input::placeholder": {
60
- color: ownerState.paletteColor?.main
61
- },
34
+ borderColor: theme.vars.palette.border.main,
62
35
  '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
63
36
  backgroundColor: ownerState.paletteColor?.main
37
+ },
38
+ '&:focus-within .MuiIconButton-root [class*="M4LIcon-icon"]': {
39
+ backgroundColor: ownerState.paletteColor?.main
64
40
  }
65
41
  },
66
- //Estilos del hover primar
67
- "&:hover": {
68
- backgroundColor: ownerState.paletteColor?.hoverOpacity
42
+ //Estilo Active para primary para el Icono e IconButton
43
+ "&:active": {
44
+ ":focus-within": {
45
+ '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
46
+ backgroundColor: ownerState.paletteColor?.main
47
+ },
48
+ '&:focus-within .MuiIconButton-root [class*="M4LIcon-icon"]': {
49
+ backgroundColor: ownerState.paletteColor?.main
50
+ },
51
+ "&:not(:placeholder-shown)": {
52
+ color: ownerState.paletteColor?.active
53
+ }
54
+ }
69
55
  },
70
56
  //Estilos del InputBase
71
57
  "& .MuiInputBase-input": {
72
- ...ownerState.error && {
73
- borderColor: ownerState.error ? theme.vars.palette.border.error : theme.vars.palette.border.default
74
- },
58
+ padding: "0px",
59
+ paddingRight: theme.vars.size.baseSpacings.sp1,
60
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
61
+ height: "inherit",
75
62
  //Estilos del InputBase en hover
76
63
  "&:hover ~ .MuiOutlinedInput-notchedOutline": {
77
64
  ...ownerState.error && {
78
65
  borderColor: ownerState.error ? theme.vars.palette.border.error : theme.vars.palette.border.default
79
66
  }
80
67
  },
81
- //Estilos del InputBase en Focus
68
+ // Estilos del InputBase en Focus
82
69
  "&:focus ~ .MuiOutlinedInput-notchedOutline": {
83
- borderColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
70
+ borderColor: ownerState.paletteColor?.main
84
71
  },
85
- //Estilos del InputBase en Active
72
+ // Estilos del InputBase en Active
86
73
  "&:active ~ .MuiOutlinedInput-notchedOutline": {
87
- borderColor: ownerState.error ? theme.vars.palette.error.active : theme.vars.palette.primary.active
74
+ borderColor: ownerState.paletteColor?.active
88
75
  },
89
76
  //Estilos del InputBase en placeholder default
90
77
  "&::placeholder": {
91
- color: theme.vars.palette.text.primary
78
+ color: theme.vars.palette.text.secondary
79
+ },
80
+ "&:not(:placeholder-shown)": {
81
+ color: ownerState.textFieldError ? ownerState.paletteColor?.main : theme.vars.palette.text.primary
92
82
  }
93
83
  },
94
84
  //Este estilo se asegura de que los campos de entrada que han sido autocompletados por el navegador no tengan ningún relleno adicional
95
85
  "& .MuiOutlinedInput-input:-webkit-autofill": {
96
86
  padding: 0
97
87
  },
98
- // Historia Error variante Outlined
99
- ...ownerState.error && {
100
- "& .MuiOutlinedInput-notchedOutline": {
101
- borderColor: ownerState.error ? theme.vars.palette.border.error : theme.vars.palette.border.default
102
- },
103
- //Estilos del hover Error
104
- "&:hover": {
105
- backgroundColor: theme.vars.palette.error.hoverOpacity,
106
- borderColor: ownerState.paletteColor?.main
107
- },
108
- //Estilos focus Error el icono y placeholder de color error
109
- "&:focus-within": {
110
- "&:focus-within .MuiInputBase-input::placeholder": {
111
- color: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
112
- },
113
- '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
114
- backgroundColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
115
- }
116
- },
117
- //Estilos active Error el icono y placeholder de color error
118
- "&:active": {
119
- "&:focus-within": {
120
- "&:focus-within .MuiInputBase-input::placeholder": {
121
- color: theme.vars.palette.error.active
122
- },
123
- '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
124
- backgroundColor: theme.vars.palette.error.active
125
- }
126
- }
127
- }
128
- },
129
88
  // Historia Disabled para Outlined
130
89
  ...ownerState.disabled && {
131
- borderColor: theme.palette.border.disabled,
132
- pointerEvents: ownerState.disabled ? "none" : "auto",
90
+ borderColor: theme.vars.palette.border.disabled,
91
+ pointerEvents: ownerState.textFieldDisabled ? "none" : "auto",
133
92
  "&:hover": {
134
- pointerEvents: ownerState.disabled ? "none" : "auto"
93
+ pointerEvents: ownerState.textFieldDisabled ? "none" : "auto"
94
+ },
95
+ "& .MuiInputBase-input::placeholder": {
96
+ color: theme.vars.palette.text.disabled
135
97
  }
136
98
  }
137
99
  }
138
100
  },
139
- // Variant Text RHFTextField
101
+ // Variant Text TextField
140
102
  ...ownerState.variantRHFTextField === "text" && {
141
103
  borderColor: "transparent",
142
104
  "& .MuiInputBase-root": {
143
105
  padding: 0,
144
106
  minHeight: 0,
107
+ height: "inherit",
145
108
  borderColor: "transparent",
146
109
  paddingLeft: theme.vars.size.baseSpacings.sp1,
147
110
  paddingRight: theme.vars.size.baseSpacings.sp1,
148
- borderRadius: theme.size.borderRadius.r1,
111
+ borderRadius: theme.vars.size.borderRadius.r1,
149
112
  //Estilos para los bordes del campo de texto
150
113
  "& .MuiOutlinedInput-notchedOutline": {
114
+ minHeight: 0,
151
115
  border: theme.vars.size.borderStroke.actionInput,
152
- borderColor: theme.vars.palette.border.default,
153
- borderTop: theme.vars.palette.primary.main,
116
+ borderColor: ownerState.error ? ownerState.paletteColor?.main : theme.vars.palette.border.default,
154
117
  borderLeft: "transparent",
118
+ borderTop: "transparent",
155
119
  borderRight: "transparent"
156
120
  },
157
- //Estilo Focus para primary para el icono y placeholder
121
+ //Estilo Hover para primary para el Icono e IconButton
122
+ "&:hover": {
123
+ backgroundColor: ownerState.paletteColor?.hoverOpacity
124
+ },
125
+ //Estilo Focus para primary para el Icono e IconButton
158
126
  ":focus-within": {
159
- borderColor: theme.palette.border.main,
160
- "&:focus-within .MuiInputBase-input::placeholder": {
161
- color: ownerState.paletteColor?.main
162
- },
163
127
  '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
164
- backgroundColor: theme.vars.palette.primary.main
128
+ backgroundColor: ownerState.paletteColor?.main
129
+ },
130
+ '&:focus-within .MuiIconButton-root [class*="M4LIcon-icon"]': {
131
+ backgroundColor: ownerState.paletteColor?.main
165
132
  }
166
133
  },
167
- //Estilo Active para primary para el icono y placeholder
134
+ //Estilo Active para primary para el Icono e IconButton
168
135
  "&:active": {
169
136
  ":focus-within": {
170
- "&:focus-within .MuiInputBase-input::placeholder": {
171
- color: theme.vars.palette.primary.active
172
- },
173
137
  '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
174
- backgroundColor: theme.vars.palette.primary.active
138
+ backgroundColor: ownerState.paletteColor?.main
139
+ },
140
+ '&:focus-within .MuiIconButton-root [class*="M4LIcon-icon"]': {
141
+ backgroundColor: ownerState.paletteColor?.main
142
+ },
143
+ "&:not(:placeholder-shown) .MuiOutlinedInput-notchedOutline": {
144
+ color: ownerState.textFieldError ? theme.vars.palette.error.main : theme.vars.palette.text.primary
175
145
  }
176
146
  }
177
147
  },
178
- //Estilos para Hover Text
179
- "&:hover": {
180
- borderColor: "transparent",
181
- backgroundColor: ownerState.paletteColor?.hoverOpacity
182
- },
183
148
  //Estilos del InputBase
184
149
  "& .MuiInputBase-input": {
185
- "&:hover ~ .MuiOutlinedInput-notchedOutline": {
186
- borderColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
187
- },
150
+ padding: "0px",
151
+ paddingRight: theme.vars.size.baseSpacings.sp1,
152
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
153
+ height: "inherit",
188
154
  //Estilo Focus del InputBase
189
155
  "&:focus ~ .MuiOutlinedInput-notchedOutline": {
190
- borderColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
156
+ borderColor: ownerState.paletteColor?.main
191
157
  },
192
158
  //Estilo Active del InputBase
193
159
  "&:active ~ .MuiOutlinedInput-notchedOutline": {
194
- borderColor: ownerState.error ? theme.vars.palette.error.active : theme.vars.palette.primary.active,
195
- "&:focus-within .MuiInputBase-input::placeholder": {
196
- color: theme.vars.palette.primary.active
197
- }
160
+ borderColor: ownerState.paletteColor?.active
198
161
  },
162
+ // Estilos del InputBase en placeholder default
199
163
  "&::placeholder": {
200
- color: theme.vars.palette.text.primary
164
+ color: theme.vars.palette.text.secondary
165
+ },
166
+ "&:not(:placeholder-shown)": {
167
+ color: ownerState.textFieldError ? ownerState.paletteColor?.main : theme.vars.palette.text.primary
201
168
  }
202
169
  },
203
170
  //Este estilo se asegura de que los campos de entrada que han sido autocompletados por el navegador no tengan ningún relleno adicional
204
171
  "& .MuiOutlinedInput-input:-webkit-autofill": {
205
172
  padding: 0
206
173
  },
207
- // Historia Error
208
- ...ownerState.error && {
209
- // Historia Error variante Text
210
- "& .MuiOutlinedInput-notchedOutline": {
211
- borderColor: theme.vars.palette.border.error,
212
- borderTop: theme.vars.palette.border.error,
213
- borderLeft: "transparent",
214
- borderRight: "transparent",
215
- "&:focus": { borderColor: theme.vars.palette.error.main }
216
- },
217
- //Estilos del hover Error
218
- "&:hover": {
219
- backgroundColor: theme.vars.palette.error.hoverOpacity
220
- },
221
- // Estilos focus Error el icono y placeholder de color error
222
- "&:focus-within": {
223
- borderColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main,
224
- "&:focus-within .MuiInputBase-input::placeholder": {
225
- color: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
226
- },
227
- '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
228
- backgroundColor: ownerState.error ? theme.vars.palette.error.main : theme.vars.palette.primary.main
229
- }
230
- },
231
- // Estilos active Error el icono y placeholder de color error
232
- "&:active": {
233
- "& .MuiOutlinedInput-notchedOutline": {
234
- borderColor: theme.vars.palette.error.main
235
- },
236
- ":focus-within": {
237
- "&:focus-within .MuiInputBase-input::placeholder": {
238
- color: theme.vars.palette.error.active
239
- },
240
- '&:focus-within [class*="M4LIcon-icon"]:not(.MuiIconButton-root [class*="M4LIcon-icon"])': {
241
- backgroundColor: theme.vars.palette.error.active
242
- }
243
- }
244
- }
245
- },
246
174
  // Historia Disabled
247
175
  ...ownerState.disabled && {
248
176
  "& .MuiOutlinedInput-notchedOutline": {
249
- borderColor: theme.palette.border.disabled,
250
- borderTop: theme.palette.border.disabled,
177
+ borderColor: theme.vars.palette.border.disabled,
178
+ borderTop: theme.vars.palette.border.disabled,
251
179
  borderLeft: "transparent",
252
180
  borderRight: "transparent"
253
181
  },
254
- pointerEvents: ownerState.disabled ? "none" : "auto",
182
+ pointerEvents: ownerState.textFieldDisabled ? "none" : "auto",
255
183
  "&:hover": {
256
- pointerEvents: ownerState.disabled ? "none" : "auto"
184
+ pointerEvents: ownerState.textFieldDisabled ? "none" : "auto"
185
+ },
186
+ "& .MuiInputBase-input::placeholder": {
187
+ color: theme.vars.palette.text.disabled
257
188
  }
258
189
  }
259
190
  }
260
191
  }
261
192
  }
262
193
  }),
194
+ /**
195
+ * Estilos personalizados para el componente Label.
196
+ */
197
+ label: ({ theme }) => ({
198
+ display: "flex",
199
+ alignItems: "center",
200
+ color: theme.vars.palette.text.primary,
201
+ "& .mandatory": {
202
+ /* color: theme.vars.palette.error.main, */
203
+ marginLeft: theme.spacing(0.5)
204
+ },
205
+ '& .M4LIcon-icon[class*="M4LIcon-icon"]': {
206
+ width: "inherit",
207
+ height: "inherit"
208
+ }
209
+ }),
263
210
  /**
264
211
  * Estilos personalizados para el componente Skeleton.
265
212
  * @author Bruce Escobar - automatic
@@ -0,0 +1,29 @@
1
+ import { Meta, StoryObj } from '@storybook/react/*';
2
+ import { RHFTextField } from '../../..';
3
+ declare const meta: Meta<typeof RHFTextField>;
4
+ type Story = StoryObj<typeof RHFTextField>;
5
+ /**
6
+ * Story for the Error outlined RHFvariants of the TextField component.
7
+ */
8
+ export declare const ErrorOutlined: Story;
9
+ /**
10
+ * Story for the Error outlined RHFvariants of the TextField component whit label props and adorment End
11
+ */
12
+ export declare const ErrorOutlinedAdormentEnd: Story;
13
+ /**
14
+ * Story for the Error outlined RHFvariants of the TextField component whit label props and adorment Start
15
+ */
16
+ export declare const ErrorOutlinedAdormentStart: Story;
17
+ /**
18
+ * Story for the Error outlined RHFvariants of the TextField component whitout adorments.
19
+ */
20
+ export declare const WhitoutAdorments: Story;
21
+ /**
22
+ * Story for the Error outlined RHFvariants of the TextField component whit adorment end.
23
+ */
24
+ export declare const WhitAdormentEnd: Story;
25
+ /**
26
+ * Story for the Error outlined RHFvariants of the TextField component whit adorment start.
27
+ */
28
+ export declare const WhitAdormentStart: Story;
29
+ export default meta;
@@ -0,0 +1,29 @@
1
+ import { Meta, StoryObj } from '@storybook/react/*';
2
+ import { RHFTextField } from '../../..';
3
+ declare const meta: Meta<typeof RHFTextField>;
4
+ type Story = StoryObj<typeof RHFTextField>;
5
+ /**
6
+ * Story for the Error Text RHFvariants of the TextField component.
7
+ */
8
+ export declare const ErrorText: Story;
9
+ /**
10
+ * Story for the Error Text RHFvariants of the TextField component whit label props and adorment End
11
+ */
12
+ export declare const ErrorTextAdormentEnd: Story;
13
+ /**
14
+ * Story for the Error Text RHFvariants of the TextField component whit label props and adorment Start
15
+ */
16
+ export declare const ErrorTextAdormentStart: Story;
17
+ /**
18
+ * Story for the Error Text RHFvariants of the TextField component whitout adorments.
19
+ */
20
+ export declare const WhitoutAdorments: Story;
21
+ /**
22
+ * Story for the Error Text RHFvariants of the TextField component whit adorment end.
23
+ */
24
+ export declare const WhitAdormentEnd: Story;
25
+ /**
26
+ * Story for the Error Text RHFvariants of the TextField component whit adorment start.
27
+ */
28
+ export declare const WhitAdormentStart: Story;
29
+ export default meta;
@@ -0,0 +1,29 @@
1
+ import { Meta, StoryObj } from '@storybook/react/*';
2
+ import { RHFTextField } from '../../..';
3
+ declare const meta: Meta<typeof RHFTextField>;
4
+ type Story = StoryObj<typeof RHFTextField>;
5
+ /**
6
+ * Story for the primary outlined RHFvariants of the TextField component.
7
+ */
8
+ export declare const PrimaryOutlined: Story;
9
+ /**
10
+ * Story for the primary outlined RHFvariants of the TextField component whit label props and adorment End
11
+ */
12
+ export declare const PrimaryOutlinedAdormentEnd: Story;
13
+ /**
14
+ * Story for the primary outlined RHFvariants of the TextField component whit label props and adorment Start
15
+ */
16
+ export declare const PrimaryOutlinedAdormentStart: Story;
17
+ /**
18
+ * Story for the primary outlined RHFvariants of the TextField component whitout adorments.
19
+ */
20
+ export declare const WhitoutAdorments: Story;
21
+ /**
22
+ * Story for the primary outlined RHFvariants of the TextField component whit adorment end.
23
+ */
24
+ export declare const WhitAdormentEnd: Story;
25
+ /**
26
+ * Story for the primary outlined RHFvariants of the TextField component whit adorment start.
27
+ */
28
+ export declare const WhitAdormentStart: Story;
29
+ export default meta;
@@ -0,0 +1,32 @@
1
+ import { Meta, StoryObj } from '@storybook/react/*';
2
+ import { RHFTextField } from '../../..';
3
+ declare const meta: Meta<typeof RHFTextField>;
4
+ type Story = StoryObj<typeof RHFTextField>;
5
+ /**
6
+ * Story for the primary text variant of the TextField component.
7
+ */
8
+ /**
9
+ * Story for the primary text RHFvariants of the TextField component.
10
+ */
11
+ export declare const PrimaryText: Story;
12
+ /**
13
+ * Story for the primary text RHFvariants of the TextField component whit label props and adorment End
14
+ */
15
+ export declare const PrimaryTextAdormentEnd: Story;
16
+ /**
17
+ * Story for the primary text RHFvariants of the TextField component whit label props and adorment Start
18
+ */
19
+ export declare const PrimaryTextAdormentStart: Story;
20
+ /**
21
+ * Story for the primary text RHFvariants of the TextField component whitout adorments.
22
+ */
23
+ export declare const WhitoutAdorments: Story;
24
+ /**
25
+ * Story for the primary text RHFvariants of the TextField component whit adorment end.
26
+ */
27
+ export declare const WhitAdormentEnd: Story;
28
+ /**
29
+ * Story for the primary text RHFvariants of the TextField component whit adorment start.
30
+ */
31
+ export declare const WhitAdormentStart: Story;
32
+ export default meta;
@@ -28,6 +28,7 @@ export interface RHFTextFieldProps extends Omit<TextFieldProps, 'size' | 'inputP
28
28
  isInteger?: boolean;
29
29
  color?: Extract<ComponentPalletColor, 'primary'>;
30
30
  RHFvariants?: VariantsRHFTextField;
31
+ RHFtextFieldError?: boolean;
31
32
  }
32
33
  export interface RHFTextFieldState extends Pick<RHFTextFieldProps, 'size' | 'disabled'> {
33
34
  type: 'password' | 'text';
@@ -39,6 +40,8 @@ export type RHFTextFieldOwnerState = RHFTextFieldProps & {
39
40
  componentPaletteColor?: ComponentPalletColor;
40
41
  paletteColor: PaletteColor;
41
42
  variantRHFTextField?: VariantsRHFTextField;
43
+ RHFtextFieldError?: boolean;
44
+ error?: boolean;
42
45
  };
43
46
  export type RHFTextFieldSlotsType = keyof typeof RHFTextFieldSlots;
44
47
  export type RHFTextFieldStyles = Partial<OverridesStyleRules<RHFTextFieldSlotsType, typeof RHF_TEXT_FIELD_KEY_COMPONENT, Theme> | undefined> | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare enum TextFieldSlots {
2
- muiTextFieldStyled = "muiTextFieldStyled",
2
+ root = "root",
3
3
  textFieldRootStyled = "textFieldRootStyled",
4
4
  muiSkeletonStyled = "muiSkeletonStyled"
5
5
  }
@@ -1,13 +1,13 @@
1
1
  export declare const MuiTextFieldStyled: import('@emotion/styled').StyledComponent<Pick<{
2
2
  variant?: import('@mui/material').TextFieldVariants | undefined;
3
- } & Omit<import('@mui/material').FilledTextFieldProps | import('@mui/material').OutlinedTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant">, "children" | "value" | "ref" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "margin" | "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" | "label" | "key" | "autoComplete" | "placeholder" | "required" | "fullWidth" | "inputProps" | "inputRef" | "SelectProps" | "multiline" | "maxRows" | "minRows" | "hiddenLabel" | "focused" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
4
- ownerState: Partial<import('../types').OwnerState> & Record<string, unknown>;
3
+ } & Omit<import('@mui/material').FilledTextFieldProps | import('@mui/material').OutlinedTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant">, "children" | "value" | "ref" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "margin" | "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" | "label" | "key" | "autoComplete" | "placeholder" | "required" | "fullWidth" | "inputProps" | "inputRef" | "SelectProps" | "multiline" | "maxRows" | "minRows" | "hiddenLabel" | "focused" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TextFieldOwnerState> & Record<string, unknown> & {
4
+ ownerState: Partial<import('../types').TextFieldOwnerState> & Record<string, unknown>;
5
5
  }, {}, {}>;
6
- export declare const TextFieldRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
7
- ownerState: Partial<import('../types').OwnerState> & Record<string, unknown>;
6
+ export declare const TextFieldRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TextFieldOwnerState> & Record<string, unknown> & {
7
+ ownerState: Partial<import('../types').TextFieldOwnerState> & Record<string, unknown>;
8
8
  }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
9
9
  export declare const MuiSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
10
10
  ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
11
- }, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "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" | "key"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
12
- ownerState: Partial<import('../types').OwnerState> & Record<string, unknown>;
11
+ }, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "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" | "key"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TextFieldOwnerState> & Record<string, unknown> & {
12
+ ownerState: Partial<import('../types').TextFieldOwnerState> & Record<string, unknown>;
13
13
  }, {}, {}>;
@@ -4,7 +4,6 @@ import { TextFieldSlots } from './slots/TextFieldEnum';
4
4
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
5
5
  import { TEXT_FIELD_KEY_COMPONENT } from './constants';
6
6
  import { ComponentPalletColor, Sizes } from '@m4l/styles';
7
- import { LabelProps } from '../../Label/types';
8
7
  /**
9
8
  * Variants for the TextField component.
10
9
  */
@@ -17,19 +16,64 @@ export type SkeletonVariants = 'rectangular' | 'circular' | 'text';
17
16
  * Props for the TextField component.
18
17
  *
19
18
  */
20
- export interface TextFieldProps extends Omit<MUITextFieldProps, 'size' | 'color' | 'disabled' | 'variant'>, Pick<LabelProps, 'helperMessage' | 'htmlFor' | 'id' | 'mandatory' | 'mandatoryMessage'> {
19
+ export interface TextFieldProps extends Omit<MUITextFieldProps, 'size' | 'color' | 'disabled' | 'variant'> {
20
+ /**
21
+ * todo: documentar
22
+ */
21
23
  dataTestId?: string;
24
+ /**
25
+ * Variante del campo de texto.
26
+ * variant="text"
27
+ */
22
28
  variant?: TextFieldVariants;
29
+ /**
30
+ * Indica si el campo de texto está deshabilitado.
31
+ * disabled={true}
32
+ */
23
33
  disabled?: boolean;
24
- size?: Sizes;
34
+ /**
35
+ * Tamaño del campo de texto.
36
+ * size="medium"
37
+ */
38
+ size?: Extract<Sizes, 'small' | 'medium'>;
39
+ /**
40
+ * Color del campo de texto.
41
+ * color="primary"
42
+ */
25
43
  color?: Extract<ComponentPalletColor, 'primary'>;
26
44
  }
27
- export type OwnerState = Pick<TextFieldProps, 'size' | 'color' | 'disabled' | 'error'> & {
28
- disabled?: boolean;
29
- paletteColor: PaletteColor;
30
- variantTextField?: TextFieldVariants;
31
- componentPaletteColor?: ComponentPalletColor;
32
- };
45
+ /**
46
+ * Estado del propietario del campo de texto.
47
+ */
48
+ export interface TextFieldOwnerState {
49
+ /**
50
+ * Indica si el campo de texto está deshabilitado.
51
+ */
52
+ textFieldDisabled?: boolean;
53
+ /**
54
+ * Color de la paleta del campo de texto.
55
+ */
56
+ textFieldPaletteColor: PaletteColor;
57
+ /**
58
+ * Variante del campo de texto.
59
+ */
60
+ textFieldVariant?: TextFieldVariants;
61
+ /**
62
+ * Color de la paleta del componente del campo de texto.
63
+ */
64
+ textFieldComponentPaletteColor?: ComponentPalletColor;
65
+ /**
66
+ * Tamaño del campo de texto.
67
+ */
68
+ textFieldSizes: Extract<Sizes, 'small' | 'medium'>;
69
+ /**
70
+ * Indica si el campo de texto es error.
71
+ */
72
+ textFieldError?: boolean;
73
+ /**
74
+ * Color del campo de texto.
75
+ */
76
+ textFieldColor?: Extract<ComponentPalletColor, 'primary'>;
77
+ }
33
78
  export type TextFieldSlotsType = keyof typeof TextFieldSlots;
34
- export type TextFieldOwnerState = OwnerState;
35
79
  export type TextFieldStyles = Partial<OverridesStyleRules<TextFieldSlotsType, typeof TEXT_FIELD_KEY_COMPONENT, Theme> | undefined> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "8.2.0-beta.devDaniel.RHFInputNumberSpinner",
3
+ "version": "8.2.0-beta.devManuela.RHFTextField",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -1,5 +0,0 @@
1
- import { RHFInputNumberSpinnerProps } from './types';
2
- /**
3
- * Componente RHFInputNumberSpinner
4
- */
5
- export declare const RHFInputNumberSpinner: (props: RHFInputNumberSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { RHFInputNumberSpinnerStyles } from './types';
2
- /**
3
- * Estilos para el componente `RHFInputNumberSpinner`.
4
- *
5
- * Este objeto contiene los estilos para los diferentes slots del componente,
6
- * permitiendo personalizar su apariencia a través de las propiedades definidas.
7
- */
8
- export declare const rhfInputNumberSpinnerStyles: RHFInputNumberSpinnerStyles;
@@ -1,4 +0,0 @@
1
- /**
2
- * Nombre de clase que se usa para dar identidad a los slots del componente.
3
- */
4
- export declare const RHFINPUTNUMBER_SPINNER_KEY_COMPONENT = "M4LRHFInputNumberSpinner";
@@ -1,10 +0,0 @@
1
- /**
2
- * Define los nombres de los slots de estilo para el componente `RHFInputNumberSpinner`. Estos slots se utilizan para
3
- * aplicar estilos específicos y crear clases CSS únicas para los distintos elementos del componente.
4
- */
5
- export declare enum RHFInputNumberSpinnerSlots {
6
- root = "root",
7
- label = "label",
8
- inputNumberSpinner = "inputNumberSpinner",
9
- helperError = "helperError"
10
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * Este componente utiliza el slot `root` para aplicar estilos personalizados
3
- * al contenedor principal del `RHFInputNumberSpinner`.
4
- */
5
- export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
6
- ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
7
- }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
8
- /**
9
- * Este componente utiliza el slot `label` para aplicar estilos personalizados
10
- * a la etiqueta que acompaña al campo de entrada.
11
- */
12
- export declare const LabelStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Label').LabelProps, keyof import('../../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
13
- ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
14
- }, {}, {}>;
15
- /**
16
- * Este componente utiliza el slot `inputNumberSpinner` para aplicar estilos
17
- * personalizados al campo de entrada numérica del spinner.
18
- */
19
- export declare const InputNumberSpinnerStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../InputNumberSpinner/types').InputNumberSpinnerProps, keyof import('../../../InputNumberSpinner/types').InputNumberSpinnerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
20
- ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
21
- }, {}, {}>;
22
- /**
23
- * Este componente utiliza el slot `inputNumberSpinner` para aplicar estilos
24
- * personalizados al campo de entrada numérica del spinner.
25
- */
26
- export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps, keyof import('../../../HelperError').HelperErrorProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown> & {
27
- ownerState: Partial<import('../types').RHFInputNumberSpinnerOwnerState> & Record<string, unknown>;
28
- }, {}, {}>;
@@ -1,26 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
3
- declare const meta: Meta<typeof RHFInputNumberSpinner>;
4
- export default meta;
5
- /**
6
- * Tipo de historia para `RHFInputNumberSpinner`.
7
- */
8
- type Story = StoryObj<typeof RHFInputNumberSpinner>;
9
- /**
10
- * Historia base para el componente `RHFInputNumberSpinner`.
11
- * Esta historia muestra la funcionalidad básica del componente.
12
- */
13
- export declare const Base: Story;
14
- export declare const Default: Story;
15
- export declare const DefaultDisabled: Story;
16
- /**
17
- * Historia base para el componente `RHFInputNumberSpinner`.
18
- * Esta historia muestra la funcionalidad básica del componente.
19
- */
20
- export declare const SinLabel: Story;
21
- export declare const SinLabelDisabled: Story;
22
- /**
23
- * Historia en Skeleton para el componente `RHFInputNumberSpinner`.
24
- * Esta historia muestra la funcionalidad del componente en modo Skeleton.
25
- */
26
- export declare const Skeleton: Story;
@@ -1,13 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
3
- declare const meta: Meta<typeof RHFInputNumberSpinner>;
4
- export default meta;
5
- /**
6
- * Tipo de historia para `RHFInputNumberSpinner`.
7
- */
8
- type Story = StoryObj<typeof RHFInputNumberSpinner>;
9
- /**
10
- * Historia base para el componente `RHFInputNumberSpinner`.
11
- * Esta historia muestra la funcionalidad básica del componente.
12
- */
13
- export declare const Base: Story;
@@ -1,23 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { RHFInputNumberSpinner } from '../RHFInputNumberSpinner';
3
- declare const meta: Meta<typeof RHFInputNumberSpinner>;
4
- export default meta;
5
- /**
6
- * Tipo de historia para `RHFInputNumberSpinner`.
7
- */
8
- type Story = StoryObj<typeof RHFInputNumberSpinner>;
9
- /**
10
- * Historia base para el componente `RHFInputNumberSpinner`.
11
- * Esta historia muestra la funcionalidad básica del componente.
12
- */
13
- export declare const Base: Story;
14
- /**
15
- * Historia base para el componente `RHFInputNumberSpinner`.
16
- * Esta historia muestra la funcionalidad básica del componente.
17
- */
18
- export declare const OutlinedWithLabel: Story;
19
- /**
20
- * Historia base para el componente `RHFInputNumberSpinner`.
21
- * Esta historia muestra la funcionalidad básica del componente.
22
- */
23
- export declare const TextWithLabel: Story;
@@ -1,71 +0,0 @@
1
- import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
- import { Theme } from '@mui/material';
3
- import { ComponentPalletColor, Sizes } from '@m4l/styles';
4
- import { LabelProps } from '../../Label';
5
- import { RHFInputNumberSpinnerSlots } from './slots/RHFInputNumberSpinnerEnum';
6
- import { RHFINPUTNUMBER_SPINNER_KEY_COMPONENT } from './constants';
7
- /**
8
- * Props para el componente RHPInputNumberSpinner
9
- */
10
- export interface RHFInputNumberSpinnerProps extends Omit<LabelProps, 'label'> {
11
- name: string;
12
- /**
13
- * Cantidad de números por los que se incrementará o disminuirá el valor.
14
- */
15
- steps: number;
16
- /**
17
- * Tipo de dato del valor, puede ser 'pt' (puntos), '%' (porcentaje) o vacio.
18
- */
19
- valueType?: 'pt' | '%';
20
- /**
21
- * Indica si el componente está deshabilitado.
22
- */
23
- disabled?: boolean;
24
- /**
25
- * Tamaño del componente, puede ser uno de los valores definidos en 'small' , 'medium' , 'large'.
26
- */
27
- sizes?: Extract<Sizes, 'small' | 'medium'>;
28
- /**
29
- * Valor máximo permitido para el componente.
30
- */
31
- maxValue: number;
32
- /**
33
- * Valor mínimo permitido para el componente.
34
- */
35
- minValue: number;
36
- color?: Extract<ComponentPalletColor, 'primary'>;
37
- /**
38
- * Prop Para el testeo del componente
39
- */
40
- instaceDataTestId?: string;
41
- /**
42
- * Variante de estilos
43
- */
44
- variants?: 'Outlined' | 'Text';
45
- /**
46
- * label para informar sobre el campo
47
- */
48
- label?: string;
49
- }
50
- /**
51
- * Define las claves del objeto `RHFInputNumberSpinnerSlots`, que se utilizan para
52
- * hacer referencia a los diferentes slots disponibles para estilizar el componente
53
- * `RHFInputNumberSpinner`.
54
- */
55
- export type RHFInputNumberSpinnerSlotsType = keyof typeof RHFInputNumberSpinnerSlots;
56
- /**
57
- * Representa las propiedades de estado específicas del componente `RHFInputNumberSpinner`.
58
- */
59
- export interface RHFInputNumberSpinnerOwnerState {
60
- /**
61
- * Valor para definir el tamaño del icono.
62
- */
63
- iconSize: Sizes;
64
- }
65
- /**
66
- * Define los estilos del componente `RHFInputNumberSpinner`. Permite la personalización parcial
67
- * de las reglas de estilo mediante `OverridesStyleRules`.
68
- *
69
- * Puede ser parcial o estar indefinido.
70
- */
71
- export type RHFInputNumberSpinnerStyles = Partial<OverridesStyleRules<RHFInputNumberSpinnerSlots, typeof RHFINPUTNUMBER_SPINNER_KEY_COMPONENT, Theme>> | undefined;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react/*';
2
- import { RHFTextField } from '../../..';
3
- declare const meta: Meta<typeof RHFTextField>;
4
- type Story = StoryObj<typeof RHFTextField>;
5
- /**
6
- * Error en RHFTextField outlined y text se utiliza para mostrar un campo de texto que indica un estado de error. Esto es útil para proporcionar retroalimentación visual al usuario cuando hay un problema con la entrada de datos.
7
- */
8
- export declare const ErrorOutlined: Story;
9
- export default meta;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react/*';
2
- import { RHFTextField } from '../../..';
3
- declare const meta: Meta<typeof RHFTextField>;
4
- type Story = StoryObj<typeof RHFTextField>;
5
- /**
6
- * Error en RHFTextField outlined y text se utiliza para mostrar un campo de texto que indica un estado de error. Esto es útil para proporcionar retroalimentación visual al usuario cuando hay un problema con la entrada de datos.
7
- */
8
- export declare const ErrorText: Story;
9
- export default meta;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react/*';
2
- import { RHFTextField } from '../../..';
3
- declare const meta: Meta<typeof RHFTextField>;
4
- type Story = StoryObj<typeof RHFTextField>;
5
- /**
6
- * Story for the primary outlined RHFvariants of the TextField component.
7
- */
8
- export declare const PrimaryOutlined: Story;
9
- export default meta;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react/*';
2
- import { RHFTextField } from '../../..';
3
- declare const meta: Meta<typeof RHFTextField>;
4
- type Story = StoryObj<typeof RHFTextField>;
5
- /**
6
- * Story for the primary text variant of the TextField component.
7
- */
8
- export declare const PrimaryText: Story;
9
- export default meta;