@m4l/components 9.2.62-B08072025beta.2 → 9.2.62-B09072025beta.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 (108) hide show
  1. package/@types/types.d.ts +8 -0
  2. package/components/AppBar/AppBar.js +10 -12
  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 +5 -1
  6. package/components/AppBar/slots/AppBarEnum.js +4 -0
  7. package/components/AppBar/slots/AppBarSlots.d.ts +18 -4
  8. package/components/AppBar/slots/AppBarSlots.js +27 -3
  9. package/components/AppBar/styles.js +42 -0
  10. package/components/AppBar/types.d.ts +0 -8
  11. package/components/ContainerFlow/ContainerFlow.d.ts +7 -0
  12. package/components/ContainerFlow/ContainerFlow.js +25 -0
  13. package/components/ContainerFlow/ContainerFlow.styles.d.ts +2 -0
  14. package/components/ContainerFlow/ContainerFlow.styles.js +46 -0
  15. package/components/ContainerFlow/constants.d.ts +8 -0
  16. package/components/ContainerFlow/constants.js +19 -0
  17. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.d.ts +7 -0
  18. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.js +10 -0
  19. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.test.d.ts +1 -0
  20. package/components/ContainerFlow/index.d.ts +2 -0
  21. package/components/ContainerFlow/slots/ContainerFlowEnum.d.ts +4 -0
  22. package/components/ContainerFlow/slots/ContainerFlowEnum.js +8 -0
  23. package/components/ContainerFlow/slots/ContainerFlowSlots.d.ts +6 -0
  24. package/components/ContainerFlow/slots/ContainerFlowSlots.js +16 -0
  25. package/components/ContainerFlow/slots/index.d.ts +0 -0
  26. package/components/ContainerFlow/tests/ContainerFlow.test.d.ts +1 -0
  27. package/components/ContainerFlow/types.d.ts +41 -0
  28. package/components/Image/Image.js +4 -2
  29. package/components/Image/image.styles.js +6 -3
  30. package/components/Image/types.d.ts +2 -0
  31. package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
  32. package/components/PropertyValue/PropertyValue.styles.js +1 -1
  33. package/components/SideBar/SideBar.js +2 -6
  34. package/components/SideBar/constants.d.ts +6 -7
  35. package/components/SideBar/constants.js +7 -7
  36. package/components/SideBar/context/sideBarContext/index.js +10 -9
  37. package/components/SideBar/context/sideBarContext/types.d.ts +10 -2
  38. package/components/SideBar/slots/SideBarEnum.d.ts +7 -7
  39. package/components/SideBar/slots/SideBarEnum.js +5 -5
  40. package/components/SideBar/slots/SideBarSlots.d.ts +9 -9
  41. package/components/SideBar/slots/SideBarSlots.js +28 -31
  42. package/components/SideBar/styles.js +3 -3
  43. package/components/SideBar/subcomponents/ContentComponent/index.js +68 -12
  44. package/components/SideBar/subcomponents/ContentComponent/style.js +103 -103
  45. package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +6 -0
  46. package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +2 -0
  47. package/components/SideBar/subcomponents/HeaderSidebar/styles.js +24 -0
  48. package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +5 -0
  49. package/components/SideBar/subcomponents/{FooterComponent → Promotion}/index.d.ts +1 -1
  50. package/components/SideBar/subcomponents/{FooterComponent → Promotion}/index.js +4 -4
  51. package/components/SideBar/subcomponents/{FooterComponent → Promotion}/styles.js +1 -7
  52. package/components/SideBar/subcomponents/SideBarDesktop/index.js +3 -4
  53. package/components/SideBar/subcomponents/SideBarDesktop/styles.js +32 -4
  54. package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
  55. package/components/SideBar/subcomponents/TreeGroupItems/index.js +3 -4
  56. package/components/SideBar/subcomponents/TreeGroupItems/styles.js +2 -90
  57. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +4 -6
  58. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +0 -1
  59. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +3 -8
  60. package/components/SideBar/types.d.ts +7 -12
  61. package/components/commercial/HamburgerMenu/HamburgerMenu.js +2 -1
  62. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +4 -5
  63. package/components/index.d.ts +1 -0
  64. package/components/mui_extended/Accordion/styles.js +3 -5
  65. package/components/mui_extended/TabContent/TabContent.js +2 -2
  66. package/components/mui_extended/TabContent/TabContent.styles.js +4 -1
  67. package/components/mui_extended/TabContent/constants.d.ts +1 -0
  68. package/components/mui_extended/TabContent/constants.js +2 -0
  69. package/components/mui_extended/TabContent/types.d.ts +1 -1
  70. package/components/mui_extended/Typography/Typography.js +3 -1
  71. package/components/mui_extended/Typography/types.d.ts +5 -0
  72. package/components/mui_extended/Typography/typography.styles.js +7 -1
  73. package/index.js +32 -30
  74. package/package.json +3 -3
  75. package/storybook/components/ContainerFlow/ContainerFlow.stories.d.ts +32 -0
  76. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn/index.d.ts +5 -0
  77. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn1Wrappers/index.d.ts +5 -0
  78. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn2Wrappers/index.d.ts +5 -0
  79. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn3Wrappers/index.d.ts +5 -0
  80. package/storybook/components/ContainerFlow/subcomponents/RenderFlexWrap/index.d.ts +5 -0
  81. package/storybook/components/ContainerFlow/subcomponents/RenderGridLayout/index.d.ts +5 -0
  82. package/storybook/components/ContainerFlow/wrapperItems/index.d.ts +10 -0
  83. package/storybook/components/SideBar/SideBar.stories.d.ts +11 -5
  84. package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +4 -0
  85. package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +1 -0
  86. package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
  87. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +0 -5
  88. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +0 -37
  89. package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +0 -1
  90. package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +0 -2
  91. package/components/SideBar/subcomponents/HeaderComponent/styles.js +0 -44
  92. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +0 -7
  93. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +0 -12
  94. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +0 -4
  95. package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +0 -4
  96. package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +0 -1
  97. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +0 -4
  98. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +0 -14
  99. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +0 -1
  100. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +0 -1
  101. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +0 -5
  102. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +0 -1
  103. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +0 -5
  104. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +0 -1
  105. /package/components/{SideBar/subcomponents/HeaderComponent → ContainerFlow}/index.js +0 -0
  106. /package/components/SideBar/subcomponents/{FooterComponent → Promotion}/styles.d.ts +0 -0
  107. /package/components/SideBar/subcomponents/{FooterComponent → Promotion}/types.d.ts +0 -0
  108. /package/storybook/components/SideBar/subcomponents/{FooterComponentHost → FooterPromotion}/constants.d.ts +0 -0
@@ -1,5 +1,6 @@
1
- import { C as CLASS_NAME_IS_ROOT, a as CLASS_NAME_MENU_ACTIVE, b as CLASS_NAME_HAS_CHILDREN, c as CLASS_NAME_ITEM_CLOSED, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE } from "../../constants.js";
1
+ import { b as CLASS_NAME_IS_ROOT, c as CLASS_NAME_MENU_ACTIVE, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE, e as CLASS_NAME_HAS_CHILDREN } from "../../constants.js";
2
2
  import { g as getTypographyStyles } from "../../../../utils/getTypographyStyles.js";
3
+ import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
3
4
  const contentComponentStyles = {
4
5
  /**
5
6
  * Estilos del contenedor principal del sidebar
@@ -9,48 +10,68 @@ const contentComponentStyles = {
9
10
  display: "flex",
10
11
  flexDirection: "column",
11
12
  height: "100%",
12
- width: "100%",
13
+ width: "fit-content",
13
14
  backgroundColor: theme.vars.palette.background.default
14
15
  }),
16
+ /**
17
+ * Estilos del contenedor que oculta el contenido cuando se encuentra des anclado.
18
+ */
19
+ contentComponentHide: ({ theme, ownerState }) => {
20
+ const width = ownerState?.anchored ? ownerState?.expandedWidth : theme.vars.size.baseSpacings.sp4;
21
+ return {
22
+ width: "100%",
23
+ height: "100%",
24
+ overflow: "hidden",
25
+ flex: 1,
26
+ display: "flex",
27
+ flexDirection: "column",
28
+ transition: "all 0.5s",
29
+ ...!ownerState?.anchored && !theme.generalSettings.isMobile && {
30
+ width: ownerState?.anchored && ownerState?.isDesktop ? ownerState?.expandedWidth : !ownerState?.isDesktop ? "100%" : theme.vars.size.baseSpacings.sp4,
31
+ minWidth: width,
32
+ maxWidth: width,
33
+ ...ownerState?.isHover && !theme.generalSettings.isMobile && {
34
+ transition: "all 0.5s",
35
+ width: `${ownerState?.expandedWidth}!important`,
36
+ maxWidth: `${ownerState?.expandedWidth}!important`,
37
+ contentVisibility: "visible",
38
+ '& [class*="containerFooter"]': {
39
+ borderWidth: theme.vars.size.baseSpacings["sp0-5"]
40
+ }
41
+ }
42
+ }
43
+ };
44
+ },
15
45
  /**
16
46
  * Contenedor que abraza el contenido del menu en primer lugar.
17
47
  */
18
- containerTreeItemsHeaderFooter: ({ theme, ownerState }) => ({
48
+ containerTreeItemsAndPromotion: ({ theme, ownerState }) => ({
19
49
  height: "100%",
20
- width: "100%",
50
+ width: ownerState?.expandedWidth,
21
51
  flex: 1,
22
52
  overflow: "hidden",
23
53
  display: "flex",
24
54
  flexDirection: "column",
25
- gap: theme.vars.size.baseSpacings.sp4,
26
- padding: "3px",
27
- paddingBottom: theme.vars.size.baseSpacings.sp4,
28
- ...!ownerState?.anchored && ownerState?.variant !== "host" && {
29
- transition: "all 0.5s",
30
- paddingLeft: "unset",
31
- paddingRight: "unset"
32
- },
55
+ paddingLeft: theme.vars.size.baseSpacings.sp4,
56
+ paddingRight: theme.vars.size.baseSpacings.sp4,
33
57
  '& [class*="M4LMenuItem-root"], & [class*="M4LMenuItem-skeletonMenuItem"]': {
34
- height: "fit-content"
58
+ ...getSizeStyles(
59
+ theme,
60
+ ownerState?.size || "medium",
61
+ "container",
62
+ (size) => ({
63
+ height: size,
64
+ minHeight: size,
65
+ maxHeight: size
66
+ })
67
+ )
35
68
  },
36
69
  "& .M4LMenuItem-root": {
37
70
  border: "unset",
38
- paddingTop: theme.vars.size.baseSpacings.sp2,
39
- paddingBottom: theme.vars.size.baseSpacings.sp2,
40
71
  paddingLeft: theme.vars.size.baseSpacings.sp2,
41
72
  paddingRight: theme.vars.size.baseSpacings.sp2,
42
- borderRadius: theme.vars.size.borderRadius["r1-5"],
43
- '& [class*="M4LMenuItem-menuItemContainer"]': {
44
- gap: theme.vars.size.baseSpacings["sp2-5"],
45
- overflow: "visible"
46
- },
47
- "&.menu-active": {
48
- "& .M4LTypography-root": {
49
- color: theme.vars.palette.primary.semanticText
50
- }
51
- },
52
73
  "& .M4LTypography-root": {
53
- paddingLeft: 0,
74
+ paddingLeft: `${theme.vars.size.baseSpacings.sp2} !important`,
54
75
  ...getTypographyStyles(
55
76
  theme.generalSettings.isMobile,
56
77
  ownerState?.size || "medium",
@@ -62,71 +83,82 @@ const contentComponentStyles = {
62
83
  /**
63
84
  * Contenedor que contiene grupo menu item desplegable.
64
85
  */
65
- containerNodeMenuItem: ({ theme }) => ({
66
- marginLeft: theme.vars.size.baseSpacings.sp6,
86
+ containerNodeMenuItem: ({ theme, ownerState }) => ({
87
+ marginLeft: theme.vars.size.baseSpacings.sp4,
67
88
  display: "flex",
68
89
  flexDirection: "column",
69
90
  overflow: "visible",
70
- position: "relative",
71
- gap: theme.vars.size.baseSpacings.sp1,
72
91
  '& [class*="M4LMenuItem-root"]:not(.menu-active)': {
73
92
  "& .M4LTypography-root": {
74
93
  color: `${theme.vars.palette.text.secondary}!important`
94
+ },
95
+ "& .M4LIcon-icon": {
96
+ backgroundColor: `${theme.vars.palette.text.secondary}!important`
75
97
  }
76
98
  },
77
99
  [`&.${CLASS_NAME_IS_ROOT}`]: {
78
- margin: "unset",
79
- "& > .MuiCollapse-root": {
80
- paddingRight: theme.vars.size.baseSpacings["sp0-5"]
100
+ margin: "unset"
101
+ },
102
+ [`& > .M4LMenuItem-root:first-of-type:not(.${CLASS_NAME_MENU_ACTIVE}).${CLASS_NAME_ITEM_IN_TREE_ACTIVE}`]: {
103
+ borderColor: theme.vars.palette.divider,
104
+ // Linea de referencia vertical
105
+ "&::before": {
106
+ content: '""',
107
+ position: "absolute",
108
+ top: "-25%",
109
+ bottom: "-25%",
110
+ height: "150%",
111
+ left: 0,
112
+ width: 2,
113
+ borderLeft: theme.vars.size.borderStroke.container,
114
+ borderColor: theme.vars.palette.border.default,
115
+ ...ownerState?.isLastSibling && !ownerState?.hasChildren && {
116
+ height: "75%"
117
+ }
118
+ },
119
+ // Linea de referencia horizontal
120
+ [`&:not(.${CLASS_NAME_HAS_CHILDREN}):after`]: {
121
+ content: '""',
122
+ position: "absolute",
123
+ margin: "0",
124
+ left: 1,
125
+ width: 4,
126
+ height: 1,
127
+ borderTop: theme.vars.size.borderStroke.container,
128
+ borderColor: theme.vars.palette.border.default
81
129
  }
82
130
  },
83
131
  [`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
84
132
  background: theme.vars.palette.text.primary
85
133
  },
86
134
  [`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
87
- [`&.${CLASS_NAME_HAS_CHILDREN}:not(.${CLASS_NAME_ITEM_CLOSED})`]: {
88
- '& [class*="M4LMenuItem-menuItemContainer"]:before': {
89
- content: '""',
90
- borderLeft: "3px solid",
91
- borderColor: theme.vars.palette.background.default,
92
- width: "3px",
93
- height: "50%",
94
- bottom: 0,
95
- position: "absolute",
96
- left: "-5px",
97
- zIndex: 1
98
- }
99
- },
100
135
  "&::before": {
101
136
  content: '""',
102
137
  position: "absolute",
103
- width: "5px",
104
- height: "5px",
105
- top: "50%",
106
- transform: "translateY(-50%)",
107
- left: "-6px",
108
- borderRadius: theme.vars.size.borderRadius["r0-5"],
109
- backgroundColor: theme.vars.palette.primary.focus,
110
- zIndex: 2
138
+ height: "25%",
139
+ top: "25%",
140
+ bottom: 0,
141
+ left: 0,
142
+ width: 2,
143
+ borderLeft: theme.vars.size.borderStroke.container,
144
+ borderColor: theme.vars.palette.primary.enabled,
145
+ ...!ownerState?.isLastSibling && !ownerState?.hasChildren && {
146
+ height: "50%"
147
+ }
111
148
  },
112
- "&::after": {
149
+ "&:after": {
113
150
  content: '""',
114
151
  position: "absolute",
115
- width: "1px",
116
- top: "0px",
117
- bottom: "0px",
118
- left: "-4px",
119
- backgroundImage: `linear-gradient(180deg,
120
- transparent 0%,
121
- ${theme.vars.palette.primary.opacityGradient1} 50%,
122
- transparent 100%)`
152
+ margin: "0",
153
+ left: 0,
154
+ width: theme.vars.size.baseSpacings.sp1,
155
+ height: 1,
156
+ borderTop: theme.vars.size.borderStroke.container,
157
+ borderColor: theme.vars.palette.primary.enabled
123
158
  }
124
159
  },
125
160
  [`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
126
- backgroundColor: theme.vars.palette.primary.opacity,
127
- borderBottomLeftRadius: 0,
128
- borderBottomRightRadius: 0,
129
- paddingRight: "9px"
161
+ backgroundColor: theme.vars.palette.primary.opacity
130
162
  },
131
163
  "& .MuiCollapse-wrapperInner": {
132
164
  display: "flex",
@@ -134,46 +166,14 @@ const contentComponentStyles = {
134
166
  paddingLeft: 0,
135
167
  paddingBottom: theme.vars.size.baseSpacings.sp1,
136
168
  paddingTop: 0,
137
- "&:before": {
138
- content: '""',
139
- position: "absolute",
140
- width: "1px",
141
- top: "-4px",
142
- bottom: "-4px",
143
- left: "-4px",
144
- backgroundColor: theme.vars.palette.background.default,
145
- zIndex: 1
146
- }
169
+ paddingRight: theme.vars.size.baseSpacings.sp1
147
170
  },
148
171
  [`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
149
- backgroundColor: theme.vars.palette.background.default,
150
- borderRadius: theme.vars.size.borderRadius.r2,
151
- border: theme.vars.size.borderStroke.container,
152
- borderColor: theme.vars.palette.primary.selectedOpacity,
153
- boxShadow: theme.vars.customShadows.z2,
154
- overflow: "hidden"
155
- },
156
- "& .MuiCollapse-root:first-of-type": {
157
- position: "relative"
158
- },
159
- "&.menu-active .MuiCollapse-wrapper.MuiCollapse-vertical:first-of-type:before": {
160
- content: '""',
161
- position: "absolute",
162
- width: "1px",
163
- top: "5px",
164
- bottom: "5px",
165
- left: "20px",
166
- borderLeft: theme.vars.size.borderStroke.container,
167
- borderColor: theme.vars.palette.border.secondary,
168
- zIndex: 1
172
+ backgroundColor: theme.vars.palette.background.base,
173
+ borderRadius: theme.vars.size.borderRadius["r1-5"]
169
174
  }
170
175
  }),
171
- /**
172
- * Contenedor que contiene el menu item principal.
173
- */
174
- containerNodeMenuItemMain: ({ theme }) => ({
175
- gap: theme.vars.size.baseSpacings.sp1
176
- }),
176
+ containerNodeMenuItemMain: {},
177
177
  /**
178
178
  * Estilos del menu item principal.
179
179
  */
@@ -0,0 +1,6 @@
1
+ import { HeaderSidebarProps } from './types';
2
+ /**
3
+ * Component HeaderSidebar representa el encabezado de la barra lateral.<
4
+ */
5
+ declare const HeaderSidebar: ({ srcIcon, title, subtitle }: HeaderSidebarProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default HeaderSidebar;
@@ -0,0 +1,2 @@
1
+ import { HeaderSidebarStyles } from '../../types';
2
+ export declare const headerSidebarStyles: HeaderSidebarStyles;
@@ -0,0 +1,24 @@
1
+ const headerSidebarStyles = {
2
+ /**
3
+ * Container del header del sidebar
4
+ */
5
+ containerHeaderSidebarRoot: ({ theme }) => ({
6
+ display: "flex",
7
+ flexDirection: "row",
8
+ alignItems: "center",
9
+ padding: `${theme.vars.size.baseSpacings.sp6} ${theme.vars.size.baseSpacings.sp5}`,
10
+ gap: `${theme.vars.size.baseSpacings.sp2}`
11
+ }),
12
+ /**
13
+ * Contenedor del título y subtítulo del sidebar
14
+ */
15
+ containerTitleSubtitle: ({ theme }) => ({
16
+ display: "flex",
17
+ flexDirection: "column",
18
+ alignItems: "start",
19
+ gap: `${theme.vars.size.baseSpacings.sp1}`
20
+ })
21
+ };
22
+ export {
23
+ headerSidebarStyles as h
24
+ };
@@ -0,0 +1,5 @@
1
+ export interface HeaderSidebarProps {
2
+ srcIcon: string;
3
+ title: string;
4
+ subtitle: string;
5
+ }
@@ -6,4 +6,4 @@ import { PromotionProps } from './types';
6
6
  * @param {VoidFunction} props.collapsed - Variable que guarda el estado de colapsado en desktop
7
7
  * @returns
8
8
  */
9
- export default function FooterComponent({ anchored }: PromotionProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export default function Promotion({ anchored }: PromotionProps): import("react/jsx-runtime").JSX.Element | null;
@@ -2,9 +2,9 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { u as useSideBar } from "../../hooks/useSideBar/index.js";
3
3
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
4
4
  import { g as getNameDataTestId } from "../../tests/utils.js";
5
- import { b as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
6
- function FooterComponent({ anchored }) {
7
- const { footerComponent: promotion } = useSideBar();
5
+ import { d as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
6
+ function Promotion({ anchored }) {
7
+ const { promotion } = useSideBar();
8
8
  const ownerState = {
9
9
  anchored
10
10
  };
@@ -22,5 +22,5 @@ function FooterComponent({ anchored }) {
22
22
  );
23
23
  }
24
24
  export {
25
- FooterComponent as F
25
+ Promotion as P
26
26
  };
@@ -9,13 +9,7 @@ const footerSideBarStyles = {
9
9
  borderTop: `${theme.vars.size.baseSpacings["sp0-5"]} solid ${theme.vars.palette.border.secondary}`,
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,
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
- }
12
+ paddingBottom: theme.vars.size.baseSpacings.sp2
19
13
  })
20
14
  };
21
15
  export {
@@ -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 { c as ContainerDesktopContentStyled, d as ContainerDesktopRootStyled } from "../../slots/SideBarSlots.js";
4
+ import { e as ContainerDesktopContentStyled, f 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, variant } = useSideBar();
10
+ const { anchored, expandedWidth } = useSideBar();
11
11
  const [eventAnchored, setEventAnchored] = useState(anchored);
12
12
  const isFirstRender = useFirstRender([anchored]);
13
13
  useEffect(() => {
@@ -18,8 +18,7 @@ const SideBarDesktop = () => {
18
18
  }, [anchored]);
19
19
  const ownerState = {
20
20
  anchored: eventAnchored,
21
- expandedWidth,
22
- variant
21
+ expandedWidth
23
22
  };
24
23
  const classRoot = getComponentSlotRoot(SIDEBAR_KEY_COMPONENT);
25
24
  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 : ownerState?.variant === "host" ? 0 : theme.vars.size.baseSpacings.sp10;
8
+ const width = ownerState?.anchored ? ownerState?.expandedWidth : theme.vars.size.baseSpacings.sp4;
9
9
  return {
10
10
  height: "100%",
11
11
  position: "relative",
@@ -17,14 +17,42 @@ const sideBarDesktopStyles = {
17
17
  /**
18
18
  * Styles applied to the root element of the `SideBar` component in desktop mode.
19
19
  */
20
- containerDesktopRoot: ({ theme }) => ({
20
+ containerDesktopRoot: ({ ownerState, theme }) => ({
21
21
  height: "100%",
22
- width: "100%",
22
+ width: "fit-content",
23
23
  overflow: "visible",
24
- borderRight: `1px solid ${theme.vars.palette.border.secondary}`,
24
+ borderRight: `1px solid ${theme.vars.palette.border.default}`,
25
+ position: !ownerState?.anchored ? "absolute" : "relative",
25
26
  inset: 0,
26
27
  //add hover effect
27
28
  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
+ }
28
56
  })
29
57
  };
30
58
  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 { e as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
7
+ import { g as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
8
8
  import { C as ContentComponent } from "../ContentComponent/index.js";
9
9
  const SideBarMobile = () => {
10
10
  const {
@@ -3,19 +3,18 @@ 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 { f as ContainerTreeGroupItemsStyled, g as ContainerContentGroupsStyled, h as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
6
+ import { h as ContainerTreeGroupItemsStyled, i as ContainerContentGroupsStyled, j 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, anchored } = useSideBar();
11
+ const { menuData } = 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,
18
- anchored
17
+ noItems: menuData.length === 0
19
18
  };
20
19
  const renderItemsDisabled = () => {
21
20
  return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
@@ -1,4 +1,3 @@
1
- import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
2
1
  const contentGroupStyles = {
3
2
  /**
4
3
  * Container for the group items in the sidebar
@@ -10,17 +9,9 @@ const contentGroupStyles = {
10
9
  flex: 1,
11
10
  flexDirection: "column",
12
11
  overflowY: "auto",
12
+ padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
13
13
  alignItems: "center",
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
- }
14
+ justifyContent: ownerState?.noItems ? "center" : "flex-start"
24
15
  }),
25
16
  /**
26
17
  * Wrapper for every principal item group in the sidebar
@@ -37,7 +28,6 @@ const contentGroupStyles = {
37
28
  containerContentTitle: ({ theme, ownerState }) => ({
38
29
  padding: `${theme.vars.size.baseSpacings.sp3} ${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp1}`,
39
30
  color: theme.vars.palette.text.primary,
40
- width: "100%",
41
31
  textAlign: "left",
42
32
  "& .MuiTypography-root": {
43
33
  color: !ownerState?.disabled ? theme.vars.palette.text.primary : `${theme.vars.palette.text.primary} !important`
@@ -72,84 +62,6 @@ const contentGroupStyles = {
72
62
  alignSelf: "center",
73
63
  lineHeight: 0,
74
64
  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 bottom,
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"
153
65
  })
154
66
  };
155
67
  export {
@@ -6,14 +6,13 @@ 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 { 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";
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";
10
10
  import { useModuleSkeleton } from "@m4l/core";
11
- import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
12
11
  import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
13
12
  import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
14
13
  import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
15
14
  function NodeMenuItem(props) {
16
- const { item, size, defaultOpen = false, className, isLastSibling = false, isRoot = false } = props;
15
+ const { item, size, defaultOpen = false, className, isLastSibling = false } = props;
17
16
  const { urlIconPrefix, classes } = useSideBar();
18
17
  const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
19
18
  const { currentSize } = useComponentSize(size);
@@ -41,12 +40,11 @@ function NodeMenuItem(props) {
41
40
  CLASS_NAME_ITEM_STATE,
42
41
  className,
43
42
  item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN,
44
- item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE,
45
- !isOpen && CLASS_NAME_ITEM_CLOSED
43
+ item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
46
44
  ),
47
45
  label: item.title,
48
46
  selected: item.active,
49
- startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: isRoot && item.itemInTreeActive ? "root" : item.active ? "itemActive" : "normal" }),
47
+ startIcon: `${urlIconPrefix}${item.iconUrl}`,
50
48
  endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
51
49
  onClick: () => handlerClick(),
52
50
  size: currentSize
@@ -6,5 +6,4 @@ export type NodeMenuItemProps = {
6
6
  size: Extract<Sizes, 'small' | 'medium'>;
7
7
  className?: string;
8
8
  isLastSibling?: boolean;
9
- isRoot?: boolean;
10
9
  };