@m4l/components 9.2.39 → 9.2.41

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.
@@ -1,5 +1,5 @@
1
1
  import { TabContentProps } from './types';
2
2
  /**
3
- * TODO: Documentar
3
+ * Componente `TabContent`, que es un envoltorio para las pestañas de `Tabs`
4
4
  */
5
5
  export declare const TabContent: (props: TabContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { u as useTabContentUtilityClasses } from "./classes/index.js";
4
- import { T as TabContentRoot } from "./styles.js";
2
+ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
3
+ import { T as TAB_CONTENT_KEY_COMPONENT } from "./constants.js";
4
+ import { T as TabContentRootStyled } from "./slots/TabContentSlots.js";
5
5
  const TabContent = (props) => {
6
6
  const { children, className, ...others } = props;
7
- const classes = useTabContentUtilityClasses();
8
- return /* @__PURE__ */ jsx(TabContentRoot, { className: clsx(classes.root, className), ...others, children });
7
+ const root = getComponentSlotRoot(TAB_CONTENT_KEY_COMPONENT);
8
+ return /* @__PURE__ */ jsx(TabContentRootStyled, { ownerState: {}, className: root, ...others, children });
9
9
  };
10
10
  export {
11
11
  TabContent as T
@@ -0,0 +1,2 @@
1
+ import { TabContentStyles } from './types';
2
+ export declare const tabContentStyles: TabContentStyles;
@@ -0,0 +1,32 @@
1
+ const tabContentStyles = {
2
+ /**
3
+ * Elemento root referencia a `TabContent`
4
+ */
5
+ root: ({ theme }) => ({
6
+ padding: theme.vars.size.baseSpacings.sp3,
7
+ display: "flex",
8
+ overflow: "hidden",
9
+ height: "100%",
10
+ flexDirection: "column",
11
+ gap: theme.vars.size.baseSpacings.sp2,
12
+ background: theme.vars.palette.background.default,
13
+ borderRadius: theme.vars.size.borderRadius.r1,
14
+ borderTopLeftRadius: theme.vars.size.borderRadius.r0,
15
+ position: "relative",
16
+ flex: 1,
17
+ border: theme.vars.size.borderStroke.container,
18
+ borderColor: theme.vars.palette?.border.secondary,
19
+ boxSizing: "border-box",
20
+ zIndex: "0",
21
+ top: "-1px",
22
+ "& .M4LStack-root": {
23
+ gap: `${theme.vars.size.baseSpacings.sp2} !important`
24
+ },
25
+ "&.M4LTabContent-root > div": {
26
+ gap: theme.vars.size.baseSpacings.sp2
27
+ }
28
+ })
29
+ };
30
+ export {
31
+ tabContentStyles as t
32
+ };
@@ -0,0 +1 @@
1
+ export declare const TAB_CONTENT_KEY_COMPONENT = "M4LTabContent";
@@ -0,0 +1,4 @@
1
+ const TAB_CONTENT_KEY_COMPONENT = "M4LTabContent";
2
+ export {
3
+ TAB_CONTENT_KEY_COMPONENT as T
4
+ };
@@ -1,2 +1 @@
1
1
  export { TabContent } from './TabContent';
2
- export type { TabContentClassesKey } from './classes/types';
@@ -0,0 +1,3 @@
1
+ export declare enum TabContentSlots {
2
+ root = "root"
3
+ }
@@ -0,0 +1,7 @@
1
+ var TabContentSlots = /* @__PURE__ */ ((TabContentSlots2) => {
2
+ TabContentSlots2["root"] = "root";
3
+ return TabContentSlots2;
4
+ })(TabContentSlots || {});
5
+ export {
6
+ TabContentSlots as T
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare const TabContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../..').TabsProps> & Record<string, unknown> & {
2
+ ownerState: Partial<import('../..').TabsProps> & Record<string, unknown>;
3
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { T as TAB_CONTENT_KEY_COMPONENT } from "../constants.js";
3
+ import { t as tabContentStyles } from "../TabContent.styles.js";
4
+ import { T as TabContentSlots } from "./TabContentEnum.js";
5
+ const TabContentRootStyled = styled("div", {
6
+ slot: TabContentSlots.root,
7
+ name: TAB_CONTENT_KEY_COMPONENT
8
+ })(tabContentStyles.root);
9
+ export {
10
+ TabContentRootStyled as T
11
+ };
@@ -1,7 +1,11 @@
1
+ import { Theme } from '@mui/material';
2
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
1
3
  import { Key } from 'react';
2
- export interface TabContentProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ import { TABS_KEY_COMPONENT } from '../Tabs/constants';
5
+ import { TabContentSlots } from './slots/TabContentEnum';
6
+ export interface TabContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
3
7
  children: React.ReactNode;
4
8
  style?: React.CSSProperties;
5
9
  key?: Key | null | undefined;
6
- className?: string | undefined;
7
10
  }
11
+ export type TabContentStyles = OverridesStyleRules<keyof typeof TabContentSlots, typeof TABS_KEY_COMPONENT, Theme>;
@@ -4,19 +4,22 @@ const tabsStyles = {
4
4
  */
5
5
  root: ({ theme }) => ({
6
6
  position: "relative",
7
- zIndex: "unset",
7
+ zIndex: 1,
8
8
  display: "flex",
9
9
  overflow: "auto",
10
10
  width: "100%",
11
11
  height: "fit-content",
12
12
  maxWidth: "fit-content",
13
13
  minHeight: "fit-content",
14
- background: theme.vars.palette.default.enabledOpacity,
14
+ background: theme.vars.palette.background.default,
15
15
  paddingBottom: theme.vars.size.baseSpacings.sp0,
16
16
  gap: theme.vars.size.baseSpacings.sp0,
17
17
  borderRadius: theme.vars.size.borderRadius.r1,
18
18
  borderBottomLeftRadius: theme.vars.size.borderRadius.r0,
19
19
  borderBottomRightRadius: theme.vars.size.borderRadius.r0,
20
+ "& .MuiTabs-flexContainer": {
21
+ background: theme.vars.palette.default.enabledOpacity
22
+ },
20
23
  "& .MuiTabs-scroller": {
21
24
  overflow: "visible !important"
22
25
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.2.39",
3
+ "version": "9.2.41",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"
@@ -0,0 +1,17 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { TabContent } from '../../../../../src';
3
+ import { Tab } from '../../../../../src/components/mui_extended/Tab';
4
+ /**
5
+ * El componente TabContent agrupa contenido de el tab seleccionado.
6
+ */
7
+ declare const meta: Meta<typeof TabContent>;
8
+ export default meta;
9
+ type Story = StoryObj<typeof Tab>;
10
+ /**
11
+ * TabContent en estado Base
12
+ */
13
+ export declare const Base: Story;
14
+ /**
15
+ * TabContent en estado Skeleton
16
+ */
17
+ export declare const Skeleton: Story;
@@ -1 +0,0 @@
1
- export declare const componentName = "M4LTabContent";
@@ -1,4 +0,0 @@
1
- const componentName = "M4LTabContent";
2
- export {
3
- componentName as c
4
- };
@@ -1,9 +0,0 @@
1
- import { TabContentClassesType } from './types';
2
- export declare const tabContentClasses: TabContentClassesType;
3
- export declare function getTabContentUtilityClass(slot: string): string;
4
- /**
5
- * TODO: Documentar
6
- */
7
- export declare const useTabContentUtilityClasses: () => {
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 getTabContentUtilityClass(slot) {
10
- return generateUtilityClass(componentName, slot);
11
- }
12
- const useTabContentUtilityClasses = () => {
13
- const slots = {
14
- root: ["root"]
15
- };
16
- const composedClasses = unstable_composeClasses(slots, getTabContentUtilityClass, {});
17
- return {
18
- ...composedClasses
19
- };
20
- };
21
- export {
22
- useTabContentUtilityClasses as u
23
- };
@@ -1,6 +0,0 @@
1
- import { useTabContentUtilityClasses } from '.';
2
- export interface TabContentClassesType {
3
- root: string;
4
- }
5
- export type TabContentClassesKey = keyof TabContentClassesType;
6
- export type Classes = ReturnType<typeof useTabContentUtilityClasses>;
@@ -1 +0,0 @@
1
- export declare const TabContentRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,7 +0,0 @@
1
- import { styled } from "@mui/material";
2
- const TabContentRoot = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LTabContent?.styleOverrides || {}
4
- }));
5
- export {
6
- TabContentRoot as T
7
- };