@mp-front/components 0.0.1-next-2 → 0.0.1-next-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.
Files changed (38) hide show
  1. package/dist/index-BP9HuXkV.cjs +31 -0
  2. package/dist/index-C0ENqrRs.js +570 -0
  3. package/dist/layout/content.component.d.ts +19 -0
  4. package/dist/layout/content.component.d.ts.map +1 -0
  5. package/dist/layout/footer.component.d.ts +17 -0
  6. package/dist/layout/footer.component.d.ts.map +1 -0
  7. package/dist/layout/header/header.component.d.ts +33 -0
  8. package/dist/layout/header/header.component.d.ts.map +1 -0
  9. package/dist/layout/header/header.types.d.ts +30 -0
  10. package/dist/layout/header/header.types.d.ts.map +1 -0
  11. package/dist/layout/header/left-side.component.d.ts +19 -0
  12. package/dist/layout/header/left-side.component.d.ts.map +1 -0
  13. package/dist/layout/header/right-side.component.d.ts +27 -0
  14. package/dist/layout/header/right-side.component.d.ts.map +1 -0
  15. package/dist/layout/header/store.component.d.ts +20 -0
  16. package/dist/layout/header/store.component.d.ts.map +1 -0
  17. package/dist/layout/header/user.component.d.ts +27 -0
  18. package/dist/layout/header/user.component.d.ts.map +1 -0
  19. package/dist/layout/index.d.ts +2 -0
  20. package/dist/layout/index.d.ts.map +1 -0
  21. package/dist/layout/root-layout.component.d.ts +46 -0
  22. package/dist/layout/root-layout.component.d.ts.map +1 -0
  23. package/dist/layout/root-layout.stories.d.ts +12 -0
  24. package/dist/layout/root-layout.stories.d.ts.map +1 -0
  25. package/dist/layout/root-layout.test.d.ts +2 -0
  26. package/dist/layout/root-layout.test.d.ts.map +1 -0
  27. package/dist/layout/root-layout.types.d.ts +10 -0
  28. package/dist/layout/root-layout.types.d.ts.map +1 -0
  29. package/dist/styles.css +1 -1
  30. package/dist/ui-components-hooks.cjs +1 -1
  31. package/dist/ui-components-hooks.js +29 -170
  32. package/dist/ui-components-index.cjs +33 -63
  33. package/dist/ui-components-index.js +7171 -7722
  34. package/dist/ui-components-layout.cjs +135 -0
  35. package/dist/ui-components-layout.js +19938 -0
  36. package/dist/useTranslation-Cenukg7h.js +147 -0
  37. package/dist/useTranslation-CnSCmJou.cjs +1 -0
  38. package/package.json +6 -18
@@ -0,0 +1,33 @@
1
+ import { ComponentProps } from 'react';
2
+ /**
3
+ * Componente de encabezado del layout.
4
+ * Componente compuesto que incluye subcomponentes: LeftSide, Store, User y RightSide.
5
+ *
6
+ * @param {ComponentProps<"header">} props - Propiedades estándar de un elemento header
7
+ * @returns {JSX.Element} Elemento header con estilos sticky y subcomponentes adjuntos
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { Header } from '@/layout'
12
+ *
13
+ * <Header>
14
+ * <Header.LeftSide>Logo</Header.LeftSide>
15
+ * <Header.RightSide>
16
+ * <Header.Store>Tienda 001</Header.Store>
17
+ * <Header.User name="Juan" role="Admin" />
18
+ * </Header.RightSide>
19
+ * </Header>
20
+ * ```
21
+ */
22
+ declare const Header: {
23
+ ({ className, ...props }: ComponentProps<"header">): import("react/jsx-runtime").JSX.Element;
24
+ LeftSide: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
25
+ Store: ({ className, children }: import('./header.types').StoreProps) => import("react/jsx-runtime").JSX.Element;
26
+ User: ({ name, role, imageUrl, items }: import('./header.types').UserProps) => import("react/jsx-runtime").JSX.Element;
27
+ RightSide: {
28
+ ({ className, children }: import('./header.types').RightSideProps): import("react/jsx-runtime").JSX.Element;
29
+ disPlayName: string;
30
+ };
31
+ };
32
+ export { Header };
33
+ //# sourceMappingURL=header.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.component.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/header.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAO3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,MAAM;8BAA6B,cAAc,CAAC,QAAQ,CAAC;;;;;;;;CAUhE,CAAA;AAOD,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { DropdownItem } from '../../components/dropdown/dropdown.types';
2
+ import { ReactNode, ComponentProps } from 'react';
3
+ /**
4
+ * Propiedades para el componente RightSide del header.
5
+ */
6
+ export interface RightSideProps extends Pick<ComponentProps<"div">, "className"> {
7
+ /** Elementos hijos a renderizar con separadores entre ellos */
8
+ children: ReactNode[];
9
+ }
10
+ /**
11
+ * Propiedades para el componente Store del header.
12
+ */
13
+ export interface StoreProps extends Pick<ComponentProps<"div">, "className"> {
14
+ /** Nombre de la tienda a mostrar */
15
+ children?: string;
16
+ }
17
+ /**
18
+ * Propiedades para el componente User del header.
19
+ */
20
+ export interface UserProps {
21
+ /** Nombre del usuario */
22
+ name?: string;
23
+ /** Rol o cargo del usuario */
24
+ role?: string;
25
+ /** URL de la imagen de avatar del usuario */
26
+ imageUrl?: string;
27
+ /** Items del menú desplegable del usuario */
28
+ items?: DropdownItem[];
29
+ }
30
+ //# sourceMappingURL=header.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.types.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/header.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAChD,+DAA+D;IAC/D,QAAQ,EAAE,SAAS,EAAE,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC1E,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;CACvB"}
@@ -0,0 +1,19 @@
1
+ import { ComponentProps } from 'react';
2
+ /**
3
+ * Componente del lado izquierdo del header.
4
+ * Contenedor para elementos como logos o navegación principal.
5
+ *
6
+ * @param {ComponentProps<"div">} props - Propiedades estándar de un elemento div
7
+ * @returns {JSX.Element} Contenedor con estilos para SVG de ancho fijo
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { LeftSide } from '@/layout/header'
12
+ *
13
+ * <LeftSide>
14
+ * <Logo />
15
+ * </LeftSide>
16
+ * ```
17
+ */
18
+ export declare const LeftSide: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
19
+ //# sourceMappingURL=left-side.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"left-side.component.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/left-side.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,4BAA6B,cAAc,CAAC,KAAK,CAAC,4CAEtE,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { RightSideProps } from './header.types';
2
+ /**
3
+ * Componente del lado derecho del header.
4
+ * Renderiza elementos hijos con separadores verticales entre ellos.
5
+ * Retorna null si el array de hijos está vacío.
6
+ *
7
+ * @param {RightSideProps} props - Propiedades del componente
8
+ * @param {string} [props.className] - Clases CSS adicionales
9
+ * @param {ReactNode[]} props.children - Array de elementos a renderizar
10
+ * @returns {JSX.Element | null} Contenedor con elementos separados o null
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { RightSide } from '@/layout/header'
15
+ *
16
+ * <RightSide>
17
+ * <Store>Tienda 001</Store>
18
+ * <User name="Juan" />
19
+ * </RightSide>
20
+ * ```
21
+ */
22
+ declare const RightSide: {
23
+ ({ className, children }: RightSideProps): import("react/jsx-runtime").JSX.Element;
24
+ disPlayName: string;
25
+ };
26
+ export { RightSide };
27
+ //# sourceMappingURL=right-side.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"right-side.component.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/right-side.component.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,SAAS;8BAA6B,cAAc;;CAyBzD,CAAA;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { StoreProps } from './header.types';
2
+ /**
3
+ * Componente de tienda del header.
4
+ * Muestra el nombre de la tienda actual con un icono.
5
+ * Retorna null si no se proporciona nombre o está vacío.
6
+ *
7
+ * @param {StoreProps} props - Propiedades del componente
8
+ * @param {string} [props.className] - Clases CSS adicionales
9
+ * @param {string} [props.children] - Nombre de la tienda
10
+ * @returns {JSX.Element | null} Información de la tienda o null
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { Store } from '@/layout/header'
15
+ *
16
+ * <Store>Tienda Central 001</Store>
17
+ * ```
18
+ */
19
+ export declare const Store: ({ className, children }: StoreProps) => import("react/jsx-runtime").JSX.Element;
20
+ //# sourceMappingURL=store.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.component.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/store.component.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAIzD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,4BAA6B,UAAU,4CAoBxD,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { UserProps } from './header.types';
2
+ /**
3
+ * Componente de usuario del header.
4
+ * Muestra información del usuario con avatar, nombre, rol y menú desplegable.
5
+ * Retorna null si no se proporciona nombre o está vacío.
6
+ *
7
+ * @param {UserProps} props - Propiedades del componente
8
+ * @param {string} [props.name] - Nombre del usuario
9
+ * @param {string} [props.role] - Rol o cargo del usuario
10
+ * @param {string} [props.imageUrl] - URL de la imagen de avatar
11
+ * @param {DropdownItem[]} [props.items] - Items del menú desplegable
12
+ * @returns {JSX.Element | null} Información del usuario con dropdown o null
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { User } from '@/layout/header'
17
+ *
18
+ * <User
19
+ * name="Juan Pérez"
20
+ * role="Administrador"
21
+ * imageUrl="/avatar.jpg"
22
+ * items={[{ label: 'Perfil', id: '1' }]}
23
+ * />
24
+ * ```
25
+ */
26
+ export declare const User: ({ name, role, imageUrl, items }: UserProps) => import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=user.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.component.d.ts","sourceRoot":"","sources":["../../../src/lib/layout/header/user.component.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,IAAI,oCAAqC,SAAS,4CAuB9D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { RootLayout } from './root-layout.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,46 @@
1
+ import { RootLayoutProps } from './root-layout.types';
2
+ /**
3
+ * Componente de layout raíz.
4
+ * Componente compuesto que proporciona la estructura principal del layout.
5
+ * Incluye subcomponentes: Header, Content y Footer.
6
+ * Soporta estado de carga con overlay mediante Portal.
7
+ *
8
+ * @param {RootLayoutProps} props - Propiedades del componente
9
+ * @param {ReactNode} props.children - Elementos hijos a renderizar
10
+ * @param {boolean} [props.loading] - Estado de carga que muestra un overlay
11
+ * @returns {JSX.Element} Contenedor principal del layout con subcomponentes adjuntos
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { RootLayout } from '@/layout'
16
+ *
17
+ * <RootLayout loading={false}>
18
+ * <RootLayout.Header>
19
+ * <div>Header</div>
20
+ * </RootLayout.Header>
21
+ * <RootLayout.Content>
22
+ * <h1>Contenido</h1>
23
+ * </RootLayout.Content>
24
+ * <RootLayout.Footer>
25
+ * © 2024
26
+ * </RootLayout.Footer>
27
+ * </RootLayout>
28
+ * ```
29
+ */
30
+ declare const RootLayout: {
31
+ ({ children, loading, ...props }: RootLayoutProps): import("react/jsx-runtime").JSX.Element;
32
+ Header: {
33
+ ({ className, ...props }: import('react').ComponentProps<"header">): import("react/jsx-runtime").JSX.Element;
34
+ LeftSide: ({ className, ...props }: import('react').ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
35
+ Store: ({ className, children }: import('./header/header.types').StoreProps) => import("react/jsx-runtime").JSX.Element;
36
+ User: ({ name, role, imageUrl, items }: import('./header/header.types').UserProps) => import("react/jsx-runtime").JSX.Element;
37
+ RightSide: {
38
+ ({ className, children }: import('./header/header.types').RightSideProps): import("react/jsx-runtime").JSX.Element;
39
+ disPlayName: string;
40
+ };
41
+ };
42
+ Content: ({ className, children, ...props }: import('react').ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
43
+ Footer: ({ className, ...props }: import('react').ComponentProps<"footer">) => import("react/jsx-runtime").JSX.Element;
44
+ };
45
+ export { RootLayout };
46
+ //# sourceMappingURL=root-layout.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-layout.component.d.ts","sourceRoot":"","sources":["../../src/lib/layout/root-layout.component.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,UAAU;sCAAqC,eAAe;;;;;;;;;;;;;CAanE,CAAA;AAMD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { RootLayout } from './root-layout.component';
3
+ declare const meta: Meta<typeof RootLayout>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const WithoutHeader: Story;
8
+ export declare const WithoutFooter: Story;
9
+ export declare const ContentOnly: Story;
10
+ export declare const CompleteLayout: Story;
11
+ export declare const EmptyLayout: Story;
12
+ //# sourceMappingURL=root-layout.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-layout.stories.d.ts","sourceRoot":"","sources":["../../src/lib/layout/root-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAajC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAU3B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KASzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=root-layout.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-layout.test.d.ts","sourceRoot":"","sources":["../../src/lib/layout/root-layout.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ /**
3
+ * Propiedades para el componente RootLayout.
4
+ * Extiende las propiedades estándar del elemento main.
5
+ */
6
+ export interface RootLayoutProps extends ComponentProps<"main"> {
7
+ /** Estado de carga que muestra un overlay sobre el contenido */
8
+ loading?: boolean;
9
+ }
10
+ //# sourceMappingURL=root-layout.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-layout.types.d.ts","sourceRoot":"","sources":["../../src/lib/layout/root-layout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC7D,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}