@m4l/components 6.0.1 → 7.0.0

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 (41) hide show
  1. package/@types/types.d.ts +21 -0
  2. package/components/GridLayout/classes/index.d.ts +1 -1
  3. package/components/Icon/types.d.ts +1 -1
  4. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.d.ts +1 -1
  5. package/components/mui_extended/Badge/Badge.styles.d.ts +2 -0
  6. package/components/mui_extended/Badge/constants.d.ts +1 -0
  7. package/components/mui_extended/Badge/slots/BadgeEnum.d.ts +3 -0
  8. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +6 -0
  9. package/components/mui_extended/Badge/slots/index.d.ts +2 -0
  10. package/components/mui_extended/Badge/types.d.ts +9 -0
  11. package/components/mui_extended/IconButton/IconButton.styles.d.ts +2 -0
  12. package/components/mui_extended/IconButton/constants.d.ts +1 -0
  13. package/components/mui_extended/IconButton/helpers/evalIconColor.d.ts +7 -0
  14. package/components/mui_extended/IconButton/slots/IconButtonEnum.d.ts +5 -0
  15. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +14 -0
  16. package/components/mui_extended/IconButton/slots/index.d.ts +2 -0
  17. package/components/mui_extended/IconButton/types.d.ts +18 -26
  18. package/contexts/index.d.ts +3 -3
  19. package/hooks/useFormAddEdit/index.d.ts +1 -1
  20. package/index.js +1 -1
  21. package/package.json +3 -2
  22. package/{vendor-B-B0U9GM.js → vendor-BLNnjAkx.js} +440 -193
  23. package/components/mui_extended/Badge/classes/constants.d.ts +0 -1
  24. package/components/mui_extended/Badge/classes/index.d.ts +0 -6
  25. package/components/mui_extended/Badge/classes/types.d.ts +0 -6
  26. package/components/mui_extended/Badge/styles.d.ts +0 -2
  27. package/components/mui_extended/Badge/tests/constants.d.ts +0 -1
  28. package/components/mui_extended/Badge/tests/utils.d.ts +0 -2
  29. package/components/mui_extended/IconButton/classes/constants.d.ts +0 -1
  30. package/components/mui_extended/IconButton/classes/index.d.ts +0 -8
  31. package/components/mui_extended/IconButton/classes/types.d.ts +0 -15
  32. package/components/mui_extended/IconButton/styledIconButton.d.ts +0 -2
  33. package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/index.d.ts +0 -2
  34. package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/types.d.ts +0 -3
  35. /package/{contexts → components/hook-form}/RHFormContext/classes/constants.d.ts +0 -0
  36. /package/{contexts → components/hook-form}/RHFormContext/classes/index.d.ts +0 -0
  37. /package/{contexts → components/hook-form}/RHFormContext/classes/types.d.ts +0 -0
  38. /package/{contexts → components/hook-form}/RHFormContext/dictionary.d.ts +0 -0
  39. /package/{contexts → components/hook-form}/RHFormContext/index.d.ts +0 -0
  40. /package/{contexts → components/hook-form}/RHFormContext/styles.d.ts +0 -0
  41. /package/{contexts → components/hook-form}/RHFormContext/types.d.ts +0 -0
@@ -3,16 +3,16 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
5
5
  import { m, LazyMotion, domMax } from "framer-motion";
6
- import React__default, { createContext, useRef, useContext, forwardRef, useMemo, useState, useEffect, useCallback, createElement, useLayoutEffect, useImperativeHandle, createRef, Suspense } from "react";
7
- import { Tooltip as Tooltip$1, Popper, IconButton as IconButton$1, Box, styled as styled$1, useTheme, alpha as alpha$1, Skeleton, generateUtilityClasses, generateUtilityClass, Popover as Popover$1, Typography as Typography$1, Dialog, Paper, CircularProgress as CircularProgress$1, Autocomplete, TextField, Chip, Accordion as Accordion$1, AccordionSummary, AccordionDetails, Badge as Badge$1, MenuItem, Avatar as Avatar$1, Link, Breadcrumbs as Breadcrumbs$1, Checkbox, LinearProgress as LinearProgress$1, Stack as Stack$1, Tabs as Tabs$1, Select, InputBase, Tab as Tab$1, FormGroup, FormControlLabel, InputAdornment, RadioGroup, Radio, SvgIcon, useForkRef, FormControl, ListItemText, ListItemButton, Collapse, Drawer as Drawer$1, ButtonBase, Grid } from "@mui/material";
6
+ import React__default, { createContext, useRef, useContext, forwardRef, useMemo, useEffect, useState, useCallback, createElement, useLayoutEffect, useImperativeHandle, createRef, Suspense } from "react";
7
+ import { Tooltip as Tooltip$1, Popper, IconButton as IconButton$1, Box, styled as styled$1, useTheme, alpha as alpha$1, Badge as Badge$1, generateUtilityClass, generateUtilityClasses, Popover as Popover$1, Skeleton, Typography as Typography$1, Dialog, Paper, CircularProgress as CircularProgress$1, Autocomplete, TextField, Chip, Accordion as Accordion$1, AccordionSummary, AccordionDetails, MenuItem, Avatar as Avatar$1, Link, Breadcrumbs as Breadcrumbs$1, Checkbox, LinearProgress as LinearProgress$1, Stack as Stack$1, Tabs as Tabs$1, Select, InputBase, Tab as Tab$1, FormGroup, FormControlLabel, InputAdornment, RadioGroup, Radio, SvgIcon, useForkRef, FormControl, ListItemText, ListItemButton, Collapse, Drawer as Drawer$1, ButtonBase, Grid } from "@mui/material";
8
8
  import { styled, alpha, useTheme as useTheme$1 } from "@mui/material/styles";
9
9
  import SimpleBarReact from "simplebar-react";
10
- import { getPropertyByString, useModuleDictionary, useModuleSkeleton, useHostTools, useNetwork, EmitEvents, useEnvironment, axiosOperation, useFlagsPresent, CommonFlags, voidFunction, useBase, evaluateWithContext, BaseProvider, useFlagsStore, useModulePrivileges, usePaginate, useAuth, DomainCountryProvider, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider, EnvironmentProvider, HostToolsProvider, NetworkProvider, AuthProvider } from "@m4l/core";
10
+ import { getPropertyByString, useModuleDictionary, useHostTools, useNetwork, useModuleSkeleton, EmitEvents, useEnvironment, axiosOperation, useFlagsPresent, CommonFlags, voidFunction, useBase, evaluateWithContext, BaseProvider, useFlagsStore, useModulePrivileges, usePaginate, useAuth, DomainCountryProvider, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider, EnvironmentProvider, HostToolsProvider, NetworkProvider, AuthProvider } from "@m4l/core";
11
11
  import { Link as Link$1, useLocation, NavLink as NavLink$1, unstable_HistoryRouter } from "react-router-dom";
12
12
  import clsx from "clsx";
13
13
  import { useForm, FormProvider, useFormContext, Controller, useWatch, useController, useFormState } from "react-hook-form";
14
14
  import { unstable_composeClasses } from "@mui/base";
15
- import { useResponsiveDesktop, useFirstRender, useResizeObserver, useIsMobile, useResponsiveContainerStore, useFormatter, useHostTheme, useLocales, HostThemeProvider, FormatterProvider, LocalesProvider, getLocaleFromNetwork, ResponsiveContainerProvider } from "@m4l/graphics";
15
+ import { useFirstRender, useResizeObserver, useResponsiveDesktop, useIsMobile, useResponsiveContainerStore, useFormatter, useHostTheme, useLocales, HostThemeProvider, FormatterProvider, LocalesProvider, getLocaleFromNetwork, ResponsiveContainerProvider } from "@m4l/graphics";
16
16
  import isString from "lodash/isString";
17
17
  import { useDropzone } from "react-dropzone";
18
18
  import * as Yup from "yup";
@@ -92,43 +92,22 @@ const iconStyles = {
92
92
  transform: `rotate(${ownerState.rotationAngle}deg)`
93
93
  },
94
94
  backgroundColor: !ownerState.disabled ? getPropertyByString(theme.vars.palette, ownerState.color || "text.primary") : theme.vars.palette.text.disabled,
95
- ...ownerState.size === "large" && {
96
- ...theme.generalSettings.isMobile ? {
97
- width: 28,
98
- height: 28,
99
- minWidth: 28,
100
- minHeight: 28
101
- } : {
102
- width: 20,
103
- height: 20,
104
- minWidth: 20,
105
- minHeight: 20
106
- }
107
- },
108
95
  ...ownerState.size === "medium" && {
109
96
  ...theme.generalSettings.isMobile ? {
110
- width: 24,
111
- height: 24,
112
- minWidth: 24,
113
- minHeight: 24
97
+ minWidth: theme.vars.size.mobile.base.medium,
98
+ minHeight: theme.vars.size.mobile.action.medium
114
99
  } : {
115
- width: 16,
116
- height: 16,
117
- minWidth: 16,
118
- minHeight: 16
100
+ minWidth: theme.vars.size.desktop.base.medium,
101
+ minHeight: theme.vars.size.desktop.base.medium
119
102
  }
120
103
  },
121
104
  ...ownerState.size === "small" && {
122
105
  ...theme.generalSettings.isMobile ? {
123
- width: 20,
124
- height: 20,
125
- minWidth: 20,
126
- minHeight: 20
106
+ minWidth: theme.vars.size.mobile.base.small,
107
+ minHeight: theme.vars.size.mobile.action.small
127
108
  } : {
128
- width: 14,
129
- height: 14,
130
- minWidth: 14,
131
- minHeight: 14
109
+ minWidth: theme.vars.size.desktop.base.small,
110
+ minHeight: theme.vars.size.desktop.base.small
132
111
  }
133
112
  },
134
113
  variants: []
@@ -280,7 +259,7 @@ const TooltipStyled = styled(Tooltip, {
280
259
  name: ICON_KEY_COMPONENT,
281
260
  slot: IconSlots.tooltip
282
261
  })(iconStyles?.tooltip);
283
- const IconStyled = styled("div", {
262
+ const IconStyled$1 = styled("div", {
284
263
  name: ICON_KEY_COMPONENT,
285
264
  slot: IconSlots.icon
286
265
  })(iconStyles?.icon);
@@ -297,7 +276,7 @@ function getPropDataTestId(prefix, keyName) {
297
276
  const Icon = (props) => {
298
277
  const {
299
278
  src,
300
- size,
279
+ size = "small",
301
280
  rotationAngle,
302
281
  tooltipContent,
303
282
  securityArea,
@@ -330,7 +309,7 @@ const Icon = (props) => {
330
309
  [TEST_PROP_ID]: getNameDataTestId$d(ICON_PREFIX$2, IconSlots.root, instaceDataTestId)
331
310
  } : {},
332
311
  children: /* @__PURE__ */ jsx(
333
- IconStyled,
312
+ IconStyled$1,
334
313
  {
335
314
  ownerState: {
336
315
  src,
@@ -358,7 +337,7 @@ const Icon = (props) => {
358
337
  ownerState: { securityArea, size: currentSize },
359
338
  ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId$d(ICON_PREFIX$2, IconSlots.root, instaceDataTestId) } : {},
360
339
  children: /* @__PURE__ */ jsx(
361
- IconStyled,
340
+ IconStyled$1,
362
341
  {
363
342
  ownerState: {
364
343
  src,
@@ -811,76 +790,366 @@ const AnimatedScroll = (props) => {
811
790
  }
812
791
  );
813
792
  };
814
- const SkeletonIconButton = (props) => {
815
- const { classes: classes2 } = props;
816
- return /* @__PURE__ */ jsx(
817
- Skeleton,
818
- {
819
- variant: "rectangular",
820
- className: classes2.skeleton,
821
- "data-testid": "SkeletonIconButton"
793
+ var IconButtonSlots = /* @__PURE__ */ ((IconButtonSlots2) => {
794
+ IconButtonSlots2["styledMUIIconButton"] = "styledMUIIconButton";
795
+ IconButtonSlots2["icon"] = "icon";
796
+ IconButtonSlots2["badgeIconButton"] = "badgeIconButton";
797
+ return IconButtonSlots2;
798
+ })(IconButtonSlots || {});
799
+ const ICON_BUTTON_KEY_COMPONENT = "M4LIconButton";
800
+ const iconButtonStyles = {
801
+ styledMUIIconButton: ({ ownerState, theme }) => ({
802
+ cursor: ownerState.disabled ? "not-allowed" : "pointer",
803
+ color: theme.vars.palette.text.primary,
804
+ borderRadius: theme.size.borderRadius.r1,
805
+ pointerEvents: ownerState.disabled ? "none" : "auto",
806
+ display: "flex",
807
+ justifyContent: "center",
808
+ // Override de estilos de Material UI
809
+ padding: 0,
810
+ // condiciones de tamaño
811
+ // condiciones de tamaño Small
812
+ ...ownerState.size === "small" && {
813
+ ...theme.generalSettings.isMobile ? {
814
+ width: theme.vars.size.mobile.action.small,
815
+ height: theme.vars.size.mobile.action.small
816
+ } : {
817
+ width: theme.vars.size.desktop.action.small,
818
+ height: theme.vars.size.desktop.action.small
819
+ },
820
+ "& .icon": {
821
+ ...theme.generalSettings.isMobile ? {
822
+ width: theme.vars.size.mobile.base.small,
823
+ height: theme.vars.size.mobile.base.small
824
+ } : {
825
+ width: theme.vars.size.desktop.base.small,
826
+ height: theme.vars.size.desktop.base.small
827
+ }
828
+ }
829
+ },
830
+ // condiciones de tamaño Medium
831
+ ...ownerState.size === "medium" && {
832
+ ...theme.generalSettings.isMobile ? {
833
+ width: theme.vars.size.mobile.action.medium,
834
+ height: theme.vars.size.mobile.action.medium
835
+ } : {
836
+ width: theme.vars.size.desktop.action.medium,
837
+ height: theme.vars.size.desktop.action.medium
838
+ },
839
+ "& .icon": {
840
+ ...theme.generalSettings.isMobile ? {
841
+ width: theme.vars.size.mobile.base.medium,
842
+ height: theme.vars.size.mobile.base.medium
843
+ } : {
844
+ width: theme.vars.size.desktop.base.medium,
845
+ height: theme.vars.size.desktop.base.medium
846
+ }
847
+ }
848
+ },
849
+ // Variantes contained
850
+ ...ownerState.variant === "contained" && ownerState.disabled !== true && {
851
+ backgroundColor: ownerState.paletteColor?.main,
852
+ display: "flex",
853
+ color: "white",
854
+ '& [class*="M4LIcon-icon"]': {
855
+ display: "flex",
856
+ justifyContent: "center",
857
+ backgroundColor: ownerState.paletteColor?.contrastText
858
+ },
859
+ //Estado Hover
860
+ "&:hover": {
861
+ background: ownerState.paletteColor?.hover,
862
+ '& [class*="M4LIcon-icon"]': {
863
+ display: "flex",
864
+ justifyContent: "center",
865
+ ...ownerState.componentPaletteColor !== "default" && {
866
+ backgroundColor: ownerState.paletteColor?.contrastText
867
+ //backgroundColor: 'white',
868
+ }
869
+ }
870
+ },
871
+ //Estado Active
872
+ "&:active": {
873
+ background: ownerState.paletteColor?.focusActive,
874
+ '& [class*="M4LIcon-icon"]': {
875
+ display: "flex",
876
+ justifyContent: "center",
877
+ ...ownerState.componentPaletteColor !== "default" && {
878
+ backgroundColor: ownerState.paletteColor?.contrastText
879
+ }
880
+ }
881
+ },
882
+ //FocusVisible
883
+ "&:focus-visible": {
884
+ background: ownerState.paletteColor?.main,
885
+ outline: `1px solid ${ownerState.paletteColor?.focusVisible}`,
886
+ outlineOffset: 1,
887
+ '& [class*="M4LIcon-icon"]': {
888
+ display: "flex",
889
+ justifyContent: "center",
890
+ ...ownerState.componentPaletteColor !== "default" && {
891
+ backgroundColor: ownerState.paletteColor?.contrastText
892
+ }
893
+ }
894
+ }
895
+ },
896
+ // Variantes contained en disabled
897
+ ...ownerState.variant === "contained" && ownerState.disabled === true && {
898
+ background: `${theme.vars.palette.action.disabledBackground} !important`,
899
+ color: theme.vars.palette.action.disabled
900
+ },
901
+ // Variante outline
902
+ ...ownerState.variant === "outline" && ownerState.disabled !== true && {
903
+ display: "flex",
904
+ justifyContent: "center",
905
+ alignItems: "center",
906
+ ...ownerState.componentPaletteColor !== "default" && {
907
+ border: `1px solid ${ownerState.paletteColor?.main}`
908
+ },
909
+ ...ownerState.componentPaletteColor === "default" && {
910
+ border: `1px solid ${ownerState.paletteColor?.main}`
911
+ },
912
+ "&:hover": {
913
+ display: "flex",
914
+ justifyContent: "center",
915
+ alignItems: "center",
916
+ border: `1px solid ${ownerState.paletteColor?.hover}`,
917
+ background: ownerState.componentPaletteColor !== "default" ? ownerState.paletteColor?.hoverOpacity : ownerState.paletteColor?.hover,
918
+ '& [class*="M4LIcon-icon"]': {
919
+ display: "flex",
920
+ justifyContent: "center",
921
+ '& [class*="M4LIcon-icon"]': {
922
+ display: "flex",
923
+ justifyContent: "center",
924
+ ...ownerState.componentPaletteColor !== "default" && {
925
+ backgroundColor: ownerState.paletteColor?.contrastText
926
+ }
927
+ }
928
+ }
929
+ },
930
+ "&:active": {
931
+ display: "flex",
932
+ justifyContent: "center",
933
+ alignItems: "center",
934
+ background: ownerState.componentPaletteColor !== "default" ? ownerState.paletteColor?.hoverOpacity : ownerState.paletteColor?.focusActive,
935
+ border: `1px solid ${ownerState.paletteColor?.focusActive}`,
936
+ '& [class*="M4LIcon-icon"]': {
937
+ display: "flex",
938
+ justifyContent: "center",
939
+ ...ownerState.componentPaletteColor !== "default" && {
940
+ backgroundColor: ownerState.paletteColor?.focusActive
941
+ }
942
+ }
943
+ },
944
+ "&:focus-visible": {
945
+ display: "flex",
946
+ justifyContent: "center",
947
+ alignItems: "center",
948
+ outlineOffset: 1,
949
+ outline: `1px solid ${ownerState.paletteColor?.focusVisible}`,
950
+ border: `1px solid ${ownerState.paletteColor?.main}`,
951
+ "& .MuiButtonBase-root": {
952
+ display: "flex",
953
+ justifyContent: "center",
954
+ alignItems: "center"
955
+ },
956
+ '& [class*="M4LIcon-icon"]': {
957
+ display: "flex",
958
+ justifyContent: "center",
959
+ '& [class*="M4LIcon-icon"]': {
960
+ display: "flex",
961
+ justifyContent: "center",
962
+ ...ownerState.componentPaletteColor !== "default" && {
963
+ backgroundColor: ownerState.paletteColor?.contrastText
964
+ }
965
+ }
966
+ }
967
+ }
968
+ },
969
+ // Variantes outline en disabled
970
+ ...ownerState.variant === "outline" && ownerState.disabled === true && {
971
+ outline: `1px solid ${theme.vars.palette.action.disabled}`,
972
+ color: ownerState.paletteColor?.main
973
+ },
974
+ // Variante text
975
+ ...ownerState.variant === "text" && ownerState.disabled !== true && {
976
+ "&:hover": {
977
+ ...ownerState.componentPaletteColor !== "default" && {
978
+ backgroundColor: ownerState.paletteColor?.hoverOpacity
979
+ },
980
+ ...ownerState.componentPaletteColor === "default" && {
981
+ backgroundColor: ownerState.paletteColor?.hover
982
+ },
983
+ '& [class*="M4LIcon-icon"]': {
984
+ display: "flex",
985
+ justifyContent: "center",
986
+ ...ownerState.componentPaletteColor !== "default" && {
987
+ alignItems: "center"
988
+ }
989
+ }
990
+ },
991
+ //FocusActive
992
+ "&:active": {
993
+ ...ownerState.componentPaletteColor !== "default" && {
994
+ backgroundColor: ownerState.paletteColor?.opacity
995
+ },
996
+ ...ownerState.componentPaletteColor === "default" && {
997
+ backgroundColor: ownerState.paletteColor?.focusActive
998
+ },
999
+ '& [class*="M4LIcon-icon"]': {
1000
+ display: "flex",
1001
+ justifyContent: "center",
1002
+ ...ownerState.componentPaletteColor !== "default" && {
1003
+ backgroundColor: ownerState.paletteColor?.focusActive
1004
+ },
1005
+ ...ownerState.componentPaletteColor === "default" && {
1006
+ backgroundColor: ownerState.paletteColor?.contrastText
1007
+ }
1008
+ }
1009
+ },
1010
+ //FocusVisible
1011
+ "&:focus-visible": {
1012
+ outline: `1px solid ${ownerState.paletteColor?.focusVisible}`,
1013
+ // Cambiado a outline
1014
+ outlineOffset: 1,
1015
+ '& [class*="M4LIcon-icon"]': {
1016
+ display: "flex",
1017
+ justifyContent: "center",
1018
+ ...ownerState.componentPaletteColor !== "default" && {
1019
+ backgroundColor: ownerState.paletteColor?.main
1020
+ }
1021
+ }
1022
+ }
1023
+ },
1024
+ // Variantes text en disabled
1025
+ ...ownerState.variant === "text" && ownerState.disabled === true && {
1026
+ color: theme.vars.palette.action.disabled
822
1027
  }
823
- );
824
- };
825
- const IconButtonRoot = styled("div")(({ theme }) => ({
826
- ...theme.components?.M4LIconButton?.styleOverrides
827
- }));
828
- const componentName$F = "M4LIconButton";
829
- const iconButtonClasses = generateUtilityClasses(componentName$F, [
830
- /* elements */
831
- "root",
832
- "skeleton",
833
- /* states or variants of elements */
834
- "sizemSall",
835
- "sizeMedium",
836
- "variantPrimary",
837
- "variantSecondary",
838
- "variantLine",
839
- "isFocus",
840
- "isDisabled",
841
- /**Toggle */
842
- "togglePressed",
843
- "toggleNotPressed"
844
- ]);
845
- function getIconButtonUtilityClass(slot) {
846
- return generateUtilityClass(componentName$F, slot);
847
- }
848
- const useUtilityClasses$f = (ownerState) => {
849
- const slots = {
850
- root: [
851
- "root",
852
- ownerState.size === "small" && "sizeSmall",
853
- ownerState.size === "medium" && "sizeMedium",
854
- ownerState.variant === "primary" && ownerState.isSkeleton !== true && "variantPrimary",
855
- ownerState.variant === "secondary" && ownerState.isSkeleton !== true && "variantSecondary",
856
- ownerState.variant === "line" && ownerState.isSkeleton !== true && "variantLine",
857
- ownerState.isFocus && !ownerState.isDisabled && "isFocus",
858
- ownerState.isDisabled && "isDisabled"
859
- ],
860
- skeleton: ["skeleton"]
861
- };
862
- const composedClasses = unstable_composeClasses(slots, getIconButtonUtilityClass, {});
863
- return {
864
- ...composedClasses
865
- };
1028
+ }),
1029
+ icon: ({ ownerState, theme }) => ({
1030
+ // condiciones de tamaño Small
1031
+ ...ownerState.size === "small" && {
1032
+ ...theme.generalSettings.isMobile ? {
1033
+ width: theme.vars.size.mobile.base.small,
1034
+ height: theme.vars.size.mobile.base.small
1035
+ } : {
1036
+ width: theme.vars.size.desktop.base.small,
1037
+ height: theme.vars.size.desktop.base.small
1038
+ }
1039
+ },
1040
+ // condiciones de tamaño Medium
1041
+ ...ownerState.size === "medium" && {
1042
+ ...theme.generalSettings.isMobile ? {
1043
+ width: theme.vars.size.mobile.base.medium,
1044
+ height: theme.vars.size.mobile.base.medium
1045
+ } : {
1046
+ width: theme.vars.size.desktop.base.medium,
1047
+ height: theme.vars.size.desktop.base.medium
1048
+ }
1049
+ }
1050
+ })
1051
+ //Comentado por el momento, falta de documentación en Figma de Badge
1052
+ // badgeIconButton: ({ ownerState, theme }) => ({
1053
+ // '& [class*="MuiBadge-badge"]': {
1054
+ // display: 'flex',
1055
+ // justifyContent: 'center',
1056
+ // alignItems: 'center',
1057
+ // fontSize: '11px',
1058
+ // backgroundColor: ownerState.paletteColor?.focusActive,
1059
+ // color: ownerState.paletteColor?.contrastText,
1060
+ // // condiciones de tamaño Small
1061
+ // ...(ownerState.size === 'small' && {
1062
+ // ...(theme.generalSettings.isMobile
1063
+ // ? {
1064
+ // width: theme.size.desktop.base.small,
1065
+ // height: theme.size.desktop.base.small,
1066
+ // }
1067
+ // : {
1068
+ // width: theme.size.desktop.base.small,
1069
+ // height: theme.size.desktop.base.small,
1070
+ // }),
1071
+ // }),
1072
+ // // condiciones de tamaño Medium
1073
+ // ...(ownerState.size === 'medium' && {
1074
+ // ...(theme.generalSettings.isMobile
1075
+ // ? {
1076
+ // width: theme.size.mobile.base.medium,
1077
+ // height: theme.size.mobile.base.medium,
1078
+ // }
1079
+ // : {
1080
+ // width: theme.size.desktop.base.medium,
1081
+ // height: theme.size.desktop.base.medium,
1082
+ // }),
1083
+ // }),
1084
+ // },
1085
+ // }),
1086
+ };
1087
+ const StyledMUIIconButton = styled(IconButton$1, {
1088
+ name: ICON_BUTTON_KEY_COMPONENT,
1089
+ slot: IconButtonSlots.styledMUIIconButton
1090
+ })(iconButtonStyles?.styledMUIIconButton);
1091
+ const IconStyled = styled(Icon, {
1092
+ name: ICON_BUTTON_KEY_COMPONENT,
1093
+ slot: IconButtonSlots.icon
1094
+ })(iconButtonStyles?.icon);
1095
+ const BadgeStyled$1 = styled(Badge$1, {
1096
+ name: ICON_BUTTON_KEY_COMPONENT,
1097
+ slot: IconButtonSlots.badgeIconButton
1098
+ })(iconButtonStyles?.badgeIconButton);
1099
+ const evalIconColor = (color, variant) => {
1100
+ console.log("color", color);
1101
+ if (variant === "contained" && color !== "default") {
1102
+ return "primary.contrastText";
1103
+ }
1104
+ if (color === "default") {
1105
+ return "text.primary";
1106
+ }
1107
+ if (color === "primary") {
1108
+ return "primary.main";
1109
+ }
1110
+ if (color === "warning") {
1111
+ return "warning.main";
1112
+ }
1113
+ if (color === "error") {
1114
+ return "error.main";
1115
+ }
1116
+ if (color === "success") {
1117
+ return "success.main";
1118
+ }
1119
+ if (color === "info") {
1120
+ return "info.main";
1121
+ }
1122
+ return "text.primary";
866
1123
  };
867
1124
  const IconButton = (props) => {
868
1125
  const {
869
1126
  src,
870
1127
  tooltip,
871
- size = "small",
872
- dictionaryTooltipId,
873
- rotationAngle,
874
- variant = "line",
1128
+ size = "medium",
1129
+ variant = "text",
875
1130
  disabled,
876
- className,
877
1131
  onClick,
878
- color,
1132
+ badgeContent,
1133
+ withBadge = false,
1134
+ dictionaryTooltipId,
1135
+ componentPaletteColor = "default",
879
1136
  ...other
880
1137
  } = props;
1138
+ const { currentSize } = useComponentSize(size);
1139
+ const theme = useTheme();
1140
+ const paletteColor = getPropertyByString(theme.palette, disabled ? "default" : componentPaletteColor, theme.palette.default);
1141
+ const ownerState = {
1142
+ variant,
1143
+ size,
1144
+ disabled,
1145
+ paletteColor,
1146
+ componentPaletteColor
1147
+ };
1148
+ const iconColor = useMemo(
1149
+ () => evalIconColor(componentPaletteColor, variant),
1150
+ [componentPaletteColor, variant]
1151
+ );
881
1152
  const { getLabel } = useModuleDictionary();
882
- const isDesktop = useResponsiveDesktop();
883
- const isSkeleton = useModuleSkeleton();
884
1153
  const finalTooltip = useMemo(() => {
885
1154
  if (disabled) {
886
1155
  return void 0;
@@ -893,58 +1162,46 @@ const IconButton = (props) => {
893
1162
  }
894
1163
  return void 0;
895
1164
  }, [tooltip, dictionaryTooltipId, getLabel, disabled]);
896
- const [
897
- isfocus
898
- /* setIsFocus */
899
- ] = useState(false);
900
- const ownerState = {
901
- variant,
902
- size: isDesktop ? size : "medium",
903
- isSkeleton,
904
- isFocus: disabled ? false : isfocus,
905
- isDisabled: disabled
906
- };
907
- const classes2 = useUtilityClasses$f(ownerState);
908
- return (
909
- /* IconButtonRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los overrides que
910
- provienen del objeto del tema. Se usa para garantizar de que estos estilos no se propaguen a
911
- otros componentes de la plataforna web. */
912
- /* @__PURE__ */ jsx(IconButtonRoot, { className: clsx(classes2.root, className), "data-testid": "IconButtonRoot", children: !isSkeleton ? (
913
- // eslint-disable-next-line react/jsx-no-useless-fragment
914
- /* @__PURE__ */ jsx(Fragment, { children: finalTooltip ? (
915
- /* Este bloque corresponde al caso en el que requiera tooltip en el componente. */
916
- /* @__PURE__ */ jsx(Tooltip$1, { title: finalTooltip || "", children: /* @__PURE__ */ jsx(
917
- IconButton$1,
918
- {
919
- ...other,
920
- onClick,
921
- disableRipple: true,
922
- disabled,
923
- children: /* @__PURE__ */ jsx(Icon, { src, size, color })
924
- }
925
- ) })
926
- ) : (
927
- /* Este bloque corresponde al caso en que solo se rquiera cargar el botón con icono. */
928
- /* @__PURE__ */ jsx(
929
- IconButton$1,
930
- {
931
- ...other,
932
- onClick,
933
- disableRipple: true,
934
- disabled,
935
- children: /* @__PURE__ */ jsx(
936
- Icon,
937
- {
938
- src,
939
- size: isDesktop ? size : "medium",
940
- rotationAngle,
941
- color
942
- }
943
- )
944
- }
945
- )
946
- ) })
947
- ) : /* @__PURE__ */ jsx(SkeletonIconButton, { classes: classes2 }) })
1165
+ return /* @__PURE__ */ jsx(
1166
+ StyledMUIIconButton,
1167
+ {
1168
+ ownerState: { ...ownerState },
1169
+ onClick: !disabled ? onClick : void 0,
1170
+ disableRipple: true,
1171
+ disabled,
1172
+ "data-testid": "IconButtonRoot",
1173
+ tabIndex: 0,
1174
+ ...other,
1175
+ children: withBadge ? /* @__PURE__ */ jsx(
1176
+ BadgeStyled$1,
1177
+ {
1178
+ ownerState: { ...ownerState },
1179
+ badgeContent,
1180
+ componentPaletteColor,
1181
+ children: /* @__PURE__ */ jsx(
1182
+ IconStyled,
1183
+ {
1184
+ ownerState: { ...ownerState },
1185
+ src,
1186
+ size: currentSize,
1187
+ color: iconColor,
1188
+ disabled,
1189
+ tooltipContent: finalTooltip
1190
+ }
1191
+ )
1192
+ }
1193
+ ) : /* @__PURE__ */ jsx(
1194
+ IconStyled,
1195
+ {
1196
+ ownerState: { ...ownerState },
1197
+ src,
1198
+ size: currentSize,
1199
+ color: iconColor,
1200
+ disabled,
1201
+ tooltipContent: finalTooltip
1202
+ }
1203
+ )
1204
+ }
948
1205
  );
949
1206
  };
950
1207
  function isValidDate(d) {
@@ -4588,8 +4845,8 @@ function useModal() {
4588
4845
  if (!context) throw new Error("useModal context must be use inside ModalContext");
4589
4846
  return context;
4590
4847
  }
4591
- const componentName$E = "M4LModal";
4592
- generateUtilityClasses(componentName$E, [
4848
+ const componentName$D = "M4LModal";
4849
+ generateUtilityClasses(componentName$D, [
4593
4850
  /* elements */
4594
4851
  "root",
4595
4852
  "windowBaseRoot",
@@ -4613,7 +4870,7 @@ generateUtilityClasses(componentName$E, [
4613
4870
  "variantPrimary"
4614
4871
  ]);
4615
4872
  function getModalUtilityClass(slot) {
4616
- return generateUtilityClass(componentName$E, slot);
4873
+ return generateUtilityClass(componentName$D, slot);
4617
4874
  }
4618
4875
  const modalUtilityClasses = (ownerState) => {
4619
4876
  const slots = {
@@ -4728,9 +4985,9 @@ function ModalProvider({ children }) {
4728
4985
  const FormProviderRoot = styled$1("form")(({ theme }) => ({
4729
4986
  ...theme.components?.M4LRHFormProvider?.styleOverrides
4730
4987
  }));
4731
- const componentName$D = "M4LRHFormProvider";
4988
+ const componentName$C = "M4LRHFormProvider";
4732
4989
  generateUtilityClasses(
4733
- componentName$D,
4990
+ componentName$C,
4734
4991
  [
4735
4992
  /* elements */
4736
4993
  "root"
@@ -4738,7 +4995,7 @@ generateUtilityClasses(
4738
4995
  ]
4739
4996
  );
4740
4997
  function getRHFormProviderUtilityClass(slot) {
4741
- return generateUtilityClass(componentName$D, slot);
4998
+ return generateUtilityClass(componentName$C, slot);
4742
4999
  }
4743
5000
  const RHFormProviderUtilityClasses = () => {
4744
5001
  const slots = {
@@ -4823,9 +5080,9 @@ const useFormFocus = () => {
4823
5080
  };
4824
5081
  return { isFocus, isTabSelected, handlerFocus, handlerOnKeyUp, handlerOnBlur };
4825
5082
  };
4826
- const componentName$C = "M4LRHFAutocomplete";
5083
+ const componentName$B = "M4LRHFAutocomplete";
4827
5084
  generateUtilityClasses(
4828
- componentName$C,
5085
+ componentName$B,
4829
5086
  [
4830
5087
  /* elements */
4831
5088
  "root",
@@ -4853,7 +5110,7 @@ generateUtilityClasses(
4853
5110
  ]
4854
5111
  );
4855
5112
  function getRHFAutocompleteClassesUtilityClass(slot) {
4856
- return generateUtilityClass(componentName$C, slot);
5113
+ return generateUtilityClass(componentName$B, slot);
4857
5114
  }
4858
5115
  const useUtilityClasses$c = (ownerState) => {
4859
5116
  const slots = {
@@ -4976,15 +5233,15 @@ const IMAGE_PREFIX = "Image";
4976
5233
  const getNameDataTestId$b = (KEY) => {
4977
5234
  return `${IMAGE_PREFIX}-${KEY}`;
4978
5235
  };
4979
- const componentName$B = "M4LImage";
4980
- generateUtilityClasses(componentName$B, [
5236
+ const componentName$A = "M4LImage";
5237
+ generateUtilityClasses(componentName$A, [
4981
5238
  /* elements */
4982
5239
  "root",
4983
5240
  "img"
4984
5241
  /* states or variants of elements */
4985
5242
  ]);
4986
5243
  function getImagenClassesUtilityClass(slot) {
4987
- return generateUtilityClass(componentName$B, slot);
5244
+ return generateUtilityClass(componentName$A, slot);
4988
5245
  }
4989
5246
  const useUtilityClasses$b = () => {
4990
5247
  const slots = {
@@ -5460,8 +5717,8 @@ function ComponentTypeImage$1(props) {
5460
5717
  }
5461
5718
  );
5462
5719
  }
5463
- const componentName$A = "M4LAccordion";
5464
- generateUtilityClasses(componentName$A, [
5720
+ const componentName$z = "M4LAccordion";
5721
+ generateUtilityClasses(componentName$z, [
5465
5722
  /* elements */
5466
5723
  "root",
5467
5724
  "endIcon",
@@ -5471,7 +5728,7 @@ generateUtilityClasses(componentName$A, [
5471
5728
  /* states or variants of elements */
5472
5729
  ]);
5473
5730
  function getAccordionUtilityClass(slot) {
5474
- return generateUtilityClass(componentName$A, slot);
5731
+ return generateUtilityClass(componentName$z, slot);
5475
5732
  }
5476
5733
  const accordionUtilityClasses = () => {
5477
5734
  const slots = {
@@ -5644,27 +5901,25 @@ var MenuActionsSlots = /* @__PURE__ */ ((MenuActionsSlots2) => {
5644
5901
  MenuActionsSlots2["labelEmpty"] = "labelEmpty";
5645
5902
  return MenuActionsSlots2;
5646
5903
  })(MenuActionsSlots || {});
5647
- const componentName$z = "M4LBadge";
5648
- const badgeClasses = generateUtilityClasses(componentName$z, [
5649
- /* elements */
5650
- "root"
5651
- /* states or variants of elements */
5652
- ]);
5653
- const BadgeRoot = styled("div")(({ theme }) => ({
5654
- display: "flex",
5655
- ...theme.components?.M4LBadge?.styleOverrides
5656
- }));
5657
- const BADGE_PREFIX = "M4LBadge";
5658
- const getNameBadgeDataTestId = (ELEMENTKEY, ID) => {
5659
- return `${BADGE_PREFIX}-${ELEMENTKEY}-${ID}`;
5660
- };
5904
+ var BadgeSlots = /* @__PURE__ */ ((BadgeSlots2) => {
5905
+ BadgeSlots2["rootBadge"] = "rootBadge";
5906
+ return BadgeSlots2;
5907
+ })(BadgeSlots || {});
5908
+ const BADGE_LABEL_KEY_COMPONENT = "M4LBadge";
5909
+ const badgeStyles = {
5910
+ rootBadge: ({}) => ({})
5911
+ };
5912
+ const BadgeRootStyled = styled(Badge$1, {
5913
+ name: BADGE_LABEL_KEY_COMPONENT,
5914
+ slot: BadgeSlots.rootBadge
5915
+ })(badgeStyles?.rootBadge);
5661
5916
  const Badge = (props) => {
5662
- const { children, dataTestId = "", ...others } = props;
5917
+ const { children, size, dataTestId = "", ...others } = props;
5918
+ const { currentSize } = useComponentSize(size);
5663
5919
  return /* @__PURE__ */ jsx(
5664
- BadgeRoot,
5920
+ BadgeRootStyled,
5665
5921
  {
5666
- className: badgeClasses.root,
5667
- ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameBadgeDataTestId("root", dataTestId) } : {},
5922
+ ownerState: { size: currentSize },
5668
5923
  children: /* @__PURE__ */ jsx(Badge$1, { ...others, children })
5669
5924
  }
5670
5925
  );
@@ -5753,10 +6008,9 @@ function MenuActions(props) {
5753
6008
  setOpen(null);
5754
6009
  externalClose && externalClose(null);
5755
6010
  };
5756
- const handleClick = (e, menuAction) => {
6011
+ const handleClick = (e, _menuAction) => {
5757
6012
  e.stopPropagation();
5758
6013
  setOpen(null);
5759
- menuAction.onClick();
5760
6014
  };
5761
6015
  const finalActions = useMemo(() => {
5762
6016
  let ret;
@@ -5819,7 +6073,7 @@ function MenuActions(props) {
5819
6073
  {
5820
6074
  dense: true,
5821
6075
  onClick: (e) => {
5822
- handleClick(e, menuAction);
6076
+ handleClick(e);
5823
6077
  },
5824
6078
  sx: { color: menuAction.color ?? "text.main" },
5825
6079
  disabled: menuAction.disabled,
@@ -6719,10 +6973,7 @@ const ToggleAbleIconButton = ({
6719
6973
  IconButton,
6720
6974
  {
6721
6975
  onClick: onToggle,
6722
- ...props,
6723
- className: clsx(
6724
- onToggle ? iconButtonClasses.togglePressed : iconButtonClasses.toggleNotPressed
6725
- )
6976
+ ...props
6726
6977
  }
6727
6978
  );
6728
6979
  };
@@ -8147,7 +8398,6 @@ const RHFTextFieldPassword = (props) => {
8147
8398
  IconButton,
8148
8399
  {
8149
8400
  onClick: () => setShowPassword(!showPassword),
8150
- variant: "line",
8151
8401
  src: showPassword ? `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye.svg` : `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye_off.svg`
8152
8402
  }
8153
8403
  ) })
@@ -21883,7 +22133,6 @@ function GeneralData() {
21883
22133
  IconButton,
21884
22134
  {
21885
22135
  src: `${host_static_assets}/${environment_assets}/frontend/components/map_gpstools/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCE_DRAW}`,
21886
- variant: "primary",
21887
22136
  onClick: handleDraw,
21888
22137
  disabled: inEdition || !geometrTypeIdCached,
21889
22138
  tooltip: getLabel(MAP_GPSTOOLS_DICCTIONARY.LABEL_DRAW)
@@ -21893,7 +22142,6 @@ function GeneralData() {
21893
22142
  IconButton,
21894
22143
  {
21895
22144
  src: `${host_static_assets}/${environment_assets}/frontend/components/map_gpstools/assets/icons/${MAP_GPSTOOLS_ICONS.GEOFENCE_FINISH}`,
21896
- variant: "primary",
21897
22145
  onClick: handleFinish,
21898
22146
  disabled: !inEdition,
21899
22147
  tooltip: getLabel(MAP_GPSTOOLS_DICCTIONARY.LABEL_FINISH)
@@ -24592,7 +24840,7 @@ const ContentComponent = () => {
24592
24840
  /* @__PURE__ */ jsx(
24593
24841
  IconButton,
24594
24842
  {
24595
- variant: "line",
24843
+ variant: "text",
24596
24844
  rotationAngle: !collapsed ? 180 : 0,
24597
24845
  onClick: () => handleButtonClick(),
24598
24846
  onMouseEnter: () => handlerOnMouseEnterIconButton(),
@@ -25254,7 +25502,6 @@ const HamburgerMenu = (props) => {
25254
25502
  {
25255
25503
  src: `${host_static_assets}/${environment_assets}/frontend/web_comercial/menu.svg`,
25256
25504
  className: classes2.ImageLogo,
25257
- variant: "secondary",
25258
25505
  onClick: () => handlerOnVisible()
25259
25506
  }
25260
25507
  ),