@m4l/components 9.1.77 → 9.1.79

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 (60) hide show
  1. package/@types/types.d.ts +11 -2
  2. package/components/HelperError/HelperError.d.ts +1 -1
  3. package/components/HelperError/HelperError.js +16 -21
  4. package/components/HelperError/HelperError.styles.js +25 -15
  5. package/components/HelperError/constant.d.ts +0 -1
  6. package/components/HelperError/constant.js +0 -2
  7. package/components/HelperError/slots/HelperErrorSlots.js +2 -1
  8. package/components/HelperError/types.d.ts +6 -10
  9. package/components/Label/Label.js +1 -1
  10. package/components/Label/Label.styles.js +70 -13
  11. package/components/Label/types.d.ts +1 -0
  12. package/components/NumberInput/NumberInput.js +124 -0
  13. package/components/NumberInput/NumberInput.styles.js +199 -0
  14. package/components/NumberInput/constants.js +4 -0
  15. package/components/NumberInput/hooks/useNumberInput/NumberInputActions.js +12 -0
  16. package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.js +106 -0
  17. package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +364 -0
  18. package/components/NumberInput/slots/NumberInputEnum.js +13 -0
  19. package/components/NumberInput/slots/NumberInputSlots.js +43 -0
  20. package/components/NumberInput/utils.js +23 -0
  21. package/components/PropertyValue/PropertyValue.d.ts +1 -1
  22. package/components/PropertyValue/PropertyValue.js +5 -17
  23. package/components/PropertyValue/PropertyValue.styles.js +6 -6
  24. package/components/hook-form/RHFCheckbox/RHFCheckBox.styles.d.ts +2 -0
  25. package/components/hook-form/RHFCheckbox/RHFCheckBox.styles.js +31 -0
  26. package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +2 -2
  27. package/components/hook-form/RHFCheckbox/RHFCheckbox.js +57 -67
  28. package/components/hook-form/RHFCheckbox/constants.d.ts +2 -0
  29. package/components/hook-form/RHFCheckbox/constants.js +7 -0
  30. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxEnum.d.ts +6 -0
  31. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxEnum.js +10 -0
  32. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +4 -0
  33. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +28 -0
  34. package/components/hook-form/RHFCheckbox/slots/index.d.ts +2 -0
  35. package/components/hook-form/RHFCheckbox/types.d.ts +33 -5
  36. package/components/hook-form/RHFNumberInput/RHFNumberInput.js +89 -0
  37. package/components/hook-form/RHFNumberInput/RHFNumberInput.styles.js +16 -0
  38. package/components/hook-form/RHFNumberInput/constants.js +4 -0
  39. package/components/hook-form/RHFNumberInput/slots/RHFNumberInputEnum.js +7 -0
  40. package/components/hook-form/RHFNumberInput/slots/RHFNumberInputSlots.js +11 -0
  41. package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
  42. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  43. package/components/hook-form/index.d.ts +1 -0
  44. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +1 -1
  45. package/components/mui_extended/CheckBox/CheckBox.d.ts +2 -2
  46. package/components/mui_extended/CheckBox/CheckBox.js +4 -3
  47. package/components/mui_extended/CheckBox/CheckBox.styles.js +64 -15
  48. package/components/mui_extended/CheckBox/types.d.ts +31 -6
  49. package/index.js +22 -20
  50. package/package.json +1 -1
  51. package/components/HelperError/HelperError.stories.d.ts +0 -13
  52. package/components/hook-form/RHFCheckbox/classes/index.d.ts +0 -12
  53. package/components/hook-form/RHFCheckbox/classes/index.js +0 -44
  54. package/components/hook-form/RHFCheckbox/classes/types.d.ts +0 -12
  55. package/components/hook-form/RHFCheckbox/styles.d.ts +0 -6
  56. package/components/hook-form/RHFCheckbox/styles.js +0 -24
  57. package/components/hook-form/RHFCheckbox/test/constants.d.ts +0 -4
  58. package/components/hook-form/RHFCheckbox/test/constants.js +0 -4
  59. package/components/hook-form/RHFCheckbox/test/utils.d.ts +0 -2
  60. package/components/hook-form/RHFCheckbox/test/utils.js +0 -7
package/@types/types.d.ts CHANGED
@@ -142,6 +142,7 @@ import { PropagateLoaderSpinnerOwnerState, PropagateLoaderSpinnerType } from '..
142
142
  import { LinearProgressIndeterminateOwnerState, LinearProgressIndeterminateType } from '../components/LinearProgressIndeterminate/types';
143
143
  import { MenuDividerOwnerState, MenuDividerSlotsType } from '../components/mui_extended/MenuDivider/types';
144
144
  import { RHFSelectSlotsType, RHFSelectOwnerState } from '../components/hook-form/RHFSelect/types';
145
+ import { RHFCheckBoxOwnerState, RHFCheckBoxSlotsType } from '../components/hook-form/RHFCheckbox/types';
145
146
 
146
147
  declare module '@mui/material/styles' {
147
148
  // Define the slots in the theme
@@ -191,6 +192,7 @@ declare module '@mui/material/styles' {
191
192
  M4LToggleButton: ToggleButtonSlotsType;
192
193
  M4LBooleanFormatter: PresentationType;
193
194
  M4LToggleIconButton: ToggleIconButtonSlotsType;
195
+ M4LRHFCheckBox: RHFCheckBoxSlotsType;
194
196
  M4LTabs: TabsSlotsType;
195
197
  RHFM4LAutocomplete: RHFAutocompleteSlotsType;
196
198
  M4LAccountPopover: AccountPopoverSlotsType;
@@ -247,6 +249,7 @@ declare module '@mui/material/styles' {
247
249
  M4LToggleButton: Partial<ToggleButtonOwnerState>;
248
250
  M4LBooleanFormatter: Partial<BooleanFormatterOwnerState>;
249
251
  M4LToggleIconButton: Partial<ToggleIconButtonOwnerState>;
252
+ M4LRHFCheckBox: Partial<RHFCheckBoxOwnerState>;
250
253
  M4LTabs: Partial<TabsOwnerState>;
251
254
  RHFM4LAutocomplete: Partial<RHFAutocompleteOwnerState>;
252
255
  M4LAccountPopover: Partial<AccountPopoverOwnerState>;
@@ -481,6 +484,11 @@ declare module '@mui/material/styles' {
481
484
  styleOverrides?: ComponentsOverrides<Theme>['M4LPropertyValue'];
482
485
  variants?: ComponentsVariants['M4LPropertyValue'];
483
486
  };
487
+ M4LRHFCheckBox?: {
488
+ defaultProps?: ComponentsPropsList['M4LRHFCheckBox'];
489
+ styleOverrides?: ComponentsOverrides<Theme>['M4LRHFCheckBox'];
490
+ variants?: ComponentsVariants['M4LRHFCheckBox'];
491
+ };
484
492
  M4LTabs?: {
485
493
  defaultProps?: ComponentsPropsList['M4LTabs'];
486
494
  styleOverrides?: ComponentsOverrides<Theme>['M4LTabs'];
@@ -525,11 +533,12 @@ declare module '@mui/material/styles' {
525
533
  defaultProps?: ComponentsPropsList['M4LMenuDivider'];
526
534
  styleOverrides?: ComponentsOverrides<Theme>['M4LMenuDivider'];
527
535
  variants?: ComponentsVariants['M4LMenuDivider'];
528
- };
536
+ };
537
+
529
538
  M4LRHFSelect?: {
530
539
  defaultProps?: ComponentsPropsList['M4LRHFSelect'];
531
540
  styleOverrides?: ComponentsOverrides<Theme>['M4LRHFSelect'];
532
541
  variants?: ComponentsVariants['M4LRHFSelect'];
533
542
  };
534
- }
543
+ }
535
544
  }
@@ -10,4 +10,4 @@ import { HelperErrorProps } from './types';
10
10
  * @updatedAt 2025-01-08 10:36:40 - automatic
11
11
  * @updatedUser Andrés Quintero - automatic
12
12
  */
13
- export declare const HelperError: (props: HelperErrorProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const HelperError: import('react').ForwardRefExoticComponent<HelperErrorProps & import('react').RefAttributes<HTMLLabelElement>>;
@@ -1,39 +1,34 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import { getPropertyByString } from "@m4l/core";
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useModuleSkeleton } from "@m4l/core";
4
4
  import { clsx } from "clsx";
5
- import { H as HELPER_ERROR_KEY_COMPONENT, c as classHelperErrorRoot, a as HELPER_ERROR_CLASS_SPECIFY } from "./constant.js";
5
+ import { H as HELPER_ERROR_KEY_COMPONENT, c as classHelperErrorRoot } from "./constant.js";
6
6
  import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
7
- import { T as TypographyStyled } from "./slots/HelperErrorSlots.js";
8
- const HelperError = (props) => {
9
- const { message = "", skeletonWidth, size = "medium", className, ...other } = props;
7
+ import { T as TypographyStyled, S as SkeletonStyled } from "./slots/HelperErrorSlots.js";
8
+ const HelperError = forwardRef(function HelperError2(props, ref) {
9
+ const { message = "", size = "medium", className, ...other } = props;
10
+ const isSkeleton = useModuleSkeleton();
10
11
  const { currentSize } = useComponentSize(size);
11
12
  const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
12
- const theme = useTheme();
13
- const paletteColor = getPropertyByString(
14
- theme.palette,
15
- "error",
16
- theme.palette.default
17
- );
18
13
  const ownerState = {
19
- helperErrorPaletteColor: paletteColor,
20
- helperErrorSizes: size
14
+ size,
15
+ color: "error"
21
16
  };
22
- return /* @__PURE__ */ jsx(
17
+ return /* @__PURE__ */ jsx(Fragment, { children: !isSkeleton ? /* @__PURE__ */ jsx(
23
18
  TypographyStyled,
24
19
  {
20
+ ref,
25
21
  "aria-errormessage": HELPER_ERROR_KEY_COMPONENT,
26
- className: clsx(classHelperErrorRoot, HELPER_ERROR_CLASS_SPECIFY, className),
27
- ownerState: { ...ownerState, size: currentSize },
22
+ className: clsx(classHelperErrorRoot, className),
23
+ ownerState: { ...ownerState },
28
24
  size: adjustedSize,
29
25
  variant: "body",
30
- skeletonWidth,
31
26
  component: "label",
32
27
  ...other,
33
28
  children: message
34
29
  }
35
- );
36
- };
30
+ ) : /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "text" }) });
31
+ });
37
32
  export {
38
33
  HelperError as H
39
34
  };
@@ -1,4 +1,4 @@
1
- import { a as HELPER_ERROR_CLASS_SPECIFY } from "./constant.js";
1
+ import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
2
2
  const helperErrorStyles = {
3
3
  /**
4
4
  * Estilos para el slot del root HelperError
@@ -8,13 +8,19 @@ const helperErrorStyles = {
8
8
  * @updatedUser Andrés Quintero - automatic
9
9
  */
10
10
  root: ({ theme, ownerState }) => ({
11
- [`&.${HELPER_ERROR_CLASS_SPECIFY}`]: {
12
- color: ownerState.helperErrorPaletteColor?.main,
13
- ...ownerState.size === "small" && {
14
- ...theme.generalSettings.isMobile ? { height: theme.size.typography.mobile.small } : { height: theme.size.typography.desktop.small }
15
- },
16
- ...ownerState.size === "medium" && {
17
- ...theme.generalSettings.isMobile ? { height: theme.size.typography.mobile.medium } : { height: theme.size.typography.desktop.medium }
11
+ "&.MuiTypography-root": {
12
+ "&.M4lclassCssSpecificity": {
13
+ color: theme.vars.palette.error.enabled,
14
+ ...getTypographyStyles(
15
+ theme.generalSettings.isMobile,
16
+ ownerState.size || "medium",
17
+ "body"
18
+ ),
19
+ ...getTypographyStyles(
20
+ theme.generalSettings.isMobile,
21
+ ownerState.size || "small",
22
+ "body"
23
+ )
18
24
  }
19
25
  }
20
26
  }),
@@ -26,13 +32,17 @@ const helperErrorStyles = {
26
32
  * @updatedUser Andrés Quintero - automatic
27
33
  */
28
34
  skeletonStyled: ({ theme, ownerState }) => ({
29
- ...ownerState.size === "small" && {
30
- ...theme.generalSettings.isMobile ? { height: theme.size.typography.desktop.small } : { height: theme.vars.size.desktop.small.container }
31
- },
32
- // Condiciones de tamaño Medium en el root
33
- ...ownerState.size === "medium" && {
34
- ...theme.generalSettings.isMobile ? { height: theme.vars.size.mobile.medium.container } : { height: theme.vars.size.desktop.medium.container }
35
- },
35
+ width: theme.vars.size.baseSpacings.sp14,
36
+ ...getTypographyStyles(
37
+ theme.generalSettings.isMobile,
38
+ ownerState.size || "medium",
39
+ "body"
40
+ ),
41
+ ...getTypographyStyles(
42
+ theme.generalSettings.isMobile,
43
+ ownerState.size || "small",
44
+ "body"
45
+ ),
36
46
  variants: []
37
47
  })
38
48
  };
@@ -7,5 +7,4 @@ 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 HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
11
10
  export declare const classHelperErrorRoot: string;
@@ -1,9 +1,7 @@
1
1
  import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
2
2
  const HELPER_ERROR_KEY_COMPONENT = "M4LHelperError";
3
- const HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
4
3
  const classHelperErrorRoot = getComponentSlotRoot(HELPER_ERROR_KEY_COMPONENT);
5
4
  export {
6
5
  HELPER_ERROR_KEY_COMPONENT as H,
7
- HELPER_ERROR_CLASS_SPECIFY as a,
8
6
  classHelperErrorRoot as c
9
7
  };
@@ -8,10 +8,11 @@ const TypographyStyled = styled(Typography, {
8
8
  name: HELPER_ERROR_KEY_COMPONENT,
9
9
  slot: HelperErrorSlots.root
10
10
  })(helperErrorStyles?.root);
11
- styled(Skeleton, {
11
+ const SkeletonStyled = styled(Skeleton, {
12
12
  name: HELPER_ERROR_KEY_COMPONENT,
13
13
  slot: HelperErrorSlots.skeletonStyled
14
14
  })(helperErrorStyles?.skeletonStyled);
15
15
  export {
16
+ SkeletonStyled as S,
16
17
  TypographyStyled as T
17
18
  };
@@ -1,4 +1,4 @@
1
- import { PaletteColor, Theme } from '@mui/material';
1
+ import { Theme } from '@mui/material';
2
2
  import { TypographyProps } from '../mui_extended/Typography/types';
3
3
  import { HELPER_ERROR_KEY_COMPONENT } from './constant';
4
4
  import { HelperErrorSlots } from './slots';
@@ -28,21 +28,17 @@ export interface HelperErrorProps extends Pick<TypographyProps, 'skeletonWidth'
28
28
  */
29
29
  export interface HelperErrorOwnerState {
30
30
  /**
31
- * Color de la paleta del campo de texto.
31
+ * Color de la paleta del texto.
32
32
  */
33
- helperErrorPaletteColor: PaletteColor;
33
+ color?: Extract<ComponentPalletColor, 'error'>;
34
34
  /**
35
35
  * Color de la paleta del componente del campo de texto.
36
36
  */
37
- helperErrorComponentPaletteColor?: ComponentPalletColor;
37
+ componentPaletteColor?: ComponentPalletColor;
38
38
  /**
39
39
  * Tamaño del campo de texto.
40
40
  */
41
- helperErrorSizes: Extract<Sizes, 'small' | 'medium'>;
42
- /**
43
- * Indica si el campo de texto es error.
44
- */
45
- helperStateError?: boolean;
41
+ size: Extract<Sizes, 'small' | 'medium'>;
46
42
  }
47
43
  /**
48
44
  * Define los tipos de slots disponibles en HelperError utilizando las claves de HelperErrorSlots.
@@ -51,4 +47,4 @@ export type HelperErrorSlotsType = keyof typeof HelperErrorSlots;
51
47
  /**
52
48
  * Define los estilos personalizables para HelperError, permitiendo la sobrescritura de estilos por defecto.
53
49
  */
54
- export type HelperErrorStyles = Partial<OverridesStyleRules<HelperErrorSlotsType, typeof HELPER_ERROR_KEY_COMPONENT, Theme> | undefined> | undefined;
50
+ export type HelperErrorStyles = OverridesStyleRules<HelperErrorSlotsType, typeof HELPER_ERROR_KEY_COMPONENT, Theme>;
@@ -57,7 +57,7 @@ const Label = (props) => {
57
57
  }
58
58
  )
59
59
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
60
- /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "text", className: "SkeletonWidthLabel" }),
60
+ /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "rectangular", className: "SkeletonWidthLabel" }),
61
61
  mandatory && /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "circular", className: "MandatoryLabel" }),
62
62
  helperMessage && /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "circular", className: "HelperIconLabel" })
63
63
  ] })
@@ -2,30 +2,43 @@ import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
2
2
  import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
3
3
  const labelStyles = {
4
4
  /**
5
- * Estilos para el contenedor raíz del Label.
5
+ * Estilos para el contenedor raíz del Label 🏷️
6
+ * @param {object} theme - El tema de MUI.
7
+ * @param {object} ownerState - El estado del componente.
8
+ * @returns {object} - Los estilos aplicados al root del Label.
6
9
  * @author Bruce Escobar - automatic
7
10
  * @createdAt 2024-10-22 09:34:39 - automatic
8
- * @updatedAt 2025-01-08 10:36:40 - automatic
9
- * @updatedUser Andrés Quintero - automatic
11
+ * @updatedAt 2025-01-20 18:52:54 - automatic
12
+ * @updatedUser cesar - automatic
10
13
  */
11
14
  root: ({ theme, ownerState }) => ({
12
15
  display: "flex",
13
- flexDireccion: "row",
16
+ flexDirection: "row",
14
17
  alignItems: "center",
15
18
  flexWrap: "wrap",
16
19
  width: "fit-content",
17
20
  ...getHeightSizeStyles(
18
21
  theme.generalSettings.isMobile,
19
22
  ownerState.size || "small",
20
- "base"
23
+ "base",
24
+ (height) => ({
25
+ minHeight: height,
26
+ height: "auto",
27
+ maxHeight: "none"
28
+ })
21
29
  ),
22
30
  gap: theme.size.baseSpacings.sp1,
31
+ /** Estilos para el estado disabled del Label 😶‍🌫️ */
23
32
  ...ownerState.disabled && {
24
33
  color: theme.vars.palette.text.disabled
25
34
  }
26
35
  }),
27
36
  /**
28
37
  * Estilos para el slot Typography del Label.
38
+ * @author cesar - automatic
39
+ * @createdAt 2025-01-20 18:52:54 - automatic
40
+ * @updatedAt 2025-01-20 18:52:54 - automatic
41
+ * @updatedUser cesar - automatic
29
42
  */
30
43
  typographyStyled: ({ theme, ownerState }) => ({
31
44
  "&.MuiTypography-root": {
@@ -49,6 +62,10 @@ const labelStyles = {
49
62
  }),
50
63
  /**
51
64
  * Estilos para el slot Typography del mensaje obligatorio del Label.
65
+ * @author cesar - automatic
66
+ * @createdAt 2025-01-20 18:52:54 - automatic
67
+ * @updatedAt 2025-01-20 18:52:54 - automatic
68
+ * @updatedUser cesar - automatic
52
69
  */
53
70
  typographyMandatoryMessageStyled: ({ theme, ownerState }) => ({
54
71
  "&.MuiTypography-root": {
@@ -72,6 +89,10 @@ const labelStyles = {
72
89
  }),
73
90
  /**
74
91
  * Estilos para el slot Icon del Label.
92
+ * @author cesar - automatic
93
+ * @createdAt 2025-01-20 18:52:54 - automatic
94
+ * @updatedAt 2025-01-20 18:52:54 - automatic
95
+ * @updatedUser cesar - automatic
75
96
  */
76
97
  iconHelperMessageStyled: ({ theme, ownerState }) => ({
77
98
  borderRadius: theme.vars.size.borderRadius.r1,
@@ -85,10 +106,19 @@ const labelStyles = {
85
106
  theme.generalSettings.isMobile,
86
107
  ownerState.size || "small",
87
108
  "base"
109
+ ),
110
+ ...getHeightSizeStyles(
111
+ theme.generalSettings.isMobile,
112
+ ownerState.size || "medium",
113
+ "base"
88
114
  )
89
115
  }),
90
116
  /**
91
117
  * Estilos para el slot Skeleton del Label.
118
+ * @author cesar - automatic
119
+ * @createdAt 2025-01-20 18:52:54 - automatic
120
+ * @updatedAt 2025-01-20 18:52:54 - automatic
121
+ * @updatedUser cesar - automatic
92
122
  */
93
123
  skeletonStyled: ({ ownerState, theme }) => ({
94
124
  width: "100%",
@@ -99,27 +129,54 @@ const labelStyles = {
99
129
  ...getHeightSizeStyles(
100
130
  theme.generalSettings.isMobile,
101
131
  ownerState.size || "medium",
102
- "action"
132
+ "base"
103
133
  ),
104
134
  ...getHeightSizeStyles(
105
135
  theme.generalSettings.isMobile,
106
136
  ownerState.size || "small",
107
- "action"
137
+ "base"
108
138
  ),
109
139
  "&.MandatoryLabel": {
110
140
  width: theme.vars.size.baseSpacings["sp0-5"],
111
- padding: theme.vars.size.baseSpacings.sp1,
112
- height: theme.vars.size.baseSpacings.sp3
141
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
142
+ paddingRight: theme.vars.size.baseSpacings.sp1
113
143
  },
114
144
  "&.SkeletonWidthLabel": {
115
145
  width: theme.vars.size.baseSpacings.sp14,
116
- borderRadius: theme.vars.size.borderRadius.r1
146
+ borderRadius: theme.vars.size.borderRadius.r1,
147
+ ...getHeightSizeStyles(
148
+ theme.generalSettings.isMobile,
149
+ ownerState.size || "medium",
150
+ "base"
151
+ ),
152
+ ...getHeightSizeStyles(
153
+ theme.generalSettings.isMobile,
154
+ ownerState.size || "small",
155
+ "base"
156
+ )
117
157
  },
118
158
  "&.HelperIconLabel": {
119
- width: theme.vars.size.baseSpacings.sp2,
120
159
  borderRadius: theme.vars.size.borderRadius.r4,
121
- height: theme.vars.size.baseSpacings.sp2,
122
- padding: theme.vars.size.baseSpacings.sp2
160
+ ...getHeightSizeStyles(
161
+ theme.generalSettings.isMobile,
162
+ ownerState.size || "small",
163
+ "base",
164
+ (val) => {
165
+ return {
166
+ width: val
167
+ };
168
+ }
169
+ ),
170
+ ...getHeightSizeStyles(
171
+ theme.generalSettings.isMobile,
172
+ ownerState.size || "medium",
173
+ "base",
174
+ (val) => {
175
+ return {
176
+ width: val
177
+ };
178
+ }
179
+ )
123
180
  }
124
181
  })
125
182
  };
@@ -32,6 +32,7 @@ export interface LabelProps extends Pick<TypographyProps, 'skeletonWidth'> {
32
32
  error?: boolean;
33
33
  /** Indica si el componente está deshabilitado. */
34
34
  disabled?: boolean;
35
+ /** Indica si el componente está deshabilitado. */
35
36
  helperText?: string;
36
37
  }
37
38
  export type OwnerState = Pick<LabelProps, 'size'>;
@@ -0,0 +1,124 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { forwardRef } from "react";
4
+ import { useEnvironment, useModuleSkeleton } from "@m4l/core";
5
+ import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
6
+ import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
7
+ import { u as useNumberInput } from "./hooks/useNumberInput/useNumberInput.js";
8
+ import { S as SkeletonStyled, R as RootStyled, I as InputStyled, C as ContainButtonsAdornmentStyled, a as ContainerButtonsStyled, b as IncrementButtonStyled, D as DecrementButtonStyled } from "./slots/NumberInputSlots.js";
9
+ import { N as NUMBER_INPUT_KEY_COMPONENT } from "./constants.js";
10
+ import { N as NumberInputSlots } from "./slots/NumberInputEnum.js";
11
+ const NumberInput = forwardRef(function NumberInput2(props, forwardedRef) {
12
+ const {
13
+ className,
14
+ defaultValue,
15
+ value,
16
+ disabled = false,
17
+ endAdornment,
18
+ error,
19
+ id,
20
+ max,
21
+ min,
22
+ onBlur,
23
+ onInputChange,
24
+ onFocus,
25
+ onChange,
26
+ required,
27
+ readOnly = false,
28
+ shiftMultiplier,
29
+ startAdornment,
30
+ step,
31
+ size = "medium",
32
+ variant = "outlined",
33
+ withDecimal = false,
34
+ dataTestId
35
+ } = props;
36
+ const {
37
+ getRootProps,
38
+ getInputProps,
39
+ getIncrementButtonProps,
40
+ getDecrementButtonProps,
41
+ focusError
42
+ } = useNumberInput({
43
+ min,
44
+ max,
45
+ step,
46
+ withDecimal,
47
+ shiftMultiplier,
48
+ defaultValue,
49
+ disabled,
50
+ error,
51
+ onFocus,
52
+ onInputChange,
53
+ onBlur,
54
+ onChange,
55
+ required,
56
+ readOnly,
57
+ value,
58
+ inputId: id,
59
+ componentName: NUMBER_INPUT_KEY_COMPONENT
60
+ });
61
+ const { host_static_assets, environment_assets } = useEnvironment();
62
+ const ownerState = {
63
+ disabled,
64
+ error,
65
+ size,
66
+ variant,
67
+ focusError,
68
+ noButtons: withDecimal
69
+ };
70
+ const isSkeleton = useModuleSkeleton();
71
+ const classes = getComponentClasses(NUMBER_INPUT_KEY_COMPONENT, NumberInputSlots);
72
+ if (isSkeleton) {
73
+ return /* @__PURE__ */ jsx(
74
+ SkeletonStyled,
75
+ {
76
+ ownerState,
77
+ className: clsx(classes.skeleton, className),
78
+ ...getPropDataTestId(NUMBER_INPUT_KEY_COMPONENT, NumberInputSlots.skeleton, dataTestId)
79
+ }
80
+ );
81
+ }
82
+ const ICON_INCREMENT = `${host_static_assets}/${environment_assets}/frontend/components/ControlIncrement/assets/icons/chevron_up_sm.svg`;
83
+ const ICON_DECREMENT = `${host_static_assets}/${environment_assets}/frontend/components/ControlIncrement/assets/icons/chevron_down_sm.svg`;
84
+ return /* @__PURE__ */ jsxs(
85
+ RootStyled,
86
+ {
87
+ ...getPropDataTestId(NUMBER_INPUT_KEY_COMPONENT, NumberInputSlots.root, dataTestId),
88
+ className: clsx(classes.root, className),
89
+ ref: forwardedRef,
90
+ ownerState,
91
+ ...getRootProps(),
92
+ children: [
93
+ startAdornment,
94
+ /* @__PURE__ */ jsx(InputStyled, { className: clsx(classes.input, className), ownerState, ...getInputProps() }),
95
+ /* @__PURE__ */ jsxs(ContainButtonsAdornmentStyled, { ownerState, children: [
96
+ endAdornment,
97
+ !withDecimal && /* @__PURE__ */ jsxs(ContainerButtonsStyled, { className: clsx(classes.containerButtons, className), ownerState, children: [
98
+ /* @__PURE__ */ jsx(
99
+ IncrementButtonStyled,
100
+ {
101
+ icon: ICON_INCREMENT,
102
+ className: clsx(classes.increment, className),
103
+ ownerState,
104
+ ...getIncrementButtonProps()
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ DecrementButtonStyled,
109
+ {
110
+ icon: ICON_DECREMENT,
111
+ className: clsx(classes.decrement, className),
112
+ ownerState,
113
+ ...getDecrementButtonProps()
114
+ }
115
+ )
116
+ ] })
117
+ ] })
118
+ ]
119
+ }
120
+ );
121
+ });
122
+ export {
123
+ NumberInput as N
124
+ };