@m4l/components 9.3.3 → 9.3.5

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 (89) hide show
  1. package/@types/types.d.ts +15 -0
  2. package/components/NumberInput/NumberInput.styles.js +1 -0
  3. package/components/PaperForm/PaperForm.js +1 -2
  4. package/components/PaperForm/components/Header.js +1 -10
  5. package/components/PaperForm/styles.js +1 -4
  6. package/components/PropertyValue/PropertyValue.js +1 -1
  7. package/components/SettingsLayout/SettingsLayout.d.ts +5 -0
  8. package/components/SettingsLayout/SettingsLayout.js +34 -0
  9. package/components/SettingsLayout/SettingsLayout.styles.d.ts +2 -0
  10. package/components/SettingsLayout/SettingsLayout.styles.js +270 -0
  11. package/components/SettingsLayout/constants.d.ts +7 -0
  12. package/components/SettingsLayout/constants.js +10 -0
  13. package/components/SettingsLayout/dictionary.d.ts +8 -0
  14. package/components/SettingsLayout/dictionary.js +11 -0
  15. package/components/SettingsLayout/icons.d.ts +14 -0
  16. package/components/SettingsLayout/icons.js +17 -0
  17. package/components/SettingsLayout/index.d.ts +2 -0
  18. package/components/SettingsLayout/index.js +1 -0
  19. package/components/SettingsLayout/slots/SettingsLayoutEnum.d.ts +17 -0
  20. package/components/SettingsLayout/slots/SettingsLayoutEnum.js +21 -0
  21. package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +47 -0
  22. package/components/SettingsLayout/slots/SettingsLayoutSlots.js +83 -0
  23. package/components/SettingsLayout/subcomponents/SettingColorPresets/SettingColorPresets.d.ts +5 -0
  24. package/components/SettingsLayout/subcomponents/SettingColorPresets/SettingColorPresets.js +37 -0
  25. package/components/SettingsLayout/subcomponents/SettingColorPresets/index.d.ts +1 -0
  26. package/components/SettingsLayout/subcomponents/SettingColorPresets/index.js +1 -0
  27. package/components/SettingsLayout/subcomponents/SettingColorPresets/types.d.ts +3 -0
  28. package/components/SettingsLayout/subcomponents/SettingDirection/SettingDirection.d.ts +5 -0
  29. package/components/SettingsLayout/subcomponents/SettingDirection/SettingDirection.js +37 -0
  30. package/components/SettingsLayout/subcomponents/SettingDirection/index.d.ts +1 -0
  31. package/components/SettingsLayout/subcomponents/SettingDirection/types.d.ts +3 -0
  32. package/components/SettingsLayout/subcomponents/SettingFullscreen/SettingFullscreen.d.ts +5 -0
  33. package/components/SettingsLayout/subcomponents/SettingFullscreen/SettingFullscreen.js +40 -0
  34. package/components/SettingsLayout/subcomponents/SettingFullscreen/index.d.ts +1 -0
  35. package/components/SettingsLayout/subcomponents/SettingFullscreen/index.js +1 -0
  36. package/components/SettingsLayout/subcomponents/SettingFullscreen/types.d.ts +3 -0
  37. package/components/SettingsLayout/subcomponents/SettingItem/SettingItem.d.ts +8 -0
  38. package/components/SettingsLayout/subcomponents/SettingItem/SettingItem.js +23 -0
  39. package/components/SettingsLayout/subcomponents/SettingItem/index.d.ts +1 -0
  40. package/components/SettingsLayout/subcomponents/SettingItem/index.js +1 -0
  41. package/components/SettingsLayout/subcomponents/SettingItem/types.d.ts +5 -0
  42. package/components/SettingsLayout/subcomponents/SettingItemColor/SettingItemColor.d.ts +8 -0
  43. package/components/SettingsLayout/subcomponents/SettingItemColor/SettingItemColor.js +24 -0
  44. package/components/SettingsLayout/subcomponents/SettingItemColor/index.d.ts +1 -0
  45. package/components/SettingsLayout/subcomponents/SettingItemColor/index.js +1 -0
  46. package/components/SettingsLayout/subcomponents/SettingItemColor/types.d.ts +6 -0
  47. package/components/SettingsLayout/subcomponents/SettingMode/SettingMode.d.ts +5 -0
  48. package/components/SettingsLayout/subcomponents/SettingMode/SettingMode.js +36 -0
  49. package/components/SettingsLayout/subcomponents/SettingMode/index.d.ts +1 -0
  50. package/components/SettingsLayout/subcomponents/SettingMode/index.js +1 -0
  51. package/components/SettingsLayout/subcomponents/SettingMode/types.d.ts +3 -0
  52. package/components/SettingsLayout/subcomponents/SettingsLayoutBase/SettingsLayoutBase.d.ts +5 -0
  53. package/components/SettingsLayout/subcomponents/SettingsLayoutBase/SettingsLayoutBase.js +76 -0
  54. package/components/SettingsLayout/subcomponents/SettingsLayoutBase/index.d.ts +1 -0
  55. package/components/SettingsLayout/subcomponents/SettingsLayoutBase/index.js +1 -0
  56. package/components/SettingsLayout/subcomponents/SettingsLayoutBase/types.d.ts +5 -0
  57. package/components/SettingsLayout/test/SettingsLayout.test.d.ts +18 -0
  58. package/components/SettingsLayout/types.d.ts +47 -0
  59. package/components/ToastContainer/ToastContainer.js +0 -1
  60. package/components/ToastContainer/ToastContainer.styles.js +126 -122
  61. package/components/ToastContainer/constants.d.ts +670 -0
  62. package/components/ToastContainer/constants.js +672 -1
  63. package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.js +2 -1
  64. package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -1
  65. package/components/hook-form/RHFNumberInput/RHFNumberInput.styles.js +2 -1
  66. package/components/hook-form/RHFPeriod/RHFPeriod.styles.js +2 -5
  67. package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.d.ts +1 -1
  68. package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js +1 -1
  69. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
  70. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js +6 -6
  71. package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +13 -11
  72. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +1 -1
  73. package/components/hook-form/RHFPeriod/subcomponents/Period/types.d.ts +2 -2
  74. package/components/hook-form/RHFSelect/RHFSelect.styles.js +2 -1
  75. package/components/index.d.ts +1 -0
  76. package/components/mui_extended/Button/ButtonStyles.js +2 -1
  77. package/components/mui_extended/IconButton/IconButton.styles.js +1 -1
  78. package/components/mui_extended/MenuItem/MenuItem.styles.js +2 -1
  79. package/components/mui_extended/TextField/constants.d.ts +5 -5
  80. package/components/mui_extended/TextField/constants.js +2 -2
  81. package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
  82. package/components/mui_extended/TextField/slots/TextFieldEnum.js +8 -8
  83. package/index.js +12 -10
  84. package/package.json +1 -1
  85. package/storybook/components/SettingsLayout/SettingsLayout.stories.d.ts +6 -0
  86. package/storybook/components/SettingsLayout/subcomponents/SettingsLayoutRender/SettingsLayoutsRender.d.ts +5 -0
  87. package/storybook/components/SettingsLayout/subcomponents/SettingsLayoutRender/index.d.ts +1 -0
  88. package/storybook/components/paperForm/PaperForm.stories.d.ts +4 -0
  89. package/components/hook-form/RHFDateTime/styles.d.ts +0 -1
@@ -0,0 +1,18 @@
1
+ export declare const mockThemeUserSettings: {
2
+ themeMode: string;
3
+ themeColor: string;
4
+ themeDirection: string;
5
+ themeLayout: string;
6
+ themeStretch: boolean;
7
+ };
8
+ export declare const mockSettingsActions: {
9
+ init: import('vitest').Mock<(...args: any[]) => any>;
10
+ onChangeMode: import('vitest').Mock<(...args: any[]) => any>;
11
+ onChangeColor: import('vitest').Mock<(...args: any[]) => any>;
12
+ onChangeDirection: import('vitest').Mock<(...args: any[]) => any>;
13
+ onChangeLayout: import('vitest').Mock<(...args: any[]) => any>;
14
+ onToggleStretch: import('vitest').Mock<(...args: any[]) => any>;
15
+ onResetSetting: import('vitest').Mock<(...args: any[]) => any>;
16
+ handleOpen: import('vitest').Mock<(...args: any[]) => any>;
17
+ setThemeSettings: import('vitest').Mock<(...args: any[]) => any>;
18
+ };
@@ -0,0 +1,47 @@
1
+ import { M4LOverridesStyleRules } from '../../@types/augmentations';
2
+ import { SettingsLayoutSlots } from './slots/SettingsLayoutEnum';
3
+ import { SETTINGS_LAYOUT_COMPONENT_KEY } from './constants';
4
+ import { Theme } from '@mui/material';
5
+ import { Sizes, ThemeUserColor } from '@m4l/styles';
6
+ import { ThemeSettingsStore } from '@m4l/graphics';
7
+ export interface SettingsLayoutProps {
8
+ /**
9
+ * Propiedad que define el ancho del componente.
10
+ */
11
+ width?: number;
12
+ /**
13
+ * Medida de tamaño para el componente.
14
+ */
15
+ size?: Extract<Sizes, 'small' | 'medium'>;
16
+ /**
17
+ * Nombre de clase css.
18
+ */
19
+ className?: string;
20
+ /**
21
+ * Identificador usado para pruebas del componente.
22
+ */
23
+ dataTestId?: string;
24
+ }
25
+ /**
26
+ * Tipo para las ranuras del componente.
27
+ * Este tipo se refiere a las claves dentro de `SettingsLayoutSlots`, que determinan los diferentes elementos
28
+ * estilizados dentro del componente, como el `root`, `backdrop`, etc.
29
+ */
30
+ export type SettingsLayoutSlotsType = keyof typeof SettingsLayoutSlots;
31
+ /**
32
+ * Combinación de las propiedades del componente y su estado propietario.
33
+ * Este tipo se utiliza para describir el estado completo del componente , incluyendo
34
+ * las propiedades pasadas al componente y el estado calculado.
35
+ */
36
+ export interface SettingsLayoutOwnerState extends Pick<ThemeSettingsStore['themeUserSettings'], 'themeDirection'> {
37
+ width: SettingsLayoutProps['width'];
38
+ size: SettingsLayoutProps['size'];
39
+ color?: ThemeUserColor;
40
+ [key: string]: unknown;
41
+ }
42
+ /**
43
+ * Tipos de estilos para el componente.
44
+ * Esta interfaz extiende las reglas de estilo personalizadas para las ranuras del componente (`SettingsLayoutSlots`)
45
+ * y permite su sobrescritura.
46
+ */
47
+ export type SettingsLayoutstyles = M4LOverridesStyleRules<SettingsLayoutSlots, typeof SETTINGS_LAYOUT_COMPONENT_KEY, Theme>;
@@ -3,7 +3,6 @@ import { ToastContainer as ToastContainer$1 } from "react-toastify";
3
3
  import { D as DEFAULT_CLOSE_TIME, T as TOAST_KEY_COMPONENT } from "./constants.js";
4
4
  import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
5
5
  import { ModuleSkeletonProvider } from "@m4l/core";
6
- import "react-toastify/dist/ReactToastify.min.css";
7
6
  import { R as RootStyled } from "./slots/toastContainerSlots.js";
8
7
  import { T as ToastContainerSlots } from "./slots/ToastContainerEnum.js";
9
8
  const ToastContainer = (props) => {
@@ -1,132 +1,136 @@
1
+ import { a as TOAST_NATIVE_STYLES } from "./constants.js";
1
2
  const toastStyles = {
2
3
  /** Root del componente ToastContainer */
3
4
  root: ({ theme, ownerState }) => ({
4
- "--toastify-color-light": theme.vars.palette.background.default,
5
- "--toastify-color-dark": theme.vars.palette.background.default,
6
- "--toastify-color-info": theme.vars.palette.info.enabled,
7
- "--toastify-color-success": theme.vars.palette.success.enabled,
8
- "--toastify-color-warning": theme.vars.palette.warning.enabled,
9
- "--toastify-color-error": theme.vars.palette.error.enabled,
10
- "--toastify-color-transparent": "rgba(255, 255, 255, 0.7)",
11
- "--toastify-icon-color-info": "var(--toastify-color-info)",
12
- "--toastify-icon-color-success": "var(--toastify-color-success)",
13
- "--toastify-icon-color-warning": "var(--toastify-color-warning)",
14
- "--toastify-icon-color-error": "var(--toastify-color-error)",
15
- "--toastify-toast-width": "320px",
16
- "--toastify-toast-background": "#fff",
17
- "--toastify-toast-min-height": "64px",
18
- "--toastify-toast-max-height": "800px",
19
- "--toastify-font-family": "sans-serif",
20
- "--toastify-z-index": "9999",
21
- "--toastify-text-color-light": "#757575",
22
- "--toastify-text-color-dark": "#fff",
23
- //Used only for colored theme
24
- "--toastify-text-color-info": "#fff",
25
- "--toastify-text-color-success": "#fff",
26
- "--toastify-text-color-warning": "#fff",
27
- "--toastify-text-color-error": "#fff",
28
- "--toastify-spinner-color": "#616161",
29
- "--toastify-spinner-color-empty-area": "#e0e0e0",
30
- // Used when no type is provided
31
- // toast("**hello**")
32
- // '--toastify-color-progress-light': 'var(--toastify-color-info)',
33
- // // Used when no type is provided
34
- // '--toastify-color-progress-dark': 'var(--toastify-color-info)',
35
- // '--toastify-color-progress-info': 'var(--toastify-color-info)',
36
- // '--toastify-color-progress-success': 'var(--toastify-color-success)',
37
- // '--toastify-color-progress-warning': 'var(--toastify-color-warning)',
38
- // '--toastify-color-progress-error': 'var(--toastify-color-error)',
39
- "--toastify-toast-bd-radius": "8px",
40
- // used to control the opacity of the progress trail
41
- "--toastify-color-progress-bgo": ".2",
42
- ...ownerState?.fixed === false ? {
43
- top: 0,
44
- position: "absolute",
45
- zIndex: theme.vars.zIndex.snackbar,
46
- "@supports (position: sticky)": {
47
- position: "sticky"
48
- }
49
- } : {},
50
- "& .Toastify": {
51
- margin: 0,
52
- padding: 0,
53
- height: 0
54
- },
55
- "& .Toastify__toast-container": {
56
- display: "flex",
57
- flexDirection: "column",
58
- gap: "16px",
5
+ ...TOAST_NATIVE_STYLES,
6
+ "&&&": {
7
+ "--toastify-color-light": theme.vars.palette.background.default,
8
+ "--toastify-color-dark": theme.vars.palette.background.default,
9
+ "--toastify-color-info": theme.vars.palette.info.enabled,
10
+ "--toastify-color-success": theme.vars.palette.success.enabled,
11
+ "--toastify-color-warning": theme.vars.palette.warning.enabled,
12
+ "--toastify-color-error": theme.vars.palette.error.enabled,
13
+ "--toastify-color-transparent": "rgba(255, 255, 255, 0.7)",
14
+ "--toastify-icon-color-info": "var(--toastify-color-info)",
15
+ "--toastify-icon-color-success": "var(--toastify-color-success)",
16
+ "--toastify-icon-color-warning": "var(--toastify-color-warning)",
17
+ "--toastify-icon-color-error": "var(--toastify-color-error)",
18
+ "--toastify-toast-width": "320px",
19
+ "--toastify-toast-background": "#fff",
20
+ "--toastify-toast-min-height": "64px",
21
+ "--toastify-toast-max-height": "800px",
22
+ "--toastify-font-family": "sans-serif",
23
+ "--toastify-z-index": "9999",
24
+ "--toastify-text-color-light": "#757575",
25
+ "--toastify-text-color-dark": "#fff",
26
+ //Used only for colored theme
27
+ "--toastify-text-color-info": "#fff",
28
+ "--toastify-text-color-success": "#fff",
29
+ "--toastify-text-color-warning": "#fff",
30
+ "--toastify-text-color-error": "#fff",
31
+ "--toastify-spinner-color": "#616161",
32
+ "--toastify-spinner-color-empty-area": "#e0e0e0",
33
+ // Used when no type is provided
34
+ // toast("**hello**")
35
+ // '--toastify-color-progress-light': 'var(--toastify-color-info)',
36
+ // // Used when no type is provided
37
+ // '--toastify-color-progress-dark': 'var(--toastify-color-info)',
38
+ // '--toastify-color-progress-info': 'var(--toastify-color-info)',
39
+ // '--toastify-color-progress-success': 'var(--toastify-color-success)',
40
+ // '--toastify-color-progress-warning': 'var(--toastify-color-warning)',
41
+ // '--toastify-color-progress-error': 'var(--toastify-color-error)',
42
+ "--toastify-toast-bd-radius": "8px",
43
+ // used to control the opacity of the progress trail
44
+ "--toastify-color-progress-bgo": ".2",
59
45
  ...ownerState?.fixed === false ? {
60
- top: "20px",
61
- position: "absolute"
46
+ top: 0,
47
+ position: "absolute",
48
+ zIndex: theme.vars.zIndex.snackbar,
49
+ "@supports (position: sticky)": {
50
+ position: "sticky"
51
+ }
62
52
  } : {},
63
- [theme.breakpoints.down(480)]: {
64
- width: "100%",
65
- minWidth: "100%",
66
- padding: "0"
67
- }
68
- },
69
- /** Used to define the position of the ToastContainer */
70
- // '.Toastify__toast-container--top-left': {},
71
- // '.Toastify__toast-container--top-center': {},
72
- // '.Toastify__toast-container--top-right': {},
73
- // '.Toastify__toast-container--bottom-left': {},
74
- // '.Toastify__toast-container--bottom-center': {},
75
- // '.Toastify__toast-container--bottom-right': {},
76
- "& .Toastify__toast--stacked[data-collapsed=true]:not(:last-child) > *": {
77
- opacity: 0.2
78
- },
79
- /** Classes for the displayed toast */
80
- "& .Toastify__toast": {
81
- minHeight: "min-content",
82
- margin: "0",
83
- padding: "0",
84
- backgroundColor: theme.vars.palette.background.default,
85
- boxShadow: theme.customShadows?.z4,
86
- borderRadius: "4px",
87
- border: `1px solid ${theme.vars.palette.border.default}`,
88
- [theme.breakpoints.down(480)]: {
89
- margin: "1%",
90
- width: "98% !important"
53
+ "& .Toastify": {
54
+ margin: 0,
55
+ padding: 0,
56
+ height: 0
57
+ },
58
+ "& .Toastify__toast-container": {
59
+ display: "flex",
60
+ flexDirection: "column",
61
+ gap: "16px",
62
+ ...ownerState?.fixed === false ? {
63
+ top: "20px",
64
+ position: "absolute"
65
+ } : {},
66
+ [theme.breakpoints.down(480)]: {
67
+ width: "100%",
68
+ minWidth: "100%",
69
+ padding: "0"
70
+ }
71
+ },
72
+ /** Used to define the position of the ToastContainer */
73
+ // '.Toastify__toast-container--top-left': {},
74
+ // '.Toastify__toast-container--top-center': {},
75
+ // '.Toastify__toast-container--top-right': {},
76
+ // '.Toastify__toast-container--bottom-left': {},
77
+ // '.Toastify__toast-container--bottom-center': {},
78
+ // '.Toastify__toast-container--bottom-right': {},
79
+ "& .Toastify__toast--stacked[data-collapsed=true]:not(:last-child) > *": {
80
+ opacity: 0.2
81
+ },
82
+ /** Classes for the displayed toast */
83
+ "& .Toastify__toast": {
84
+ minHeight: "min-content",
85
+ margin: "0",
86
+ padding: "0",
87
+ backgroundColor: theme.vars.palette.background.default,
88
+ boxShadow: theme.customShadows?.z4,
89
+ borderRadius: "4px",
90
+ border: `1px solid ${theme.vars.palette.border.default}`,
91
+ [theme.breakpoints.down(480)]: {
92
+ margin: "1%",
93
+ width: "98% !important"
94
+ }
95
+ },
96
+ ".Toastify__toast--rtl": {},
97
+ "& .Toastify__toast-body": {
98
+ margin: "0px",
99
+ padding: "0px"
100
+ },
101
+ /** Used to position the icon */
102
+ // '& .Toastify__toast-icon': {},
103
+ /** handle the notification color and the text color based on the theme */
104
+ // '& .Toastify__toast-theme--dark': {},
105
+ // '& .Toastify__toast-theme--light': {},
106
+ // '& .Toastify__toast-theme--colored.Toastify__toast--default': {},
107
+ // '& .Toastify__toast-theme--colored.Toastify__toast--info': {},
108
+ // '& .Toastify__toast-theme--colored.Toastify__toast--success': {},
109
+ // '& .Toastify__toast-theme--colored.Toastify__toast--warning': {},
110
+ // '& .Toastify__toast-theme--colored.Toastify__toast--error': {},
111
+ "& .Toastify__progress-bar--wrp": {
112
+ position: "absolute",
113
+ top: 0,
114
+ height: "2px",
115
+ borderTopLeftRadius: "2px",
116
+ borderTopRightRadius: "2px",
117
+ borderBottomLeftRadius: "0",
118
+ borderBottomRightRadius: "0",
119
+ overflow: "hidden"
120
+ },
121
+ "& .Toastify__progress-bar": {
122
+ borderTopLeftRadius: "2px",
123
+ borderBottomLeftRadius: "0",
124
+ borderBottomRightRadius: "0"
91
125
  }
92
- },
93
- ".Toastify__toast--rtl": {},
94
- "& .Toastify__toast-body": {
95
- margin: "0px",
96
- padding: "0px"
97
- },
98
- /** Used to position the icon */
99
- // '& .Toastify__toast-icon': {},
100
- /** handle the notification color and the text color based on the theme */
101
- // '& .Toastify__toast-theme--dark': {},
102
- // '& .Toastify__toast-theme--light': {},
103
- // '& .Toastify__toast-theme--colored.Toastify__toast--default': {},
104
- // '& .Toastify__toast-theme--colored.Toastify__toast--info': {},
105
- // '& .Toastify__toast-theme--colored.Toastify__toast--success': {},
106
- // '& .Toastify__toast-theme--colored.Toastify__toast--warning': {},
107
- // '& .Toastify__toast-theme--colored.Toastify__toast--error': {},
108
- "& .Toastify__progress-bar--wrp": {
109
- position: "absolute",
110
- top: 0,
111
- height: "2px",
112
- borderTopLeftRadius: "2px",
113
- borderTopRightRadius: "2px",
114
- borderBottomLeftRadius: "0",
115
- borderBottomRightRadius: "0",
116
- overflow: "hidden"
117
- },
118
- "& .Toastify__progress-bar": {
119
- borderTopLeftRadius: "2px",
120
- borderBottomLeftRadius: "0",
121
- borderBottomRightRadius: "0"
126
+ // '& .Toastify__progress-bar--rtl': {},
127
+ // '& .Toastify__progress-bar-theme--light': {},
128
+ // '& .Toastify__progress-bar-theme--dark': {},
129
+ // '& .Toastify__progress-bar--info': {},
130
+ // '& .Toastify__progress-bar--success': {},
131
+ // '& .Toastify__progress-bar--warning': {},
132
+ // '& .Toastify__progress-bar--error': {},
122
133
  }
123
- // '& .Toastify__progress-bar--rtl': {},
124
- // '& .Toastify__progress-bar-theme--light': {},
125
- // '& .Toastify__progress-bar-theme--dark': {},
126
- // '& .Toastify__progress-bar--info': {},
127
- // '& .Toastify__progress-bar--success': {},
128
- // '& .Toastify__progress-bar--warning': {},
129
- // '& .Toastify__progress-bar--error': {},
130
134
  }),
131
135
  /** 📦 Contenedor Principal del Toast 📦 */
132
136
  messageRoot: ({ theme }) => ({