@m4l/components 8.2.2 → 8.2.3
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.
- package/components/mui_extended/MenuItem/MenuItem.d.ts +6 -4
- package/components/mui_extended/MenuItem/MenuItem.integration.test.d.ts +1 -0
- package/components/mui_extended/MenuItem/MenuItem.test.d.ts +1 -0
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +4 -3
- package/components/mui_extended/MenuItem/types.d.ts +5 -3
- package/package.json +1 -1
- package/{components/mui_extended/MenuItem → storybook/components/extended/mui/MenuItems}/MenuItem.stories.d.ts +15 -7
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { MenuItemProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* MenuItem component renders a menu item with optional icon and label.
|
|
3
|
+
* The MenuItem component renders a menu item with an optional icon and label.
|
|
4
4
|
* It supports different sizes, colors, and states such as disabled and selected.
|
|
5
5
|
* If the module is in skeleton mode, it renders a skeleton menu item instead.
|
|
6
|
+
* @param props
|
|
7
|
+
* @returns
|
|
6
8
|
* @author Bruce Escobar - automatic
|
|
7
|
-
* @createdAt 2024-10-22
|
|
8
|
-
* @updatedAt 2024-10-
|
|
9
|
-
* @updatedUser
|
|
9
|
+
* @createdAt 2024-10-22 19:53:39 - automatic
|
|
10
|
+
* @updatedAt 2024-10-30 07:57:20 - automatic
|
|
11
|
+
* @updatedUser SebastianM - automatic
|
|
10
12
|
*/
|
|
11
13
|
export declare const MenuItem: (props: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
declare const MenuItemRoot: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').MenuItemOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLLIElement | 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<HTMLLIElement> | null | undefined;
|
|
3
3
|
}, "children" | "action" | "divider" | "style" | "dense" | "disabled" | "sx" | "classes" | "autoFocus" | "className" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "selected" | "disableGutters">, "children" | "value" | "ref" | "title" | "id" | "action" | "divider" | "hidden" | "color" | "content" | "style" | "dense" | "disabled" | "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" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "key" | "selected" | "disableGutters"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('..').MenuItemOwnerState> & Record<string, unknown> & {
|
|
4
4
|
ownerState: Partial<import('..').MenuItemOwnerState> & Record<string, unknown>;
|
|
5
5
|
}, {}, {}>;
|
|
6
|
-
|
|
6
|
+
declare const MenuItemIcon: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('..').MenuItemOwnerState> & Record<string, unknown> & {
|
|
7
7
|
ownerState: Partial<import('..').MenuItemOwnerState> & Record<string, unknown>;
|
|
8
8
|
}, {}, {}>;
|
|
9
|
-
|
|
9
|
+
declare const SkeletonMenuItem: import('@emotion/styled').StyledComponent<Pick<import('../../Skeleton/types').SkeletonProps, keyof import('../../Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('..').MenuItemOwnerState> & Record<string, unknown> & {
|
|
10
10
|
ownerState: Partial<import('..').MenuItemOwnerState> & Record<string, unknown>;
|
|
11
11
|
}, {}, {}>;
|
|
12
|
+
export { MenuItemRoot, MenuItemIcon, SkeletonMenuItem };
|
|
@@ -6,7 +6,8 @@ import { MENUITEM_KEY_COMPONENT } from './constants';
|
|
|
6
6
|
/**
|
|
7
7
|
* Props para el componente `MenuItem`, extendiendo las propiedades originales de Material UI.
|
|
8
8
|
* Omit<MUIMenuItemProps, 'size' | 'color'>
|
|
9
|
-
* [
|
|
9
|
+
* [startIcon] - Prop opcional para el ícono a la izquierda en el `MenuItem`.
|
|
10
|
+
* [endIcon] - Prop opcional para el ícono a la derecha en el `MenuItem`.
|
|
10
11
|
* label - Texto que describe el `MenuItem`.
|
|
11
12
|
* [selected] - Indica si el item está seleccionado.
|
|
12
13
|
* [componentPaletteColor] - Personalización del color de la paleta del componente.
|
|
@@ -15,13 +16,14 @@ import { MENUITEM_KEY_COMPONENT } from './constants';
|
|
|
15
16
|
* [size] - Tamaño del `MenuItem` (por defecto 'medium').
|
|
16
17
|
*/
|
|
17
18
|
export interface MenuItemProps extends Omit<MUIMenuItemProps, 'size' | 'color'> {
|
|
18
|
-
|
|
19
|
+
startIcon?: string;
|
|
20
|
+
endIcon?: string;
|
|
19
21
|
label: string;
|
|
20
22
|
selected?: boolean;
|
|
21
23
|
componentPaletteColor?: ComponentPalletColor;
|
|
22
24
|
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
23
25
|
disabled?: boolean;
|
|
24
|
-
size?: Sizes
|
|
26
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Estado del propietario del `MenuItem` utilizado para definir propiedades internas de estilo y comportamiento.
|
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
-
import { MenuItem } from '
|
|
2
|
+
import { MenuItem } from '../../../../../src/components/mui_extended/MenuItem';
|
|
3
3
|
declare const meta: Meta<typeof MenuItem>;
|
|
4
4
|
type Story = StoryObj<typeof MenuItem>;
|
|
5
5
|
/**
|
|
6
6
|
* Historia base para `MenuItem` en modo estándar.
|
|
7
7
|
*/
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const Default: Story;
|
|
9
9
|
/**
|
|
10
|
-
* Historia para `MenuItem` activado y con ícono.
|
|
10
|
+
* Historia para `MenuItem` activado y con ícono a la izquierda.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ActiveWithStartIcon: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Historia para `MenuItem` activado y con ícono a la derecha.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ActiveWithEndIcon: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Historia para `MenuItem` activado y con íconos.
|
|
11
19
|
*/
|
|
12
20
|
export declare const ActiveWithIcon: Story;
|
|
13
21
|
/**
|
|
@@ -15,19 +23,19 @@ export declare const ActiveWithIcon: Story;
|
|
|
15
23
|
*/
|
|
16
24
|
export declare const ActiveWithoutIcon: Story;
|
|
17
25
|
/**
|
|
18
|
-
* Historia para `MenuItem` desactivado con
|
|
26
|
+
* Historia para `MenuItem` desactivado con íconos.
|
|
19
27
|
*/
|
|
20
28
|
export declare const InactiveWithIcon: Story;
|
|
21
29
|
/**
|
|
22
|
-
* Historia para `MenuItem` desactivado sin
|
|
30
|
+
* Historia para `MenuItem` desactivado sin íconos.
|
|
23
31
|
*/
|
|
24
32
|
export declare const InactiveWithoutIcon: Story;
|
|
25
33
|
/**
|
|
26
|
-
* Historia para `MenuItem` deshabilitado con
|
|
34
|
+
* Historia para `MenuItem` deshabilitado con íconos.
|
|
27
35
|
*/
|
|
28
36
|
export declare const DisabledWithIcon: Story;
|
|
29
37
|
/**
|
|
30
|
-
* Historia para `MenuItem` deshabilitado sin
|
|
38
|
+
* Historia para `MenuItem` deshabilitado sin íconos.
|
|
31
39
|
*/
|
|
32
40
|
export declare const DisabledWithoutIcon: Story;
|
|
33
41
|
/**
|