@m4l/components 9.2.62-B09072025beta.1 → 9.2.62-B10072025beta.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 (109) hide show
  1. package/@types/types.d.ts +0 -8
  2. package/components/AppBar/AppBar.js +12 -10
  3. package/components/AppBar/constants.d.ts +1 -1
  4. package/components/AppBar/constants.js +1 -1
  5. package/components/AppBar/slots/AppBarEnum.d.ts +1 -5
  6. package/components/AppBar/slots/AppBarEnum.js +0 -4
  7. package/components/AppBar/slots/AppBarSlots.d.ts +4 -18
  8. package/components/AppBar/slots/AppBarSlots.js +3 -27
  9. package/components/AppBar/styles.js +0 -42
  10. package/components/AppBar/types.d.ts +8 -0
  11. package/components/Image/Image.js +2 -4
  12. package/components/Image/image.styles.js +3 -6
  13. package/components/Image/types.d.ts +0 -2
  14. package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
  15. package/components/PropertyValue/PropertyValue.styles.js +1 -1
  16. package/components/SideBar/SideBar.js +6 -2
  17. package/components/SideBar/constants.d.ts +7 -6
  18. package/components/SideBar/constants.js +7 -7
  19. package/components/SideBar/context/sideBarContext/index.js +9 -10
  20. package/components/SideBar/context/sideBarContext/types.d.ts +2 -10
  21. package/components/SideBar/slots/SideBarEnum.d.ts +7 -7
  22. package/components/SideBar/slots/SideBarEnum.js +5 -5
  23. package/components/SideBar/slots/SideBarSlots.d.ts +9 -9
  24. package/components/SideBar/slots/SideBarSlots.js +31 -28
  25. package/components/SideBar/styles.js +3 -3
  26. package/components/SideBar/subcomponents/ContentComponent/index.js +12 -68
  27. package/components/SideBar/subcomponents/ContentComponent/style.js +122 -103
  28. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.d.ts +1 -1
  29. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.js +4 -4
  30. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.js +8 -2
  31. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +5 -0
  32. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +37 -0
  33. package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +1 -0
  34. package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +2 -0
  35. package/components/SideBar/subcomponents/HeaderComponent/styles.js +44 -0
  36. package/components/SideBar/subcomponents/SideBarDesktop/index.js +4 -3
  37. package/components/SideBar/subcomponents/SideBarDesktop/styles.js +4 -32
  38. package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
  39. package/components/SideBar/subcomponents/TreeGroupItems/index.js +4 -3
  40. package/components/SideBar/subcomponents/TreeGroupItems/styles.js +90 -2
  41. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +7 -0
  42. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +12 -0
  43. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +4 -0
  44. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +6 -4
  45. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +1 -0
  46. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +8 -3
  47. package/components/SideBar/types.d.ts +12 -7
  48. package/components/commercial/HamburgerMenu/HamburgerMenu.js +1 -2
  49. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +5 -4
  50. package/components/index.d.ts +0 -1
  51. package/components/mui_extended/Accordion/styles.js +5 -3
  52. package/components/mui_extended/MenuItem/MenuItem.js +1 -1
  53. package/components/mui_extended/TabContent/TabContent.js +2 -2
  54. package/components/mui_extended/TabContent/TabContent.styles.js +1 -4
  55. package/components/mui_extended/TabContent/constants.d.ts +0 -1
  56. package/components/mui_extended/TabContent/constants.js +0 -2
  57. package/components/mui_extended/TabContent/types.d.ts +1 -1
  58. package/components/mui_extended/Typography/Typography.js +1 -3
  59. package/components/mui_extended/Typography/types.d.ts +0 -5
  60. package/components/mui_extended/Typography/typography.styles.js +1 -7
  61. package/index.js +30 -32
  62. package/package.json +3 -3
  63. package/storybook/components/SideBar/SideBar.stories.d.ts +5 -11
  64. package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +4 -0
  65. package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +1 -0
  66. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +4 -0
  67. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +14 -0
  68. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +1 -0
  69. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +1 -0
  70. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +5 -0
  71. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +1 -0
  72. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +5 -0
  73. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +1 -0
  74. package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
  75. package/components/ContainerFlow/ContainerFlow.d.ts +0 -7
  76. package/components/ContainerFlow/ContainerFlow.js +0 -25
  77. package/components/ContainerFlow/ContainerFlow.styles.d.ts +0 -2
  78. package/components/ContainerFlow/ContainerFlow.styles.js +0 -46
  79. package/components/ContainerFlow/constants.d.ts +0 -8
  80. package/components/ContainerFlow/constants.js +0 -19
  81. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.d.ts +0 -7
  82. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.js +0 -10
  83. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.test.d.ts +0 -1
  84. package/components/ContainerFlow/index.d.ts +0 -2
  85. package/components/ContainerFlow/slots/ContainerFlowEnum.d.ts +0 -4
  86. package/components/ContainerFlow/slots/ContainerFlowEnum.js +0 -8
  87. package/components/ContainerFlow/slots/ContainerFlowSlots.d.ts +0 -6
  88. package/components/ContainerFlow/slots/ContainerFlowSlots.js +0 -16
  89. package/components/ContainerFlow/slots/index.d.ts +0 -0
  90. package/components/ContainerFlow/tests/ContainerFlow.test.d.ts +0 -1
  91. package/components/ContainerFlow/types.d.ts +0 -41
  92. package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +0 -6
  93. package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +0 -2
  94. package/components/SideBar/subcomponents/HeaderSidebar/styles.js +0 -24
  95. package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +0 -5
  96. package/storybook/components/ContainerFlow/ContainerFlow.stories.d.ts +0 -32
  97. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn/index.d.ts +0 -5
  98. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn1Wrappers/index.d.ts +0 -5
  99. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn2Wrappers/index.d.ts +0 -5
  100. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn3Wrappers/index.d.ts +0 -5
  101. package/storybook/components/ContainerFlow/subcomponents/RenderFlexWrap/index.d.ts +0 -5
  102. package/storybook/components/ContainerFlow/subcomponents/RenderGridLayout/index.d.ts +0 -5
  103. package/storybook/components/ContainerFlow/wrapperItems/index.d.ts +0 -10
  104. package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +0 -4
  105. package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +0 -1
  106. /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.d.ts +0 -0
  107. /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/types.d.ts +0 -0
  108. /package/components/{ContainerFlow → SideBar/subcomponents/HeaderComponent}/index.js +0 -0
  109. /package/storybook/components/SideBar/subcomponents/{FooterPromotion → FooterComponentHost}/constants.d.ts +0 -0
@@ -6,10 +6,16 @@ const footerSideBarStyles = {
6
6
  height: "auto",
7
7
  display: "grid",
8
8
  placeItems: "center",
9
- borderTop: `${theme.vars.size.baseSpacings["sp0-5"]} solid ${theme.vars.palette.border.secondary}`,
9
+ boxShadow: `0px -1px 0px 0px ${theme.vars.palette.border.disabled}`,
10
10
  borderWidth: ownerState?.anchored ? theme.vars.size.baseSpacings["sp0-5"] : theme.vars.size.baseSpacings.sp0,
11
11
  transition: "all 0.5s",
12
- paddingBottom: theme.vars.size.baseSpacings.sp2
12
+ paddingBottom: theme.vars.size.baseSpacings.sp2,
13
+ marginLeft: theme.vars.size.baseSpacings.sp4,
14
+ marginRight: theme.vars.size.baseSpacings.sp4,
15
+ ...!ownerState?.anchored && !theme.generalSettings.isMobile && {
16
+ transition: "all 0.5s",
17
+ visibility: "hidden"
18
+ }
13
19
  })
14
20
  };
15
21
  export {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Componente que representa el encabezado del sidebar.
3
+ * @returns {JSX.Element}
4
+ */
5
+ export declare const HeaderComponent: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { u as useSideBar } from "../../hooks/useSideBar/index.js";
3
+ import { H as HeaderContainerComponentStyled, B as ButtonAnchoredStyled } from "../../slots/SideBarSlots.js";
4
+ import { useEnvironment } from "@m4l/core";
5
+ import { e as PATH_ARROW_RIGHT_ICON } from "../../constants.js";
6
+ import { useIsMobile } from "@m4l/graphics";
7
+ const HeaderComponent = () => {
8
+ const {
9
+ headerComponent,
10
+ onToggleAnchored,
11
+ anchored,
12
+ variant,
13
+ classes
14
+ } = useSideBar();
15
+ const { host_static_assets, environment_assets } = useEnvironment();
16
+ const isDesktop = !useIsMobile();
17
+ const handleToggleAnchored = () => {
18
+ onToggleAnchored(!anchored);
19
+ };
20
+ return /* @__PURE__ */ jsxs(HeaderContainerComponentStyled, { ownerState: { anchored, variant }, children: [
21
+ headerComponent && headerComponent,
22
+ variant === "microfrontend" && isDesktop && /* @__PURE__ */ jsx(
23
+ ButtonAnchoredStyled,
24
+ {
25
+ icon: `${host_static_assets}/${environment_assets}/${PATH_ARROW_RIGHT_ICON}`,
26
+ onClick: handleToggleAnchored,
27
+ rotationAngle: anchored ? 0 : 180,
28
+ className: classes.buttonAnchored,
29
+ variant: "contained",
30
+ role: "anchored-button"
31
+ }
32
+ )
33
+ ] });
34
+ };
35
+ export {
36
+ HeaderComponent as H
37
+ };
@@ -0,0 +1 @@
1
+ export { HeaderComponent } from './HeaderComponent';
@@ -0,0 +1,2 @@
1
+ import { HeaderComponentStyles } from '../../types';
2
+ export declare const headerComponentStyles: HeaderComponentStyles;
@@ -0,0 +1,44 @@
1
+ const headerComponentStyles = {
2
+ /**
3
+ * Wrapper para el encabezado del sidebar
4
+ */
5
+ headerContainerComponent: ({ theme, ownerState }) => ({
6
+ display: "flex",
7
+ flexDirection: "row",
8
+ justifyContent: "space-between",
9
+ alignItems: "center",
10
+ width: "100%",
11
+ gap: theme.vars.size.baseSpacings.sp3,
12
+ paddingLeft: theme.vars.size.baseSpacings.sp4,
13
+ paddingRight: theme.vars.size.baseSpacings.sp4,
14
+ paddingBottom: theme.vars.size.baseSpacings.sp3,
15
+ transition: "all 0.5s",
16
+ "& > div": {
17
+ transition: "all 0.5s"
18
+ },
19
+ "& > div:first-of-type .M4LImage-root": {
20
+ //minWidth: '140px',
21
+ minHeight: theme.vars.size.baseSpacings.sp10
22
+ },
23
+ ...!ownerState?.anchored && ownerState?.variant !== "host" && {
24
+ transition: "all 0.5s",
25
+ height: theme.vars.size.baseSpacings.sp14,
26
+ justifyContent: "center",
27
+ alignItems: "center",
28
+ paddingLeft: theme.vars.size.baseSpacings.sp2,
29
+ paddingRight: theme.vars.size.baseSpacings.sp2,
30
+ gap: "unset",
31
+ "& > div:not(.M4LSideBar-buttonAnchored)": {
32
+ visibility: "hidden",
33
+ transition: "all 0.5s"
34
+ }
35
+ }
36
+ }),
37
+ /**
38
+ * Styles applied to the button anchored in the header component
39
+ */
40
+ buttonAnchored: {}
41
+ };
42
+ export {
43
+ headerComponentStyles as h
44
+ };
@@ -1,13 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useFirstRender } from "@m4l/graphics";
3
3
  import { u as useSideBar } from "../../hooks/useSideBar/index.js";
4
- import { e as ContainerDesktopContentStyled, f as ContainerDesktopRootStyled } from "../../slots/SideBarSlots.js";
4
+ import { c as ContainerDesktopContentStyled, d as ContainerDesktopRootStyled } from "../../slots/SideBarSlots.js";
5
5
  import { S as SIDEBAR_KEY_COMPONENT } from "../../constants.js";
6
6
  import { C as ContentComponent } from "../ContentComponent/index.js";
7
7
  import { useState, useEffect } from "react";
8
8
  import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
9
9
  const SideBarDesktop = () => {
10
- const { anchored, expandedWidth } = useSideBar();
10
+ const { anchored, expandedWidth, variant } = useSideBar();
11
11
  const [eventAnchored, setEventAnchored] = useState(anchored);
12
12
  const isFirstRender = useFirstRender([anchored]);
13
13
  useEffect(() => {
@@ -18,7 +18,8 @@ const SideBarDesktop = () => {
18
18
  }, [anchored]);
19
19
  const ownerState = {
20
20
  anchored: eventAnchored,
21
- expandedWidth
21
+ expandedWidth,
22
+ variant
22
23
  };
23
24
  const classRoot = getComponentSlotRoot(SIDEBAR_KEY_COMPONENT);
24
25
  return /* @__PURE__ */ jsx(
@@ -5,7 +5,7 @@ const sideBarDesktopStyles = {
5
5
  * sin que se oculte por el overflow hidden que tiene el contenido del sidebar
6
6
  */
7
7
  containerDesktopContent: ({ theme, ownerState }) => {
8
- const width = ownerState?.anchored ? ownerState?.expandedWidth : theme.vars.size.baseSpacings.sp4;
8
+ const width = ownerState?.anchored ? ownerState?.expandedWidth : ownerState?.variant === "host" ? 0 : theme.vars.size.baseSpacings.sp10;
9
9
  return {
10
10
  height: "100%",
11
11
  position: "relative",
@@ -17,42 +17,14 @@ const sideBarDesktopStyles = {
17
17
  /**
18
18
  * Styles applied to the root element of the `SideBar` component in desktop mode.
19
19
  */
20
- containerDesktopRoot: ({ ownerState, theme }) => ({
20
+ containerDesktopRoot: ({ theme }) => ({
21
21
  height: "100%",
22
- width: "fit-content",
22
+ width: "100%",
23
23
  overflow: "visible",
24
- borderRight: `1px solid ${theme.vars.palette.border.default}`,
25
- position: !ownerState?.anchored ? "absolute" : "relative",
24
+ borderRight: `1px solid ${theme.vars.palette.border.secondary}`,
26
25
  inset: 0,
27
26
  //add hover effect
28
27
  zIndex: 999
29
- }),
30
- /**
31
- * Container button to achores the sidebar.
32
- */
33
- containerBtnAnchored: ({ theme, ownerState }) => ({
34
- position: "absolute",
35
- right: "-20px",
36
- top: "20px",
37
- zIndex: 1e3,
38
- padding: `${theme.vars.size.baseSpacings.sp10} 10px`,
39
- "& .MuiButtonBase-root": {
40
- ...!ownerState?.anchored && {
41
- "&:before": {
42
- content: '""',
43
- position: "absolute",
44
- inset: 0,
45
- backgroundColor: theme.vars.palette.background.default,
46
- zIndex: -1
47
- }
48
- }
49
- },
50
- "&&& .M4LIconButton-root:hover": {
51
- backgroundColor: theme.vars.palette.primary.enabled,
52
- "& .M4LIcon-icon": {
53
- backgroundColor: `${theme.vars.palette.primary.contrastText}!important`
54
- }
55
- }
56
28
  })
57
29
  };
58
30
  export {
@@ -4,7 +4,7 @@ import { u as useSideBar } from "../../hooks/useSideBar/index.js";
4
4
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
5
5
  import { g as getNameDataTestId } from "../../tests/utils.js";
6
6
  import { D as Drawer } from "./subcomponents/Drawer.js";
7
- import { g as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
7
+ import { e as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
8
8
  import { C as ContentComponent } from "../ContentComponent/index.js";
9
9
  const SideBarMobile = () => {
10
10
  const {
@@ -3,18 +3,19 @@ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
3
3
  import { u as useSideBar } from "../../hooks/useSideBar/index.js";
4
4
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
5
5
  import { g as getNameDataTestId } from "../../tests/utils.js";
6
- import { h as ContainerTreeGroupItemsStyled, i as ContainerContentGroupsStyled, j as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
6
+ import { f as ContainerTreeGroupItemsStyled, g as ContainerContentGroupsStyled, h as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
7
7
  import { N as NodeMenuItemMain } from "./subcomponents/NodeMenuItemMain/NodeMenuItemMain.js";
8
8
  import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
9
9
  import { M as MenuItem } from "../../../mui_extended/MenuItem/MenuItem.js";
10
10
  const TreeGroupItems = (contentGroupsProps) => {
11
- const { menuData } = useSideBar();
11
+ const { menuData, anchored } = useSideBar();
12
12
  const { getLabel } = useModuleDictionary();
13
13
  const { size } = contentGroupsProps;
14
14
  const { currentSize } = useComponentSize(size);
15
15
  const isSkeleton = useModuleSkeleton();
16
16
  const ownerState = {
17
- noItems: menuData.length === 0
17
+ noItems: menuData.length === 0,
18
+ anchored
18
19
  };
19
20
  const renderItemsDisabled = () => {
20
21
  return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
@@ -1,3 +1,4 @@
1
+ import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
1
2
  const contentGroupStyles = {
2
3
  /**
3
4
  * Container for the group items in the sidebar
@@ -9,9 +10,17 @@ const contentGroupStyles = {
9
10
  flex: 1,
10
11
  flexDirection: "column",
11
12
  overflowY: "auto",
12
- padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
13
13
  alignItems: "center",
14
- justifyContent: ownerState?.noItems ? "center" : "flex-start"
14
+ justifyContent: ownerState?.noItems ? "center" : "flex-start",
15
+ transition: "all 0.5s",
16
+ paddingTop: theme.vars.size.baseSpacings.sp3,
17
+ paddingLeft: theme.vars.size.baseSpacings.sp4,
18
+ paddingRight: theme.vars.size.baseSpacings.sp4,
19
+ gap: theme.vars.size.baseSpacings.sp4,
20
+ ...!ownerState?.anchored && !theme.generalSettings.isMobile && {
21
+ transition: "all 0.5s",
22
+ visibility: "hidden"
23
+ }
15
24
  }),
16
25
  /**
17
26
  * Wrapper for every principal item group in the sidebar
@@ -28,6 +37,7 @@ const contentGroupStyles = {
28
37
  containerContentTitle: ({ theme, ownerState }) => ({
29
38
  padding: `${theme.vars.size.baseSpacings.sp3} ${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp1}`,
30
39
  color: theme.vars.palette.text.primary,
40
+ width: "100%",
31
41
  textAlign: "left",
32
42
  "& .MuiTypography-root": {
33
43
  color: !ownerState?.disabled ? theme.vars.palette.text.primary : `${theme.vars.palette.text.primary} !important`
@@ -62,6 +72,84 @@ const contentGroupStyles = {
62
72
  alignSelf: "center",
63
73
  lineHeight: 0,
64
74
  marginLeft: "auto"
75
+ }),
76
+ /**
77
+ * Styles applied to the container of the adornment icon in the header component
78
+ */
79
+ containerAdornmentIcon: ({ theme, ownerState }) => ({
80
+ overflow: "hidden",
81
+ borderRadius: theme.vars.size.borderRadius["r1-5"],
82
+ display: "flex",
83
+ justifyContent: "center",
84
+ alignItems: "center",
85
+ position: "relative",
86
+ width: "fit-content",
87
+ height: "fit-content",
88
+ padding: "1px",
89
+ "& .M4LIcon-root": {
90
+ width: "fit-content",
91
+ height: "fit-content",
92
+ padding: theme.vars.size.baseSpacings["sp0-5"],
93
+ "& .M4LIcon-icon": {
94
+ ...getSizeStyles(
95
+ theme,
96
+ ownerState?.size || "medium",
97
+ "case",
98
+ (sizeValue) => ({
99
+ width: `${sizeValue}!important`,
100
+ height: `${sizeValue}!important`,
101
+ minWidth: `${sizeValue}!important`,
102
+ minHeight: `${sizeValue}!important`
103
+ })
104
+ )
105
+ }
106
+ },
107
+ ...ownerState?.variant !== "itemActive" && ownerState?.variant !== "normal" && {
108
+ "& .M4LIcon-icon": {
109
+ backgroundColor: `${theme.vars.palette.chips.persianGreen.contained.colorTone}!important`
110
+ }
111
+ },
112
+ ...ownerState?.variant === "normal" && {
113
+ "& .M4LIcon-icon": {
114
+ backgroundColor: `${theme.vars.palette.text.secondary}!important`
115
+ }
116
+ },
117
+ ...ownerState?.variant === "main" && {
118
+ backgroundColor: theme.vars.palette.chips.persianGreen.contained.backgroundColorTone
119
+ },
120
+ ...ownerState?.variant === "root" && {
121
+ backgroundColor: theme.vars.palette.primary.enabled
122
+ },
123
+ ...ownerState?.variant === "itemActive" && {
124
+ boxShadow: theme.vars.customShadows.primary2,
125
+ background: `linear-gradient(to right,
126
+ ${theme.vars.palette.primary.opacityGradient1},
127
+ ${theme.vars.palette.primary.opacityGradient2})`,
128
+ "& .M4LSideBar-backgroundAdornmentIcon": {
129
+ background: theme.vars.palette.background.default
130
+ },
131
+ "&::before": {
132
+ content: '""',
133
+ position: "absolute",
134
+ inset: "1.4px",
135
+ background: theme.vars.palette.primary.enabledOpacity,
136
+ borderRadius: "5px"
137
+ },
138
+ "& .M4LIcon-icon": {
139
+ backgroundColor: `${theme.vars.palette.primary.enabled}!important`
140
+ }
141
+ }
142
+ }),
143
+ /**
144
+ * Styles applied to the background of the adornment icon in the header component
145
+ */
146
+ backgroundAdornmentIcon: () => ({
147
+ width: "100%",
148
+ height: "100%",
149
+ display: "flex",
150
+ justifyContent: "center",
151
+ alignItems: "center",
152
+ borderRadius: "5px"
65
153
  })
66
154
  };
67
155
  export {
@@ -0,0 +1,7 @@
1
+ import { AdornmentIconProps } from './types';
2
+ /**
3
+ * Adornment icon component
4
+ * @param props - Adornment icon props
5
+ * @returns Adornment icon component
6
+ */
7
+ export declare const AdornmentIcon: (props: AdornmentIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
3
+ import { i as ContainerAdornmentIconStyled, j as BackgroundAdornmentIconStyled } from "../../../../slots/SideBarSlots.js";
4
+ import { I as Icon } from "../../../../../Icon/Icon.js";
5
+ const AdornmentIcon = (props) => {
6
+ const { icon, variant = "main" } = props;
7
+ const { classes } = useSideBar();
8
+ return /* @__PURE__ */ jsx(ContainerAdornmentIconStyled, { ownerState: { variant }, children: /* @__PURE__ */ jsx(BackgroundAdornmentIconStyled, { className: classes.backgroundAdornmentIcon, children: /* @__PURE__ */ jsx(Icon, { src: icon }) }) });
9
+ };
10
+ export {
11
+ AdornmentIcon as A
12
+ };
@@ -0,0 +1,4 @@
1
+ export interface AdornmentIconProps {
2
+ icon: string;
3
+ variant: 'main' | 'root' | 'itemActive' | 'normal';
4
+ }
@@ -6,13 +6,14 @@ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
6
6
  import { g as getNameDataTestId } from "../../../../tests/utils.js";
7
7
  import { A as ArrowIcon } from "../ArrowIcon/index.js";
8
8
  import { l as ContainerNodeMenuItemStyled } from "../../../../slots/SideBarSlots.js";
9
- import { c as CLASS_NAME_MENU_ACTIVE, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE, e as CLASS_NAME_HAS_CHILDREN } from "../../../../constants.js";
9
+ import { a as CLASS_NAME_MENU_ACTIVE, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE, b as CLASS_NAME_HAS_CHILDREN, c as CLASS_NAME_ITEM_CLOSED } from "../../../../constants.js";
10
10
  import { useModuleSkeleton } from "@m4l/core";
11
+ import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
11
12
  import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
12
13
  import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
13
14
  import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
14
15
  function NodeMenuItem(props) {
15
- const { item, size, defaultOpen = false, className, isLastSibling = false } = props;
16
+ const { item, size, defaultOpen = false, className, isLastSibling = false, isRoot = false } = props;
16
17
  const { urlIconPrefix, classes } = useSideBar();
17
18
  const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
18
19
  const { currentSize } = useComponentSize(size);
@@ -40,11 +41,12 @@ function NodeMenuItem(props) {
40
41
  CLASS_NAME_ITEM_STATE,
41
42
  className,
42
43
  item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN,
43
- item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
44
+ item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE,
45
+ !isOpen && CLASS_NAME_ITEM_CLOSED
44
46
  ),
45
47
  label: item.title,
46
48
  selected: item.active,
47
- startIcon: `${urlIconPrefix}${item.iconUrl}`,
49
+ startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: isRoot && item.itemInTreeActive ? "root" : item.active ? "itemActive" : "normal" }),
48
50
  endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
49
51
  onClick: () => handlerClick(),
50
52
  size: currentSize
@@ -6,4 +6,5 @@ export type NodeMenuItemProps = {
6
6
  size: Extract<Sizes, 'small' | 'medium'>;
7
7
  className?: string;
8
8
  isLastSibling?: boolean;
9
+ isRoot?: boolean;
9
10
  };
@@ -5,13 +5,16 @@ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
5
5
  import { A as ArrowIcon } from "../ArrowIcon/index.js";
6
6
  import { Collapse } from "@mui/material";
7
7
  import { N as NodeMenuItem } from "../NodeMenuItem/index.js";
8
- import { b as CLASS_NAME_IS_ROOT } from "../../../../constants.js";
8
+ import { C as CLASS_NAME_IS_ROOT } from "../../../../constants.js";
9
9
  import clsx from "clsx";
10
10
  import { useModuleSkeleton } from "@m4l/core";
11
+ import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
12
+ import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
11
13
  import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
12
14
  import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
13
15
  const NodeMenuItemMain = (props) => {
14
16
  const { item, size, defaultOpen = false } = props;
17
+ const { urlIconPrefix } = useSideBar();
15
18
  const { currentSize } = useComponentSize(size);
16
19
  const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
17
20
  const isSkeleton = useModuleSkeleton();
@@ -31,7 +34,8 @@ const NodeMenuItemMain = (props) => {
31
34
  MenuItemMainStyled,
32
35
  {
33
36
  label: item.title,
34
- startIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
37
+ startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: "main" }),
38
+ endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
35
39
  onClick: () => handlerClick(),
36
40
  size: currentSize
37
41
  }
@@ -43,7 +47,8 @@ const NodeMenuItemMain = (props) => {
43
47
  size: currentSize,
44
48
  className: clsx(CLASS_NAME_IS_ROOT),
45
49
  defaultOpen: isSkeleton ? false : true,
46
- isLastSibling: item.children?.length === index + 1
50
+ isLastSibling: item.children?.length === index + 1,
51
+ isRoot: true
47
52
  },
48
53
  child.title
49
54
  )) })
@@ -51,10 +51,6 @@ export interface SideBarProps {
51
51
  * Slogan de la empresa
52
52
  */
53
53
  companySlogan?: string;
54
- /**
55
- * Indica la variación de estilo del componente
56
- */
57
- variantStyle?: 'variantDefault' | 'variantComercial';
58
54
  moduleSelectedId?: string | undefined;
59
55
  onMenuItemClick: (item: MenuDataType) => void;
60
56
  /**
@@ -74,10 +70,19 @@ export interface SideBarProps {
74
70
  */
75
71
  urlIconPrefix?: string;
76
72
  /**
77
- * Promoción del sidebar, se renderiza en el footer del sidebar
73
+ * Variación del componente, puede ser uno de los valores definidos en 'variantDefault' , 'variantComercial'
74
+ */
75
+ variant?: SidebarVariants;
76
+ /**
77
+ * Componente que se renderiza en el encabezado del sidebar
78
+ */
79
+ headerComponent?: ReactElement;
80
+ /**
81
+ * Componente que se renderiza en el pie de página del sidebar
78
82
  */
79
- promotion?: ReactElement;
83
+ footerComponent?: ReactElement;
80
84
  }
85
+ export type SidebarVariants = 'host' | 'microfrontend';
81
86
  /**
82
87
  * Interface que representa el estado de un elemento de menú en la barra lateral.
83
88
  */
@@ -96,7 +101,7 @@ export type SideBarOwnerState = Pick<IMenuDataWithState, 'active' | 'itemInTreeA
96
101
  export type SideBarStyles = M4LOverridesStyleRules<SideBarSlotsType, typeof SIDEBAR_KEY_COMPONENT, Theme>;
97
102
  export type SideBarDesktopStyles = M4LOverridesStyleRules<SideBarDesktopSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
98
103
  export type ContentGroupsStyles = M4LOverridesStyleRules<ContentGroupsSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
99
- export type HeaderSidebarStyles = M4LOverridesStyleRules<HeaderSidebarSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
104
+ export type HeaderComponentStyles = M4LOverridesStyleRules<HeaderSidebarSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
100
105
  export type SideBarFooterStyles = M4LOverridesStyleRules<SideBarFooterSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
101
106
  export type SideBarMobileStyles = M4LOverridesStyleRules<SideBarMobileSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
102
107
  export type ContentComponentStyles = M4LOverridesStyleRules<ContentComponentSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
@@ -44,8 +44,7 @@ const HamburgerMenu = (props) => {
44
44
  onToggleVisible: handlerOnVisible,
45
45
  anchored: false,
46
46
  companyLogoSmallUrl: "",
47
- companyName: "",
48
- variantStyle: "variantComercial"
47
+ companyName: ""
49
48
  }
50
49
  )
51
50
  ]
@@ -1,11 +1,12 @@
1
1
  import { g as getCommonActionsDictionary } from "../../../../CommonActions/dictionary.js";
2
+ const DICTIONARY_KEY = "rhf_period";
2
3
  const dictionary = {
3
- LABEL_YEARS: "period.label_years",
4
- LABEL_MONTHS: "period.label_months",
5
- LABEL_DAYS: "period.label_days"
4
+ LABEL_YEARS: `${DICTIONARY_KEY}.label_years`,
5
+ LABEL_MONTHS: `${DICTIONARY_KEY}.label_months`,
6
+ LABEL_DAYS: `${DICTIONARY_KEY}.label_days`
6
7
  };
7
8
  function getPeriodComponetsDictionary() {
8
- return ["period"].concat(getCommonActionsDictionary());
9
+ return [DICTIONARY_KEY].concat(getCommonActionsDictionary());
9
10
  }
10
11
  export {
11
12
  dictionary as d,
@@ -7,7 +7,6 @@ export * from './BaseModule';
7
7
  export * from './Chip';
8
8
  export * from './commercial';
9
9
  export * from './CommonActions/';
10
- export * from './ContainerFlow';
11
10
  export * from './CommonActions/dictionary';
12
11
  export * from './DataGrid';
13
12
  export * from './DragResizeWindowRND';
@@ -16,8 +16,7 @@ const accordionStyles = {
16
16
  borderRadius: "unset"
17
17
  },
18
18
  margin: "unset",
19
- overflow: "visible",
20
- height: "min-content"
19
+ overflow: "visible"
21
20
  }
22
21
  }),
23
22
  /**
@@ -103,7 +102,10 @@ const accordionStyles = {
103
102
  * **************************************************************
104
103
  */
105
104
  accordionDetails: ({ theme, ownerState }) => ({
106
- padding: theme.vars.size.baseSpacings.sp4,
105
+ paddingLeft: theme.vars.size.baseSpacings.sp3,
106
+ paddingRight: theme.vars.size.baseSpacings.sp3,
107
+ paddingTop: theme.vars.size.baseSpacings.sp1,
108
+ paddingBottom: theme.vars.size.baseSpacings.sp1,
107
109
  background: theme.vars.palette.background.default,
108
110
  display: "flex",
109
111
  flexDirection: "column",
@@ -94,7 +94,7 @@ const MenuItem = (props) => {
94
94
  disabled
95
95
  }
96
96
  ),
97
- /* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, children: [
97
+ /* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, className: MENUITEM_CLASSES.menuItemContainer, children: [
98
98
  renderIcon(startIcon, "MenuItemStartIcon", getComponentSlotRoot("MenuItemStartIcon")),
99
99
  /* @__PURE__ */ jsx(
100
100
  MenuItemTypographyStyled,
@@ -3,9 +3,9 @@ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.j
3
3
  import { T as TAB_CONTENT_KEY_COMPONENT } from "./constants.js";
4
4
  import { T as TabContentRootStyled } from "./slots/TabContentSlots.js";
5
5
  const TabContent = (props) => {
6
- const { children, className, background = false, ...others } = props;
6
+ const { children, className, hasBackground = false, ...others } = props;
7
7
  const root = getComponentSlotRoot(TAB_CONTENT_KEY_COMPONENT);
8
- return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ownerState: { background }, ...others, children });
8
+ return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ownerState: { hasBackground }, ...others, children });
9
9
  };
10
10
  export {
11
11
  TabContent as T
@@ -1,4 +1,3 @@
1
- import { C as CONTAINER_QUERY_NAME } from "./constants.js";
2
1
  const tabContentStyles = {
3
2
  /**
4
3
  * Elemento root referencia a `TabContent`
@@ -10,8 +9,6 @@ const tabContentStyles = {
10
9
  paddingRight: 0,
11
10
  display: "flex",
12
11
  overflow: "auto",
13
- containerName: CONTAINER_QUERY_NAME,
14
- containerType: "inline-size",
15
12
  // height: '100%',
16
13
  flexDirection: "column",
17
14
  gap: theme.vars.size.baseSpacings.sp2,
@@ -23,7 +20,7 @@ const tabContentStyles = {
23
20
  boxSizing: "border-box",
24
21
  zIndex: "0",
25
22
  top: "-1px",
26
- ...ownerState?.background ? {
23
+ ...ownerState?.hasBackground ? {
27
24
  backgroundColor: theme.vars.palette.background.base,
28
25
  paddingLeft: theme.vars.size.baseSpacings.sp2,
29
26
  paddingRight: theme.vars.size.baseSpacings.sp2,
@@ -1,2 +1 @@
1
1
  export declare const TAB_CONTENT_KEY_COMPONENT = "M4LTabContent";
2
- export declare const CONTAINER_QUERY_NAME = "container";
@@ -1,6 +1,4 @@
1
1
  const TAB_CONTENT_KEY_COMPONENT = "M4LTabContent";
2
- const CONTAINER_QUERY_NAME = "container";
3
2
  export {
4
- CONTAINER_QUERY_NAME as C,
5
3
  TAB_CONTENT_KEY_COMPONENT as T
6
4
  };
@@ -7,6 +7,6 @@ export interface TabContentProps extends Omit<React.HTMLAttributes<HTMLDivElemen
7
7
  children: React.ReactNode;
8
8
  style?: React.CSSProperties;
9
9
  key?: Key | null | undefined;
10
- background?: boolean;
10
+ hasBackground?: boolean;
11
11
  }
12
12
  export type TabContentStyles = M4LOverridesStyleRules<keyof typeof TabContentSlots, typeof TABS_KEY_COMPONENT, Theme>;
@@ -17,7 +17,6 @@ function Typography(props) {
17
17
  dataTestid,
18
18
  children,
19
19
  disabled,
20
- ellipsis = false,
21
20
  ...other
22
21
  } = props;
23
22
  const isSkeleton = useModuleSkeleton();
@@ -29,8 +28,7 @@ function Typography(props) {
29
28
  size: adjustedSize,
30
29
  skeletonRows,
31
30
  variant,
32
- skeleton: isSkeleton,
33
- ellipsis
31
+ skeleton: isSkeleton
34
32
  };
35
33
  return /* @__PURE__ */ jsx(
36
34
  StyledMUITypography,