@m4l/components 9.1.61 → 9.1.62
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/@types/types.d.ts +8 -0
- package/components/mui_extended/Tab/Slots/TabEnum.d.ts +1 -0
- package/components/mui_extended/Tab/Slots/TabEnum.js +1 -0
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +8 -0
- package/components/mui_extended/Tab/Slots/TabSlots.js +6 -0
- package/components/mui_extended/Tab/Tab.js +6 -6
- package/components/mui_extended/Tab/Tab.styles.js +33 -48
- package/components/mui_extended/Tab/constants.d.ts +0 -10
- package/components/mui_extended/Tab/constants.js +1 -7
- package/components/mui_extended/Tabs/Tabs.d.ts +2 -2
- package/components/mui_extended/Tabs/Tabs.js +3 -5
- package/components/mui_extended/Tabs/Tabs.styles.d.ts +2 -0
- package/components/mui_extended/Tabs/Tabs.styles.js +34 -0
- package/components/mui_extended/Tabs/Tabs.test.d.ts +1 -0
- package/components/mui_extended/Tabs/constants.d.ts +4 -0
- package/components/mui_extended/Tabs/constants.js +4 -0
- package/components/mui_extended/Tabs/slots/TabsEnum.d.ts +3 -0
- package/components/mui_extended/Tabs/slots/TabsEnum.js +7 -0
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +5 -0
- package/components/mui_extended/Tabs/slots/TabsSlots.js +11 -0
- package/components/mui_extended/Tabs/types.d.ts +21 -0
- package/package.json +1 -1
- package/components/mui_extended/Tabs/classes/constants.d.ts +0 -1
- package/components/mui_extended/Tabs/classes/constants.js +0 -4
- package/components/mui_extended/Tabs/classes/index.d.ts +0 -9
- package/components/mui_extended/Tabs/classes/index.js +0 -23
- package/components/mui_extended/Tabs/classes/types.d.ts +0 -6
- package/components/mui_extended/Tabs/styles.d.ts +0 -3
- package/components/mui_extended/Tabs/styles.js +0 -7
package/@types/types.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ import { ToggleButtonOwnerState, ToggleButtonSlotsType } from '../components/mui
|
|
|
132
132
|
|
|
133
133
|
import { BooleanFormatterOwnerState, PresentationType } from '../components/formatters/BooleanFormatter/types';
|
|
134
134
|
import { ToggleIconButtonOwnerState, ToggleIconButtonSlotsType } from '../components/mui_extended/ToggleIconButton/types';
|
|
135
|
+
import { TabsSlotsType,TabsOwnerState } from '../components/mui_extended/Tabs/types';
|
|
135
136
|
|
|
136
137
|
import { PopoverOwnerState, PopoverSlotsType } from '../components/mui_extended/Popover/types';
|
|
137
138
|
import { AccountPopoverOwnerState, AccountPopoverSlotsType } from '../components/AccountPopover/types';
|
|
@@ -189,6 +190,7 @@ declare module '@mui/material/styles' {
|
|
|
189
190
|
M4LToggleButton: ToggleButtonSlotsType;
|
|
190
191
|
M4LBooleanFormatter: PresentationType;
|
|
191
192
|
M4LToggleIconButton: ToggleIconButtonSlotsType;
|
|
193
|
+
M4LTabs: TabsSlotsType;
|
|
192
194
|
RHFM4LAutocomplete: RHFAutocompleteSlotsType;
|
|
193
195
|
M4LAccountPopover: AccountPopoverSlotsType;
|
|
194
196
|
M4LPropertyValue: PropertyValueType;
|
|
@@ -241,6 +243,7 @@ declare module '@mui/material/styles' {
|
|
|
241
243
|
M4LToggleButton: Partial<ToggleButtonOwnerState>;
|
|
242
244
|
M4LBooleanFormatter: Partial<BooleanFormatterOwnerState>;
|
|
243
245
|
M4LToggleIconButton: Partial<ToggleIconButtonOwnerState>;
|
|
246
|
+
M4LTabs: Partial<TabsOwnerState>;
|
|
244
247
|
RHFM4LAutocomplete: Partial<RHFAutocompleteOwnerState>;
|
|
245
248
|
M4LAccountPopover: Partial<AccountPopoverOwnerState>;
|
|
246
249
|
M4LPropertyValue: Partial<PropertyVaLueOwnerState>;
|
|
@@ -570,6 +573,11 @@ declare module '@mui/material/styles' {
|
|
|
570
573
|
styleOverrides?: ComponentsOverrides<Theme>['M4LPropertyValue'];
|
|
571
574
|
variants?: ComponentsVariants['M4LPropertyValue'];
|
|
572
575
|
};
|
|
576
|
+
M4LTabs?: {
|
|
577
|
+
defaultProps?: ComponentsPropsList['M4LTabs'];
|
|
578
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTabs'];
|
|
579
|
+
variants?: ComponentsVariants['M4LTabs'];
|
|
580
|
+
};
|
|
573
581
|
M4LColor?: {
|
|
574
582
|
defaultProps?: ComponentsPropsList['M4LColor'];
|
|
575
583
|
styleOverrides?: ComponentsOverrides<Theme>['M4LColor'];
|
|
@@ -8,6 +8,14 @@ export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<
|
|
|
8
8
|
}, "children" | "value" | "action" | "style" | "icon" | "disabled" | "sx" | "classes" | "className" | "tabIndex" | "label" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "iconPosition" | "wrapped">, "children" | "value" | "ref" | "title" | "id" | "action" | "hidden" | "color" | "content" | "style" | "icon" | "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" | "label" | "key" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "iconPosition" | "wrapped"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
|
|
9
9
|
ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
|
|
10
10
|
}, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* `IconStyled`:
|
|
13
|
+
* Componente de tipo icono (`Icon`).
|
|
14
|
+
* Utiliza el slot `icon` para agregar estilos específicos al icono del Tab.
|
|
15
|
+
*/
|
|
16
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
|
|
17
|
+
ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
|
|
18
|
+
}, {}, {}>;
|
|
11
19
|
/**
|
|
12
20
|
* `TypographyStyled`:
|
|
13
21
|
* Componente de texto estilizado basado en `Typography`, se usa para mostrar texto en cada pestaña.
|
|
@@ -4,15 +4,21 @@ import { t as tabStyles } from "../Tab.styles.js";
|
|
|
4
4
|
import { T as TAB_KEY_COMPONENT } from "../constants.js";
|
|
5
5
|
import { T as TabSlots } from "./TabEnum.js";
|
|
6
6
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
7
|
+
import { I as Icon } from "../../../Icon/Icon.js";
|
|
7
8
|
const RootStyled = styled(Tab, {
|
|
8
9
|
name: TAB_KEY_COMPONENT,
|
|
9
10
|
slot: TabSlots.root
|
|
10
11
|
})(tabStyles?.root);
|
|
12
|
+
const IconStyled = styled(Icon, {
|
|
13
|
+
name: TAB_KEY_COMPONENT,
|
|
14
|
+
slot: TabSlots.icon
|
|
15
|
+
})(tabStyles?.icon);
|
|
11
16
|
const TypographyStyled = styled(Typography, {
|
|
12
17
|
name: TAB_KEY_COMPONENT,
|
|
13
18
|
slot: TabSlots.tipography
|
|
14
19
|
})(tabStyles?.tipography);
|
|
15
20
|
export {
|
|
21
|
+
IconStyled as I,
|
|
16
22
|
RootStyled as R,
|
|
17
23
|
TypographyStyled as T
|
|
18
24
|
};
|
|
@@ -2,11 +2,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { useModuleSkeleton } from "@m4l/core";
|
|
4
4
|
import { T as TabSlots } from "./Slots/TabEnum.js";
|
|
5
|
-
import {
|
|
5
|
+
import { T as TAB_KEY_COMPONENT } from "./constants.js";
|
|
6
6
|
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
7
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
-
import { R as RootStyled, T as TypographyStyled } from "./Slots/TabSlots.js";
|
|
9
|
-
import { I as Icon } from "../../Icon/Icon.js";
|
|
8
|
+
import { R as RootStyled, T as TypographyStyled, I as IconStyled } from "./Slots/TabSlots.js";
|
|
10
9
|
function Tab(props) {
|
|
11
10
|
const {
|
|
12
11
|
size = "medium",
|
|
@@ -38,13 +37,14 @@ function Tab(props) {
|
|
|
38
37
|
return /* @__PURE__ */ jsx(
|
|
39
38
|
RootStyled,
|
|
40
39
|
{
|
|
41
|
-
label: label ? /* @__PURE__ */ jsx(TypographyStyled, { className: clsx(
|
|
40
|
+
label: label ? /* @__PURE__ */ jsx(TypographyStyled, { size: adjustedSize, className: clsx(classes.tipography, className), ownerState: { ...OwnerState }, variant: "body", children: label }) : void 0,
|
|
42
41
|
disabled: isSkeleton || disabled,
|
|
43
42
|
ownerState: { ...OwnerState },
|
|
44
43
|
icon: urlIcon ? /* @__PURE__ */ jsx(
|
|
45
|
-
|
|
44
|
+
IconStyled,
|
|
46
45
|
{
|
|
47
|
-
|
|
46
|
+
ownerState: { ...OwnerState },
|
|
47
|
+
className: clsx(classes.icon, className),
|
|
48
48
|
src: urlIcon,
|
|
49
49
|
size
|
|
50
50
|
}
|
|
@@ -48,14 +48,25 @@ const tabStyles = {
|
|
|
48
48
|
},
|
|
49
49
|
// Ajuste de alineación del icono
|
|
50
50
|
"& .MuiTab-iconWrapper": {
|
|
51
|
-
marginBottom:
|
|
51
|
+
marginBottom: 0
|
|
52
52
|
},
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
//Disabled
|
|
54
|
+
...ownerState.tabDisabled && {
|
|
55
|
+
".M4LTab-icon div": {
|
|
56
|
+
backgroundColor: `${theme.vars.palette.text.disabled} !important`
|
|
57
|
+
},
|
|
58
|
+
".M4LTab-tipography": {
|
|
59
|
+
color: `${theme.vars.palette.text.disabled} !important`
|
|
60
|
+
}
|
|
56
61
|
},
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
//Default
|
|
63
|
+
"&:not(.Mui-selected)": {
|
|
64
|
+
".M4LTab-icon div": {
|
|
65
|
+
backgroundColor: theme.vars.palette.text.secondary
|
|
66
|
+
},
|
|
67
|
+
".M4LTab-tipography": {
|
|
68
|
+
color: theme.vars.palette.text.secondary
|
|
69
|
+
}
|
|
59
70
|
},
|
|
60
71
|
/**
|
|
61
72
|
* **Pseudoclases**:
|
|
@@ -79,10 +90,10 @@ const tabStyles = {
|
|
|
79
90
|
border: theme.vars.size.borderStroke.container,
|
|
80
91
|
borderColor: theme.vars.palette.border.secondary,
|
|
81
92
|
borderBottom: 0,
|
|
82
|
-
".icon
|
|
93
|
+
".M4LTab-icon div": {
|
|
83
94
|
backgroundColor: ownerState.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.enabled
|
|
84
95
|
},
|
|
85
|
-
"
|
|
96
|
+
".M4LTab-tipography": {
|
|
86
97
|
color: ownerState.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.enabled
|
|
87
98
|
},
|
|
88
99
|
// Efecto ripple en estado seleccionado
|
|
@@ -97,7 +108,7 @@ const tabStyles = {
|
|
|
97
108
|
height: theme.vars.size.borderRadius["r0-5"],
|
|
98
109
|
left: 0,
|
|
99
110
|
top: -1,
|
|
100
|
-
backgroundColor: ownerState.tabSkeleton ? theme.vars.palette.
|
|
111
|
+
backgroundColor: ownerState.tabSkeleton ? theme.vars.palette.skeleton.default : ownerState.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.main,
|
|
101
112
|
borderEndStartRadius: theme.vars.size.borderRadius["r1"],
|
|
102
113
|
borderEndEndRadius: theme.vars.size.borderRadius["r1"],
|
|
103
114
|
position: "absolute"
|
|
@@ -107,10 +118,10 @@ const tabStyles = {
|
|
|
107
118
|
},
|
|
108
119
|
"&:active": {
|
|
109
120
|
background: theme.vars.palette.primary.activeOpacity,
|
|
110
|
-
".icon
|
|
121
|
+
".M4LTab-icon div": {
|
|
111
122
|
backgroundColor: theme.vars.palette.primary.active
|
|
112
123
|
},
|
|
113
|
-
"
|
|
124
|
+
".M4LTab-tipography": {
|
|
114
125
|
color: theme.vars.palette.primary.active
|
|
115
126
|
},
|
|
116
127
|
"&::after": {
|
|
@@ -120,44 +131,18 @@ const tabStyles = {
|
|
|
120
131
|
},
|
|
121
132
|
"&.Mui-selected:focus-visible": {
|
|
122
133
|
background: theme.vars.palette.primary.activeOpacity,
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
position: "absolute",
|
|
127
|
-
top: `-${theme.size.baseSpacings.sp1}`,
|
|
128
|
-
left: `-${theme.size.baseSpacings.sp1}`,
|
|
129
|
-
right: `-${theme.size.baseSpacings.sp1}`,
|
|
130
|
-
bottom: 0,
|
|
131
|
-
boxSizing: "border-box",
|
|
132
|
-
border: theme.vars.size.borderStroke.container,
|
|
133
|
-
borderBottom: 0,
|
|
134
|
-
borderColor: theme.vars.palette.primary.focusVisible,
|
|
135
|
-
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
136
|
-
borderBottomRightRadius: 0,
|
|
137
|
-
borderBottomLeftRadius: 0
|
|
138
|
-
},
|
|
134
|
+
outline: "1px solid",
|
|
135
|
+
outlineOffset: "-1px",
|
|
136
|
+
color: theme.vars.palette[ownerState.tabColor || "default"].focusVisible,
|
|
139
137
|
"&:hover": {
|
|
140
138
|
backgroundColor: theme.vars.palette.primary.activeOpacity
|
|
141
139
|
}
|
|
142
140
|
},
|
|
143
141
|
"&:focus-visible": {
|
|
144
142
|
background: theme.vars.palette[ownerState.tabColor || "default"].activeOpacity,
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
position: "absolute",
|
|
149
|
-
top: `-${theme.size.baseSpacings.sp1}`,
|
|
150
|
-
left: `-${theme.size.baseSpacings.sp1}`,
|
|
151
|
-
right: `-${theme.size.baseSpacings.sp1}`,
|
|
152
|
-
bottom: 0,
|
|
153
|
-
boxSizing: "border-box",
|
|
154
|
-
border: theme.vars.size.borderStroke.container,
|
|
155
|
-
borderBottom: 0,
|
|
156
|
-
borderColor: theme.vars.palette[ownerState.tabColor || "default"].focusVisible,
|
|
157
|
-
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
158
|
-
borderBottomRightRadius: 0,
|
|
159
|
-
borderBottomLeftRadius: 0
|
|
160
|
-
},
|
|
143
|
+
outline: "1px solid",
|
|
144
|
+
outlineOffset: "-1px",
|
|
145
|
+
color: theme.vars.palette[ownerState.tabColor || "default"].focusVisible,
|
|
161
146
|
"&:hover": {
|
|
162
147
|
backgroundColor: theme.vars.palette[ownerState.tabColor || "default"].activeOpacity
|
|
163
148
|
}
|
|
@@ -172,12 +157,12 @@ const tabStyles = {
|
|
|
172
157
|
* @updatedUser Andrés Quintero - automatic
|
|
173
158
|
*/
|
|
174
159
|
tipography: ({ ownerState }) => ({
|
|
175
|
-
"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
160
|
+
cursor: "pointer",
|
|
161
|
+
...ownerState.tabSkeleton && {
|
|
162
|
+
width: "32px"
|
|
179
163
|
}
|
|
180
|
-
})
|
|
164
|
+
}),
|
|
165
|
+
icon: {}
|
|
181
166
|
};
|
|
182
167
|
export {
|
|
183
168
|
tabStyles as t
|
|
@@ -2,13 +2,3 @@
|
|
|
2
2
|
* Nombre de clase que se usa para dar identidad a los slots del componente.
|
|
3
3
|
*/
|
|
4
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";
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
const TAB_KEY_COMPONENT = "M4LTab";
|
|
2
|
-
const TAB_SPECIFY = "M4lclassCssSpecificity";
|
|
3
|
-
const TYPOGRAPHY_KEY = "tipography";
|
|
4
|
-
const ICON_KEY = "icon";
|
|
5
2
|
export {
|
|
6
|
-
|
|
7
|
-
TAB_KEY_COMPONENT as T,
|
|
8
|
-
TYPOGRAPHY_KEY as a,
|
|
9
|
-
TAB_SPECIFY as b
|
|
3
|
+
TAB_KEY_COMPONENT as T
|
|
10
4
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { u as useTabsUtilityClasses } from "./classes/index.js";
|
|
4
|
-
import { M as MUITabs } from "./styles.js";
|
|
2
|
+
import { R as RootStyled } from "./slots/TabsSlots.js";
|
|
5
3
|
const Tabs = (props) => {
|
|
6
4
|
const { children, className, ...others } = props;
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
+
const ownerState = {};
|
|
6
|
+
return /* @__PURE__ */ jsx(RootStyled, { ownerState: { ownerState }, ...others, children });
|
|
9
7
|
};
|
|
10
8
|
export {
|
|
11
9
|
Tabs as T
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const tabsStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Elemento root referencia a `MuiTabs` de MUI
|
|
4
|
+
*/
|
|
5
|
+
root: ({ theme }) => ({
|
|
6
|
+
position: "relative",
|
|
7
|
+
zIndex: 2,
|
|
8
|
+
display: "flex",
|
|
9
|
+
overflow: "auto",
|
|
10
|
+
width: "100%",
|
|
11
|
+
height: "fit-content",
|
|
12
|
+
maxWidth: "fit-content",
|
|
13
|
+
minHeight: "fit-content",
|
|
14
|
+
background: theme.vars.palette.default.enabled,
|
|
15
|
+
paddingBottom: theme.vars.size.baseSpacings.sp0,
|
|
16
|
+
gap: theme.vars.size.baseSpacings.sp0,
|
|
17
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
18
|
+
borderBottomLeftRadius: theme.vars.size.borderRadius.r0,
|
|
19
|
+
borderBottomRightRadius: theme.vars.size.borderRadius.r0,
|
|
20
|
+
"& .MuiTabs-scroller": {
|
|
21
|
+
overflow: "visible !important"
|
|
22
|
+
},
|
|
23
|
+
"& .MuiTabs-indicator": {
|
|
24
|
+
display: "none"
|
|
25
|
+
},
|
|
26
|
+
"& .simplebar-content": {
|
|
27
|
+
display: "flex",
|
|
28
|
+
gap: theme.vars.size.baseSpacings.sp0
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
tabsStyles as t
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').TabsOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | 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<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, "children" | "value" | "action" | "style" | "variant" | "sx" | "classes" | "className" | "aria-label" | "aria-labelledby" | "onChange" | "slotProps" | "slots" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar">, "children" | "value" | "ref" | "title" | "id" | "action" | "hidden" | "color" | "content" | "style" | "variant" | "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" | "slotProps" | "slots" | "key" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabsProps> & Record<string, unknown> & {
|
|
4
|
+
ownerState: Partial<import('../types').TabsProps> & Record<string, unknown>;
|
|
5
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled, Tabs } from "@mui/material";
|
|
2
|
+
import { t as tabsStyles } from "../Tabs.styles.js";
|
|
3
|
+
import { T as TABS_KEY_COMPONENT } from "../constants.js";
|
|
4
|
+
import { T as TabsSlots } from "./TabsEnum.js";
|
|
5
|
+
const RootStyled = styled(Tabs, {
|
|
6
|
+
name: TABS_KEY_COMPONENT,
|
|
7
|
+
slot: TabsSlots.root
|
|
8
|
+
})(tabsStyles.root);
|
|
9
|
+
export {
|
|
10
|
+
RootStyled as R
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
2
|
+
import { TabsProps as MuiTabProps } from '@mui/material/Tabs';
|
|
3
|
+
import { TabsSlots } from './slots/TabsEnum';
|
|
4
|
+
import { TABS_KEY_COMPONENT } from './constants';
|
|
5
|
+
import { Theme } from '@mui/material';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the tabs component.
|
|
8
|
+
*/
|
|
9
|
+
export type TabsProps = MuiTabProps;
|
|
10
|
+
/**
|
|
11
|
+
* State for the tabs component.
|
|
12
|
+
*/
|
|
13
|
+
export type TabsOwnerState = TabsProps;
|
|
14
|
+
/**
|
|
15
|
+
* Slots for the tabs component.
|
|
16
|
+
*/
|
|
17
|
+
export type TabsSlotsType = typeof TabsSlots;
|
|
18
|
+
/**
|
|
19
|
+
* Styles for the tabs component overrides.
|
|
20
|
+
*/
|
|
21
|
+
export type TabsStyles = OverridesStyleRules<TabsSlots, typeof TABS_KEY_COMPONENT, Theme>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LTabs";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TabsClassesType } from './types';
|
|
2
|
-
export declare const tabsClasses: TabsClassesType;
|
|
3
|
-
export declare function getTabsUtilityClass(slot: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* TODO: Documentar
|
|
6
|
-
*/
|
|
7
|
-
export declare const useTabsUtilityClasses: () => {
|
|
8
|
-
root: string;
|
|
9
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
import { c as componentName } from "./constants.js";
|
|
4
|
-
generateUtilityClasses(componentName, [
|
|
5
|
-
/* elements */
|
|
6
|
-
"root"
|
|
7
|
-
/* states or variants of elements */
|
|
8
|
-
]);
|
|
9
|
-
function getTabsUtilityClass(slot) {
|
|
10
|
-
return generateUtilityClass(componentName, slot);
|
|
11
|
-
}
|
|
12
|
-
const useTabsUtilityClasses = () => {
|
|
13
|
-
const slots = {
|
|
14
|
-
root: ["root"]
|
|
15
|
-
};
|
|
16
|
-
const composedClasses = unstable_composeClasses(slots, getTabsUtilityClass, {});
|
|
17
|
-
return {
|
|
18
|
-
...composedClasses
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useTabsUtilityClasses as u
|
|
23
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const MUITabs: import('@emotion/styled').StyledComponent<import('@mui/material').TabsOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
-
ref?: ((instance: HTMLDivElement | 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<HTMLDivElement> | null | undefined;
|
|
3
|
-
}, "children" | "value" | "action" | "style" | "variant" | "sx" | "classes" | "className" | "aria-label" | "aria-labelledby" | "onChange" | "slotProps" | "slots" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|