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

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 (43) hide show
  1. package/@types/export.d.ts +3 -0
  2. package/@types/types.d.ts +1 -12
  3. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/index.js +1 -1
  4. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyTabs/index.js +1 -1
  5. package/components/mui_extended/Tab/classes/constants.d.ts +1 -0
  6. package/components/mui_extended/Tab/classes/constants.js +4 -0
  7. package/components/mui_extended/Tab/classes/index.d.ts +10 -0
  8. package/components/mui_extended/Tab/classes/index.js +25 -0
  9. package/components/mui_extended/Tab/classes/types.d.ts +7 -0
  10. package/components/mui_extended/Tab/constant.d.ts +1 -0
  11. package/components/mui_extended/Tab/constant.js +4 -0
  12. package/components/mui_extended/Tab/index.d.ts +5 -1
  13. package/components/mui_extended/Tab/index.js +40 -0
  14. package/components/mui_extended/Tab/styles.d.ts +2 -0
  15. package/components/mui_extended/Tab/styles.js +11 -0
  16. package/components/mui_extended/Tab/tests/utils.d.ts +2 -0
  17. package/components/mui_extended/Tab/types.d.ts +2 -53
  18. package/components/mui_extended/index.d.ts +1 -1
  19. package/index.js +1 -1
  20. package/package.json +1 -1
  21. package/test/TestAppWrapper.d.ts +31 -0
  22. package/test/utils.d.ts +26 -6
  23. package/components/PropertyValue/tests/index.test.d.ts +0 -1
  24. package/components/hook-form/RHFDateTime/test/index.test.d.ts +0 -1
  25. package/components/hook-form/RHFUpload/RHFUploadImage/tests/index.test.d.ts +0 -1
  26. package/components/mui_extended/LoadingButton/tests/index.test.d.ts +0 -1
  27. package/components/mui_extended/Tab/Slots/TabEnum.d.ts +0 -9
  28. package/components/mui_extended/Tab/Slots/TabEnum.js +0 -9
  29. package/components/mui_extended/Tab/Slots/TabSlots.d.ts +0 -26
  30. package/components/mui_extended/Tab/Slots/TabSlots.js +0 -24
  31. package/components/mui_extended/Tab/Slots/index.d.ts +0 -2
  32. package/components/mui_extended/Tab/Slots/index.js +0 -1
  33. package/components/mui_extended/Tab/Tab.d.ts +0 -5
  34. package/components/mui_extended/Tab/Tab.js +0 -67
  35. package/components/mui_extended/Tab/Tab.styles.d.ts +0 -5
  36. package/components/mui_extended/Tab/Tab.styles.js +0 -147
  37. package/components/mui_extended/Tab/constants.d.ts +0 -14
  38. package/components/mui_extended/Tab/constants.js +0 -10
  39. package/storybook/components/extended/mui/Tab/stories/Tab.disable.stories.d.ts +0 -36
  40. package/storybook/components/extended/mui/Tab/stories/Tab.enable.stories.d.ts +0 -36
  41. package/storybook/components/extended/mui/Tab/stories/Tab.sizes.stories.d.ts +0 -28
  42. package/storybook/components/extended/mui/Tab/stories/Tab.skeleton.stories.d.ts +0 -32
  43. /package/components/{NavLink → mui_extended/Tab}/tests/index.test.d.ts +0 -0
@@ -158,6 +158,9 @@ declare module '@mui/material/styles' {
158
158
  M4LAccordion?: {
159
159
  styleOverrides?: ComponentsOverrides<Theme>['M4LAccordion'];
160
160
  };
161
+ M4LTab?: {
162
+ styleOverrides?: ComponentsOverrides<Theme>['M4LTab'];
163
+ };
161
164
  M4LRHFormProvider?: {
162
165
  styleOverrides?: ComponentsOverrides<Theme>['M4LRHFormProvider'];
163
166
  };
package/@types/types.d.ts CHANGED
@@ -52,8 +52,6 @@ import type {
52
52
  } from '../components/mui_extended/MenuItem/types';
53
53
 
54
54
  import { SelectOwnerState, SelectSlotsType } from '../components/mui_extended/Select/types';
55
- import { TabOwnerState, TabSlotsType } from '../components/mui_extended/Tab/types';
56
-
57
55
 
58
56
  declare module '@mui/material/styles' {
59
57
  // Define the slots in the theme
@@ -78,8 +76,6 @@ declare module '@mui/material/styles' {
78
76
  M4LSkeleton: SkeletonSlotsType;
79
77
  M4LSelect: SelectSlotsType;
80
78
  M4LTypography: TypographySlotsType;
81
- M4LTab: TabSlotsType;
82
-
83
79
  }
84
80
 
85
81
  interface ComponentsPropsList {
@@ -104,8 +100,6 @@ declare module '@mui/material/styles' {
104
100
  M4LSkeleton: Partial<SkeletonOwnerState>;
105
101
  M4LSelect: Partial<SelectOwnerState>;
106
102
  M4LTypography: Partial<TypographyOwnerState>;
107
- M4LTab: Partial<TabOwnerState>;
108
-
109
103
  }
110
104
 
111
105
  interface Components {
@@ -188,7 +182,6 @@ declare module '@mui/material/styles' {
188
182
  defaultProps?: ComponentsPropsList['M4LControlIncrement'];
189
183
  styleOverrides?: ComponentsOverrides<Theme>['M4LControlIncrement'];
190
184
  variants?: ComponentsVariants['M4LControlIncrement'];
191
- }
192
185
  M4LMenuItem?: {
193
186
  defaultProps?: ComponentsPropsList['M4LMenuItem'];
194
187
  styleOverrides?: ComponentsOverrides<Theme>['M4LMenuItem'];
@@ -209,10 +202,6 @@ declare module '@mui/material/styles' {
209
202
  styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
210
203
  variants?: ComponentsVariants['M4LTypography'];
211
204
  };
212
- M4LTab?: {
213
- defaultProps?: ComponentsPropsList['M4LTab'];
214
- styleOverrides?: ComponentsOverrides<Theme>['M4LTab'];
215
- variants?: ComponentsVariants['M4LTab'];
216
- };
217
205
  }
206
+ }
218
207
  }
@@ -7,7 +7,7 @@ import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
7
7
  import "@geoman-io/leaflet-geoman-free";
8
8
  import clsx from "clsx";
9
9
  import { D as DivTabGpsToolsRoot } from "../../styles.js";
10
- import { T as Tab } from "../../../../../mui_extended/Tab/Tab.js";
10
+ import { T as Tab } from "../../../../../mui_extended/Tab/index.js";
11
11
  import { G as GeofencesList } from "./subcomponents/GeofencesList/index.js";
12
12
  import { u as useLayers } from "../../hooks/useLayers/index.js";
13
13
  import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../dictionary.js";
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
4
4
  import clsx from "clsx";
5
- import { T as Tab } from "../../../../../../../../../mui_extended/Tab/Tab.js";
5
+ import { T as Tab } from "../../../../../../../../../mui_extended/Tab/index.js";
6
6
  import { G as GeneralData } from "../GeneralData/index.js";
7
7
  import { C as ConfigData } from "../ConfigData/index.js";
8
8
  import { S as StyleData } from "../StyleData/index.js";
@@ -0,0 +1 @@
1
+ export declare const componentName = "M4LTab";
@@ -0,0 +1,4 @@
1
+ const componentName = "M4LTab";
2
+ export {
3
+ componentName as c
4
+ };
@@ -0,0 +1,10 @@
1
+ import { TabClassesType } from './types';
2
+ export declare const tabClasses: TabClassesType;
3
+ export declare function getTabUtilityClass(slot: string): string;
4
+ /**
5
+ * TODO: Documentar
6
+ */
7
+ export declare const tabUtilityClasses: () => {
8
+ skeleton: string;
9
+ root: string;
10
+ };
@@ -0,0 +1,25 @@
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
+ "skeleton"
8
+ /* states or variants of elements */
9
+ ]);
10
+ function getTabUtilityClass(slot) {
11
+ return generateUtilityClass(componentName, slot);
12
+ }
13
+ const tabUtilityClasses = () => {
14
+ const slots = {
15
+ root: ["root"],
16
+ skeleton: ["skeleton"]
17
+ };
18
+ const composedClasses = unstable_composeClasses(slots, getTabUtilityClass, {});
19
+ return {
20
+ ...composedClasses
21
+ };
22
+ };
23
+ export {
24
+ tabUtilityClasses as t
25
+ };
@@ -0,0 +1,7 @@
1
+ import { tabUtilityClasses } from '.';
2
+ export interface TabClassesType {
3
+ root: string;
4
+ skeleton: string;
5
+ }
6
+ export type TabClassesKey = keyof TabClassesType;
7
+ export type Classes = ReturnType<typeof tabUtilityClasses>;
@@ -0,0 +1 @@
1
+ export declare const COMPONENT_PREFIX = "m4l-tab";
@@ -0,0 +1,4 @@
1
+ const COMPONENT_PREFIX = "m4l-tab";
2
+ export {
3
+ COMPONENT_PREFIX as C
4
+ };
@@ -1 +1,5 @@
1
- export * from './Tab';
1
+ import { TabProps } from './types';
2
+ /**
3
+ * TODO: Documentar
4
+ */
5
+ export declare function Tab(props: TabProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useModuleSkeleton } from "@m4l/core";
3
+ import { Tab as Tab$1, Skeleton } from "@mui/material";
4
+ import { T as TabRoot, S as SKTTabWrapper } from "./styles.js";
5
+ import { t as tabUtilityClasses } from "./classes/index.js";
6
+ import clsx from "clsx";
7
+ import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.js";
8
+ import { g as getNameDataTestId } from "../../../test/getNameDataTestId.js";
9
+ import { C as COMPONENT_PREFIX } from "./constant.js";
10
+ function Tab(props) {
11
+ const { SKTWidth, SKTHeight, className, dataTestId = "", ...other } = props;
12
+ const isSkeleton = useModuleSkeleton();
13
+ const classes = tabUtilityClasses();
14
+ return /* @__PURE__ */ jsx(
15
+ TabRoot,
16
+ {
17
+ className: clsx(classes.root, className),
18
+ ...process.env.NODE_ENV !== "production" ? {
19
+ [TEST_PROP_ID]: getNameDataTestId(COMPONENT_PREFIX, "root", dataTestId)
20
+ } : {},
21
+ children: !isSkeleton ? /* @__PURE__ */ jsx(Tab$1, { ...other }) : /* @__PURE__ */ jsx(
22
+ SKTTabWrapper,
23
+ {
24
+ className: classes.skeleton,
25
+ ...process.env.NODE_ENV !== "production" ? {
26
+ [TEST_PROP_ID]: getNameDataTestId(
27
+ COMPONENT_PREFIX,
28
+ "skeleton",
29
+ dataTestId
30
+ )
31
+ } : {},
32
+ children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: SKTWidth, height: SKTHeight })
33
+ }
34
+ )
35
+ }
36
+ );
37
+ }
38
+ export {
39
+ Tab as T
40
+ };
@@ -0,0 +1,2 @@
1
+ export declare const TabRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
2
+ export declare const SKTTabWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ const TabRoot = styled("div")(({ theme }) => ({
3
+ ...theme.components?.M4LTab?.styleOverrides || {}
4
+ }));
5
+ const SKTTabWrapper = styled("div")(({ theme }) => ({
6
+ padding: theme.spacing(1.5, 2)
7
+ }));
8
+ export {
9
+ SKTTabWrapper as S,
10
+ TabRoot as T
11
+ };
@@ -0,0 +1,2 @@
1
+ import { TabClassesKey } from '../classes/types';
2
+ export declare const getNameTabDataTestId: (KEY: TabClassesKey, DATATESTID: string) => string;
@@ -1,57 +1,6 @@
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
- */
1
+ import { TabProps as MUITabProps } from '@mui/material';
2
+ export interface TabProps extends MUITabProps {
14
3
  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
- */
19
4
  SKTHeight: string | number;
20
- /**
21
- * Identificador único para pruebas unitarias.
22
- */
23
5
  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;
36
6
  }
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;
@@ -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/Tab';
27
+ export { Tab } from './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/Tab.js";
154
+ import { T as T5 } from "./components/mui_extended/Tab/index.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.Tab",
3
+ "version": "8.2.0",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -0,0 +1,31 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface TestAppWrapperProps {
3
+ children: ReactNode;
4
+ }
5
+ /**
6
+ * TestWrapper is a React functional component that provides a consistent testing environment
7
+ * for components that rely on various context providers.
8
+ *
9
+ * It wraps the children components with the following contexts:
10
+ * - ModuleSkeletonContext: Provides the skeleton loading state for components that require it.
11
+ * - HostThemeProviderMock: Mocks the theme provider to ensure components are styled correctly during tests.
12
+ * - AppearanceComponentProvider: Supplies the necessary context for appearance-related components.
13
+ *
14
+ * This wrapper is useful for reducing redundancy in tests by encapsulating common providers,
15
+ * allowing for cleaner and more maintainable test code.
16
+ * @param {Object} props - The properties passed to the component.
17
+ * @param {ReactNode} props.children - The child components that will be rendered within the context providers.
18
+ * @example
19
+ * // Usage example
20
+ * render(
21
+ * <TestWrapper>
22
+ * <MyComponent />
23
+ * </TestWrapper>
24
+ * );
25
+ * @author Cesar Garces - automatic
26
+ * @createdAt 2024-10-25 14:12:46 - automatic
27
+ * @updatedAt 2024-10-25 14:12:46 - automatic
28
+ * @updatedUser Cesar Garces - automatic
29
+ */
30
+ declare const TestAppWrapper: FC<TestAppWrapperProps>;
31
+ export default TestAppWrapper;
package/test/utils.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { cleanup, screen, act, fireEvent, within, waitFor, RenderResult } from '@testing-library/react';
2
- import { describe, expect } from 'vitest';
3
- import { default as userEvent } from '@testing-library/user-event';
1
+ import { act, cleanup, fireEvent, RenderResult, screen, waitFor, within } from '@testing-library/react';
4
2
  import { renderHook } from '@testing-library/react-hooks';
5
- import { default as React } from 'react';
3
+ import { default as userEvent, UserEvent } from '@testing-library/user-event';
4
+ import { ReactElement } from 'react';
5
+ import { describe, expect } from 'vitest';
6
6
  /**
7
7
  * TODO: Documentar
8
8
  * @author Juan Escobar - automatic
@@ -10,7 +10,27 @@ import { default as React } from 'react';
10
10
  * @updatedAt 2024-10-09 14:12:46 - automatic
11
11
  * @updatedUser Juan Escobar - automatic
12
12
  */
13
- declare const customRender: (ui: React.ReactElement, options?: {}) => RenderResult & {
13
+ declare const customRender: (ui: ReactElement, options?: {}) => RenderResult & {
14
14
  user: ReturnType<typeof userEvent.setup>;
15
15
  };
16
- export { customRender as render, renderHook, screen, cleanup, act, fireEvent, userEvent, within, waitFor, describe, expect, };
16
+ /**
17
+ * This function is a wrapper around the render function from @testing-library/react.
18
+ * Render Material UI components with the TestAppWrapper context.
19
+ * TestAppWrapper is a React functional component that provides a consistent testing environment
20
+ * for components that rely on various context providers.
21
+ * It wraps the children components with the following contexts:
22
+ * ModuleSkeletonContext, HostThemeProviderMock, and AppearanceComponentProvider.
23
+ * @param ui - The component to render.
24
+ * @param options - Additional options to pass to the render function.
25
+ * @returns The rendered component and the user event object.
26
+ * @example
27
+ * // Usage example
28
+ * const { renderUI, user } = renderMaterialUI(<MyComponent />);
29
+ * @author Andrés Quintero - automatic
30
+ * @createdAt 2024-10-09 14:12:46 - automatic
31
+ * @updatedAt 2024-10-09 14:12:46 - automatic
32
+ */
33
+ declare const renderMaterialUI: (ui: ReactElement, options?: {}) => RenderResult & {
34
+ user: UserEvent;
35
+ };
36
+ export { act, cleanup, describe, expect, fireEvent, customRender as render, renderHook, renderMaterialUI, screen, userEvent, waitFor, within, };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * Define los nombres de los slots de estilo para el componente `Tab`. Estos slots se utilizan para
3
- * aplicar estilos específicos y crear clases CSS únicas para los distintos elementos del componente.
4
- */
5
- export declare enum TabSlots {
6
- root = "root",
7
- icon = "icon",
8
- tipography = "tipography"
9
- }
@@ -1,9 +0,0 @@
1
- var TabSlots = /* @__PURE__ */ ((TabSlots2) => {
2
- TabSlots2["root"] = "root";
3
- TabSlots2["icon"] = "icon";
4
- TabSlots2["tipography"] = "tipography";
5
- return TabSlots2;
6
- })(TabSlots || {});
7
- export {
8
- TabSlots as T
9
- };
@@ -1,26 +0,0 @@
1
- /**
2
- * `RootStyled`:
3
- * Componente personalizado de pestaña (`MuiTab`) basado en el componente de pestañas de Material-UI.
4
- * Utiliza el slot `root` para agregar estilos específicos al botón de la pestaña en la interfaz.
5
- */
6
- export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').TabOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
- 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;
8
- }, "children" | "value" | "action" | "style" | "icon" | "disabled" | "sx" | "classes" | "className" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "label" | "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" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "label" | "key" | "iconPosition" | "wrapped"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').TabOwnerState> & Record<string, unknown> & {
9
- ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
10
- }, {}, {}>;
11
- /**
12
- * `TypographyStyled`:
13
- * Componente de texto estilizado basado en `Typography`, se usa para mostrar texto en cada pestaña.
14
- * El slot `tipography` permite la personalización del estilo tipográfico de las pestañas.
15
- */
16
- export declare const TypographyStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Typography/types').TypographyProps, keyof import('../../Typography/types').TypographyProps> & 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
- }, {}, {}>;
19
- /**
20
- * `IconStyled`:
21
- * Componente de ícono estilizado basado en `Icon`, utilizado para mostrar un ícono en cada pestaña.
22
- * Usa el slot `icon` para modificar o añadir estilos específicos a los íconos en las pestañas.
23
- */
24
- 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> & {
25
- ownerState: Partial<import('../types').TabOwnerState> & Record<string, unknown>;
26
- }, {}, {}>;
@@ -1,24 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
- import { Tab } from "@mui/material";
3
- import { t as tabStyles } from "../Tab.styles.js";
4
- import { T as TAB_KEY_COMPONENT } from "../constants.js";
5
- import { T as TabSlots } from "./TabEnum.js";
6
- import { T as Typography } from "../../Typography/Typography.js";
7
- import { I as Icon } from "../../../Icon/Icon.js";
8
- const RootStyled = styled(Tab, {
9
- name: TAB_KEY_COMPONENT,
10
- slot: TabSlots.root
11
- })(tabStyles?.root);
12
- const TypographyStyled = styled(Typography, {
13
- name: TAB_KEY_COMPONENT,
14
- slot: TabSlots.tipography
15
- })(tabStyles?.tipography);
16
- const IconStyled = styled(Icon, {
17
- name: TAB_KEY_COMPONENT,
18
- slot: TabSlots.icon
19
- })(tabStyles?.icon);
20
- export {
21
- IconStyled as I,
22
- RootStyled as R,
23
- TypographyStyled as T
24
- };
@@ -1,2 +0,0 @@
1
- export * from './TabSlots';
2
- export type { TabSlots } from './TabEnum';
@@ -1,5 +0,0 @@
1
- import { TabProps } from './types';
2
- /**
3
- * Componente `Tab` que representa una pestaña interactiva.
4
- */
5
- export declare function Tab(props: TabProps): import("react/jsx-runtime").JSX.Element;
@@ -1,67 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
1
- import { TabStyles } from './types';
2
- /**
3
- * Estilos personalizados para el componente Tab de Material-UI.
4
- */
5
- export declare const tabStyles: TabStyles;
@@ -1,147 +0,0 @@
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
- };
@@ -1,14 +0,0 @@
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";
@@ -1,10 +0,0 @@
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,36 +0,0 @@
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;
@@ -1,36 +0,0 @@
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;
@@ -1,28 +0,0 @@
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;
@@ -1,32 +0,0 @@
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;