@m4l/components 9.2.61 → 9.2.62

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 (156) hide show
  1. package/@types/types.d.ts +8 -0
  2. package/components/Chip/Chip.js +9 -10
  3. package/components/Chip/ChipStyles.js +13 -2
  4. package/components/Chip/constants.d.ts +9 -0
  5. package/components/Chip/constants.js +6 -2
  6. package/components/Chip/slots/ChipEnum.d.ts +3 -0
  7. package/components/Chip/slots/ChipEnum.js +6 -1
  8. package/components/Chip/slots/ChipSlots.js +1 -1
  9. package/components/DataGrid/Datagrid.styles.js +8 -13
  10. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
  11. package/components/DynamicFilter/DynamicFilter.styles.js +99 -90
  12. package/components/DynamicFilter/slots/SlotsEnum.d.ts +0 -3
  13. package/components/DynamicFilter/slots/SlotsEnum.js +0 -3
  14. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +0 -9
  15. package/components/DynamicFilter/slots/dynamicFilterSlots.js +3 -19
  16. package/components/DynamicFilter/store/DynamicFilterContext.js +6 -7
  17. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.js +2 -2
  18. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.js +2 -2
  19. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.js +2 -2
  20. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +2 -2
  21. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.js +2 -2
  22. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.js +2 -2
  23. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +1 -1
  24. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +1 -0
  25. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +2 -1
  26. package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +2 -0
  27. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +24 -18
  28. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +4 -1
  29. package/components/DynamicSort/DynamicSort.styles.js +92 -90
  30. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +0 -9
  31. package/components/DynamicSort/slots/DynamicSortSlots.js +7 -23
  32. package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -4
  33. package/components/DynamicSort/slots/SlotsEnum.js +1 -4
  34. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +2 -2
  35. package/components/DynamicSort/subcomponents/InputSort/InputSort.js +2 -0
  36. package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +22 -17
  37. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +2 -2
  38. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +2 -0
  39. package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +2 -1
  40. package/components/LanguagePopover/LanguagePopover.js +7 -5
  41. package/components/LanguagePopover/LanguagePopover.styles.js +32 -4
  42. package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +9 -3
  43. package/components/LanguagePopover/slots/LanguagePopoverSlots.js +1 -3
  44. package/components/LanguagePopover/types.d.ts +6 -1
  45. package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
  46. package/components/PaperForm/styles.js +2 -1
  47. package/components/PropertyValue/PropertyValue.js +2 -1
  48. package/components/PropertyValue/PropertyValue.styles.js +7 -4
  49. package/components/PropertyValue/types.d.ts +4 -0
  50. package/components/SideBar/SideBar.js +4 -2
  51. package/components/SideBar/constants.d.ts +26 -2
  52. package/components/SideBar/constants.js +19 -7
  53. package/components/SideBar/context/sideBarContext/index.js +19 -5
  54. package/components/SideBar/context/sideBarContext/types.d.ts +22 -1
  55. package/components/SideBar/helpers/getMenuDataWithState/index.js +25 -8
  56. package/components/SideBar/hooks/useCollapse/index.d.ts +1 -0
  57. package/components/SideBar/hooks/useCollapse/index.js +1 -0
  58. package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +11 -0
  59. package/components/SideBar/hooks/useCollapse/useCollapse.js +23 -0
  60. package/components/SideBar/slots/SideBarEnum.d.ts +5 -5
  61. package/components/SideBar/slots/SideBarEnum.js +9 -11
  62. package/components/SideBar/slots/SideBarSlots.d.ts +9 -3
  63. package/components/SideBar/slots/SideBarSlots.js +36 -28
  64. package/components/SideBar/styles.js +2 -4
  65. package/components/SideBar/subcomponents/ContentComponent/index.js +39 -19
  66. package/components/SideBar/subcomponents/ContentComponent/style.js +171 -22
  67. package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/index.d.ts +2 -2
  68. package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/index.js +8 -15
  69. package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/styles.js +2 -2
  70. package/components/SideBar/subcomponents/Promotion/types.d.ts +5 -0
  71. package/components/SideBar/subcomponents/SideBarDesktop/index.js +1 -1
  72. package/components/SideBar/subcomponents/SideBarDesktop/styles.js +10 -14
  73. package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
  74. package/components/SideBar/subcomponents/TreeGroupItems/index.d.ts +5 -0
  75. package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/index.js +16 -18
  76. package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/styles.js +5 -7
  77. package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.js +10 -7
  78. package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems/subcomponents/NodeMenuItem}/index.d.ts +3 -3
  79. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +69 -0
  80. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +9 -0
  81. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.d.ts +5 -0
  82. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +56 -0
  83. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/index.d.ts +1 -0
  84. package/components/SideBar/subcomponents/TreeGroupItems/types.d.ts +4 -0
  85. package/components/SideBar/types.d.ts +7 -3
  86. package/components/WindowBase/WindowBase.js +7 -1
  87. package/components/WindowBase/WindowBase.styles.js +50 -15
  88. package/components/WindowBase/constants.d.ts +1 -0
  89. package/components/WindowBase/constants.js +5 -1
  90. package/components/WindowBase/slots/WindowBaseEnum.d.ts +2 -1
  91. package/components/WindowBase/slots/WindowBaseEnum.js +1 -0
  92. package/components/WindowBase/slots/WindowBaseSlots.d.ts +3 -0
  93. package/components/WindowBase/slots/WindowBaseSlots.js +6 -1
  94. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +11 -5
  95. package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
  96. package/components/WindowBase/subcomponents/Header/useButtonActions.js +4 -2
  97. package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
  98. package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +1 -1
  99. package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +5 -0
  100. package/components/WindowBase/types.d.ts +16 -0
  101. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +13 -0
  102. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +26 -20
  103. package/components/areas/contexts/AreasContext/store.js +2 -2
  104. package/components/extended/React-Resizable/helpers.js +1 -1
  105. package/components/extended/React-resizable-panels/SplitLayout.js +6 -3
  106. package/components/extended/React-resizable-panels/SplitLayout.styles.js +78 -36
  107. package/components/extended/React-resizable-panels/constants.d.ts +6 -0
  108. package/components/extended/React-resizable-panels/constants.js +5 -1
  109. package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.d.ts +2 -1
  110. package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.js +1 -0
  111. package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +3 -0
  112. package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.js +7 -1
  113. package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +1 -1
  114. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
  115. package/components/hook-form/RHFTextField/RHFTextField.js +1 -0
  116. package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +3 -38
  117. package/components/mui_extended/Accordion/styles.js +10 -2
  118. package/components/mui_extended/Button/Button.js +3 -1
  119. package/components/mui_extended/Button/ButtonStyles.js +6 -1
  120. package/components/mui_extended/Button/types.d.ts +1 -1
  121. package/components/mui_extended/Divider/index.d.ts +1 -0
  122. package/components/mui_extended/Divider/index.js +1 -0
  123. package/components/mui_extended/NavLink/NavLink.js +3 -1
  124. package/components/mui_extended/NavLink/NavLink.styles.js +2 -1
  125. package/components/mui_extended/NavLink/types.d.ts +3 -1
  126. package/components/mui_extended/Tab/Tab.styles.js +2 -1
  127. package/components/mui_extended/TabContent/TabContent.styles.js +2 -8
  128. package/components/mui_extended/TextField/TextField.js +1 -1
  129. package/components/mui_extended/TextField/TextField.styles.js +20 -18
  130. package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
  131. package/components/mui_extended/index.d.ts +1 -0
  132. package/hooks/useDynamicFilterAndSort/styles.js +1 -1
  133. package/index.d.ts +1 -0
  134. package/index.js +16 -13
  135. package/package.json +4 -3
  136. package/storybook/components/DynamicFilter/DynamicFilter.stories.d.ts +27 -11
  137. package/storybook/components/DynamicSort/DynamicSort.stories.d.ts +26 -10
  138. package/storybook/components/ObjectLogs/ObjectLogs.stories.d.ts +2 -2
  139. package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +4 -0
  140. package/storybook/components/SideBar/subcomponents/FooterPromotion/constants.d.ts +3 -0
  141. package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +1 -0
  142. package/storybook/components/extended/mui/IconButton/IconButton.stories.d.ts +1 -0
  143. package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +1 -0
  144. package/utils/index.d.ts +1 -0
  145. package/components/SideBar/subcomponents/ContentGroups/index.d.ts +0 -5
  146. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/index.js +0 -63
  147. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.d.ts +0 -2
  148. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +0 -47
  149. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/types.d.ts +0 -7
  150. package/components/SideBar/subcomponents/ContentGroups/types.d.ts +0 -4
  151. package/components/SideBar/subcomponents/FooterSidebar/types.d.ts +0 -5
  152. package/components/SideBar/subcomponents/HeaderSidebar/index.js +0 -25
  153. /package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/styles.d.ts +0 -0
  154. /package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/styles.d.ts +0 -0
  155. /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.d.ts +0 -0
  156. /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/types.d.ts +0 -0
@@ -1,44 +1,193 @@
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
+ import { g as getTypographyStyles } from "../../../../utils/getTypographyStyles.js";
3
+ import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
1
4
  const contentComponentStyles = {
2
5
  /**
3
6
  * Estilos del contenedor principal del sidebar
4
7
  */
5
8
  contentComponentRoot: ({ theme }) => ({
6
9
  position: "relative",
7
- height: "100%",
8
- width: "auto",
9
- backgroundColor: theme.vars.palette.background.default,
10
10
  display: "flex",
11
- flexDirection: "column"
11
+ flexDirection: "column",
12
+ height: "100%",
13
+ width: "fit-content",
14
+ backgroundColor: theme.vars.palette.background.default
12
15
  }),
13
16
  /**
14
17
  * Estilos del contenedor que oculta el contenido cuando se encuentra des anclado.
15
18
  */
16
- contentComponentHide: ({ theme, ownerState }) => ({
17
- width: "100%",
18
- height: "100%",
19
- overflow: "hidden",
20
- transition: "all 0.5s",
21
- flex: 1,
22
- ...!ownerState?.anchored && {
23
- width: ownerState?.anchored && ownerState?.isDesktop ? ownerState?.expandedWidth : !ownerState?.isDesktop ? "100%" : theme.vars.size.baseSpacings.sp4,
24
- "&:hover": {
25
- transition: "all 0.5s",
26
- width: ownerState?.expandedWidth,
27
- contentVisibility: "visible",
28
- '& [class*="containerFooter"]': {
29
- borderWidth: theme.vars.size.baseSpacings["sp0-5"]
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
+ }
30
41
  }
31
42
  }
32
- }
33
- }),
43
+ };
44
+ },
34
45
  /**
35
46
  * Contenedor que abraza el contenido del menu en primer lugar.
36
47
  */
37
- containerComponent: ({ ownerState }) => ({
48
+ containerTreeItemsAndPromotion: ({ theme, ownerState }) => ({
38
49
  height: "100%",
39
50
  width: ownerState?.expandedWidth,
51
+ flex: 1,
52
+ overflow: "hidden",
40
53
  display: "flex",
41
- flexDirection: "column"
54
+ flexDirection: "column",
55
+ paddingLeft: theme.vars.size.baseSpacings.sp4,
56
+ paddingRight: theme.vars.size.baseSpacings.sp4,
57
+ '& [class*="M4LMenuItem-root"], & [class*="M4LMenuItem-skeletonMenuItem"]': {
58
+ ...getSizeStyles(
59
+ theme,
60
+ ownerState?.size || "medium",
61
+ "container",
62
+ (size) => ({
63
+ height: size,
64
+ minHeight: size,
65
+ maxHeight: size
66
+ })
67
+ )
68
+ },
69
+ "& .M4LMenuItem-root": {
70
+ border: "unset",
71
+ paddingLeft: theme.vars.size.baseSpacings.sp2,
72
+ paddingRight: theme.vars.size.baseSpacings.sp2,
73
+ "& .M4LTypography-root": {
74
+ paddingLeft: `${theme.vars.size.baseSpacings.sp2} !important`,
75
+ ...getTypographyStyles(
76
+ theme.generalSettings.isMobile,
77
+ ownerState?.size || "medium",
78
+ "caption"
79
+ )
80
+ }
81
+ }
82
+ }),
83
+ /**
84
+ * Contenedor que contiene grupo menu item desplegable.
85
+ */
86
+ containerNodeMenuItem: ({ theme, ownerState }) => ({
87
+ marginLeft: theme.vars.size.baseSpacings.sp4,
88
+ display: "flex",
89
+ flexDirection: "column",
90
+ overflow: "visible",
91
+ '& [class*="M4LMenuItem-root"]:not(.menu-active)': {
92
+ "& .M4LTypography-root": {
93
+ color: `${theme.vars.palette.text.secondary}!important`
94
+ },
95
+ "& .M4LIcon-icon": {
96
+ backgroundColor: `${theme.vars.palette.text.secondary}!important`
97
+ }
98
+ },
99
+ [`&.${CLASS_NAME_IS_ROOT}`]: {
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
129
+ }
130
+ },
131
+ [`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
132
+ background: theme.vars.palette.text.primary
133
+ },
134
+ [`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
135
+ "&::before": {
136
+ content: '""',
137
+ position: "absolute",
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
+ }
148
+ },
149
+ "&:after": {
150
+ content: '""',
151
+ position: "absolute",
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
158
+ }
159
+ },
160
+ [`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
161
+ backgroundColor: theme.vars.palette.primary.opacity
162
+ },
163
+ "& .MuiCollapse-wrapperInner": {
164
+ display: "flex",
165
+ flexDirection: "column",
166
+ paddingLeft: 0,
167
+ paddingBottom: theme.vars.size.baseSpacings.sp1,
168
+ paddingTop: 0,
169
+ paddingRight: theme.vars.size.baseSpacings.sp1
170
+ },
171
+ [`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
172
+ backgroundColor: theme.vars.palette.background.base,
173
+ borderRadius: theme.vars.size.borderRadius["r1-5"]
174
+ }
175
+ }),
176
+ containerNodeMenuItemMain: {},
177
+ /**
178
+ * Estilos del menu item principal.
179
+ */
180
+ menuItemMain: ({ theme, ownerState }) => ({
181
+ "& .M4LSideBar-containerArrowIconRoot": {
182
+ marginLeft: "unset"
183
+ },
184
+ "&&& .M4LTypography-root": {
185
+ ...getTypographyStyles(
186
+ theme.generalSettings.isMobile,
187
+ ownerState?.size || "medium",
188
+ "bodyDens"
189
+ )
190
+ }
42
191
  })
43
192
  };
44
193
  export {
@@ -1,4 +1,4 @@
1
- import { FooterSidebarProps } from './types';
1
+ import { PromotionProps } from './types';
2
2
  /**
3
3
  * Renderiza el footer del sidebar
4
4
  * @param {CollapseButtonProps} props - Propiedades del componente
@@ -6,4 +6,4 @@ import { FooterSidebarProps } 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 FooterSidebar({ anchored }: FooterSidebarProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function Promotion({ anchored }: PromotionProps): import("react/jsx-runtime").JSX.Element | null;
@@ -2,32 +2,25 @@ 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 { j as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
6
- import { I as Image } from "../../../Image/Image.js";
7
- function FooterSidebar({ anchored }) {
8
- const { companyLogoNormalUrl } = useSideBar();
5
+ import { d as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
6
+ function Promotion({ anchored }) {
7
+ const { promotion } = useSideBar();
9
8
  const ownerState = {
10
9
  anchored
11
10
  };
11
+ if (!promotion) {
12
+ return null;
13
+ }
12
14
  return /* @__PURE__ */ jsx(
13
15
  ContainerFooterStyled,
14
16
  {
15
17
  ownerState,
16
18
  role: "footer",
17
19
  ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("footer") } : {},
18
- children: /* @__PURE__ */ jsx(
19
- Image,
20
- {
21
- width: "auto",
22
- height: "40px",
23
- src: companyLogoNormalUrl || "",
24
- alt: "logo"
25
- },
26
- "Logo"
27
- )
20
+ children: promotion
28
21
  }
29
22
  );
30
23
  }
31
24
  export {
32
- FooterSidebar as F
25
+ Promotion as P
33
26
  };
@@ -6,10 +6,10 @@ const footerSideBarStyles = {
6
6
  height: "auto",
7
7
  display: "grid",
8
8
  placeItems: "center",
9
- padding: `${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp12}`,
10
9
  borderTop: `${theme.vars.size.baseSpacings["sp0-5"]} solid ${theme.vars.palette.border.secondary}`,
11
10
  borderWidth: ownerState?.anchored ? theme.vars.size.baseSpacings["sp0-5"] : theme.vars.size.baseSpacings.sp0,
12
- transition: "all 0.5s"
11
+ transition: "all 0.5s",
12
+ paddingBottom: theme.vars.size.baseSpacings.sp2
13
13
  })
14
14
  };
15
15
  export {
@@ -0,0 +1,5 @@
1
+ export interface PromotionProps {
2
+ onToggleAnchored: (anchored: boolean) => void;
3
+ anchored: boolean;
4
+ }
5
+ export type WrapperCollapseButtonProps = Pick<PromotionProps, 'anchored'>;
@@ -1,7 +1,7 @@
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 { m as ContainerDesktopContentStyled, n 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";
@@ -30,14 +30,22 @@ const sideBarDesktopStyles = {
30
30
  /**
31
31
  * Container button to achores the sidebar.
32
32
  */
33
- containerBtnAnchored: ({ theme }) => ({
33
+ containerBtnAnchored: ({ theme, ownerState }) => ({
34
34
  position: "absolute",
35
35
  right: "-20px",
36
36
  top: "20px",
37
37
  zIndex: 1e3,
38
38
  padding: `${theme.vars.size.baseSpacings.sp10} 10px`,
39
39
  "& .MuiButtonBase-root": {
40
- background: theme.vars.palette.background.default
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
+ }
41
49
  },
42
50
  "&&& .M4LIconButton-root:hover": {
43
51
  backgroundColor: theme.vars.palette.primary.enabled,
@@ -45,18 +53,6 @@ const sideBarDesktopStyles = {
45
53
  backgroundColor: `${theme.vars.palette.primary.contrastText}!important`
46
54
  }
47
55
  }
48
- // '&:hover': {
49
- // '& .MuiButtonBase-root': {
50
- // border: `1px solid ${theme.palette.border.default}`,
51
- // background: theme.vars.palette.primary.enabled,
52
- // '& [class*="M4LIcon-root"] > div':{
53
- // backgroundColor: theme.vars.palette.background.default,
54
- // },
55
- // },
56
- // '& .MuiButtonBase-root:active': {
57
- // background: theme.vars.palette.primary.active,
58
- // },
59
- // },
60
56
  })
61
57
  };
62
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 { o 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 {
@@ -0,0 +1,5 @@
1
+ import { TreeGroupItemsProps } from './types';
2
+ /**
3
+ * Renderiza el contenido de los grupos
4
+ */
5
+ export declare const TreeGroupItems: (contentGroupsProps: TreeGroupItemsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,27 +1,21 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useModuleDictionary } from "@m4l/core";
1
+ import { jsx } from "react/jsx-runtime";
2
+ 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 { d as ContainerContentGroupsRootStyled, e as ContainerContentGroupsStyled, f as ContainerContentTitleStyled, g as ContainerContentNavItemsStyled } from "../../slots/SideBarSlots.js";
7
- import { C as ContainerMenuItemsMain } from "./subcomponents/ContainerMenuItemsMain/index.js";
6
+ import { h as ContainerTreeGroupItemsStyled, i as ContainerContentGroupsStyled, j as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
7
+ import { N as NodeMenuItemMain } from "./subcomponents/NodeMenuItemMain/NodeMenuItemMain.js";
8
8
  import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
9
- import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
10
9
  import { M as MenuItem } from "../../../mui_extended/MenuItem/MenuItem.js";
11
- const ContentGroups = (contentGroupsProps) => {
10
+ const TreeGroupItems = (contentGroupsProps) => {
12
11
  const { menuData } = useSideBar();
13
12
  const { getLabel } = useModuleDictionary();
14
13
  const { size } = contentGroupsProps;
15
14
  const { currentSize } = useComponentSize(size);
15
+ const isSkeleton = useModuleSkeleton();
16
16
  const ownerState = {
17
17
  noItems: menuData.length === 0
18
18
  };
19
- const renderTitle = (title) => {
20
- return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { children: /* @__PURE__ */ jsx(Typography, { variant: "bodyDens", skeletonWidth: "100px", children: title }) });
21
- };
22
- const renderItems = (item) => {
23
- return /* @__PURE__ */ jsx(ContainerContentNavItemsStyled, { children: item?.map((list) => /* @__PURE__ */ jsx(ContainerMenuItemsMain, { item: list, openSubItem: true, size: currentSize }, list.title)) });
24
- };
25
19
  const renderItemsDisabled = () => {
26
20
  return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
27
21
  MenuItem,
@@ -32,21 +26,25 @@ const ContentGroups = (contentGroupsProps) => {
32
26
  ) });
33
27
  };
34
28
  return /* @__PURE__ */ jsx(
35
- ContainerContentGroupsRootStyled,
29
+ ContainerTreeGroupItemsStyled,
36
30
  {
37
31
  ownerState,
38
32
  role: "bodysidebar",
39
33
  ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("content-groups") } : {},
40
34
  children: menuData.length > 0 ? menuData.map((itemGroup) => (
41
35
  /* Render title section in menusidebar */
42
- /* @__PURE__ */ jsxs(ContainerContentGroupsStyled, { children: [
43
- renderTitle(itemGroup.title),
44
- renderItems(itemGroup.children)
45
- ] }, itemGroup.title)
36
+ /* @__PURE__ */ jsx(ContainerContentGroupsStyled, { children: /* @__PURE__ */ jsx(
37
+ NodeMenuItemMain,
38
+ {
39
+ item: itemGroup,
40
+ size: currentSize,
41
+ defaultOpen: isSkeleton ? false : true
42
+ }
43
+ ) }, itemGroup.title)
46
44
  )) : renderItemsDisabled()
47
45
  }
48
46
  );
49
47
  };
50
48
  export {
51
- ContentGroups as C
49
+ TreeGroupItems as T
52
50
  };
@@ -2,10 +2,11 @@ const contentGroupStyles = {
2
2
  /**
3
3
  * Container for the group items in the sidebar
4
4
  */
5
- containerContentGroupsRoot: ({ theme, ownerState }) => ({
5
+ containerTreeGroupItems: ({ theme, ownerState }) => ({
6
6
  display: "flex",
7
7
  width: "100%",
8
8
  height: "100%",
9
+ flex: 1,
9
10
  flexDirection: "column",
10
11
  overflowY: "auto",
11
12
  padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
@@ -15,14 +16,11 @@ const contentGroupStyles = {
15
16
  /**
16
17
  * Wrapper for every principal item group in the sidebar
17
18
  */
18
- containerContentGroups: ({ theme }) => ({
19
+ containerContentGroups: () => ({
19
20
  display: "flex",
20
21
  width: "100%",
21
- height: "100%",
22
- flexDirection: "column",
23
- padding: `${theme.vars.size.baseSpacings.sp3} 0px`,
24
- flex: 1,
25
- overflow: "auto"
22
+ height: "auto",
23
+ flexDirection: "column"
26
24
  }),
27
25
  /**
28
26
  * Title wrapper for every principal item group in the sidebar
@@ -1,23 +1,26 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useEnvironment } from "@m4l/core";
3
- import { T as TEST_PROP_ID } from "../../../../../../../../test/constants_no_mock.js";
4
- import { g as getNameDataTestId } from "../../../../../../tests/utils.js";
5
- import { c as PATH_ARROW_DOWN_ICON } from "../../../../../../constants.js";
6
- import { i as ContainerArrowIconRootStyled } from "../../../../../../slots/SideBarSlots.js";
7
- import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
3
+ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
4
+ import { g as getNameDataTestId } from "../../../../tests/utils.js";
5
+ import { f as PATH_ARROW_DOWN_ICON } from "../../../../constants.js";
6
+ import { k as ContainerArrowIconRootStyled } from "../../../../slots/SideBarSlots.js";
7
+ import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
8
+ import { I as Icon } from "../../../../../Icon/Icon.js";
8
9
  function ArrowIcon(props) {
9
10
  const { openState, active } = props;
10
11
  const { host_static_assets, environment_assets } = useEnvironment();
12
+ const { classes } = useSideBar();
11
13
  return /* @__PURE__ */ jsx(
12
14
  ContainerArrowIconRootStyled,
13
15
  {
16
+ className: classes.containerArrowIconRoot,
14
17
  ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("arrowIconRoot") } : {},
15
18
  children: /* @__PURE__ */ jsx(
16
- IconButton,
19
+ Icon,
17
20
  {
18
21
  src: `${host_static_assets}/${environment_assets}/${PATH_ARROW_DOWN_ICON}`,
19
22
  rotationAngle: openState ? 270 : 90,
20
- color: active ? "primary" : "default"
23
+ color: active ? "primary.enabled" : "text.primary"
21
24
  }
22
25
  )
23
26
  }
@@ -1,8 +1,8 @@
1
- import { NavListSubItemProps } from './types';
1
+ import { NodeMenuItemProps } from './types';
2
2
  /**
3
3
  * MenuItems component renderiza los items del menu con sus respectivos hijos y estados
4
- * @param {NavListSubItemProps} props - Propiedades del componente
4
+ * @param {NodeMenuItemProps} props - Propiedades del componente
5
5
  * @param {MenuDataType} props.item - Datos del item del menu
6
6
  * @param {boolean} props.openSubItem - Estado del item del menu: Abierto - cerrado
7
7
  */
8
- export declare function ContainerMenuItemsMain(props: NavListSubItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function NodeMenuItem(props: NodeMenuItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Collapse } from "@mui/material";
3
+ import clsx from "clsx";
4
+ import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
5
+ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
6
+ import { g as getNameDataTestId } from "../../../../tests/utils.js";
7
+ import { A as ArrowIcon } from "../ArrowIcon/index.js";
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";
10
+ import { useModuleSkeleton } from "@m4l/core";
11
+ import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
12
+ import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
13
+ import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
14
+ function NodeMenuItem(props) {
15
+ const { item, size, defaultOpen = false, className, isLastSibling = false } = props;
16
+ const { urlIconPrefix, classes } = useSideBar();
17
+ const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
18
+ const { currentSize } = useComponentSize(size);
19
+ const isSkeleton = useModuleSkeleton();
20
+ const ownerState = {
21
+ active: item.active,
22
+ itemInTreeActive: item.itemInTreeActive,
23
+ sidebarSize: currentSize,
24
+ hasChildren,
25
+ isLastSibling
26
+ };
27
+ const CLASS_NAME_ITEM_STATE = clsx(item.active && CLASS_NAME_MENU_ACTIVE, item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE);
28
+ return /* @__PURE__ */ jsxs(
29
+ ContainerNodeMenuItemStyled,
30
+ {
31
+ className: clsx(classes.containerNodeMenuItem, CLASS_NAME_ITEM_STATE, className),
32
+ role: "listitem",
33
+ ownerState,
34
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
35
+ children: [
36
+ /* @__PURE__ */ jsx(
37
+ MenuItem,
38
+ {
39
+ className: clsx(
40
+ CLASS_NAME_ITEM_STATE,
41
+ className,
42
+ item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN,
43
+ item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
44
+ ),
45
+ label: item.title,
46
+ selected: item.active,
47
+ startIcon: `${urlIconPrefix}${item.iconUrl}`,
48
+ endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
49
+ onClick: () => handlerClick(),
50
+ size: currentSize
51
+ }
52
+ ),
53
+ hasChildren ? /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child, index) => /* @__PURE__ */ jsx(
54
+ NodeMenuItem,
55
+ {
56
+ item: child,
57
+ size: currentSize,
58
+ defaultOpen: isSkeleton ? false : child.active,
59
+ isLastSibling: item.children?.length === index + 1
60
+ },
61
+ child.title
62
+ )) }) : null
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ export {
68
+ NodeMenuItem as N
69
+ };
@@ -0,0 +1,9 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { IMenuDataWithState } from '../../../../types';
3
+ export type NodeMenuItemProps = {
4
+ item: IMenuDataWithState;
5
+ defaultOpen?: boolean;
6
+ size: Extract<Sizes, 'small' | 'medium'>;
7
+ className?: string;
8
+ isLastSibling?: boolean;
9
+ };
@@ -0,0 +1,5 @@
1
+ import { NodeMenuItemProps } from '../NodeMenuItem/types';
2
+ /**
3
+ * Componente que representa un nodo menu Item principal.
4
+ */
5
+ export declare const NodeMenuItemMain: (props: NodeMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { m as ContainerNodeMenuItemMainStyled, M as MenuItemMainStyled } from "../../../../slots/SideBarSlots.js";
3
+ import { g as getNameDataTestId } from "../../../../tests/utils.js";
4
+ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
5
+ import { A as ArrowIcon } from "../ArrowIcon/index.js";
6
+ import { Collapse } from "@mui/material";
7
+ import { N as NodeMenuItem } from "../NodeMenuItem/index.js";
8
+ import { b as CLASS_NAME_IS_ROOT } from "../../../../constants.js";
9
+ import clsx from "clsx";
10
+ import { useModuleSkeleton } from "@m4l/core";
11
+ import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
12
+ import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
13
+ const NodeMenuItemMain = (props) => {
14
+ const { item, size, defaultOpen = false } = props;
15
+ const { currentSize } = useComponentSize(size);
16
+ const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
17
+ const isSkeleton = useModuleSkeleton();
18
+ const ownerState = {
19
+ active: item.active,
20
+ itemInTreeActive: item.itemInTreeActive,
21
+ sidebarSize: currentSize
22
+ };
23
+ return /* @__PURE__ */ jsxs(
24
+ ContainerNodeMenuItemMainStyled,
25
+ {
26
+ role: "treeitem",
27
+ ownerState,
28
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
29
+ children: [
30
+ /* @__PURE__ */ jsx(
31
+ MenuItemMainStyled,
32
+ {
33
+ label: item.title,
34
+ startIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
35
+ onClick: () => handlerClick(),
36
+ size: currentSize
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child, index) => /* @__PURE__ */ jsx(
40
+ NodeMenuItem,
41
+ {
42
+ item: child,
43
+ size: currentSize,
44
+ className: clsx(CLASS_NAME_IS_ROOT),
45
+ defaultOpen: isSkeleton ? false : true,
46
+ isLastSibling: item.children?.length === index + 1
47
+ },
48
+ child.title
49
+ )) })
50
+ ]
51
+ }
52
+ );
53
+ };
54
+ export {
55
+ NodeMenuItemMain as N
56
+ };
@@ -0,0 +1 @@
1
+ export { NodeMenuItemMain } from './NodeMenuItemMain';