@m4l/components 9.3.19-BE061025-beta.1 → 9.3.19-BE101025-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/components/Card/constants.d.ts +1 -1
  2. package/components/Chip/constants.d.ts +1 -1
  3. package/components/ContainerFlow/constants.d.ts +1 -1
  4. package/components/DataGrid/subcomponents/editors/EditLabelEditor/formatter.d.ts +8 -0
  5. package/components/DataGrid/subcomponents/editors/EditLabelEditor/index.d.ts +3 -0
  6. package/components/DataGrid/subcomponents/editors/EditLabelEditor/types.d.ts +5 -0
  7. package/components/DataGrid/subcomponents/editors/EditLabelEditor/useColumnEditLabel.d.ts +9 -0
  8. package/components/DataGrid/tests/helpers/types.d.ts +2 -0
  9. package/components/EditLabel/constants.d.ts +1 -1
  10. package/components/EditLabel/slots/EditLabelEnum.d.ts +1 -0
  11. package/components/EditLabel/slots/EditLabelSlots.d.ts +3 -0
  12. package/components/EditLabel/types.d.ts +2 -2
  13. package/components/FormContainer/constants.d.ts +1 -1
  14. package/components/Image/constant.d.ts +1 -1
  15. package/components/ImageText/constants.d.ts +1 -1
  16. package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.d.ts +5 -0
  17. package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +154 -0
  18. package/components/MFIsolationAppStorybook/constants.d.ts +1 -0
  19. package/components/MFIsolationAppStorybook/icons.d.ts +3 -0
  20. package/components/MFIsolationAppStorybook/icons.js +6 -0
  21. package/components/MFIsolationAppStorybook/index.d.ts +1 -0
  22. package/components/MFIsolationAppStorybook/index.js +1 -0
  23. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
  24. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
  25. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +1 -0
  26. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.js +1 -0
  27. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.d.ts +5 -0
  28. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js +44 -0
  29. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.d.ts +1 -0
  30. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.js +1 -0
  31. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/types.d.ts +4 -0
  32. package/components/MFIsolationAppStorybook/types.d.ts +31 -0
  33. package/components/MenuActions/constants.d.ts +1 -1
  34. package/components/NoItemSelected/constant.d.ts +1 -1
  35. package/components/Stepper/Stepper.styles.js +17 -14
  36. package/components/Stepper/helpers/getInitialFieldValues/index.d.ts +12 -0
  37. package/components/Stepper/helpers/getInitialFieldValues/index.js +14 -0
  38. package/components/Stepper/helpers/index.d.ts +2 -0
  39. package/components/Stepper/helpers/parseWatchedValues/index.d.ts +17 -0
  40. package/components/Stepper/helpers/parseWatchedValues/index.js +12 -0
  41. package/components/Stepper/hooks/useDynamicValidation/index.d.ts +11 -0
  42. package/components/Stepper/hooks/useDynamicValidation/index.js +69 -0
  43. package/components/Stepper/hooks/useStepperActions/index.js +19 -3
  44. package/components/Stepper/store/StepperStore/index.js +20 -1
  45. package/components/Stepper/subcomponents/StepArea/index.js +45 -25
  46. package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +18 -10
  47. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -1
  48. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +38 -5
  49. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.d.ts +2 -1
  50. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +5 -3
  51. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.d.ts +2 -1
  52. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +5 -3
  53. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.d.ts +2 -1
  54. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -3
  55. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +30 -11
  56. package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.js +20 -10
  57. package/components/Stepper/types.d.ts +7 -0
  58. package/components/WindowBase/constants.d.ts +1 -1
  59. package/components/extended/React-Json-Viewer/constants.d.ts +1 -1
  60. package/components/extended/React-resizable-panels/SplitLayout.js +1 -1
  61. package/components/formatters/ChipStatusFormatter/constants.d.ts +1 -1
  62. package/components/formatters/EditLabelFormatter/constants.d.ts +1 -1
  63. package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterSlots.d.ts +1 -0
  64. package/components/formatters/EditLabelFormatter/types.d.ts +1 -1
  65. package/components/hook-form/RHFAutocomplete/types.d.ts +1 -1
  66. package/components/hook-form/RHFCheckbox/constants.d.ts +1 -1
  67. package/components/hook-form/RHFSelect/constants.d.ts +1 -1
  68. package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +25 -1
  69. package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.js +5 -1
  70. package/components/hook-form/RHFormContext/index.d.ts +1 -1
  71. package/components/hook-form/RHFormContext/index.js +14 -2
  72. package/components/index.d.ts +1 -0
  73. package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +3 -3
  74. package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +2 -2
  75. package/components/mui_extended/Button/Button.js +15 -4
  76. package/components/mui_extended/Button/ButtonStyles.js +155 -82
  77. package/components/mui_extended/Button/{constans.d.ts → constants.d.ts} +1 -0
  78. package/components/mui_extended/Button/constants.js +8 -0
  79. package/components/mui_extended/Button/slots/ButtonSlots.js +1 -1
  80. package/components/mui_extended/Button/types.d.ts +1 -1
  81. package/components/mui_extended/IconButton/constants.d.ts +1 -1
  82. package/components/mui_extended/IconButton/constants.js +4 -1
  83. package/components/mui_extended/MenuItem/MenuItem.js +1 -1
  84. package/components/mui_extended/MenuItem/constants.d.ts +1 -1
  85. package/components/mui_extended/NavLink/constants.d.ts +1 -1
  86. package/components/mui_extended/Select/Select.js +2 -2
  87. package/components/mui_extended/Select/constants.d.ts +1 -1
  88. package/components/mui_extended/TextField/constants.d.ts +1 -1
  89. package/components/mui_extended/Tooltip/Tooltip.styles.js +8 -1
  90. package/components/mui_extended/Tooltip/constants.d.ts +1 -1
  91. package/components/mui_extended/Typography/constants.d.ts +1 -1
  92. package/index.js +12 -10
  93. package/package.json +1 -1
  94. package/utils/getComponentSlotRoot.d.ts +3 -1
  95. package/components/mui_extended/Button/constans.js +0 -4
@@ -1,19 +1,29 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import React, { useMemo } from "react";
2
+ import React, { useState, useEffect, useMemo } from "react";
3
3
  import { u as useIsLastVisibleValidStep } from "../../../../hooks/useIsLastVisibleValidStep/index.js";
4
4
  import { m as StepperFooterRightActionsStyled } from "../../../../slots/StepperSlot.js";
5
- import { S as StepperNextButton } from "../../../StepperButtons/StepperNextButton/index.js";
6
5
  import { S as StepperSubmitButton } from "../../../StepperButtons/StepperSubmitButton/index.js";
6
+ import { S as StepperNextButton } from "../../../StepperButtons/StepperNextButton/index.js";
7
7
  function StepperFooterRightActions(props) {
8
8
  const { children } = props;
9
9
  const isLastVisibleValidStep = useIsLastVisibleValidStep();
10
- const childrenWithoutNextButton = useMemo(() => {
11
- if (!isLastVisibleValidStep) {
12
- return children;
13
- }
10
+ const [hasCustomSubmitButton, setHasCustomSubmitButton] = useState(false);
11
+ useEffect(() => {
12
+ const hasCustomButton = React.Children.toArray(children).some((child) => {
13
+ if (React.isValidElement(child)) {
14
+ return child.type === StepperSubmitButton;
15
+ }
16
+ return false;
17
+ });
18
+ setHasCustomSubmitButton(hasCustomButton);
19
+ }, [children]);
20
+ const filteredChildren = useMemo(() => {
14
21
  return React.Children.toArray(children).filter((child) => {
15
22
  if (React.isValidElement(child)) {
16
- if (child.type === StepperNextButton) {
23
+ if (!isLastVisibleValidStep && child.type === StepperSubmitButton) {
24
+ return false;
25
+ }
26
+ if (isLastVisibleValidStep && child.type === StepperNextButton) {
17
27
  return false;
18
28
  }
19
29
  }
@@ -21,10 +31,10 @@ function StepperFooterRightActions(props) {
21
31
  });
22
32
  }, [children, isLastVisibleValidStep]);
23
33
  const submitButton = useMemo(() => {
24
- return isLastVisibleValidStep ? /* @__PURE__ */ jsx(StepperSubmitButton, {}) : null;
25
- }, [isLastVisibleValidStep]);
34
+ return isLastVisibleValidStep && !hasCustomSubmitButton ? /* @__PURE__ */ jsx(StepperSubmitButton, {}) : null;
35
+ }, [isLastVisibleValidStep, hasCustomSubmitButton]);
26
36
  return /* @__PURE__ */ jsxs(StepperFooterRightActionsStyled, { children: [
27
- childrenWithoutNextButton,
37
+ filteredChildren,
28
38
  submitButton
29
39
  ] });
30
40
  }
@@ -5,6 +5,7 @@ import { ContentAreaSlots, ContentSlots, StepperFooterSlots, StepperSlots } from
5
5
  import { STEPPER_PREFIX_NAME } from './constants';
6
6
  import { M4LOverridesStyleRules } from '../../@types/augmentations';
7
7
  import { Step as StepComponent } from './subcomponents/StepperContent/subcomponents/Step';
8
+ import { ButtonProps } from '../mui_extended/Button';
8
9
  export type Orientation = 'horizontal' | 'vertical';
9
10
  export type IndicatorType = 'number' | 'dot';
10
11
  export type FormData = Record<string, string | number | boolean | null | undefined>;
@@ -145,6 +146,12 @@ export interface StepperFooterProps {
145
146
  export interface StepperFooterLeftActionsProps {
146
147
  children?: ReactNode;
147
148
  }
149
+ /**
150
+ * Props para los botones del Stepper que extienden las props de Button de mui_extended
151
+ */
152
+ export interface StepperButtonProps extends Omit<ButtonProps, 'label'> {
153
+ label?: string;
154
+ }
148
155
  /**
149
156
  * Props del StepperFooterRightActions
150
157
  */
@@ -1,2 +1,2 @@
1
1
  export declare const WINDOW_BASE_KEY_COMPONENT = "M4LWindowBase";
2
- export declare const WINDOW_BASE_CLASSES: Record<string, string>;
2
+ export declare const WINDOW_BASE_CLASSES: Record<"wrapperWindowBase" | "contentWindowBase" | "headerContentWindowBase" | "headerTitleWindowBase" | "headerSubTitleWindowBase" | "pointIcon" | "containerTitleSubtitle" | "headerIconWindowBase" | "menuActionsWindowBase" | "iconsWrapperWindowBase" | "headerWindowComponent" | "linearProgressIndeterminate" | "contentEditionInfo" | "windowContainerComponent" | "toastContainer" | "containerLeftActions", string>;
@@ -1,2 +1,2 @@
1
1
  export declare const REACT_JSON_VIEWER_KEY_COMPONENT = "M4LReactJsonViewer";
2
- export declare const REACT_JSON_VIEWER_CLASSES: Record<string, string>;
2
+ export declare const REACT_JSON_VIEWER_CLASSES: Record<"root", string>;
@@ -32,7 +32,7 @@ const SplitLayout = (props) => {
32
32
  splitPosition
33
33
  },
34
34
  defaultSize: defaultMasterSize,
35
- className: classes.master,
35
+ className: classes.splitMaster,
36
36
  children: firstPartMemo
37
37
  }
38
38
  ),
@@ -2,4 +2,4 @@
2
2
  * Clave del componente ChipStatusFormatter
3
3
  */
4
4
  export declare const CHIP_STATUS_FORMATTER_KEY_COMPONENT = "M4LChipStatusFormatter";
5
- export declare const CHIP_STATUS_FORMATTER_CLASSES: Record<string, string>;
5
+ export declare const CHIP_STATUS_FORMATTER_CLASSES: Record<"root" | "columnWrapper", string>;
@@ -2,4 +2,4 @@
2
2
  * Clave del componente ChipStatusFormatter
3
3
  */
4
4
  export declare const EDIT_LABEL_FORMATTER_KEY_COMPONENT = "M4LEditLabelFormatter";
5
- export declare const EDIT_LABEL_FORMATTER_CLASSES: Record<string, string>;
5
+ export declare const EDIT_LABEL_FORMATTER_CLASSES: Record<"root" | "columnWrapper", string>;
@@ -2,3 +2,4 @@
2
2
  * componente root del ChipStatusFormatter
3
3
  */
4
4
  export declare const EditLabelFormatterRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../EditLabel').EditLabelProps, keyof import('../../../EditLabel').EditLabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
5
+ export declare const EditLabelFormatterColumnWrapperStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -4,7 +4,7 @@ import { EditLabelFormatterSlots as Slots } from './slots/EditLabelFormatterEnum
4
4
  import { Theme } from '@mui/material';
5
5
  import { EditLabelProps } from '../../EditLabel/types';
6
6
  export type ChipStatusKey = string | number;
7
- export interface EditLabelFormatterProps extends Pick<EditLabelProps, 'label' | 'onChange' | 'size' | 'width' | 'className'> {
7
+ export interface EditLabelFormatterProps extends Pick<EditLabelProps, 'label' | 'onChange' | 'size' | 'fieldWidth' | 'className'> {
8
8
  /**
9
9
  * Componente personalizado
10
10
  */
@@ -5,7 +5,7 @@ import { RFHAUTOCOMPLETE_KEY_COMPONENT } from './constants';
5
5
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
6
6
  import { RFHAutocompleteSlots } from './slots';
7
7
  import { LabelProps } from '../../Label/types';
8
- import { AutocompleteProps } from 'src/components/mui_extended/Autocomplete/types';
8
+ import { AutocompleteProps } from '../../mui_extended/Autocomplete/types';
9
9
  export type GetOptionString<T> = (option: T | null) => string;
10
10
  export type RHFAutocompleteVariants = 'outlined' | 'text';
11
11
  export type RHFAutocompleteType = 'text' | 'image';
@@ -1,2 +1,2 @@
1
1
  export declare const RHF_CHECKBOX_KEY_COMPONENT = "M4LRHFCheckbox";
2
- export declare const TEXT_FIELD_CLASSES: Record<string, string>;
2
+ export declare const TEXT_FIELD_CLASSES: Record<"root" | "checkBox" | "containerCheckTypography" | "labelComponent", string>;
@@ -5,4 +5,4 @@ export declare const RHFSELECT_COMPONENT_KEY = "RHFSelect";
5
5
  /**
6
6
  * Clases CSS generadas dinámicamente para el componente RHFSelect.
7
7
  */
8
- export declare const RHFSELECT_CLASSES: Record<string, string>;
8
+ export declare const RHFSELECT_CLASSES: Record<"select" | "root" | "label" | "helperError", string>;
@@ -1,5 +1,29 @@
1
+ import { RHFUploadSingleFileSlots } from './slots/RHFUploadSingleFileEnum';
1
2
  export declare const RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT = "M4LRHFUploadSingleFile";
2
- export declare const RHF_UPLOAD_SINGLE_FILE_CLASSES: Record<string, string>;
3
+ export declare const RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES: {
4
+ root: RHFUploadSingleFileSlots.root;
5
+ label: RHFUploadSingleFileSlots.label;
6
+ helperError: RHFUploadSingleFileSlots.helperError;
7
+ containerDropZone: RHFUploadSingleFileSlots.containerDropZone;
8
+ dropZone: RHFUploadSingleFileSlots.dropZone;
9
+ image: RHFUploadSingleFileSlots.image;
10
+ containerBlockContent: RHFUploadSingleFileSlots.containerBlockContent;
11
+ blockContentGroup: RHFUploadSingleFileSlots.blockContentGroup;
12
+ illustrationUpload: RHFUploadSingleFileSlots.illustrationUpload;
13
+ title: RHFUploadSingleFileSlots.title;
14
+ description: RHFUploadSingleFileSlots.description;
15
+ divider: RHFUploadSingleFileSlots.divider;
16
+ dividerText: RHFUploadSingleFileSlots.dividerText;
17
+ button: RHFUploadSingleFileSlots.button;
18
+ containerPreview: RHFUploadSingleFileSlots.containerPreview;
19
+ containerNameSize: RHFUploadSingleFileSlots.containerNameSize;
20
+ imagePreview: RHFUploadSingleFileSlots.imagePreview;
21
+ namePreview: RHFUploadSingleFileSlots.namePreview;
22
+ sizePreview: RHFUploadSingleFileSlots.sizePreview;
23
+ closePreview: RHFUploadSingleFileSlots.closePreview;
24
+ linearProgress: string;
25
+ };
26
+ export declare const RHF_UPLOAD_SINGLE_FILE_CLASSES: Record<"title" | "divider" | "button" | "root" | "label" | "image" | "description" | "helperError" | "containerDropZone" | "dropZone" | "containerBlockContent" | "blockContentGroup" | "illustrationUpload" | "dividerText" | "containerPreview" | "containerNameSize" | "imagePreview" | "namePreview" | "sizePreview" | "closePreview" | "linearProgress", string>;
3
27
  export declare const DEFAULT_MAX_FILE_SIZE: number;
4
28
  export declare const FILES_ICONS: {
5
29
  readonly 'application/pdf': "frontend/components/RHF_upload_single_file/assets/icons/application_pdf.svg";
@@ -1,7 +1,11 @@
1
1
  import { g as getComponentClasses } from "../../../../utils/getComponentSlotRoot.js";
2
2
  import { R as RHFUploadSingleFileSlots } from "./slots/RHFUploadSingleFileEnum.js";
3
3
  const RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT = "M4LRHFUploadSingleFile";
4
- const RHF_UPLOAD_SINGLE_FILE_CLASSES = getComponentClasses(RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT, RHFUploadSingleFileSlots);
4
+ const RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES = {
5
+ linearProgress: "linearProgress-linearProgress",
6
+ ...RHFUploadSingleFileSlots
7
+ };
8
+ const RHF_UPLOAD_SINGLE_FILE_CLASSES = getComponentClasses(RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT, RHF_UPLOAD_SINGLE_FILE_COMPLEMENTARY_CLASSES);
5
9
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024;
6
10
  const PATH_ICONS = "frontend/components/RHF_upload_single_file/assets/icons";
7
11
  const FILES_ICONS = {
@@ -20,7 +20,7 @@ import { CustomFormArguments, FormProviderProps, RHFormProviderRef } from './typ
20
20
  * });
21
21
  * ```
22
22
  */
23
- export declare function useCustomForm({ validationSchema, values, statusLoad, mode }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, FieldValues>;
23
+ export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, FieldValues>;
24
24
  /**
25
25
  * Componente que proporciona el contexto de React Hook Form con funcionalidades adicionales.
26
26
  *
@@ -6,7 +6,12 @@ import { yupResolver } from "@hookform/resolvers/yup";
6
6
  import { F as FormProviderRoot } from "./styles.js";
7
7
  import { R as RHFormProviderUtilityClasses } from "./classes/index.js";
8
8
  const classes = RHFormProviderUtilityClasses();
9
- function useCustomForm({ validationSchema, values, statusLoad, mode }) {
9
+ function useCustomForm({
10
+ validationSchema,
11
+ values,
12
+ statusLoad,
13
+ mode
14
+ }) {
10
15
  const formMethods = useForm({
11
16
  resolver: yupResolver(validationSchema),
12
17
  defaultValues: values,
@@ -51,7 +56,14 @@ const FormProviderCustom = forwardRef((props, ref) => {
51
56
  setError: formMethods.setError,
52
57
  unregister: formMethods.unregister
53
58
  }), [formMethods, handleSubmit, onSubmit]);
54
- return /* @__PURE__ */ jsx(FormProvider, { ...props, children: /* @__PURE__ */ jsx(FormProviderRoot, { className: clsx(classes.root, className), onSubmit: handleSubmit(onSubmit), children }) });
59
+ return /* @__PURE__ */ jsx(FormProvider, { ...props, children: /* @__PURE__ */ jsx(
60
+ FormProviderRoot,
61
+ {
62
+ className: clsx(classes.root, className),
63
+ onSubmit: handleSubmit(onSubmit),
64
+ children
65
+ }
66
+ ) });
55
67
  });
56
68
  FormProviderCustom.displayName = "FormProviderCustom";
57
69
  const RHFormProvider = forwardRef((props, ref) => {
@@ -34,6 +34,7 @@ export * from './Loadable';
34
34
  export * from './LoadingError';
35
35
  export * from './MenuActions';
36
36
  export * from './MFIsolationApp';
37
+ export * from './MFIsolationAppStorybook';
37
38
  export * from './MFLoader';
38
39
  export * from './ImageText';
39
40
  export * from './NoItemSelected';
@@ -6,8 +6,8 @@ export type UseAdornmentsProps<T> = {
6
6
  loading?: boolean;
7
7
  adjustedSize: 'small' | 'medium';
8
8
  getOptionLabelLocal: (option: T) => string;
9
- getOptionalStartAdornment: (option: T) => React.ReactNode;
10
- getOptionalEndAdornment: (option: T) => React.ReactNode;
9
+ getOptionalStartAdornment?: (option: T) => React.ReactNode;
10
+ getOptionalEndAdornment?: (option: T) => React.ReactNode;
11
11
  ownerState: AutocompleteOwnerState;
12
12
  handleDelete: (option: T) => void;
13
13
  getOptionUrlImage?: (option: T) => string;
@@ -17,7 +17,7 @@ export type UseAdornmentsProps<T> = {
17
17
  handleRefresh: () => void;
18
18
  disabled?: boolean;
19
19
  onOpenLocal: (event: React.MouseEvent<HTMLButtonElement>) => void;
20
- startAdornment: AutocompleteProps<unknown, true>['startAdornment'];
20
+ startAdornment?: AutocompleteProps<unknown, true>['startAdornment'];
21
21
  };
22
22
  /**
23
23
  * Hook para el componente Autocomplete local
@@ -30,8 +30,8 @@ function useStartAdornments(props) {
30
30
  onDeleted: () => handleDelete(option),
31
31
  disabledDeleteButton: disabled,
32
32
  ownerState: { ...ownerState },
33
- startIcon: getOptionalStartAdornment(option),
34
- endIcon: getOptionalEndAdornment(option)
33
+ startIcon: getOptionalStartAdornment?.(option),
34
+ endIcon: getOptionalEndAdornment?.(option)
35
35
  },
36
36
  `${option}-${index}`
37
37
  )) }) });
@@ -1,8 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
3
3
  import { useTheme } from "@mui/material";
4
- import clsx from "clsx";
5
4
  import { forwardRef } from "react";
5
+ import { B as BUTTON_CLASSES } from "./constants.js";
6
+ import clsx from "clsx";
6
7
  import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
7
8
  import { S as SkeletonButtonStyled, B as ButtonRootStyled, T as TextButtonStyled, a as ButtonIconStyled } from "./slots/ButtonSlots.js";
8
9
  const Button = forwardRef((props, ref) => {
@@ -58,7 +59,8 @@ const Button = forwardRef((props, ref) => {
58
59
  alt: "icon",
59
60
  size: currentSize,
60
61
  disabled,
61
- instaceDataTestId
62
+ instaceDataTestId,
63
+ className: BUTTON_CLASSES.buttonIcon
62
64
  }
63
65
  );
64
66
  }
@@ -70,7 +72,7 @@ const Button = forwardRef((props, ref) => {
70
72
  role: "button",
71
73
  startIcon: renderIcon(startIcon, "ButtonStartIcon"),
72
74
  endIcon: renderIcon(endIcon, "ButtonEndIcon"),
73
- className: clsx(className),
75
+ className: clsx(className, BUTTON_CLASSES.buttonRoot),
74
76
  variant,
75
77
  size,
76
78
  disabled,
@@ -80,7 +82,16 @@ const Button = forwardRef((props, ref) => {
80
82
  ref,
81
83
  ...others,
82
84
  children: [
83
- /* @__PURE__ */ jsx(TextButtonStyled, { ownerState: { ...ownerState }, color: adjustedColor, size: currentSize, children: label }),
85
+ /* @__PURE__ */ jsx(
86
+ TextButtonStyled,
87
+ {
88
+ ownerState: { ...ownerState },
89
+ color: adjustedColor,
90
+ size: currentSize,
91
+ className: BUTTON_CLASSES.textButton,
92
+ children: label
93
+ }
94
+ ),
84
95
  props.children
85
96
  ]
86
97
  }
@@ -1,84 +1,166 @@
1
1
  import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
+ import { B as BUTTON_CLASSES } from "./constants.js";
2
3
  const buttonStyles = {
3
4
  /**
4
5
  * Styles for the root element of the button component.
5
6
  */
6
- buttonRoot: ({ theme, ownerState }) => ({
7
- display: "flex",
8
- flexWrap: "nowrap",
9
- alignItems: "center",
10
- gap: theme.vars.size.baseSpacings.sp1,
11
- padding: `0px ${theme.vars.size.baseSpacings.sp2}`,
12
- boxShadow: "none",
13
- borderRadius: theme.vars.size.borderRadius["r1-5"],
14
- maxWidth: "200px",
15
- minWidth: "0",
16
- flexShrink: 0,
17
- "&:hover": {
18
- backgroundColor: ownerState?.color === "default" ? ownerState?.paletteColor?.hover : ownerState?.paletteColor?.hoverOpacity,
19
- borderColor: ownerState?.paletteColor?.hover
20
- },
21
- "&:active": {
22
- boxShadow: "none",
23
- borderColor: ownerState?.paletteColor?.active,
24
- backgroundColor: ownerState?.paletteColor?.activeOpacity
25
- },
26
- "&:focus-visible": {
27
- boxShadow: "none",
28
- backgroundColor: ownerState?.paletteColor?.activeOpacity
29
- },
30
- "&:disabled": {
31
- backgroundColor: "none",
32
- "&&& .M4LIcon-icon": {
33
- backgroundColor: theme.vars.palette.text.disabled
34
- },
7
+ buttonRoot: ({ theme, ownerState }) => {
8
+ const selectionEffect = {
9
+ boxShadow: `inset 0px 0px 0px 1px ${theme.vars.palette.border.main}`
10
+ };
11
+ return {
12
+ // Configuración general
13
+ display: "flex",
14
+ flexWrap: "nowrap",
15
+ alignItems: "center",
16
+ gap: theme.vars.size.baseSpacings.sp1,
17
+ padding: `0px ${theme.vars.size.baseSpacings.sp2}`,
18
+ borderRadius: theme.vars.size.borderRadius["r1-5"],
19
+ maxWidth: "200px",
20
+ minWidth: "0",
21
+ flexShrink: 0,
22
+ border: "unset!important",
23
+ // Tamaño de altura
24
+ ...getSizeStyles(
25
+ theme,
26
+ ownerState?.size || "medium",
27
+ "action",
28
+ (size) => {
29
+ return {
30
+ height: "auto!important",
31
+ minHeight: size
32
+ };
33
+ }
34
+ ),
35
+ // Variante Contained
35
36
  ...ownerState?.variant === "contained" && {
36
- backgroundColor: ownerState?.paletteColor?.enabled
37
- }
38
- },
39
- ...ownerState?.variant === "contained" && {
40
- backgroundColor: ownerState?.paletteColor?.enabled,
41
- "&:hover": {
42
- backgroundColor: ownerState?.paletteColor?.hover
37
+ backgroundColor: ownerState?.paletteColor?.enabled,
38
+ boxShadow: "unset",
39
+ // Color del texto
40
+ [`&&& .${BUTTON_CLASSES.textButton}`]: {
41
+ color: ownerState?.paletteColor?.contrastText
42
+ },
43
+ // Color de los adornos laterales
44
+ "&&& .M4LIcon-icon": {
45
+ backgroundColor: ownerState?.paletteColor?.contrastText
46
+ },
47
+ // Estado Hover
48
+ "&:hover": {
49
+ backgroundColor: ownerState?.paletteColor?.hover,
50
+ boxShadow: "unset"
51
+ },
52
+ // Estado Active
53
+ "&:active": {
54
+ backgroundColor: ownerState?.paletteColor?.activeOpacity,
55
+ boxShadow: "unset"
56
+ },
57
+ // Estado focus visible
58
+ "&:focus-visible": {
59
+ backgroundColor: ownerState?.paletteColor?.activeOpacity,
60
+ ...selectionEffect
61
+ }
43
62
  },
44
- "&:active": {
45
- boxShadow: "none",
46
- backgroundColor: ownerState?.paletteColor?.active
47
- }
48
- },
49
- ...ownerState?.variant === "outlined" && {
50
- borderColor: ownerState?.paletteColor?.enabled,
51
- "&&& .M4LIcon-icon": {
52
- backgroundColor: ownerState?.paletteColor?.semanticText
53
- }
54
- },
55
- ...ownerState?.variant === "text" && {
56
- color: ownerState?.paletteColor?.semanticText,
57
- borderColor: ownerState?.paletteColor?.enabled,
58
- "&&& .M4LIcon-icon": {
59
- backgroundColor: ownerState?.paletteColor?.semanticText
60
- }
61
- },
62
- "& span": {
63
- margin: "0px"
64
- },
65
- ...getSizeStyles(
66
- theme,
67
- ownerState?.size || "medium",
68
- "action",
69
- (size) => {
70
- return {
71
- height: "auto!important",
72
- minHeight: size
73
- };
63
+ // Variante Outlined
64
+ ...ownerState?.variant === "outlined" && {
65
+ "&&&": {
66
+ // Borde
67
+ ...ownerState?.color === "default" ? {
68
+ outline: `1px solid ${theme.vars.palette.border.default}`,
69
+ outlineOffset: "-1px"
70
+ } : {
71
+ outline: `1px solid ${ownerState?.paletteColor?.enabled}`,
72
+ outlineOffset: "-1px"
73
+ },
74
+ // Color del texto
75
+ [`& .${BUTTON_CLASSES.textButton}`]: {
76
+ ...ownerState?.color === "default" ? {
77
+ color: theme.vars.palette.text.primary
78
+ } : {
79
+ color: ownerState?.paletteColor?.semanticText
80
+ }
81
+ },
82
+ // Color de los adornos laterales
83
+ "& .M4LIcon-icon": {
84
+ backgroundColor: ownerState?.paletteColor?.semanticText
85
+ },
86
+ // Estado Hover
87
+ "&:hover": {
88
+ backgroundColor: ownerState?.paletteColor?.hoverOpacity,
89
+ outline: `1px solid ${ownerState?.paletteColor?.hover}`,
90
+ outlineOffset: "-1px",
91
+ boxShadow: "unset"
92
+ }
93
+ },
94
+ // Estado Active
95
+ "&&&:active": {
96
+ backgroundColor: ownerState?.paletteColor?.activeOpacity,
97
+ outline: `1px solid ${ownerState?.paletteColor?.active}`,
98
+ outlineOffset: "-1px"
99
+ },
100
+ // Estado focus visible
101
+ "&:focus-visible": {
102
+ backgroundColor: ownerState?.paletteColor?.activeOpacity,
103
+ outline: "unset!important",
104
+ //efecto de selección
105
+ ...selectionEffect
106
+ }
107
+ },
108
+ // Variante Text
109
+ ...ownerState?.variant === "text" && {
110
+ "&&&": {
111
+ backgroundColor: "unset",
112
+ outline: "unset",
113
+ // Color del texto
114
+ [`& .${BUTTON_CLASSES.textButton}`]: {
115
+ color: ownerState?.paletteColor?.semanticText
116
+ },
117
+ // Color de los adornos laterales
118
+ "& .M4LIcon-icon": {
119
+ backgroundColor: ownerState?.paletteColor?.semanticText
120
+ },
121
+ // Estado Hover
122
+ "&:hover": {
123
+ backgroundColor: ownerState?.paletteColor?.hoverOpacity,
124
+ boxShadow: "unset"
125
+ },
126
+ // Estado Active
127
+ "&:active": {
128
+ backgroundColor: ownerState?.paletteColor?.activeOpacity
129
+ },
130
+ // Estado focus visible
131
+ "&:focus-visible": {
132
+ backgroundColor: ownerState?.paletteColor?.activeOpacity,
133
+ //efecto de selección
134
+ ...selectionEffect
135
+ }
136
+ }
137
+ },
138
+ // Estado deshabilitado
139
+ "&:disabled": {
140
+ "&&&": {
141
+ backgroundColor: "unset",
142
+ // Color del texto
143
+ [`& .${BUTTON_CLASSES.textButton}`]: {
144
+ color: theme.vars.palette.text.disabled
145
+ },
146
+ // Color de los adornos laterales
147
+ "& .M4LIcon-icon": {
148
+ backgroundColor: theme.vars.palette.text.disabled
149
+ }
150
+ }
151
+ },
152
+ // Overrides
153
+ "& span": {
154
+ margin: "0px"
155
+ },
156
+ // Configuración de achura completa
157
+ ...ownerState?.fullWidth && {
158
+ width: "100%",
159
+ maxWidth: "unset",
160
+ minWidth: "unset"
74
161
  }
75
- ),
76
- ...ownerState?.fullWidth && {
77
- width: "100%",
78
- maxWidth: "unset",
79
- minWidth: "unset"
80
- }
81
- }),
162
+ };
163
+ },
82
164
  /**
83
165
  * Styles for the text of the button component.
84
166
  */
@@ -99,15 +181,6 @@ const buttonStyles = {
99
181
  display: "block",
100
182
  overflow: "hidden",
101
183
  textOverflow: "ellipsis"
102
- },
103
- ...ownerState.variant === "contained" && {
104
- color: ownerState.color === "default" ? ownerState.paletteColor?.semanticText : ownerState.paletteColor?.contrastText
105
- },
106
- ...(ownerState?.variant === "outlined" || ownerState?.variant === "text") && {
107
- color: ownerState?.paletteColor?.semanticText
108
- },
109
- ...ownerState?.disabled && {
110
- color: theme.vars.palette.text.disabled
111
184
  }
112
185
  }),
113
186
  /**
@@ -6,3 +6,4 @@
6
6
  * @default 'M4LButton'
7
7
  */
8
8
  export declare const BUTTON_KEY_COMPONENT = "M4LButton";
9
+ export declare const BUTTON_CLASSES: Record<"buttonRoot" | "skeletonButton" | "buttonIcon" | "textButton", string>;
@@ -0,0 +1,8 @@
1
+ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
2
+ import { B as ButtonSlots } from "./slots/ButtonEnum.js";
3
+ const BUTTON_KEY_COMPONENT = "M4LButton";
4
+ const BUTTON_CLASSES = getComponentClasses(BUTTON_KEY_COMPONENT, ButtonSlots);
5
+ export {
6
+ BUTTON_CLASSES as B,
7
+ BUTTON_KEY_COMPONENT as a
8
+ };
@@ -1,7 +1,7 @@
1
1
  import { Button } from "@mui/material";
2
2
  import { styled } from "@mui/material/styles";
3
3
  import { b as buttonStyles } from "../ButtonStyles.js";
4
- import { B as BUTTON_KEY_COMPONENT } from "../constans.js";
4
+ import { a as BUTTON_KEY_COMPONENT } from "../constants.js";
5
5
  import { B as ButtonSlots } from "./ButtonEnum.js";
6
6
  import { S as Skeleton } from "../../Skeleton/Skeleton.js";
7
7
  import { T as Typography } from "../../Typography/Typography.js";
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps as MUIButtonProps, PaletteColor, Theme } from '@mui/material';
2
2
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
3
- import { BUTTON_KEY_COMPONENT } from './constans';
3
+ import { BUTTON_KEY_COMPONENT } from './constants';
4
4
  import { ButtonSlots } from './slots/ButtonEnum';
5
5
  import { ComponentPalletColor, Sizes } from '@m4l/styles';
6
6
  import { ReactNode } from 'react';
@@ -2,4 +2,4 @@ export declare const ICON_BUTTON_KEY_COMPONENT = "M4LIconButton";
2
2
  /**
3
3
  * Inventario de clases CSS para el componente TextField
4
4
  */
5
- export declare const ICON_BUTTON_CLASSES: Record<string, string>;
5
+ export declare const ICON_BUTTON_CLASSES: Record<"text" | "selected" | "contained" | "skeleton" | "icon" | "outline" | "styledMUIIconButton" | "badgeIconButton", string>;
@@ -2,7 +2,10 @@ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js
2
2
  import { I as IconButtonSlots } from "./slots/IconButtonEnum.js";
3
3
  const ICON_BUTTON_KEY_COMPONENT = "M4LIconButton";
4
4
  const IconButtonComplementaryClasses = {
5
- selected: "selected"
5
+ selected: "selected",
6
+ contained: "contained",
7
+ outline: "outline",
8
+ text: "text"
6
9
  };
7
10
  const IconButtonCombineClasses = {
8
11
  ...IconButtonSlots,