@m4l/components 9.1.146 → 9.1.147

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 (206) hide show
  1. package/.storybook/constants.d.ts +0 -10
  2. package/.storybook/utils/getStylesColorsByMode.d.ts +116 -116
  3. package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +3 -3
  4. package/components/AppBar/slots/AppBarSlots.d.ts +2 -2
  5. package/components/Chip/ChipStyles.js +1 -1
  6. package/components/Chip/slots/ChipSlots.d.ts +1 -1
  7. package/components/Color/slots/ColorSlots.d.ts +1 -1
  8. package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
  9. package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
  10. package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
  11. package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
  12. package/components/DataGrid/contexts/DataGridContext/index.d.ts +1 -2
  13. package/components/DataGrid/contexts/DataGridContext/index.js +1 -1
  14. package/components/DataGrid/contexts/FilterContext/index.js +1 -1
  15. package/components/DataGrid/dictionary.js +0 -3
  16. package/components/DataGrid/slots/DataGridEnum.js +2 -2
  17. package/components/DataGrid/slots/DataGridSlot.js +1 -1
  18. package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +1 -2
  19. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +1 -2
  20. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -1
  21. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +2 -2
  22. package/components/DynamicFilter/dictionary.js +0 -12
  23. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +4 -4
  24. package/components/DynamicFilter/store/DynamicFilterContext.js +1 -1
  25. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +1 -1
  26. package/components/DynamicSort/dictionary.js +1 -6
  27. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
  28. package/components/DynamicSort/slots/DynamicSortSlots.js +2 -2
  29. package/components/DynamicSort/store/DynamicSortContext.js +1 -1
  30. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +1 -1
  31. package/components/GridLayout/GridLayout.js +1 -1
  32. package/components/GridLayout/styles.js +1 -1
  33. package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
  34. package/components/GridLayout/subcomponents/Responsive/helper.js +1 -1
  35. package/components/GridLayout/subcomponents/Responsive/index.js +1 -1
  36. package/components/GridLayout/subcomponents/Responsive/responsiveUtils.js +3 -3
  37. package/components/GridLayout/subcomponents/withSizeProvider/index.js +1 -1
  38. package/components/Icon/Icon.js +1 -1
  39. package/components/Icon/constants.js +2 -2
  40. package/components/Icon/slots/IconSlots.js +1 -1
  41. package/components/Image/Image.js +1 -1
  42. package/components/Image/constant.js +2 -2
  43. package/components/Image/slots/ImageSlots.js +1 -1
  44. package/components/Image/subcomponents/IntersectComponent/index.js +1 -1
  45. package/components/Label/slots/LabelSlots.d.ts +1 -1
  46. package/components/LanguagePopover/LanguagePopover.js +1 -1
  47. package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
  48. package/components/LoadingError/LoadingError.js +1 -1
  49. package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
  50. package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +1 -1
  51. package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
  52. package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
  53. package/components/NoItemSelected/NoItemSelected.js +1 -1
  54. package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.js +1 -1
  55. package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
  56. package/components/Pager/Pager.styles.js +0 -8
  57. package/components/Pager/dicctionary.js +0 -5
  58. package/components/PrintingSystem/subcomponents/ChartNode/index.js +1 -1
  59. package/components/PropertyValue/PropertyValue.js +2 -2
  60. package/components/ScrollBar/ScrollBar.js +1 -1
  61. package/components/SideBar/slots/SideBarEnum.js +4 -4
  62. package/components/SideBar/slots/SideBarSlots.js +1 -1
  63. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/index.js +1 -1
  64. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
  65. package/components/ToastContainer/ToastContainer.js +1 -1
  66. package/components/ToastContainer/slots/toastContainerSlots.d.ts +2 -2
  67. package/components/WindowConfirm/slots/WindowConfirmSlots.d.ts +3 -3
  68. package/components/animate/variants/bounce.js +1 -1
  69. package/components/animate/variants/fade.js +1 -1
  70. package/components/animate/variants/transition.js +2 -2
  71. package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
  72. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +2 -2
  73. package/components/areas/components/AreasViewer/AreasViewer.js +1 -1
  74. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +1 -1
  75. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow/useWindow.d.ts +1 -1
  76. package/components/areas/contexts/AreasContext/helpers/helper.js +15 -15
  77. package/components/areas/contexts/AreasContext/store.js +3 -3
  78. package/components/areas/icons.js +0 -8
  79. package/components/commercial/HamburgerMenu/classes/index.js +1 -1
  80. package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
  81. package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
  82. package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -1
  83. package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +3 -3
  84. package/components/formatters/PeriodFormatter/PeriodFormatter.js +1 -1
  85. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +2 -2
  86. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
  87. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +1 -1
  88. package/components/hook-form/RHFPeriod/RHFPeriod.js +1 -1
  89. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +2 -2
  90. package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
  91. package/components/hook-form/RHFTextField/RHFTextField.styles.js +1 -3
  92. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  93. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
  94. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.js +1 -1
  95. package/components/hook-form/RHFUpload/RHFUploadImage/classes/index.js +1 -1
  96. package/components/hook-form/RHFormContext/classes/index.d.ts +2 -2
  97. package/components/hook-form/RHFormContext/classes/index.js +1 -1
  98. package/components/hook-form/RHFormContext/index.js +1 -1
  99. package/components/modal/classes/index.js +1 -1
  100. package/components/mui_extended/Accordion/Accordion.js +1 -1
  101. package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +2 -2
  102. package/components/mui_extended/Accordion/slots/AccordionSlots.js +2 -2
  103. package/components/mui_extended/Autocomplete/Autocomplete.js +1 -1
  104. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +4 -4
  105. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +3 -3
  106. package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
  107. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
  108. package/components/mui_extended/Button/slots/ButtonSlots.d.ts +1 -1
  109. package/components/mui_extended/CheckBox/CheckBox.js +1 -1
  110. package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +1 -1
  111. package/components/mui_extended/CheckBox/slots/CheckBoxSlots.js +2 -2
  112. package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
  113. package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.js +1 -1
  114. package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
  115. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
  116. package/components/mui_extended/ImageButton/utils/Clases/index.js +1 -1
  117. package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
  118. package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
  119. package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
  120. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
  121. package/components/mui_extended/NavLink/NavLink.js +1 -1
  122. package/components/mui_extended/NavLink/constants.js +2 -2
  123. package/components/mui_extended/NavLink/slots/NavLinkSlots.js +1 -1
  124. package/components/mui_extended/Popover/Popover.js +1 -1
  125. package/components/mui_extended/Popover/Popover.styles.js +1 -5
  126. package/components/mui_extended/Popover/constants.js +2 -2
  127. package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
  128. package/components/mui_extended/Select/Select.js +1 -1
  129. package/components/mui_extended/Select/Select.styles.js +1 -1
  130. package/components/mui_extended/Select/constants.js +1 -1
  131. package/components/mui_extended/Select/slots/SelectSlots.d.ts +2 -2
  132. package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
  133. package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
  134. package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
  135. package/components/mui_extended/Tab/Tab.js +1 -1
  136. package/components/mui_extended/TabContent/classes/index.js +1 -1
  137. package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
  138. package/components/mui_extended/TextField/constants.js +1 -1
  139. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
  140. package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
  141. package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
  142. package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
  143. package/components/mui_extended/Typography/Typography.js +1 -1
  144. package/components/mui_extended/Typography/constants.js +3 -3
  145. package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
  146. package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
  147. package/components/popups/components/PopupsViewer/icons.js +0 -1
  148. package/hooks/useSvgColor/constants.js +2 -2
  149. package/hooks/useSvgColor/helpers.js +1 -1
  150. package/hooks/useSvgColor/useSvgColor.js +1 -1
  151. package/index.d.ts +1 -1
  152. package/index.js +27 -19
  153. package/mockServiceWorker.js +52 -0
  154. package/package.json +2 -2
  155. package/storybook-decorators/WithAppearanceContext/WithAppearanceContext.d.ts +6 -0
  156. package/storybook-decorators/WithContexts/WithContexts.d.ts +5 -0
  157. package/storybook-decorators/WithContexts/WithContexts.js +51 -0
  158. package/storybook-decorators/WithContexts/constants.d.ts +10 -0
  159. package/storybook-decorators/WithContexts/constants.js +18 -0
  160. package/storybook-decorators/WithContexts/index.js +1 -0
  161. package/storybook-decorators/WithContexts/styles.d.ts +1 -0
  162. package/storybook-decorators/WithContexts/styles.js +15 -0
  163. package/storybook-decorators/WithContexts/subcomponents/AppWithTheme.d.ts +6 -0
  164. package/storybook-decorators/WithContexts/subcomponents/AppWithTheme.js +32 -0
  165. package/storybook-decorators/WithDictionaryContext/WithDictionaryContext.d.ts +21 -0
  166. package/storybook-decorators/WithForm/WithForm.d.ts +8 -0
  167. package/storybook-decorators/WithForm/WithForm.js +12 -0
  168. package/storybook-decorators/WithForm/index.js +1 -0
  169. package/storybook-decorators/WithFormAutoValidation/WithFormAutoValidation.d.ts +7 -0
  170. package/storybook-decorators/WithFormAutoValidation/WithFormAutoValidation.js +22 -0
  171. package/storybook-decorators/WithFormAutoValidation/index.js +1 -0
  172. package/storybook-decorators/WithPopupsProvider/WithPopupsProvider.d.ts +5 -0
  173. package/storybook-decorators/WithPopupsProvider/WithPopupsProvider.js +22 -0
  174. package/storybook-decorators/WithPopupsProvider/index.js +1 -0
  175. package/storybook-decorators/WithScaleIcons/WithScaleIcons.d.ts +7 -0
  176. package/storybook-decorators/WithScaleIcons/WithScaleIcons.js +7 -0
  177. package/storybook-decorators/WithScaleIcons/index.js +1 -0
  178. package/storybook-decorators/WithWindowsContainer/WithWindowsContainer.d.ts +5 -0
  179. package/storybook-decorators/WithWindowsContainer/WithWindowsContainer.js +8 -0
  180. package/storybook-decorators/WithWindowsContainer/index.d.ts +2 -0
  181. package/storybook-decorators/WithWindowsContainer/index.js +1 -0
  182. package/storybook-decorators/WithWindowsContainer/subcomponents/WindowsContainer/WindowsContainer.d.ts +5 -0
  183. package/storybook-decorators/WithWindowsContainer/subcomponents/WindowsContainer/WindowsContainer.js +25 -0
  184. package/storybook-decorators/WithWindowsContainer/subcomponents/WindowsContainer/index.js +1 -0
  185. package/storybook-decorators/WithWrapper/WithWrapper.d.ts +24 -0
  186. package/storybook-decorators/WithWrapper/WithWrapper.js +8 -0
  187. package/storybook-decorators/WithWrapper/index.js +1 -0
  188. package/storybook-decorators/index.d.ts +7 -0
  189. package/storybook-decorators/index.js +1 -0
  190. package/test/mocks.d.ts +2 -2
  191. package/vite-env.d.ts +18 -0
  192. package/.storybook/decorators/WithWindowsContainer/index.d.ts +0 -1
  193. package/vendor.js +0 -172
  194. /package/{.storybook/decorators → storybook-decorators}/WithAppearanceContext/index.d.ts +0 -0
  195. /package/{.storybook/decorators → storybook-decorators}/WithContexts/index.d.ts +0 -0
  196. /package/{.storybook/decorators → storybook-decorators}/WithContexts/types.d.ts +0 -0
  197. /package/{.storybook/decorators → storybook-decorators}/WithDictionaryContext/contants.d.ts +0 -0
  198. /package/{.storybook/decorators → storybook-decorators}/WithDictionaryContext/index.d.ts +0 -0
  199. /package/{.storybook/decorators → storybook-decorators}/WithForm/index.d.ts +0 -0
  200. /package/{.storybook/decorators → storybook-decorators}/WithFormAutoValidation/index.d.ts +0 -0
  201. /package/{.storybook/decorators → storybook-decorators}/WithPopupsProvider/index.d.ts +0 -0
  202. /package/{.storybook/decorators → storybook-decorators}/WithScaleIcons/index.d.ts +0 -0
  203. /package/{.storybook/decorators → storybook-decorators}/WithWindowsContainer/subcomponents/WindowsContainer/index.d.ts +0 -0
  204. /package/{.storybook/decorators → storybook-decorators}/WithWindowsContainer/subcomponents/WindowsContainer/types.d.ts +0 -0
  205. /package/{.storybook/decorators → storybook-decorators}/WithWrapper/index.d.ts +0 -0
  206. /package/{.storybook/decorators → storybook-decorators}/WithWrapper/types.d.ts +0 -0
@@ -0,0 +1,51 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ThemeSettingsProvider } from "@m4l/graphics";
3
+ import { CommonFlags } from "@m4l/core";
4
+ import { A as AppWithTheme } from "./subcomponents/AppWithTheme.js";
5
+ import { E as ENVIRONMENT_ASSETS, H as HOST_STATIC_ASSETS, a as HOST_API_REMOTE, b as HOST_API_LOCAL, D as DATABASE, P as PWD, U as USER, S as STORYBOOK_ISOLATION_MODULE_ID } from "./constants.js";
6
+ import { M as MFIsolationApp } from "../../components/MFIsolationApp/MFIsolationApp.js";
7
+ const WithContexts = (Story, storyContext) => {
8
+ const { globals, parameters } = storyContext;
9
+ const { themeMode, themeColor, deviceType } = globals ?? {};
10
+ const { isolationForceSkeleton, isolationComponentsDictionary, loadAreasFromNetwork, loadCookiesFromNetwork, onAreasLoad = () => {
11
+ } } = parameters ?? {};
12
+ return /* @__PURE__ */ jsx(
13
+ MFIsolationApp,
14
+ {
15
+ moduleId: STORYBOOK_ISOLATION_MODULE_ID,
16
+ user: USER,
17
+ pwd: PWD,
18
+ database: DATABASE,
19
+ host_api_local: HOST_API_LOCAL,
20
+ host_api_remote: HOST_API_REMOTE,
21
+ host_static_assets: HOST_STATIC_ASSETS,
22
+ environment_assets: ENVIRONMENT_ASSETS,
23
+ activeAreasNetwork: loadAreasFromNetwork,
24
+ activeCookiesFromNetwork: loadCookiesFromNetwork,
25
+ skeletonFlags: [
26
+ isolationForceSkeleton ? "forceSkeleton" : CommonFlags.FLAG_DICTIONARY_LOADED
27
+ ],
28
+ privileges: [],
29
+ onLoad: onAreasLoad,
30
+ componentsDictionary: isolationComponentsDictionary,
31
+ observedDivRef: {},
32
+ forcedDeviceType: deviceType === "automatic" ? void 0 : deviceType,
33
+ children: /* @__PURE__ */ jsx(
34
+ ThemeSettingsProvider,
35
+ {
36
+ themeSettingsForced: {
37
+ themeMode,
38
+ themeDirection: "ltr",
39
+ themeColor,
40
+ themeStretch: false,
41
+ themeLayout: "vertical"
42
+ },
43
+ children: /* @__PURE__ */ jsx(AppWithTheme, { themeMode, themeColor, children: /* @__PURE__ */ jsx(Story, {}) })
44
+ }
45
+ )
46
+ }
47
+ );
48
+ };
49
+ export {
50
+ WithContexts as W
51
+ };
@@ -0,0 +1,10 @@
1
+ export declare const USER: string;
2
+ export declare const PWD: string;
3
+ export declare const DATABASE = "";
4
+ export declare const ENVIRONMENT_ASSETS: string;
5
+ export declare const HOST_API_LOCAL: string;
6
+ export declare const HOST_API_REMOTE: string;
7
+ export declare const HOST_STATIC_ASSETS: string;
8
+ export declare const DOMAIN_TOKEN: string;
9
+ export declare const STORYBOOK_MODULE_ID: string;
10
+ export declare const STORYBOOK_ISOLATION_MODULE_ID: string;
@@ -0,0 +1,18 @@
1
+ const USER = "carloszapata@gmail.com";
2
+ const PWD = "Mayuscula123.";
3
+ const DATABASE = "";
4
+ const ENVIRONMENT_ASSETS = "d1";
5
+ const HOST_API_LOCAL = "http://localhost:3000/domain";
6
+ const HOST_API_REMOTE = "https://lab1.stage.made4labs.com/api/v1/domain";
7
+ const HOST_STATIC_ASSETS = "https://s3.amazonaws.com/static.made4labs/environments";
8
+ const STORYBOOK_ISOLATION_MODULE_ID = "users_list";
9
+ export {
10
+ DATABASE as D,
11
+ ENVIRONMENT_ASSETS as E,
12
+ HOST_STATIC_ASSETS as H,
13
+ PWD as P,
14
+ STORYBOOK_ISOLATION_MODULE_ID as S,
15
+ USER as U,
16
+ HOST_API_REMOTE as a,
17
+ HOST_API_LOCAL as b
18
+ };
@@ -0,0 +1 @@
1
+ export declare const RootStyle: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,15 @@
1
+ import { styled } from "@mui/material/styles";
2
+ const RootStyle = styled("div")(({ theme }) => ({
3
+ padding: 25,
4
+ backgroundColor: theme.vars.palette.background.default,
5
+ borderColor: theme.vars.palette.primary.enabled,
6
+ borderStyle: "solid",
7
+ borderWidth: 1,
8
+ width: "100%",
9
+ height: "100%",
10
+ fontSize: "inherit",
11
+ container: "container / inline-size"
12
+ }));
13
+ export {
14
+ RootStyle as R
15
+ };
@@ -0,0 +1,6 @@
1
+ import { AppThemeProps } from '../types';
2
+ /**
3
+ * AppWithTheme es un componente que se encarga de proveer el contexto de tema a la aplicación.
4
+ *
5
+ */
6
+ export declare const AppWithTheme: ({ themeMode, themeColor, children }: AppThemeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useThemeSettingsStore, HostThemeProvider, GlobalStyles } from "@m4l/graphics";
3
+ import { fnComponentsOverrides } from "@m4l/styles";
4
+ import { R as RootStyle } from "../styles.js";
5
+ import { useEffect } from "react";
6
+ const AppWithTheme = ({ themeMode, themeColor, children }) => {
7
+ const themeOptions = useThemeSettingsStore((state) => state.themeOptions);
8
+ const currentThemeSettings = useThemeSettingsStore((state) => state.themeUserSettings);
9
+ const setThemeSettings = useThemeSettingsStore((state) => state.settingsActions.setThemeSettings);
10
+ useEffect(() => {
11
+ setThemeSettings({
12
+ ...currentThemeSettings,
13
+ themeMode,
14
+ themeColor
15
+ });
16
+ }, [themeMode, themeColor]);
17
+ return /* @__PURE__ */ jsx(RootStyle, { children: /* @__PURE__ */ jsxs(
18
+ HostThemeProvider,
19
+ {
20
+ isMicroFrontEnd: false,
21
+ hostThemeOptions: themeOptions,
22
+ fnComponentsOverrides,
23
+ children: [
24
+ /* @__PURE__ */ jsx(GlobalStyles, {}),
25
+ children
26
+ ]
27
+ }
28
+ ) });
29
+ };
30
+ export {
31
+ AppWithTheme as A
32
+ };
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ interface GlobalContextType {
3
+ data: any;
4
+ isLoading: boolean;
5
+ loadDataForFirstStory: () => Promise<void>;
6
+ checkIncomingData: () => Promise<void>;
7
+ }
8
+ /**
9
+ * Decorador usado para cargar el diccionario de componente.
10
+ * Si tiene varias historias, solo se cargará la primera,
11
+ * la demas esperaran a que la primera termine de llamar la API.
12
+ */
13
+ export declare const WithDictionaryContext: React.FC<{
14
+ comps: string[];
15
+ children: React.ReactNode;
16
+ }>;
17
+ /**
18
+ * Contexto para extraer el value del contexto
19
+ */
20
+ export declare const useStoryBookDictionaryContext: () => GlobalContextType;
21
+ export {};
@@ -0,0 +1,8 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ /**
3
+ * Decorator that adds the form context to the story and triggers validation after a delay.
4
+ */
5
+ export declare const WithForms: ({ values, validationSchema }: {
6
+ values?: {} | undefined;
7
+ validationSchema?: {} | undefined;
8
+ }) => (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { fn } from "@storybook/test";
3
+ import { R as RHFormProvider } from "../../components/hook-form/RHFormContext/index.js";
4
+ const WithForms = ({ values = {}, validationSchema = {} }) => {
5
+ return function WithFormStory(Story) {
6
+ const onSubmit = fn();
7
+ return /* @__PURE__ */ jsx(RHFormProvider, { onSubmit, values, validationSchema, children: /* @__PURE__ */ jsx(Story, {}) });
8
+ };
9
+ };
10
+ export {
11
+ WithForms as W
12
+ };
@@ -0,0 +1,7 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ /**
3
+ * Decorador para que el Story ejecute automaticamente las validaciones de react-hook-fom.
4
+ * Se debe usar con el decorador WithForm que es el que configura el formulario y su contexto.
5
+ * @param Story
6
+ */
7
+ export declare const WithFormAutoValidation: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { useFormContext } from "react-hook-form";
4
+ const WithFormAutoValidation = (Story) => {
5
+ const TriggerValidation = () => {
6
+ const { trigger } = useFormContext();
7
+ useEffect(() => {
8
+ const timeout = setTimeout(() => {
9
+ trigger();
10
+ }, 1e3);
11
+ return () => clearTimeout(timeout);
12
+ }, [trigger]);
13
+ return null;
14
+ };
15
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
16
+ /* @__PURE__ */ jsx(TriggerValidation, {}),
17
+ /* @__PURE__ */ jsx(Story, {})
18
+ ] });
19
+ };
20
+ export {
21
+ WithFormAutoValidation as W
22
+ };
@@ -0,0 +1,5 @@
1
+ import { StoryFn, StoryContext } from '@storybook/react';
2
+ /**
3
+ * Decora la historia con el proveedor de popups, puede recibir initialPopups como parametro de ella
4
+ */
5
+ export declare const WithPopupsProvider: (MyStory: StoryFn, { parameters }: StoryContext) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { u as useStateRef } from "../../hooks/useStateRef/index.js";
3
+ import { useCallback } from "react";
4
+ import { W as WindowsContainer } from "../WithWindowsContainer/subcomponents/WindowsContainer/WindowsContainer.js";
5
+ import { a as PopupsProvider } from "../../components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
6
+ const WithPopupsProvider = (MyStory, { parameters }) => {
7
+ const [refDiv, setRef] = useStateRef(null);
8
+ const getContainerElement = useCallback(() => refDiv, [refDiv]);
9
+ return /* @__PURE__ */ jsx(WindowsContainer, { ref: setRef, children: refDiv && /* @__PURE__ */ jsx(
10
+ PopupsProvider,
11
+ {
12
+ getContainerElement,
13
+ baseZindex: 0,
14
+ storeId: "story 1.0",
15
+ initialPopups: parameters?.initialPopups || [],
16
+ children: /* @__PURE__ */ jsx(MyStory, {})
17
+ }
18
+ ) });
19
+ };
20
+ export {
21
+ WithPopupsProvider as W
22
+ };
@@ -0,0 +1,7 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ /**
3
+ * Decorador para escalar íconos en las historias de Storybook.
4
+ * @param MyStory
5
+ * @param context
6
+ */
7
+ export declare const WithScaleIcons: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const WithScaleIcons = (Story) => {
3
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx("div", { style: { transform: "scale(4)" }, children: /* @__PURE__ */ jsx(Story, {}) }) });
4
+ };
5
+ export {
6
+ WithScaleIcons as W
7
+ };
@@ -0,0 +1,5 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ /**
3
+ * Decora la historia con el proveedor de popups, puede recibir initialPopups como parametro de ella
4
+ */
5
+ export declare const WithWindowsContainer: (MyStory: StoryFn) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { W as WindowsContainer } from "./subcomponents/WindowsContainer/WindowsContainer.js";
3
+ const WithWindowsContainer = (MyStory) => {
4
+ return /* @__PURE__ */ jsx(WindowsContainer, { children: /* @__PURE__ */ jsx(MyStory, {}) });
5
+ };
6
+ export {
7
+ WithWindowsContainer as W
8
+ };
@@ -0,0 +1,2 @@
1
+ export * from './WithWindowsContainer';
2
+ export { WindowsContainer } from './subcomponents/WindowsContainer';
@@ -0,0 +1,5 @@
1
+ import { WindowsContainerProps } from './types';
2
+ /**
3
+ * Contendor de ventanas
4
+ */
5
+ export declare const WindowsContainer: import('react').ForwardRefExoticComponent<WindowsContainerProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ const WindowsContainer = forwardRef(
4
+ ({ children, ...rest }, ref) => {
5
+ return /* @__PURE__ */ jsx(
6
+ "div",
7
+ {
8
+ ref,
9
+ style: {
10
+ width: "100%",
11
+ height: "400px",
12
+ position: "relative",
13
+ resize: "both",
14
+ overflow: "hidden",
15
+ border: "1px dotted gray"
16
+ },
17
+ ...rest,
18
+ children
19
+ }
20
+ );
21
+ }
22
+ );
23
+ export {
24
+ WindowsContainer as W
25
+ };
@@ -0,0 +1,24 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ import { WithWrapperParameters } from './types';
3
+ /**
4
+ * Un decorador de Storybook que envuelve una historia dentro de un contenedor centrado con
5
+ * altura, ancho y otros parámetros de estilo personalizables.
6
+ * @param {StoryFn} Story - La función de la historia que renderiza el componente.
7
+ * @param {object} context - El objeto de contexto que contiene los parámetros de Storybook.
8
+ * @param {Parameters} context.parameters - Parámetros personalizados para el contenedor, incluyendo `height` y `width`.
9
+ * @returns {JSX.Element} - Un elemento `div` que envuelve y centra la historia.
10
+ * @example
11
+ * // Uso en una historia de Storybook:
12
+ * export default {
13
+ * title: 'MiComponente',
14
+ * decorators: [WithWrapper],
15
+ * };
16
+ *
17
+ * const Template = (args) => <MiComponente {...args} />;
18
+ *
19
+ * export const Default = Template.bind({});
20
+ * Default.parameters = { height: '200px', width: '200px' };
21
+ */
22
+ export declare const WithWrapper: (Story: StoryFn, { parameters }: {
23
+ parameters: WithWrapperParameters;
24
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const WithWrapper = (Story, { parameters }) => {
3
+ const { height = "100px", width = "100px", ...others } = parameters;
4
+ return /* @__PURE__ */ jsx("div", { style: { height, width, display: "flex", justifyContent: "center", alignItems: "center", ...others }, children: /* @__PURE__ */ jsx(Story, {}) });
5
+ };
6
+ export {
7
+ WithWrapper as W
8
+ };
@@ -0,0 +1,7 @@
1
+ export * from './WithContexts';
2
+ export * from './WithPopupsProvider';
3
+ export * from './WithForm';
4
+ export * from './WithFormAutoValidation';
5
+ export * from './WithWindowsContainer';
6
+ export * from './WithScaleIcons';
7
+ export * from './WithWrapper';
@@ -0,0 +1 @@
1
+
package/test/mocks.d.ts CHANGED
@@ -15,7 +15,7 @@ export declare const mock_useEnvironment: {
15
15
  domain_token: string;
16
16
  };
17
17
  export declare const mockedGraphics: {
18
- useFormatter: import('vitest').MockInstance<() => graphics.Formatters>;
18
+ useFormatter: import('vitest').MockInstance<() => import('@m4l/graphics').Formatters>;
19
19
  };
20
20
  export declare function restoreGraphicsMocked(): void;
21
21
  /**
@@ -23,5 +23,5 @@ export declare function restoreGraphicsMocked(): void;
23
23
  */
24
24
  export declare const coreImplementation: typeof core;
25
25
  export declare const graphicsImplementation: {
26
- useFormatter: import('vitest').MockInstance<() => graphics.Formatters>;
26
+ useFormatter: import('vitest').MockInstance<() => import('@m4l/graphics').Formatters>;
27
27
  };
package/vite-env.d.ts CHANGED
@@ -2,3 +2,21 @@
2
2
  /// <reference types="vitest" />
3
3
  /// <reference types="vitest/globals" />
4
4
  /// <reference types="vitest/importMeta" />
5
+
6
+
7
+ interface ImportMetaEnv {
8
+ readonly VITE_USER: string;
9
+ readonly VITE_USER_PWD: string;
10
+ readonly VITE_ENVIRONMENT_ASSETS: string;
11
+ readonly VITE_HOST_STATIC_ASSETS: string;
12
+ readonly VITE_HOST_API_REMOTE: string;
13
+ readonly VITE_HOST_API_LOCAL: string;
14
+ readonly VITE_DOMAIN_TOKEN: string;
15
+ readonly VITE_STORYBOOK_MODULE_ID: string;
16
+ readonly VITE_STORYBOOK_ISOLATION_MODULE_ID: string;
17
+
18
+ // more env variables...
19
+ }
20
+ interface ImportMeta {
21
+ readonly env: ImportMetaEnv;
22
+ }
@@ -1 +0,0 @@
1
- export * from './WithWindowsContainer';
package/vendor.js DELETED
@@ -1,172 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useThemeSettingsStore, HostThemeProvider, GlobalStyles, ThemeSettingsProvider } from "@m4l/graphics";
3
- import { CommonFlags } from "@m4l/core";
4
- import { fnComponentsOverrides } from "@m4l/styles";
5
- import { styled } from "@mui/material/styles";
6
- import { useEffect, forwardRef, useCallback } from "react";
7
- import { M as MFIsolationApp } from "./components/MFIsolationApp/MFIsolationApp.js";
8
- import { u as useStateRef } from "./hooks/useStateRef/index.js";
9
- import { a as PopupsProvider } from "./components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
10
- import { fn } from "@storybook/test";
11
- import { R as RHFormProvider } from "./components/hook-form/RHFormContext/index.js";
12
- import { useFormContext } from "react-hook-form";
13
- const RootStyle = styled("div")(({ theme }) => ({
14
- padding: 25,
15
- backgroundColor: theme.vars.palette.background.default,
16
- borderColor: theme.vars.palette.primary.enabled,
17
- borderStyle: "solid",
18
- borderWidth: 1,
19
- width: "100%",
20
- height: "100%",
21
- fontSize: "inherit",
22
- container: "container / inline-size"
23
- }));
24
- const AppWithTheme = ({ themeMode, themeColor, children }) => {
25
- const themeOptions = useThemeSettingsStore((state) => state.themeOptions);
26
- const currentThemeSettings = useThemeSettingsStore((state) => state.themeUserSettings);
27
- const setThemeSettings = useThemeSettingsStore((state) => state.settingsActions.setThemeSettings);
28
- useEffect(() => {
29
- setThemeSettings({
30
- ...currentThemeSettings,
31
- themeMode,
32
- themeColor
33
- });
34
- }, [themeMode, themeColor]);
35
- return /* @__PURE__ */ jsx(RootStyle, { children: /* @__PURE__ */ jsxs(
36
- HostThemeProvider,
37
- {
38
- isMicroFrontEnd: false,
39
- hostThemeOptions: themeOptions,
40
- fnComponentsOverrides,
41
- children: [
42
- /* @__PURE__ */ jsx(GlobalStyles, {}),
43
- children
44
- ]
45
- }
46
- ) });
47
- };
48
- const USER = `carloszapata@gmail.com`;
49
- const PWD = `Mayuscula123.`;
50
- const DATABASE = "";
51
- const ENVIRONMENT_ASSETS = "d1";
52
- const HOST_API_LOCAL = "http://localhost:3000/domain";
53
- const HOST_API_REMOTE = "https://lab1.stage.made4labs.com/api/v1/domain";
54
- const HOST_STATIC_ASSETS = "https://s3.amazonaws.com/static.made4labs/environments";
55
- const STORYBOOK_ISOLATION_MODULE_ID = "users_list";
56
- const WithContexts = (Story, storyContext) => {
57
- const { globals, parameters } = storyContext;
58
- const { themeMode, themeColor, deviceType } = globals ?? {};
59
- const { isolationForceSkeleton, isolationComponentsDictionary, loadAreasFromNetwork, loadCookiesFromNetwork, onAreasLoad = () => {
60
- } } = parameters ?? {};
61
- return /* @__PURE__ */ jsx(
62
- MFIsolationApp,
63
- {
64
- moduleId: STORYBOOK_ISOLATION_MODULE_ID,
65
- user: USER,
66
- pwd: PWD,
67
- database: DATABASE,
68
- host_api_local: HOST_API_LOCAL,
69
- host_api_remote: HOST_API_REMOTE,
70
- host_static_assets: HOST_STATIC_ASSETS,
71
- environment_assets: ENVIRONMENT_ASSETS,
72
- activeAreasNetwork: loadAreasFromNetwork,
73
- activeCookiesFromNetwork: loadCookiesFromNetwork,
74
- skeletonFlags: [
75
- isolationForceSkeleton ? "forceSkeleton" : CommonFlags.FLAG_DICTIONARY_LOADED
76
- ],
77
- privileges: [],
78
- onLoad: onAreasLoad,
79
- componentsDictionary: isolationComponentsDictionary,
80
- observedDivRef: {},
81
- forcedDeviceType: deviceType === "automatic" ? void 0 : deviceType,
82
- children: /* @__PURE__ */ jsx(
83
- ThemeSettingsProvider,
84
- {
85
- themeSettingsForced: {
86
- themeMode,
87
- themeDirection: "ltr",
88
- themeColor,
89
- themeStretch: false,
90
- themeLayout: "vertical"
91
- },
92
- children: /* @__PURE__ */ jsx(AppWithTheme, { themeMode, themeColor, children: /* @__PURE__ */ jsx(Story, {}) })
93
- }
94
- )
95
- }
96
- );
97
- };
98
- const WindowsContainer = forwardRef(
99
- ({ children, ...rest }, ref) => {
100
- return /* @__PURE__ */ jsx(
101
- "div",
102
- {
103
- ref,
104
- style: {
105
- width: "100%",
106
- height: "400px",
107
- position: "relative",
108
- resize: "both",
109
- overflow: "hidden",
110
- border: "1px dotted gray"
111
- },
112
- ...rest,
113
- children
114
- }
115
- );
116
- }
117
- );
118
- const WithPopupsProvider = (MyStory, { parameters }) => {
119
- const [refDiv, setRef] = useStateRef(null);
120
- const getContainerElement = useCallback(() => refDiv, [refDiv]);
121
- return /* @__PURE__ */ jsx(WindowsContainer, { ref: setRef, children: refDiv && /* @__PURE__ */ jsx(
122
- PopupsProvider,
123
- {
124
- getContainerElement,
125
- baseZindex: 0,
126
- storeId: "story 1.0",
127
- initialPopups: parameters?.initialPopups || [],
128
- children: /* @__PURE__ */ jsx(MyStory, {})
129
- }
130
- ) });
131
- };
132
- const WithForms = ({ values = {}, validationSchema = {} }) => {
133
- return function WithFormStory(Story) {
134
- const onSubmit = fn();
135
- return /* @__PURE__ */ jsx(RHFormProvider, { onSubmit, values, validationSchema, children: /* @__PURE__ */ jsx(Story, {}) });
136
- };
137
- };
138
- const WithFormAutoValidation = (Story) => {
139
- const TriggerValidation = () => {
140
- const { trigger } = useFormContext();
141
- useEffect(() => {
142
- const timeout = setTimeout(() => {
143
- trigger();
144
- }, 1e3);
145
- return () => clearTimeout(timeout);
146
- }, [trigger]);
147
- return null;
148
- };
149
- return /* @__PURE__ */ jsxs(Fragment, { children: [
150
- /* @__PURE__ */ jsx(TriggerValidation, {}),
151
- /* @__PURE__ */ jsx(Story, {})
152
- ] });
153
- };
154
- const WithWindowsContainer = (MyStory) => {
155
- return /* @__PURE__ */ jsx(WindowsContainer, { children: /* @__PURE__ */ jsx(MyStory, {}) });
156
- };
157
- const WithScaleIcons = (Story) => {
158
- return /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx("div", { style: { transform: "scale(4)" }, children: /* @__PURE__ */ jsx(Story, {}) }) });
159
- };
160
- const WithWrapper = (Story, { parameters }) => {
161
- const { height = "100px", width = "100px", ...others } = parameters;
162
- return /* @__PURE__ */ jsx("div", { style: { height, width, display: "flex", justifyContent: "center", alignItems: "center", ...others }, children: /* @__PURE__ */ jsx(Story, {}) });
163
- };
164
- export {
165
- WithContexts as W,
166
- WithPopupsProvider as a,
167
- WithForms as b,
168
- WithFormAutoValidation as c,
169
- WithWindowsContainer as d,
170
- WithScaleIcons as e,
171
- WithWrapper as f
172
- };