@m4l/components 9.1.14 → 9.1.16

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 (54) hide show
  1. package/@types/types.d.ts +8 -0
  2. package/components/CommonActions/components/ActionFormIntro/index.d.ts +2 -2
  3. package/components/CommonActions/components/ActionFormIntro/index.js +4 -3
  4. package/components/Icon/Icon.d.ts +2 -2
  5. package/components/ModalDialog/ModalDialog.d.ts +2 -2
  6. package/components/WindowBase/WindowBase.styles.js +24 -24
  7. package/components/hook-form/RHFAutocomplete/subcomponents/ComponentTypeImage/index.js +1 -1
  8. package/components/mui_extended/Badge/Badge.d.ts +8 -1
  9. package/components/mui_extended/Badge/Badge.js +25 -4
  10. package/components/mui_extended/Badge/Badge.styles.js +56 -2
  11. package/components/mui_extended/Badge/index.d.ts +6 -2
  12. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +2 -2
  13. package/components/mui_extended/Badge/slots/index.js +1 -0
  14. package/components/mui_extended/Badge/types.d.ts +9 -3
  15. package/components/mui_extended/Badge/types.js +1 -0
  16. package/components/mui_extended/CircularProgress/slots/CircularProgressSlots.js +1 -1
  17. package/components/mui_extended/Dialog/Dialog.styles.js +2 -2
  18. package/components/mui_extended/LoadingButton/LoadingButton.d.ts +5 -0
  19. package/components/mui_extended/LoadingButton/LoadingButton.js +93 -0
  20. package/components/mui_extended/LoadingButton/LoadingButton.styles.d.ts +5 -0
  21. package/components/mui_extended/LoadingButton/LoadingButton.styles.js +200 -0
  22. package/components/mui_extended/LoadingButton/LoadingButton.test.d.ts +1 -0
  23. package/components/mui_extended/LoadingButton/constants.d.ts +8 -0
  24. package/components/mui_extended/LoadingButton/constants.js +4 -0
  25. package/components/mui_extended/LoadingButton/index.d.ts +1 -9
  26. package/components/mui_extended/LoadingButton/slots/LoadingButtonEnum.d.ts +7 -0
  27. package/components/mui_extended/LoadingButton/slots/LoadingButtonEnum.js +11 -0
  28. package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +38 -0
  29. package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.js +36 -0
  30. package/components/mui_extended/LoadingButton/types.d.ts +13 -7
  31. package/components/mui_extended/MenuItem/MenuItem.d.ts +2 -2
  32. package/components/mui_extended/MenuItem/MenuItem.styles.js +6 -6
  33. package/components/mui_extended/index.d.ts +1 -1
  34. package/index.js +1 -1
  35. package/package.json +1 -1
  36. package/storybook/components/ModalDialog/subcomponent/WithExtendedContainer.d.ts +2 -2
  37. package/storybook/components/extended/mui/Badge/Badge.stories.d.ts +33 -0
  38. package/storybook/components/extended/mui/LoadingButton/LoadingButton.stories.d.ts +42 -0
  39. package/components/LanguagePopover/tests/index.test.d.ts +0 -2
  40. package/components/hook-form/RHFAutocomplete/test/index.test.d.ts +0 -5
  41. package/components/mui_extended/Badge/styles.d.ts +0 -0
  42. package/components/mui_extended/LoadingButton/classes/constants.d.ts +0 -1
  43. package/components/mui_extended/LoadingButton/classes/constants.js +0 -4
  44. package/components/mui_extended/LoadingButton/classes/index.d.ts +0 -11
  45. package/components/mui_extended/LoadingButton/classes/index.js +0 -42
  46. package/components/mui_extended/LoadingButton/classes/types.d.ts +0 -11
  47. package/components/mui_extended/LoadingButton/index.js +0 -47
  48. package/components/mui_extended/LoadingButton/styles.d.ts +0 -1
  49. package/components/mui_extended/LoadingButton/styles.js +0 -8
  50. package/components/mui_extended/LoadingButton/tests/constants.d.ts +0 -1
  51. package/components/mui_extended/LoadingButton/tests/constants.js +0 -4
  52. package/components/mui_extended/LoadingButton/tests/utils.d.ts +0 -2
  53. package/components/mui_extended/LoadingButton/tests/utils.js +0 -7
  54. /package/components/mui_extended/{CircularProgress/CircularProgress.test.d.ts → Badge/tests/Badge.test.d.ts} +0 -0
package/@types/types.d.ts CHANGED
@@ -133,6 +133,7 @@ import { WindowBaseOwnerState, WindowBaseType } from '../components/WindowBase';
133
133
  import { OwnerStateWindowConfirm, WindowConfirmType } from '../components/WindowConfirm';
134
134
  import { AppBarSlotsType, AppBarOwnerState } from '../components/AppBar/types';
135
135
  import { DialogOwnerState, DialogType } from '../components/mui_extended/Dialog/types';
136
+ import { LoadingButtonOwnerState, LoadingButtonSlotsType } from '../components/mui_extended/LoadingButton/types';
136
137
 
137
138
 
138
139
  declare module '@mui/material/styles' {
@@ -173,6 +174,7 @@ declare module '@mui/material/styles' {
173
174
  M4LWindowConfirm: WindowConfirmType;
174
175
  M4LAppBar: AppBarSlotsType;
175
176
  M4LWiDialog: DialogType;
177
+ M4LLoadingButton: LoadingButtonSlotsType;
176
178
  }
177
179
 
178
180
  interface ComponentsPropsList {
@@ -212,6 +214,7 @@ declare module '@mui/material/styles' {
212
214
  M4LWindowConfirm: Partial<OwnerStateWindowConfirm>;
213
215
  M4LAppBar: Partial<AppBarOwnerState>;
214
216
  M4LWiDialog: Partial<DialogOwnerState>;
217
+ M4LLoadingButton: Partial<LoadingButtonOwnerState>;
215
218
  }
216
219
 
217
220
  interface Components {
@@ -485,5 +488,10 @@ declare module '@mui/material/styles' {
485
488
  styleOverrides?: ComponentsOverrides<Theme>['M4LWiDialog'];
486
489
  variants?: ComponentsVariants['M4LWiDialog'];
487
490
  };
491
+ M4LLoadingButton?: {
492
+ defaultProps?: ComponentsPropsList['M4LLoadingButton'];
493
+ styleOverrides?: ComponentsOverrides<Theme>['M4LLoadingButton'];
494
+ variants?: ComponentsVariants['M4LLoadingButton'];
495
+ };
488
496
  }
489
497
  }
@@ -1,5 +1,5 @@
1
- import { MuiLabLoadingButtonProps } from '../../../mui_extended/LoadingButton/types';
1
+ import { LoadingButtonProps } from '../../../mui_extended/LoadingButton/types';
2
2
  /**
3
3
  * TODO: Documentar
4
4
  */
5
- export declare function ActionFormIntro(props: MuiLabLoadingButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ActionFormIntro(props: LoadingButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useFormContext, useFormState } from "react-hook-form";
3
3
  import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
4
4
  import { Skeleton } from "@mui/material";
5
- import { L as LoadingButton } from "../../../mui_extended/LoadingButton/index.js";
5
+ import { L as LoadingButton } from "../../../mui_extended/LoadingButton/LoadingButton.js";
6
6
  import { u as useCommonActionsUtilityClasses } from "../../classes/index.js";
7
7
  function ActionFormIntro(props) {
8
8
  const { getLabel } = useModuleDictionary();
@@ -11,6 +11,7 @@ function ActionFormIntro(props) {
11
11
  const { isSubmitting } = useFormState({
12
12
  control
13
13
  });
14
+ const { variant = "contained", color = "primary" } = props;
14
15
  const classes = useCommonActionsUtilityClasses();
15
16
  if (isSkeleton) {
16
17
  return /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 57, height: 30 });
@@ -18,9 +19,9 @@ function ActionFormIntro(props) {
18
19
  return /* @__PURE__ */ jsx(
19
20
  LoadingButton,
20
21
  {
21
- variant: "contained",
22
+ variant,
22
23
  type: "submit",
23
- color: "primary",
24
+ color,
24
25
  loading: isSubmitting,
25
26
  className: classes.actionFormIntro,
26
27
  ...props,
@@ -3,7 +3,7 @@ import { IconProps } from './types';
3
3
  * Provee de un medio por el cual se carga un icono svg en la plataforma web, aporta su versión provisional de carga en red.
4
4
  * @author Bruce Escobar - automatic
5
5
  * @createdAt 2024-10-22 19:08:59 - automatic
6
- * @updatedAt 2024-12-05 14:14:39 - automatic
7
- * @updatedUser SebastianM - automatic
6
+ * @updatedAt 2024-12-10 08:14:13 - automatic
7
+ * @updatedUser Bruce Escobar - automatic
8
8
  */
9
9
  export declare const Icon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -34,7 +34,7 @@
34
34
  * - Dynamically updates the fullscreen mode when the `fullScreen` prop changes.
35
35
  * @author cesar - automatic
36
36
  * @createdAt 2024-11-28 08:35:15 - automatic
37
- * @updatedAt 2024-12-06 11:53:51 - automatic
38
- * @updatedUser cesar - automatic
37
+ * @updatedAt 2024-12-10 08:14:13 - automatic
38
+ * @updatedUser Bruce Escobar - automatic
39
39
  */
40
40
  export declare const ModalDialog: () => import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,8 @@ const windowBaseStyles = {
3
3
  * Styles for the window base wrapper component.
4
4
  * @author cesar - automatic
5
5
  * @createdAt 2024-11-15 18:08:44 - automatic
6
- * @updatedAt 2024-12-06 14:42:54 - automatic
7
- * @updatedUser cesar - automatic
6
+ * @updatedAt 2024-12-10 08:14:13 - automatic
7
+ * @updatedUser Bruce Escobar - automatic
8
8
  */
9
9
  wrapperWindowBase: ({ theme, ownerState }) => ({
10
10
  height: "100%",
@@ -27,8 +27,8 @@ const windowBaseStyles = {
27
27
  * Styles for the content of the window base component.
28
28
  * @author cesar - automatic
29
29
  * @createdAt 2024-11-15 18:08:44 - automatic
30
- * @updatedAt 2024-12-06 14:42:54 - automatic
31
- * @updatedUser cesar - automatic
30
+ * @updatedAt 2024-12-10 08:14:13 - automatic
31
+ * @updatedUser Bruce Escobar - automatic
32
32
  */
33
33
  contentWindowBase: ({ theme }) => ({
34
34
  padding: theme.vars.size.baseSpacings.sp3,
@@ -38,8 +38,8 @@ const windowBaseStyles = {
38
38
  * Styles for the header of the window base component.
39
39
  * @author cesar - automatic
40
40
  * @createdAt 2024-11-15 18:08:44 - automatic
41
- * @updatedAt 2024-12-06 14:42:54 - automatic
42
- * @updatedUser cesar - automatic
41
+ * @updatedAt 2024-12-10 08:14:13 - automatic
42
+ * @updatedUser Bruce Escobar - automatic
43
43
  */
44
44
  headerWindowComponent: ({ theme, ownerState }) => ({
45
45
  width: "100%",
@@ -74,8 +74,8 @@ const windowBaseStyles = {
74
74
  * Styles for the content of the header of the window base component.
75
75
  * @author cesar - automatic
76
76
  * @createdAt 2024-11-15 18:08:44 - automatic
77
- * @updatedAt 2024-12-06 14:42:54 - automatic
78
- * @updatedUser cesar - automatic
77
+ * @updatedAt 2024-12-10 08:14:13 - automatic
78
+ * @updatedUser Bruce Escobar - automatic
79
79
  */
80
80
  headerContentWindowBase: ({ theme }) => ({
81
81
  display: "flex",
@@ -89,8 +89,8 @@ const windowBaseStyles = {
89
89
  * Styles for the title of the header of the window base component.
90
90
  * @author cesar - automatic
91
91
  * @createdAt 2024-11-15 18:08:44 - automatic
92
- * @updatedAt 2024-12-06 14:42:54 - automatic
93
- * @updatedUser cesar - automatic
92
+ * @updatedAt 2024-12-10 08:14:13 - automatic
93
+ * @updatedUser Bruce Escobar - automatic
94
94
  */
95
95
  headerTitleWindowBase: ({ theme }) => ({
96
96
  width: "auto",
@@ -101,8 +101,8 @@ const windowBaseStyles = {
101
101
  * Styles for the subtitle container of the header of the window base component.
102
102
  * @author cesar - automatic
103
103
  * @createdAt 2024-11-15 18:08:44 - automatic
104
- * @updatedAt 2024-12-06 14:42:54 - automatic
105
- * @updatedUser cesar - automatic
104
+ * @updatedAt 2024-12-10 08:14:13 - automatic
105
+ * @updatedUser Bruce Escobar - automatic
106
106
  */
107
107
  subtitleContainer: ({ theme }) => ({
108
108
  display: "flex",
@@ -116,8 +116,8 @@ const windowBaseStyles = {
116
116
  * @returns An object containing the styles for the dot window base component.
117
117
  * @author cesar - automatic
118
118
  * @createdAt 2024-11-22 19:40:23 - automatic
119
- * @updatedAt 2024-12-06 14:42:54 - automatic
120
- * @updatedUser cesar - automatic
119
+ * @updatedAt 2024-12-10 08:14:13 - automatic
120
+ * @updatedUser Bruce Escobar - automatic
121
121
  */
122
122
  pointWindowBase: ({ theme, ownerState }) => ({
123
123
  display: "flex",
@@ -143,8 +143,8 @@ const windowBaseStyles = {
143
143
  * Styles for the subtitle of the header of the window base component.
144
144
  * @author cesar - automatic
145
145
  * @createdAt 2024-11-15 18:08:44 - automatic
146
- * @updatedAt 2024-12-06 14:42:54 - automatic
147
- * @updatedUser cesar - automatic
146
+ * @updatedAt 2024-12-10 08:14:13 - automatic
147
+ * @updatedUser Bruce Escobar - automatic
148
148
  */
149
149
  headerSubTitleWindowBase: ({ theme }) => ({
150
150
  width: "auto !important",
@@ -155,8 +155,8 @@ const windowBaseStyles = {
155
155
  * Styles for the icon of the header of the window base component.
156
156
  * @author cesar - automatic
157
157
  * @createdAt 2024-11-18 08:11:19 - automatic
158
- * @updatedAt 2024-12-06 14:42:54 - automatic
159
- * @updatedUser cesar - automatic
158
+ * @updatedAt 2024-12-10 08:14:13 - automatic
159
+ * @updatedUser Bruce Escobar - automatic
160
160
  */
161
161
  headerIconWindowBase: ({ theme }) => ({
162
162
  display: "flex",
@@ -169,8 +169,8 @@ const windowBaseStyles = {
169
169
  * Styles for the icons wrapper of the window base component.
170
170
  * @author cesar - automatic
171
171
  * @createdAt 2024-11-18 08:11:19 - automatic
172
- * @updatedAt 2024-12-06 14:42:54 - automatic
173
- * @updatedUser cesar - automatic
172
+ * @updatedAt 2024-12-10 08:14:13 - automatic
173
+ * @updatedUser Bruce Escobar - automatic
174
174
  */
175
175
  iconsWrapperWindowBase: () => ({
176
176
  display: "flex",
@@ -180,8 +180,8 @@ const windowBaseStyles = {
180
180
  * Styles for the dot icon of the window base component.
181
181
  * @author cesar - automatic
182
182
  * @createdAt 2024-11-22 19:40:23 - automatic
183
- * @updatedAt 2024-12-06 14:42:54 - automatic
184
- * @updatedUser cesar - automatic
183
+ * @updatedAt 2024-12-10 08:14:13 - automatic
184
+ * @updatedUser Bruce Escobar - automatic
185
185
  */
186
186
  pointIcon: ({ theme, ownerState }) => ({
187
187
  color: theme.vars.palette.text.primary,
@@ -205,8 +205,8 @@ const windowBaseStyles = {
205
205
  * Styles for the menu actions of the window base component.
206
206
  * @author cesar - automatic
207
207
  * @createdAt 2024-12-05 07:49:27 - automatic
208
- * @updatedAt 2024-12-06 14:42:54 - automatic
209
- * @updatedUser cesar - automatic
208
+ * @updatedAt 2024-12-10 08:14:13 - automatic
209
+ * @updatedUser Bruce Escobar - automatic
210
210
  */
211
211
  menuActionsWindowBase: () => ({
212
212
  left: "-50px"
@@ -13,10 +13,10 @@ import { w as withRenderOption } from "../RenderOption/index.js";
13
13
  import { S as SkeletonRHFAutocomplete } from "../Skeleton/index.js";
14
14
  import { L as Label } from "../../../../Label/Label.js";
15
15
  import { T as Typography } from "../../../../mui_extended/Typography/Typography.js";
16
- import { C as CircularProgress } from "../../../../mui_extended/CircularProgress/CircularProgress.js";
17
16
  import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
18
17
  import { H as HelperError } from "../../../../HelperError/HelperError.js";
19
18
  import { I as Image } from "../../../../Image/Image.js";
19
+ import { C as CircularProgress } from "../../../../mui_extended/CircularProgress/CircularProgress.js";
20
20
  function ComponentTypeImage(props) {
21
21
  const {
22
22
  name: nameRHF,
@@ -1,5 +1,12 @@
1
1
  import { BadgeProps } from './types';
2
2
  /**
3
- * TODO: Documentar
3
+ * The Badge component renders a customizable badge that can display labels, counts, or status indicators.
4
+ * It supports various sizes, colors, and variants (e.g., standard or dot) to suit different use cases.
5
+ * @param {BadgeProps} props - Props for the `Badge` component.
6
+ * @returns JSX.Element - The rendered Badge component.
7
+ * @author cesar
8
+ * @createdAt 2024-12-03 11:11:02
9
+ * @updatedAt 2024-12-09 10:38:37 - automatic
10
+ * @updatedUser cesar - automatic
4
11
  */
5
12
  export declare const Badge: (props: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,36 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Badge as Badge$1 } from "@mui/material";
3
2
  import { B as BadgeRootStyled } from "./slots/BadgeSlots.js";
3
+ import clsx from "clsx";
4
+ import { g as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
5
+ import { B as BADGE_LABEL_KEY_COMPONENT } from "./constants.js";
6
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
4
7
  import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
8
+ import { B as BadgeSlots } from "./slots/BadgeEnum.js";
5
9
  const Badge = (props) => {
6
- const { children, size, dataTestId = "", ...others } = props;
10
+ const {
11
+ color = "default",
12
+ size = "medium",
13
+ variant = "standard",
14
+ dataTestId,
15
+ children,
16
+ ...others
17
+ } = props;
7
18
  const { currentSize } = useComponentSize(size);
19
+ const normalizedSize = currentSize === "large" ? "medium" : currentSize;
20
+ const ownerState = {
21
+ BadgeColor: color,
22
+ BadgeVariant: variant,
23
+ BadgeSize: normalizedSize
24
+ };
8
25
  return /* @__PURE__ */ jsx(
9
26
  BadgeRootStyled,
10
27
  {
11
- ownerState: { size: currentSize },
12
- children: /* @__PURE__ */ jsx(Badge$1, { ...others, children })
28
+ role: "badge-role",
29
+ className: clsx(getComponentSlotRoot(BADGE_LABEL_KEY_COMPONENT)),
30
+ ...getPropDataTestId(BADGE_LABEL_KEY_COMPONENT, BadgeSlots.rootBadge, dataTestId),
31
+ ownerState,
32
+ ...others,
33
+ children
13
34
  }
14
35
  );
15
36
  };
@@ -1,6 +1,60 @@
1
1
  const badgeStyles = {
2
- rootBadge: () => ({
3
- // No data to appply
2
+ /**
3
+ * Badge Root Styles
4
+ * @author cesar - automatic
5
+ * @createdAt 2024-12-03 11:11:02 - automatic
6
+ * @updatedAt 2024-12-05 14:50:10 - automatic
7
+ * @updatedUser cesar - automatic
8
+ */
9
+ rootBadge: ({ theme, ownerState }) => ({
10
+ "& .MuiBadge-badge": {
11
+ display: "flex",
12
+ justifyContent: "center",
13
+ alignItems: "center",
14
+ flexShrink: 0,
15
+ padding: theme.vars.size.baseSpacings.sp1,
16
+ height: theme.vars.size.baseSpacings["sp3-5"],
17
+ width: theme.vars.size.baseSpacings["sp3-5"],
18
+ minWidth: theme.vars.size.baseSpacings["sp3-5"],
19
+ minHeight: theme.vars.size.baseSpacings["sp3-5"],
20
+ // Colores dinámicos basados en el estado
21
+ color: theme.palette[ownerState.BadgeColor || "default"].contrastText,
22
+ backgroundColor: theme.palette[ownerState.BadgeColor || "default"].light,
23
+ // Tamaño dinámico basado en `BadgeSize` y si es móvil
24
+ ...theme.generalSettings.isMobile ? {
25
+ ...ownerState.BadgeSize === "small" && {
26
+ height: theme.vars.size.mobile.small.base,
27
+ minWidth: theme.vars.size.mobile.small.base,
28
+ fontSize: theme.vars.size.typography.mobile.small.body.fontSize
29
+ },
30
+ ...ownerState.BadgeSize === "medium" && {
31
+ height: theme.vars.size.mobile.medium.base,
32
+ minWidth: theme.vars.size.mobile.medium.base,
33
+ fontSize: theme.vars.size.typography.mobile.medium.body.fontSize
34
+ }
35
+ } : {
36
+ ...ownerState.BadgeSize === "small" && {
37
+ height: theme.vars.size.desktop.small.base,
38
+ minWidth: theme.vars.size.desktop.small.base,
39
+ fontSize: theme.vars.size.typography.desktop.small.body.fontSize
40
+ },
41
+ ...ownerState.BadgeSize === "medium" && {
42
+ height: theme.vars.size.desktop.medium.base,
43
+ minWidth: theme.vars.size.desktop.medium.base,
44
+ fontSize: theme.vars.size.typography.desktop.medium.body.fontSize
45
+ }
46
+ },
47
+ // Estilos para variantes
48
+ ...ownerState.BadgeVariant === "dot" && {
49
+ height: ownerState.BadgeSize === "small" && theme.vars.size.baseSpacings.sp2,
50
+ width: ownerState.BadgeSize === "small" && theme.vars.size.baseSpacings.sp2,
51
+ minWidth: ownerState.BadgeSize === "small" && theme.vars.size.baseSpacings.sp2,
52
+ minHeight: ownerState.BadgeSize === "small" && theme.vars.size.baseSpacings.sp2,
53
+ borderRadius: "50%",
54
+ fontSize: 0
55
+ },
56
+ borderRadius: "50%"
57
+ }
4
58
  })
5
59
  };
6
60
  export {
@@ -1,2 +1,6 @@
1
- export { Badge } from './Badge';
2
- export type { BadgeProps } from './types';
1
+ export * from './Badge.styles';
2
+ export * from './Badge';
3
+ export * from './constants';
4
+ export * from './slots/BadgeEnum';
5
+ export * from './slots/BadgeSlots';
6
+ export * from './types';
@@ -1,5 +1,5 @@
1
1
  export declare const BadgeRootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').BadgeOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
2
2
  ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
3
- }, "children" | "components" | "color" | "style" | "variant" | "className" | "classes" | "sx" | "slots" | "slotProps" | "componentsProps" | "invisible" | "max" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero">, "children" | "ref" | "title" | "id" | "components" | "hidden" | "color" | "content" | "style" | "variant" | "className" | "classes" | "onChange" | "sx" | "translate" | "slots" | "slotProps" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "componentsProps" | "invisible" | "max" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').BadgeOwnerState> & Record<string, unknown> & {
4
- ownerState: Partial<import('../types').BadgeOwnerState> & Record<string, unknown>;
3
+ }, "children" | "components" | "color" | "style" | "variant" | "className" | "classes" | "sx" | "slots" | "slotProps" | "componentsProps" | "invisible" | "max" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero">, "children" | "ref" | "title" | "id" | "components" | "hidden" | "color" | "content" | "style" | "variant" | "className" | "classes" | "onChange" | "sx" | "translate" | "slots" | "slotProps" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "componentsProps" | "invisible" | "max" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('..').BadgeOwnerState> & Record<string, unknown> & {
4
+ ownerState: Partial<import('..').BadgeOwnerState> & Record<string, unknown>;
5
5
  }, {}, {}>;
@@ -3,11 +3,17 @@ import { Theme } from '@mui/material/styles';
3
3
  import { BADGE_LABEL_KEY_COMPONENT } from './constants';
4
4
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
5
5
  import { BadgeSlots } from './slots';
6
- import { Sizes } from '@m4l/styles';
6
+ import { ComponentPalletColor, Sizes } from '@m4l/styles';
7
7
  export interface BadgeProps extends MUIBadgeProps {
8
8
  dataTestId?: string;
9
- size?: Sizes;
9
+ variant?: 'standard' | 'dot' | undefined;
10
+ size?: Extract<Sizes, 'small' | 'medium'>;
11
+ color?: ComponentPalletColor;
10
12
  }
11
13
  export type BadgeSlotsType = keyof typeof BadgeSlots;
12
- export type BadgeOwnerState = {};
14
+ export type BadgeOwnerState = {
15
+ BadgeColor?: BadgeProps['color'];
16
+ BadgeVariant?: BadgeProps['variant'];
17
+ BadgeSize?: BadgeProps['size'];
18
+ };
13
19
  export type BadgeStyles = Partial<OverridesStyleRules<BadgeSlotsType, typeof BADGE_LABEL_KEY_COMPONENT, Theme> | undefined> | undefined;
@@ -1,8 +1,8 @@
1
1
  import { styled, CircularProgress } from "@mui/material";
2
+ import { S as Skeleton } from "../../Skeleton/Skeleton.js";
2
3
  import { c as circularProgressStyles } from "../CircularProgress.styles.js";
3
4
  import { a as CIRCULAR_PROGRESS_KEY_COMPONENT } from "../constants.js";
4
5
  import { C as CircularProgressSlots } from "./CircularProgressEnum.js";
5
- import { S as Skeleton } from "../../Skeleton/Skeleton.js";
6
6
  const RootStyled = styled(CircularProgress, {
7
7
  name: CIRCULAR_PROGRESS_KEY_COMPONENT,
8
8
  slot: CircularProgressSlots.root
@@ -3,8 +3,8 @@ const dialogStyles = {
3
3
  * Dialog Root style
4
4
  * @author cesar - automatic
5
5
  * @createdAt 2024-11-24 15:58:24 - automatic
6
- * @updatedAt 2024-12-05 17:01:44 - automatic
7
- * @updatedUser cesar - automatic
6
+ * @updatedAt 2024-12-10 08:14:13 - automatic
7
+ * @updatedUser Bruce Escobar - automatic
8
8
  */
9
9
  dialogRoot: ({ theme }) => ({
10
10
  background: theme.vars.palette.background.backdrop,
@@ -0,0 +1,5 @@
1
+ import { LoadingButtonProps } from './types';
2
+ /**
3
+ * Componente LoadingButton que extiende las props de Button
4
+ */
5
+ export declare const LoadingButton: import('react').ForwardRefExoticComponent<Omit<LoadingButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,93 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { forwardRef } from "react";
4
+ import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
5
+ import { useTheme } from "@mui/material";
6
+ import { S as SkeletonLoadingButtonStyled, L as LoadingButtonRootStyled, T as TextLoadingButtonStyled, C as CircularProgressStyled, a as LoadingButtonIconStyled } from "./slots/LoadingButtonSlots.js";
7
+ import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
8
+ const LoadingButton = forwardRef((props, ref) => {
9
+ const {
10
+ className,
11
+ endIcon,
12
+ label,
13
+ startIcon,
14
+ color = "default",
15
+ disabled = false,
16
+ size = "small",
17
+ variant = "contained",
18
+ skeletonWidth = "100%",
19
+ loading = false,
20
+ ...others
21
+ } = props;
22
+ const { currentSize } = useComponentSize(size);
23
+ const isSkeleton = useModuleSkeleton();
24
+ const theme = useTheme();
25
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
26
+ const paletteColor = getPropertyByString(
27
+ theme.vars.palette,
28
+ disabled ? "default" : color || "default",
29
+ theme.vars.palette.default
30
+ );
31
+ const ownerState = {
32
+ size,
33
+ variant,
34
+ disabled,
35
+ paletteColor,
36
+ color,
37
+ loading
38
+ };
39
+ if (isSkeleton) {
40
+ return /* @__PURE__ */ jsx(SkeletonLoadingButtonStyled, { "data-testid": "SkeletonButton", width: skeletonWidth, ownerState: { ...ownerState } });
41
+ }
42
+ const getAdjustedColor = (btnColor, btnVariant) => {
43
+ return btnVariant === "contained" ? `${btnColor}.contrastText` : `${btnColor}.main`;
44
+ };
45
+ const adjustedColor = getAdjustedColor(color, variant);
46
+ const renderIcon = (icon, instaceDataTestId) => {
47
+ if (!icon) {
48
+ return null;
49
+ }
50
+ if (typeof icon !== "string") {
51
+ return icon;
52
+ } else {
53
+ return /* @__PURE__ */ jsx(
54
+ LoadingButtonIconStyled,
55
+ {
56
+ color: adjustedColor,
57
+ ownerState: { ...ownerState },
58
+ src: icon,
59
+ alt: "icon",
60
+ size: adjustedSize,
61
+ disabled: loading || disabled,
62
+ instaceDataTestId,
63
+ className: clsx(className)
64
+ }
65
+ );
66
+ }
67
+ };
68
+ return /* @__PURE__ */ jsxs(
69
+ LoadingButtonRootStyled,
70
+ {
71
+ "aria-disabled": disabled,
72
+ role: "button",
73
+ startIcon: renderIcon(startIcon, "LoadingButtonStartIcon"),
74
+ endIcon: renderIcon(endIcon, "LoadingButtonEndIcon"),
75
+ className: clsx(className),
76
+ variant,
77
+ size,
78
+ disabled: loading || disabled,
79
+ disableRipple: true,
80
+ ownerState: { ...ownerState },
81
+ ref,
82
+ ...others,
83
+ children: [
84
+ /* @__PURE__ */ jsx(TextLoadingButtonStyled, { ownerState: { ...ownerState }, color: adjustedColor, children: label }),
85
+ loading === true && /* @__PURE__ */ jsx(CircularProgressStyled, { ownerState: { ...ownerState }, size: adjustedSize })
86
+ ]
87
+ }
88
+ );
89
+ });
90
+ LoadingButton.displayName = "LoadingButton";
91
+ export {
92
+ LoadingButton as L
93
+ };
@@ -0,0 +1,5 @@
1
+ import { LoadingButtonStyles } from './types';
2
+ /**
3
+ * Objeto que contiene todos los estilos para el componente LoadingButton.
4
+ */
5
+ export declare const loadingButtonStyles: LoadingButtonStyles;