@m4l/components 8.2.0-beta.devDaniel.MenuActionsBug → 8.2.0-beta.devDaniel.Tab

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 (76) hide show
  1. package/@types/export.d.ts +3 -3
  2. package/@types/types.d.ts +12 -1
  3. package/components/AccountPopover/classes/index.d.ts +1 -1
  4. package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.js +3 -3
  5. package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.js +10 -10
  6. package/components/SideBar/classes/index.d.ts +1 -1
  7. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.js +2 -2
  8. package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
  9. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.js +3 -3
  10. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.js +3 -3
  11. package/components/extended/react-resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
  12. package/components/extended/react-resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
  13. package/components/hook-form/RHFAutocomplete/subcomponents/ComponentTypeImage/index.js +1 -1
  14. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  15. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.js +2 -2
  16. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/index.js +1 -1
  17. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +1 -1
  18. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.js +5 -5
  19. package/components/modal/classes/index.d.ts +2 -2
  20. package/components/mui_extended/MenuActions/MenuActions.d.ts +1 -8
  21. package/components/mui_extended/MenuActions/MenuActions.js +77 -55
  22. package/components/mui_extended/MenuActions/MenuActions.stories.d.ts +25 -0
  23. package/components/mui_extended/MenuActions/MenuActions.styles.d.ts +0 -4
  24. package/components/mui_extended/MenuActions/MenuActions.styles.js +38 -11
  25. package/components/mui_extended/MenuActions/constants.d.ts +0 -17
  26. package/components/mui_extended/MenuActions/constants.js +2 -6
  27. package/components/mui_extended/MenuActions/dictionary.d.ts +0 -15
  28. package/components/mui_extended/MenuActions/slots/MenuActionsEnum.d.ts +5 -8
  29. package/components/mui_extended/MenuActions/slots/MenuActionsEnum.js +4 -1
  30. package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +16 -29
  31. package/components/mui_extended/MenuActions/slots/MenuActionsSlots.js +33 -16
  32. package/components/mui_extended/MenuActions/types.d.ts +18 -80
  33. package/components/mui_extended/Pager/classes/index.d.ts +1 -1
  34. package/components/mui_extended/Select/slots/SelectSlots.d.ts +1 -1
  35. package/components/mui_extended/Tab/Slots/TabEnum.d.ts +9 -0
  36. package/components/mui_extended/Tab/Slots/TabEnum.js +9 -0
  37. package/components/mui_extended/Tab/Slots/TabSlots.d.ts +26 -0
  38. package/components/mui_extended/Tab/Slots/TabSlots.js +24 -0
  39. package/components/mui_extended/Tab/Slots/index.d.ts +2 -0
  40. package/components/mui_extended/Tab/Tab.d.ts +5 -0
  41. package/components/mui_extended/Tab/Tab.js +67 -0
  42. package/components/mui_extended/Tab/Tab.styles.d.ts +5 -0
  43. package/components/mui_extended/Tab/Tab.styles.js +147 -0
  44. package/components/mui_extended/Tab/constants.d.ts +14 -0
  45. package/components/mui_extended/Tab/constants.js +10 -0
  46. package/components/mui_extended/Tab/index.d.ts +1 -5
  47. package/components/mui_extended/Tab/types.d.ts +53 -2
  48. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
  49. package/components/mui_extended/index.d.ts +1 -1
  50. package/index.js +1 -1
  51. package/package.json +1 -1
  52. package/storybook/components/extended/mui/Tab/stories/Tab.disable.stories.d.ts +36 -0
  53. package/storybook/components/extended/mui/Tab/stories/Tab.enable.stories.d.ts +36 -0
  54. package/storybook/components/extended/mui/Tab/stories/Tab.sizes.stories.d.ts +28 -0
  55. package/storybook/components/extended/mui/Tab/stories/Tab.skeleton.stories.d.ts +32 -0
  56. package/components/mui_extended/MenuActions/stories/MenuActions.default.stories.d.ts +0 -25
  57. package/components/mui_extended/MenuActions/stories/MenuActions.othersProps.stories.d.ts +0 -13
  58. package/components/mui_extended/MenuItem/MenuItem.js +0 -66
  59. package/components/mui_extended/MenuItem/MenuItem.styles.js +0 -111
  60. package/components/mui_extended/MenuItem/constants.js +0 -4
  61. package/components/mui_extended/MenuItem/slots/MenuItemEnum.js +0 -9
  62. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +0 -24
  63. package/components/mui_extended/MenuItem/types.js +0 -1
  64. package/components/mui_extended/Tab/classes/constants.d.ts +0 -1
  65. package/components/mui_extended/Tab/classes/constants.js +0 -4
  66. package/components/mui_extended/Tab/classes/index.d.ts +0 -10
  67. package/components/mui_extended/Tab/classes/index.js +0 -25
  68. package/components/mui_extended/Tab/classes/types.d.ts +0 -7
  69. package/components/mui_extended/Tab/constant.d.ts +0 -1
  70. package/components/mui_extended/Tab/constant.js +0 -4
  71. package/components/mui_extended/Tab/index.js +0 -40
  72. package/components/mui_extended/Tab/styles.d.ts +0 -2
  73. package/components/mui_extended/Tab/styles.js +0 -11
  74. package/components/mui_extended/Tab/tests/index.test.d.ts +0 -1
  75. package/components/mui_extended/Tab/tests/utils.d.ts +0 -2
  76. /package/components/mui_extended/{MenuItem → Tab/Slots}/index.js +0 -0
@@ -0,0 +1,67 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
4
+ import { useTheme } from "@mui/material";
5
+ import { a as TYPOGRAPHY_KEY, b as TAB_SPECIFY, I as ICON_KEY } from "./constants.js";
6
+ import { useRef, useMemo } from "react";
7
+ import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
8
+ import { R as RootStyled, T as TypographyStyled, I as IconStyled } from "./Slots/TabSlots.js";
9
+ function Tab(props) {
10
+ const {
11
+ SKTWidth,
12
+ SKTHeight,
13
+ size = "medium",
14
+ // Tamaño del tab, por defecto 'medium'.
15
+ disabled,
16
+ // Indica si el tab está deshabilitado.
17
+ label,
18
+ // Texto que se muestra en el tab.
19
+ urlIcon,
20
+ // URL del icono a mostrar en el tab.
21
+ value,
22
+ ...other
23
+ // Otras propiedades que se pasan al componente.
24
+ } = props;
25
+ const refMuiTab = useRef(null);
26
+ const isSelected = useMemo(() => {
27
+ if (refMuiTab.current) {
28
+ return refMuiTab.current?.classList?.contains("Mui-selected");
29
+ }
30
+ return false;
31
+ }, [refMuiTab.current]);
32
+ const { currentSize } = useComponentSize(size);
33
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
34
+ const isSkeleton = useModuleSkeleton();
35
+ const theme = useTheme();
36
+ const paletteColor = getPropertyByString(theme.vars.palette, disabled || !isSelected || isSkeleton ? "default" : "primary", theme.vars.palette.default);
37
+ const OwnerState = {
38
+ paletteColor,
39
+ size: adjustedSize,
40
+ disabled,
41
+ skeleton: isSkeleton
42
+ };
43
+ return /* @__PURE__ */ jsx(
44
+ RootStyled,
45
+ {
46
+ ref: refMuiTab,
47
+ label: label ? /* @__PURE__ */ jsx(TypographyStyled, { className: clsx(TYPOGRAPHY_KEY, TAB_SPECIFY), skeletonWidth: 40, ownerState: { OwnerState }, variant: "body", children: label }) : void 0,
48
+ disabled,
49
+ ownerState: { ...OwnerState },
50
+ icon: urlIcon ? /* @__PURE__ */ jsx(
51
+ IconStyled,
52
+ {
53
+ className: clsx(ICON_KEY, TAB_SPECIFY),
54
+ ownerState: { OwnerState },
55
+ src: urlIcon,
56
+ size
57
+ }
58
+ ) : void 0,
59
+ value,
60
+ tabIndex: 0,
61
+ ...other
62
+ }
63
+ );
64
+ }
65
+ export {
66
+ Tab as T
67
+ };
@@ -0,0 +1,5 @@
1
+ import { TabStyles } from './types';
2
+ /**
3
+ * Estilos personalizados para el componente Tab de Material-UI.
4
+ */
5
+ export declare const tabStyles: TabStyles;
@@ -0,0 +1,147 @@
1
+ const tabStyles = {
2
+ /**
3
+ * Slot Raíz: Estilos para el contenedor principal del componente Tab.
4
+ */
5
+ root: ({ theme, ownerState }) => ({
6
+ // Estructura y layout básico
7
+ display: "flex",
8
+ flexDirection: "row",
9
+ alignItems: "center",
10
+ width: "fit-content",
11
+ minHeight: "fit-content",
12
+ minWidth: "fit-content",
13
+ gap: theme.vars.size.baseSpacings.sp1,
14
+ opacity: 1,
15
+ overflow: "visible",
16
+ // Bordes y radio de borde
17
+ border: theme.vars.size.borderStroke.container,
18
+ borderColor: "transparent",
19
+ borderBottom: 0,
20
+ borderTopLeftRadius: `calc(${theme.vars.size.borderRadius.r1} - 1px)`,
21
+ borderTopRightRadius: `calc(${theme.vars.size.borderRadius.r1} - 1px)`,
22
+ boxSizing: "border-box",
23
+ // Padding
24
+ paddingTop: 0,
25
+ paddingBottom: 0,
26
+ paddingLeft: theme.vars.size.baseSpacings.sp2,
27
+ paddingRight: theme.vars.size.baseSpacings.sp2,
28
+ position: "relative",
29
+ // Altura para vista móvil y de escritorio basada en el tamaño
30
+ ...theme.generalSettings.isMobile ? {
31
+ ...ownerState.size === "medium" && {
32
+ height: theme.vars.size.mobile.medium.container
33
+ },
34
+ ...ownerState.size === "small" && {
35
+ height: theme.vars.size.mobile.small.container
36
+ }
37
+ } : {
38
+ ...ownerState.size === "medium" && {
39
+ height: theme.vars.size.desktop.medium.container
40
+ },
41
+ ...ownerState.size === "small" && {
42
+ height: theme.vars.size.desktop.small.container
43
+ }
44
+ },
45
+ // Ajuste de alineación del icono
46
+ "& .MuiTab-iconWrapper": {
47
+ marginBottom: 1
48
+ },
49
+ /**
50
+ * **Pseudoclases**:
51
+ * - Estilos para los estados hover, focus-visible y active.
52
+ */
53
+ "&:hover": {
54
+ background: theme.vars.palette.background.hover
55
+ },
56
+ "&:focus-visible": {
57
+ background: ownerState.paletteColor?.hoverOpacity,
58
+ "&::before": {
59
+ content: '""',
60
+ position: "absolute",
61
+ top: `-${theme.size.baseSpacings.sp1}`,
62
+ left: `-${theme.size.baseSpacings.sp1}`,
63
+ right: `-${theme.size.baseSpacings.sp1}`,
64
+ bottom: 0,
65
+ boxSizing: "border-box",
66
+ border: theme.vars.size.borderStroke.container,
67
+ borderBottom: 0,
68
+ borderColor: theme.vars.palette.border.main,
69
+ borderRadius: theme.vars.size.borderRadius.r1,
70
+ borderBottomRightRadius: 0,
71
+ borderBottomLeftRadius: 0
72
+ }
73
+ },
74
+ "&:active": {
75
+ background: ownerState.paletteColor?.activeOpacity
76
+ },
77
+ /**
78
+ * **Estado Seleccionado**:
79
+ * - Estilos aplicados cuando la pestaña está en estado seleccionado (`.Mui-selected`).
80
+ * - Incluye estilos específicos para el icono y la tipografía.
81
+ */
82
+ "&.Mui-selected": {
83
+ border: theme.vars.size.borderStroke.container,
84
+ borderColor: theme.vars.palette.border.secondary,
85
+ borderBottom: 0,
86
+ ".icon.M4lclassCssSpecificity div": {
87
+ backgroundColor: !ownerState.disabled ? ownerState.paletteColor?.main : theme.vars.palette.text.secondary
88
+ },
89
+ "span": {
90
+ color: !ownerState.disabled ? ownerState.paletteColor?.main : theme.vars.palette.text.secondary
91
+ },
92
+ // Efecto ripple en estado seleccionado
93
+ "& .MuiTouchRipple-root": {
94
+ borderTopLeftRadius: theme.vars.size.baseSpacings["sp0-5"],
95
+ borderTopRightRadius: theme.vars.size.baseSpacings["sp0-5"]
96
+ },
97
+ "&::after": {
98
+ content: '""',
99
+ width: "70%",
100
+ transform: "translateX(20%)",
101
+ height: theme.vars.size.borderRadius["r0-5"],
102
+ left: 0,
103
+ top: -1,
104
+ backgroundColor: ownerState.skeleton ? theme.vars.palette.background.surface : ownerState.disabled ? theme.vars.palette.background.surface : ownerState.paletteColor?.main,
105
+ borderEndStartRadius: theme.vars.size.borderRadius["r0-5"],
106
+ borderEndEndRadius: theme.vars.size.borderRadius["r0-5"],
107
+ position: "absolute"
108
+ }
109
+ },
110
+ "&.Mui-selected:hover": {
111
+ backgroundColor: ownerState.paletteColor?.hoverOpacity
112
+ },
113
+ "&.Mui-selected:active": {
114
+ background: ownerState.paletteColor?.activeOpacity,
115
+ ".icon.M4lclassCssSpecificity div": {
116
+ backgroundColor: ownerState.paletteColor?.active
117
+ },
118
+ "span": {
119
+ color: ownerState.paletteColor?.active
120
+ },
121
+ "&::after": {
122
+ background: ownerState.paletteColor?.active
123
+ }
124
+ }
125
+ }),
126
+ /**
127
+ * Slot de Icono:
128
+ * - **Estilos Generales**: Configura el color base del ícono, con especificidad adicional para clases específicas.
129
+ */
130
+ icon: ({ theme }) => ({
131
+ "&.M4lclassCssSpecificity div": {
132
+ backgroundColor: theme.vars.palette.text.secondary
133
+ }
134
+ }),
135
+ /**
136
+ * Slot de Tipografía:
137
+ * - **Estilos Generales**: Configura el color base del texto, aplicando especificidad para clases específicas.
138
+ */
139
+ tipography: ({ theme }) => ({
140
+ "&.M4lclassCssSpecificity": {
141
+ color: theme.vars.palette.text.secondary
142
+ }
143
+ })
144
+ };
145
+ export {
146
+ tabStyles as t
147
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Nombre de clase que se usa para dar identidad a los slots del componente.
3
+ */
4
+ export declare const TAB_KEY_COMPONENT = "M4LTab";
5
+ /**
6
+ * Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
7
+ * tener la necesidad de agregar valores en !important.
8
+ */
9
+ export declare const TAB_SPECIFY = "M4lclassCssSpecificity";
10
+ /**
11
+ *
12
+ */
13
+ export declare const TYPOGRAPHY_KEY = "tipography";
14
+ export declare const ICON_KEY = "icon";
@@ -0,0 +1,10 @@
1
+ const TAB_KEY_COMPONENT = "M4LTab";
2
+ const TAB_SPECIFY = "M4lclassCssSpecificity";
3
+ const TYPOGRAPHY_KEY = "tipography";
4
+ const ICON_KEY = "icon";
5
+ export {
6
+ ICON_KEY as I,
7
+ TAB_KEY_COMPONENT as T,
8
+ TYPOGRAPHY_KEY as a,
9
+ TAB_SPECIFY as b
10
+ };
@@ -1,5 +1 @@
1
- import { TabProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export declare function Tab(props: TabProps): import("react/jsx-runtime").JSX.Element;
1
+ export * from './Tab';
@@ -1,6 +1,57 @@
1
- import { TabProps as MUITabProps } from '@mui/material';
2
- export interface TabProps extends MUITabProps {
1
+ import { TabProps as MUITabProps, PaletteColor, Theme } from '@mui/material';
2
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
3
+ import { Sizes } from '@m4l/styles';
4
+ import { TabSlots } from './Slots/TabEnum';
5
+ import { TAB_KEY_COMPONENT } from './constants';
6
+ /**
7
+ * Propiedades personalizadas para el componente `Tab`, extendiendo algunas propiedades de MUI.
8
+ */
9
+ export interface TabProps extends Omit<MUITabProps, 'size' | 'label' | 'color'> {
10
+ /**
11
+ * Anchura del componente en estado Skeleton.
12
+ * Puede ser un valor numérico o un string con unidades CSS (por ejemplo, `px`, `%`, etc.).
13
+ */
3
14
  SKTWidth: string | number;
15
+ /**
16
+ * Altura del componente en estado Skeleton.
17
+ * Puede ser un valor numérico o un string con unidades CSS (por ejemplo, `px`, `%`, etc.).
18
+ */
4
19
  SKTHeight: string | number;
20
+ /**
21
+ * Identificador único para pruebas unitarias.
22
+ */
5
23
  dataTestId?: string;
24
+ /**
25
+ * Tamaño del `Tab`, limitado a los valores `small` o `medium`.
26
+ */
27
+ size?: Extract<Sizes, 'small' | 'medium'>;
28
+ /**
29
+ * URL del icono a mostrar en el `Tab`.
30
+ */
31
+ urlIcon?: string;
32
+ /**
33
+ * Texto a mostrar en el `Tab`.
34
+ */
35
+ label?: string;
6
36
  }
37
+ /**
38
+ * Tipo de slot del `Tab`, basado en las opciones definidas en `TabSlots`.
39
+ */
40
+ export type TabSlotsType = keyof typeof TabSlots;
41
+ /**
42
+ * Estado interno del propietario del `Tab`.
43
+ */
44
+ export interface TabOwnerState extends Pick<TabProps, 'size' | 'disabled'> {
45
+ /**
46
+ * Indica si el `Tab` está en estado Skeleton.
47
+ */
48
+ skeleton: boolean;
49
+ /**
50
+ * Color de la paleta asociado al `Tab`.
51
+ */
52
+ paletteColor: PaletteColor;
53
+ }
54
+ /**
55
+ * Estilos personalizados para el `Tab`, sobreescribiendo las reglas de estilo.
56
+ */
57
+ export type TabStyles = Partial<OverridesStyleRules<TabSlots, typeof TAB_KEY_COMPONENT, Theme> | undefined> | undefined;
@@ -1,6 +1,6 @@
1
1
  export declare const MuiTextFieldStyled: import('@emotion/styled').StyledComponent<Pick<{
2
2
  variant?: import('@mui/material').TextFieldVariants | undefined;
3
- } & Omit<import('@mui/material').FilledTextFieldProps | import('@mui/material').OutlinedTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant">, "children" | "value" | "ref" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "margin" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "onChange" | "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" | "label" | "key" | "autoComplete" | "placeholder" | "required" | "fullWidth" | "maxRows" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps" | "inputProps" | "inputRef" | "multiline" | "minRows" | "SelectProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
3
+ } & Omit<import('@mui/material').FilledTextFieldProps | import('@mui/material').OutlinedTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant">, "children" | "value" | "ref" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "margin" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "onChange" | "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" | "label" | "key" | "autoComplete" | "placeholder" | "required" | "fullWidth" | "inputProps" | "inputRef" | "SelectProps" | "multiline" | "maxRows" | "minRows" | "hiddenLabel" | "focused" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
4
4
  ownerState: Partial<import('../types').OwnerState> & Record<string, unknown>;
5
5
  }, {}, {}>;
6
6
  export declare const TextFieldRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').OwnerState> & Record<string, unknown> & {
@@ -24,7 +24,7 @@ export * from './TabContent';
24
24
  export { Pager } from './Pager';
25
25
  export type { PagerProps } from './Pager/types';
26
26
  export { getPagerComponentsDictionary } from './Pager/dicctionary';
27
- export { Tab } from './Tab';
27
+ export { Tab } from './Tab/Tab';
28
28
  export * from './TabContext';
29
29
  export * from './Typography/Typography';
30
30
  export * from './ToggleButton';
package/index.js CHANGED
@@ -151,7 +151,7 @@ import { L as L9 } from "./components/mui_extended/LinkWithRoute/index.js";
151
151
  import { L as L10 } from "./components/mui_extended/LoadingButton/index.js";
152
152
  import { P as P13 } from "./components/mui_extended/Pager/index.js";
153
153
  import { g as g26 } from "./components/mui_extended/Pager/dicctionary.js";
154
- import { T as T5 } from "./components/mui_extended/Tab/index.js";
154
+ import { T as T5 } from "./components/mui_extended/Tab/Tab.js";
155
155
  import { a as a9 } from "./components/mui_extended/MenuActions/dictionary.js";
156
156
  import { a as a10, M as M11 } from "./components/mui_extended/MenuActions/MenuActions.js";
157
157
  import { T as T6 } from "./components/mui_extended/Tooltip/Tooltip.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "8.2.0-beta.devDaniel.MenuActionsBug",
3
+ "version": "8.2.0-beta.devDaniel.Tab",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -0,0 +1,36 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tab } from '../../../../../../src/components/mui_extended/Tab';
3
+ /**
4
+ * Información meta para Storybook del componente `Tab`, en la variante deshabilitada.
5
+ */
6
+ declare const meta: Meta<typeof Tab>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof Tab>;
9
+ /**
10
+ * Historia `Base`: Tab deshabilitado con icono, texto, y sin efecto ripple.
11
+ */
12
+ export declare const Base: Story;
13
+ /**
14
+ * Historia `DisabledActiveWithIconAndText`: Tab activo, deshabilitado, con icono y texto.
15
+ */
16
+ export declare const DisabledActiveWithIconAndText: Story;
17
+ /**
18
+ * Historia `DisabledActiveWithText`: Tab activo, deshabilitado, solo con texto.
19
+ */
20
+ export declare const DisabledActiveWithText: Story;
21
+ /**
22
+ * Historia `DisabledActiveWithIcon`: Tab activo, deshabilitado, solo con icono.
23
+ */
24
+ export declare const DisabledActiveWithIcon: Story;
25
+ /**
26
+ * Historia `DisabledDefaultWithIconAndText`: Tab por defecto, deshabilitado, con icono y texto.
27
+ */
28
+ export declare const DisabledDefaultWithIconAndText: Story;
29
+ /**
30
+ * Historia `DisabledDefaultActiveWithText`: Tab por defecto activo, deshabilitado, solo con texto.
31
+ */
32
+ export declare const DisabledDefaultActiveWithText: Story;
33
+ /**
34
+ * Historia `DisabledDefaultActiveWithIcon`: Tab por defecto activo, deshabilitado, solo con icono.
35
+ */
36
+ export declare const DisabledDefaultActiveWithIcon: Story;
@@ -0,0 +1,36 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tab } from '../../../../../../src/components/mui_extended/Tab';
3
+ /**
4
+ * The Tab component groups related content, enabling navigation without leaving the page.
5
+ */
6
+ declare const meta: Meta<typeof Tab>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof Tab>;
9
+ /**
10
+ * Base tab component with icon and text
11
+ */
12
+ export declare const Base: Story;
13
+ /**
14
+ * Active Tab with icon and text
15
+ */
16
+ export declare const ActiveWithIconAndText: Story;
17
+ /**
18
+ * Active Tab with text only
19
+ */
20
+ export declare const ActiveWithText: Story;
21
+ /**
22
+ * Active Tab with icon only
23
+ */
24
+ export declare const ActiveWithIcon: Story;
25
+ /**
26
+ * Default Tab with icon and text
27
+ */
28
+ export declare const DefaultWithIconAndText: Story;
29
+ /**
30
+ * Default active Tab with text only
31
+ */
32
+ export declare const DefaultActiveWithText: Story;
33
+ /**
34
+ * Default active Tab with icon only
35
+ */
36
+ export declare const DefaultActiveWithIcon: Story;
@@ -0,0 +1,28 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tab } from '../../../../../../src/components/mui_extended/Tab';
3
+ /**
4
+ * El componente Tab agrupa contenido relacionado y permite la navegación sin salir de la página.
5
+ */
6
+ declare const meta: Meta<typeof Tab>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof Tab>;
9
+ /**
10
+ * Tab base con icono y tamaño mediano, estilo seleccionado (activo).
11
+ */
12
+ export declare const Base: Story;
13
+ /**
14
+ * Tab activo de tamaño pequeño con icono.
15
+ */
16
+ export declare const SmallActive: Story;
17
+ /**
18
+ * Tab activo de tamaño mediano con icono.
19
+ */
20
+ export declare const MediumActive: Story;
21
+ /**
22
+ * Tab por defecto de tamaño pequeño con icono.
23
+ */
24
+ export declare const SmallDefault: Story;
25
+ /**
26
+ * Tab por defecto de tamaño mediano con icono.
27
+ */
28
+ export declare const MediumDefault: Story;
@@ -0,0 +1,32 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tab } from '../../../../../../src/components/mui_extended/Tab';
3
+ /**
4
+ * El componente Tab agrupa contenido relacionado y permite la navegación sin salir de la página.
5
+ */
6
+ declare const meta: Meta<typeof Tab>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof Tab>;
9
+ /**
10
+ * Tab en estado Skeleton cuando está activo, con icono y texto.
11
+ */
12
+ export declare const SkeletonActiveWithIconAndText: Story;
13
+ /**
14
+ * Tab en estado Skeleton cuando está activo, con solo texto.
15
+ */
16
+ export declare const SkeletonActiveWithText: Story;
17
+ /**
18
+ * Tab en estado Skeleton cuando está activo, con solo icono.
19
+ */
20
+ export declare const SkeletonActiveWithIcon: Story;
21
+ /**
22
+ * Tab en estado Skeleton por defecto, con icono y texto.
23
+ */
24
+ export declare const SkeletonDefaultWithIconAndText: Story;
25
+ /**
26
+ * Tab en estado Skeleton por defecto, con solo texto.
27
+ */
28
+ export declare const SkeletonDefaultWithText: Story;
29
+ /**
30
+ * Tab en estado Skeleton por defecto, con solo icono.
31
+ */
32
+ export declare const SkeletonDefaultWithIcon: Story;
@@ -1,25 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { MenuActions } from '../index';
3
- declare const meta: Meta<typeof MenuActions>;
4
- export default meta;
5
- type Story = StoryObj<typeof MenuActions>;
6
- /**
7
- * Componente base de `MenuActions`.
8
- */
9
- export declare const Base: Story;
10
- /**
11
- * Componente `MenuActions` con sizes de small.
12
- */
13
- export declare const SmallSizes: Story;
14
- /**
15
- * Componente `MenuActions` con sizes de medium.
16
- */
17
- export declare const MediumSizes: Story;
18
- /**
19
- * Estado vacío del componente `MenuActions`.
20
- */
21
- export declare const Empty: Story;
22
- /**
23
- * `MenuActions` en modo esqueleto (skeleton).
24
- */
25
- export declare const WithSkeleton: Story;
@@ -1,13 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { MenuActions } from '../index';
3
- declare const meta: Meta<typeof MenuActions>;
4
- export default meta;
5
- type Story = StoryObj<typeof MenuActions>;
6
- /**
7
- * Componente base de `MenuActions`.
8
- */
9
- export declare const Base: Story;
10
- /**
11
- * `MenuActions` con un elemento adicional al final de la lista (`endListElement`).
12
- */
13
- export declare const WithEndListElement: Story;
@@ -1,66 +0,0 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import { createElement } from "react";
3
- import { useTheme } from "@mui/material";
4
- import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
5
- import { S as SkeletonMenuItem, M as MenuItemRoot, a as MenuItemIcon } from "./slots/MenuItemSlots.js";
6
- import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
7
- import { T as Typography } from "../Typography/Typography.js";
8
- const MenuItem = (props) => {
9
- const {
10
- key,
11
- value,
12
- icon,
13
- label,
14
- disabled,
15
- selected,
16
- size = "medium",
17
- color = "primary",
18
- ...other
19
- } = props;
20
- const { currentSize } = useComponentSize(size);
21
- const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
22
- const isSkeleton = useModuleSkeleton();
23
- const theme = useTheme();
24
- const paletteColor = getPropertyByString(
25
- theme.vars.palette,
26
- disabled ? "default" : color,
27
- theme.vars.palette.default
28
- );
29
- const ownerState = {
30
- size: adjustedSize,
31
- disabled,
32
- selected,
33
- paletteColor,
34
- componentPaletteColor: color
35
- };
36
- if (isSkeleton) {
37
- return /* @__PURE__ */ jsx(SkeletonMenuItem, { ownerState: { ...ownerState } });
38
- }
39
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
40
- MenuItemRoot,
41
- {
42
- ...other,
43
- key,
44
- value,
45
- ownerState: { ...ownerState },
46
- disabled,
47
- className: "M4LMenuItemRoot"
48
- },
49
- !icon ? /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: label }) : /* @__PURE__ */ jsxs(Fragment, { children: [
50
- /* @__PURE__ */ jsx(
51
- MenuItemIcon,
52
- {
53
- ownerState: { ...ownerState },
54
- src: icon,
55
- size: adjustedSize,
56
- disabled,
57
- className: "M4LMenuItemIcon"
58
- }
59
- ),
60
- /* @__PURE__ */ jsx(Typography, { variant: "body", children: label })
61
- ] })
62
- ) });
63
- };
64
- export {
65
- MenuItem as M
66
- };