@pipelinesolucoes/menu 1.0.0-beta.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.
- package/LICENSE +78 -0
- package/README.md +166 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +19 -0
- package/dist/app/layout.js.map +1 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/page.js +6 -0
- package/dist/app/page.js.map +1 -0
- package/dist/components/BarraFerramentas.d.ts +13 -0
- package/dist/components/BarraFerramentas.js +31 -0
- package/dist/components/BarraFerramentas.js.map +1 -0
- package/dist/components/BarraFerramentasHamburguer.d.ts +16 -0
- package/dist/components/BarraFerramentasHamburguer.js +42 -0
- package/dist/components/BarraFerramentasHamburguer.js.map +1 -0
- package/dist/components/BarraFerramentasSaaS.d.ts +10 -0
- package/dist/components/BarraFerramentasSaaS.js +18 -0
- package/dist/components/BarraFerramentasSaaS.js.map +1 -0
- package/dist/components/BarraFerramentasStyled.d.ts +14 -0
- package/dist/components/BarraFerramentasStyled.js +61 -0
- package/dist/components/BarraFerramentasStyled.js.map +1 -0
- package/dist/components/ItemMenu.d.ts +30 -0
- package/dist/components/ItemMenu.js +86 -0
- package/dist/components/ItemMenu.js.map +1 -0
- package/dist/components/MenuHamburguer.d.ts +12 -0
- package/dist/components/MenuHamburguer.js +36 -0
- package/dist/components/MenuHamburguer.js.map +1 -0
- package/dist/components/MenuHorizontal.d.ts +34 -0
- package/dist/components/MenuHorizontal.js +52 -0
- package/dist/components/MenuHorizontal.js.map +1 -0
- package/dist/components/MenuVertical.d.ts +35 -0
- package/dist/components/MenuVertical.js +53 -0
- package/dist/components/MenuVertical.js.map +1 -0
- package/dist/components/SideNav.d.ts +83 -0
- package/dist/components/SideNav.js +55 -0
- package/dist/components/SideNav.js.map +1 -0
- package/dist/components/drawer/DesktopDrawer.d.ts +64 -0
- package/dist/components/drawer/DesktopDrawer.js +198 -0
- package/dist/components/drawer/DesktopDrawer.js.map +1 -0
- package/dist/components/drawer/DrawerResponsive.d.ts +74 -0
- package/dist/components/drawer/DrawerResponsive.js +96 -0
- package/dist/components/drawer/DrawerResponsive.js.map +1 -0
- package/dist/components/drawer/IconDrawerTrigger.d.ts +85 -0
- package/dist/components/drawer/IconDrawerTrigger.js +137 -0
- package/dist/components/drawer/IconDrawerTrigger.js.map +1 -0
- package/dist/components/drawer/LogoutIcon.d.ts +4 -0
- package/dist/components/drawer/LogoutIcon.js +10 -0
- package/dist/components/drawer/LogoutIcon.js.map +1 -0
- package/dist/components/drawer/MobileDrawer.d.ts +64 -0
- package/dist/components/drawer/MobileDrawer.js +158 -0
- package/dist/components/drawer/MobileDrawer.js.map +1 -0
- package/dist/components/drawer/UserAvatarMenu.d.ts +77 -0
- package/dist/components/drawer/UserAvatarMenu.js +103 -0
- package/dist/components/drawer/UserAvatarMenu.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/_app.d.ts +2 -0
- package/dist/pages/_app.js +20 -0
- package/dist/pages/_app.js.map +1 -0
- package/dist/pages/_document.d.ts +9 -0
- package/dist/pages/_document.js +33 -0
- package/dist/pages/_document.js.map +1 -0
- package/dist/theme.d.ts +35 -0
- package/dist/theme.js +142 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Drawer.d.ts +66 -0
- package/dist/types/Drawer.js +2 -0
- package/dist/types/Drawer.js.map +1 -0
- package/dist/types/ItemMenuConfig.d.ts +6 -0
- package/dist/types/ItemMenuConfig.js +2 -0
- package/dist/types/ItemMenuConfig.js.map +1 -0
- package/dist/types/NavItem.d.ts +5 -0
- package/dist/types/NavItem.js +2 -0
- package/dist/types/NavItem.js.map +1 -0
- package/dist/types/RotaMenuConfig.d.ts +4 -0
- package/dist/types/RotaMenuConfig.js +2 -0
- package/dist/types/RotaMenuConfig.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
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C,YAAY,IACX,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,eAAe,EACjC,sBAAsB,EAAE,oBAAoB,EAC5C,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,UAAU,EACvB,aAAa,EAAE,YAAY,EAC3B,YAAY,EAAE,WAAW,EACzB,sBAAsB,EAAE,oBAAoB,EAC5C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,gBACR,UAAU,YAErB,QAAQ,GACI,CAChB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC,gBAAgB;AAClD,QAAgB,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,kBAAkB;AAE3D,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ItemMenuConfig } from '@/types/ItemMenuConfig';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { SvgIconProps } from '@mui/material';
|
|
5
|
+
interface MenuHamburguerProps {
|
|
6
|
+
listaItemMenu?: ItemMenuConfig[];
|
|
7
|
+
background_color?: string;
|
|
8
|
+
color: string;
|
|
9
|
+
imageHamburguer: () => ReactElement<HTMLImageElement> | ReactElement<SvgIconProps>;
|
|
10
|
+
}
|
|
11
|
+
declare const MenuHamburguer: React.FC<MenuHamburguerProps>;
|
|
12
|
+
export default MenuHamburguer;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import IconButton from '@mui/material/IconButton';
|
|
6
|
+
import Menu from '@mui/material/Menu';
|
|
7
|
+
import { SpanBody1 } from './BarraFerramentasStyled';
|
|
8
|
+
const MenuHamburguer = ({ listaItemMenu, background_color = "transparent", color, imageHamburguer }) => {
|
|
9
|
+
const [anchorElNav, setAnchorElNav] = React.useState(null);
|
|
10
|
+
const handleOpenNavMenu = (event) => {
|
|
11
|
+
setAnchorElNav(event.currentTarget);
|
|
12
|
+
};
|
|
13
|
+
const handleCloseNavMenu = () => {
|
|
14
|
+
setAnchorElNav(null);
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(Box, { children: [_jsx(IconButton, { size: "large", "aria-label": "menu hamburguer", "aria-haspopup": "true", onClick: handleOpenNavMenu, color: "inherit", children: imageHamburguer() }), _jsx(Menu, { anchorEl: anchorElNav, anchorOrigin: {
|
|
17
|
+
vertical: 'bottom',
|
|
18
|
+
horizontal: 'left',
|
|
19
|
+
}, keepMounted: true, transformOrigin: {
|
|
20
|
+
vertical: 'top',
|
|
21
|
+
horizontal: 'left',
|
|
22
|
+
}, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: { display: { xs: 'block', md: 'none', paddingTop: '0', paddingBottom: '0' } }, children: _jsx("nav", { children: _jsx(Box, { display: "flex", flexDirection: "column", sx: { padding: "24px", gap: "16px", backgroundColor: background_color }, children: listaItemMenu && listaItemMenu.length > 0
|
|
23
|
+
? (listaItemMenu.map((item, index) => {
|
|
24
|
+
const el = item.component;
|
|
25
|
+
const type = el.type;
|
|
26
|
+
if (type.typeName === "ItemMenu") {
|
|
27
|
+
return React.cloneElement(el, { key: index, afterClick: handleCloseNavMenu });
|
|
28
|
+
}
|
|
29
|
+
return React.cloneElement(el, { key: index });
|
|
30
|
+
}))
|
|
31
|
+
: (_jsx(SpanBody1, { text_color: color, children: "carregando..." })) }) }) })] }));
|
|
32
|
+
};
|
|
33
|
+
MenuHamburguer.displayName = "MenuHamburguer"; // para DevTools
|
|
34
|
+
MenuHamburguer.typeName = "MenuHamburguer"; // para seu código
|
|
35
|
+
export default MenuHamburguer;
|
|
36
|
+
//# sourceMappingURL=MenuHamburguer.js.map
|
|
@@ -0,0 +1 @@
|
|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
|
|
6
|
+
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
/**
|
|
8
|
+
* Props do componente MenuHorizontal
|
|
9
|
+
*/
|
|
10
|
+
interface MenuHorizontalProps {
|
|
11
|
+
/**
|
|
12
|
+
* Lista de itens do menu horizontal. Cada item deve seguir a interface `ItemMenuConfig`.
|
|
13
|
+
*/
|
|
14
|
+
listaItemMenu: ItemMenuConfig[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Componente MenuHorizontal
|
|
18
|
+
*
|
|
19
|
+
* Renderiza um menu horizontal de itens customizáveis. Cada item é passado via `listaItemMenu` como um componente React,
|
|
20
|
+
* e o menu cuida de renderizá-los dentro de um container horizontal com espaçamento uniforme.
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* Exemplo de uso:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <MenuHorizontal
|
|
26
|
+
* listaItemMenu={[
|
|
27
|
+
* { component: <Button>Home</Button> },
|
|
28
|
+
* { component: <Button>Perfil</Button> }
|
|
29
|
+
* ]}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare const MenuHorizontal: React.FC<MenuHorizontalProps>;
|
|
34
|
+
export default MenuHorizontal;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { styled } from '@mui/material';
|
|
6
|
+
/**
|
|
7
|
+
* Container principal do menu horizontal
|
|
8
|
+
*/
|
|
9
|
+
export const Container = styled('div')(() => ({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
flexGrow: 1,
|
|
15
|
+
gap: '16px',
|
|
16
|
+
width: '100%',
|
|
17
|
+
}));
|
|
18
|
+
/**
|
|
19
|
+
* Componente MenuHorizontal
|
|
20
|
+
*
|
|
21
|
+
* Renderiza um menu horizontal de itens customizáveis. Cada item é passado via `listaItemMenu` como um componente React,
|
|
22
|
+
* e o menu cuida de renderizá-los dentro de um container horizontal com espaçamento uniforme.
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* Exemplo de uso:
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <MenuHorizontal
|
|
28
|
+
* listaItemMenu={[
|
|
29
|
+
* { component: <Button>Home</Button> },
|
|
30
|
+
* { component: <Button>Perfil</Button> }
|
|
31
|
+
* ]}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
const MenuHorizontal = ({ listaItemMenu }) => {
|
|
36
|
+
const [buttons, setButtons] = React.useState(null);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (listaItemMenu) {
|
|
39
|
+
const constructedButtons = listaItemMenu.map((item, index) => React.cloneElement(item.component, { key: index }));
|
|
40
|
+
setButtons(constructedButtons);
|
|
41
|
+
}
|
|
42
|
+
}, [listaItemMenu]);
|
|
43
|
+
if (buttons) {
|
|
44
|
+
return _jsx(Container, { children: buttons });
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return _jsx(Container, { children: "carregando..." });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
MenuHorizontal.displayName = "MenuHorizontal"; // para DevTools
|
|
51
|
+
export default MenuHorizontal;
|
|
52
|
+
//# sourceMappingURL=MenuHorizontal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuHorizontal.js","sourceRoot":"","sources":["../../src/components/MenuHorizontal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/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2
|
+
import { ItemMenuConfig } from '@/types/ItemMenuConfig';
|
|
3
|
+
/**
|
|
4
|
+
* Container principal do menu vertical
|
|
5
|
+
*/
|
|
6
|
+
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
/**
|
|
8
|
+
* Props do componente MenuVertical
|
|
9
|
+
*/
|
|
10
|
+
interface MenuVerticalProps {
|
|
11
|
+
/**
|
|
12
|
+
* Lista de itens do menu. Cada item deve seguir a interface `ItemMenuConfig`.
|
|
13
|
+
*/
|
|
14
|
+
listaItemMenu: ItemMenuConfig[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Componente MenuVertical
|
|
18
|
+
*
|
|
19
|
+
* Renderiza um menu vertical de itens customizáveis. Cada item é passado via `listaItemMenu` como um componente React,
|
|
20
|
+
* e o menu cuida de renderizá-los dentro de um container vertical com espaçamento uniforme.
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* Exemplo de uso:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <MenuVertical
|
|
26
|
+
*
|
|
27
|
+
* listaItemMenu={[
|
|
28
|
+
* { component: <Button>Home</Button> },
|
|
29
|
+
* { component: <Button>Perfil</Button> }
|
|
30
|
+
* ]}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare const MenuVertical: React.FC<MenuVerticalProps>;
|
|
35
|
+
export default MenuVertical;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { styled } from '@mui/material';
|
|
6
|
+
/**
|
|
7
|
+
* Container principal do menu vertical
|
|
8
|
+
*/
|
|
9
|
+
export const Container = styled('div')(() => ({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'flex-start',
|
|
14
|
+
flexGrow: 1,
|
|
15
|
+
gap: '16px',
|
|
16
|
+
width: '100%',
|
|
17
|
+
}));
|
|
18
|
+
/**
|
|
19
|
+
* Componente MenuVertical
|
|
20
|
+
*
|
|
21
|
+
* Renderiza um menu vertical de itens customizáveis. Cada item é passado via `listaItemMenu` como um componente React,
|
|
22
|
+
* e o menu cuida de renderizá-los dentro de um container vertical com espaçamento uniforme.
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* Exemplo de uso:
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <MenuVertical
|
|
28
|
+
*
|
|
29
|
+
* listaItemMenu={[
|
|
30
|
+
* { component: <Button>Home</Button> },
|
|
31
|
+
* { component: <Button>Perfil</Button> }
|
|
32
|
+
* ]}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
const MenuVertical = ({ listaItemMenu }) => {
|
|
37
|
+
const [buttons, setButtons] = React.useState(null);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (listaItemMenu) {
|
|
40
|
+
const constructedButtons = listaItemMenu.map((item, index) => React.cloneElement(item.component, { key: index }));
|
|
41
|
+
setButtons(constructedButtons);
|
|
42
|
+
}
|
|
43
|
+
}, [listaItemMenu]);
|
|
44
|
+
if (buttons) {
|
|
45
|
+
return (_jsx(Container, { children: buttons }));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return (_jsx(Container, { children: "carregando..." }));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
MenuVertical.displayName = "MenuVertical"; // para DevTools
|
|
52
|
+
export default MenuVertical;
|
|
53
|
+
//# sourceMappingURL=MenuVertical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuVertical.js","sourceRoot":"","sources":["../../src/components/MenuV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AAC,CAAC,gBAAgB;AAE3D,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { NavItem } from "../types/NavItem";
|
|
3
|
+
/**
|
|
4
|
+
* Props do componente SideNav
|
|
5
|
+
*/
|
|
6
|
+
interface SideNavProps {
|
|
7
|
+
/**
|
|
8
|
+
* Lista de itens do menu lateral. Cada item possui `label` e `content`
|
|
9
|
+
*/
|
|
10
|
+
items: NavItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Largura do menu lateral em pixels
|
|
13
|
+
* @default 180
|
|
14
|
+
*/
|
|
15
|
+
menuWidth?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Cor de fundo do menu lateral
|
|
18
|
+
* @default 'transparent'
|
|
19
|
+
*/
|
|
20
|
+
menuBackground?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Cor de fundo padrão dos itens do menu
|
|
23
|
+
* @default 'transparent'
|
|
24
|
+
*/
|
|
25
|
+
itemMenuBackgroundColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Cor de fundo do item selecionado
|
|
28
|
+
* @default 'primary.main'
|
|
29
|
+
*/
|
|
30
|
+
itemMenuBackgroundColorSelected?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Cor de fundo do item ao passar o mouse (hover)
|
|
33
|
+
* @default 'grey.300'
|
|
34
|
+
*/
|
|
35
|
+
itemMenuBackgroundColorHover?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Cor do texto dos itens do menu
|
|
38
|
+
* @default 'black'
|
|
39
|
+
*/
|
|
40
|
+
itemMenuColor?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Cor do texto do item selecionado
|
|
43
|
+
* @default 'black'
|
|
44
|
+
*/
|
|
45
|
+
itemMenuColorSelected?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Border radius do menu e do container de conteúdo
|
|
48
|
+
* @default '0'
|
|
49
|
+
*/
|
|
50
|
+
borderRadius?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Border radius de cada item do menu
|
|
53
|
+
* @default '16px'
|
|
54
|
+
*/
|
|
55
|
+
itemMenuBorderRadius?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Cor de fundo do container de conteúdo
|
|
58
|
+
* @default 'grey.50'
|
|
59
|
+
*/
|
|
60
|
+
contentBackground?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Altura do container de conteúdo (ex: '500px' ou '100%')
|
|
63
|
+
* @default '500px'
|
|
64
|
+
*/
|
|
65
|
+
height?: string | number;
|
|
66
|
+
/**
|
|
67
|
+
* Elemento(s) que serão renderizados no topo do menu lateral
|
|
68
|
+
*/
|
|
69
|
+
renderTopMenu?: ReactNode;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Componente SideNav
|
|
73
|
+
*
|
|
74
|
+
* Um menu lateral com itens clicáveis que alteram o conteúdo exibido em um container ao lado.
|
|
75
|
+
* Cada item possui um `label` e `content` que será renderizado no container.
|
|
76
|
+
*
|
|
77
|
+
* O componente é totalmente customizável via props, incluindo cores, bordas, largura do menu e conteúdo, elementos extras, e altura do container.
|
|
78
|
+
*/
|
|
79
|
+
declare function SideNav({ items, menuWidth, menuBackground, borderRadius, itemMenuBorderRadius, itemMenuBackgroundColor, itemMenuBackgroundColorHover, itemMenuBackgroundColorSelected, itemMenuColor, itemMenuColorSelected, contentBackground, renderTopMenu, height, }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare namespace SideNav {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
83
|
+
export default SideNav;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Box, styled } from "@mui/material";
|
|
5
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
6
|
+
const Container = styled('div')(({ theme }) => ({
|
|
7
|
+
display: 'grid',
|
|
8
|
+
gridTemplateColumns: 'auto 1fr',
|
|
9
|
+
width: "100%",
|
|
10
|
+
padding: '0',
|
|
11
|
+
}));
|
|
12
|
+
/**
|
|
13
|
+
* Componente SideNav
|
|
14
|
+
*
|
|
15
|
+
* Um menu lateral com itens clicáveis que alteram o conteúdo exibido em um container ao lado.
|
|
16
|
+
* Cada item possui um `label` e `content` que será renderizado no container.
|
|
17
|
+
*
|
|
18
|
+
* O componente é totalmente customizável via props, incluindo cores, bordas, largura do menu e conteúdo, elementos extras, e altura do container.
|
|
19
|
+
*/
|
|
20
|
+
export default function SideNav({ items, menuWidth = 180, menuBackground = 'transparent', borderRadius = '0', itemMenuBorderRadius = '16px', itemMenuBackgroundColor = "transparent", itemMenuBackgroundColorHover = "grey.300", itemMenuBackgroundColorSelected = "primary.main", itemMenuColor = 'black', itemMenuColorSelected = 'black', contentBackground = "grey.50", renderTopMenu, height = "500px", // altura padrão
|
|
21
|
+
}) {
|
|
22
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
23
|
+
return (_jsxs(Container, { children: [_jsxs(Box, { sx: {
|
|
24
|
+
width: menuWidth,
|
|
25
|
+
bgcolor: menuBackground,
|
|
26
|
+
borderRadius: borderRadius,
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
gap: 1,
|
|
30
|
+
}, children: [renderTopMenu && renderTopMenu, items.map((item, idx) => (_jsx(Box, { onClick: () => setActiveIndex(idx), sx: {
|
|
31
|
+
cursor: "pointer",
|
|
32
|
+
px: 2,
|
|
33
|
+
py: 1,
|
|
34
|
+
borderRadius: itemMenuBorderRadius,
|
|
35
|
+
bgcolor: activeIndex === idx ? itemMenuBackgroundColorSelected : itemMenuBackgroundColor,
|
|
36
|
+
color: activeIndex === idx ? itemMenuColorSelected : itemMenuColor,
|
|
37
|
+
"&:hover": {
|
|
38
|
+
bgcolor: activeIndex === idx ? itemMenuBackgroundColorSelected : itemMenuBackgroundColorHover,
|
|
39
|
+
},
|
|
40
|
+
width: "100%",
|
|
41
|
+
}, children: item.label }, item.label)))] }), _jsx(Box, { sx: {
|
|
42
|
+
width: "auto",
|
|
43
|
+
flex: 1,
|
|
44
|
+
ml: 2,
|
|
45
|
+
p: 2,
|
|
46
|
+
bgcolor: contentBackground,
|
|
47
|
+
borderRadius: borderRadius,
|
|
48
|
+
minHeight: height,
|
|
49
|
+
maxHeight: height,
|
|
50
|
+
position: "relative",
|
|
51
|
+
overflowY: "auto", // permite scroll caso o conteúdo seja maior que a altura
|
|
52
|
+
}, children: _jsx(AnimatePresence, { mode: "wait", children: _jsx(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2 }, style: { width: "100%" }, children: items[activeIndex].content }, activeIndex) }) })] }));
|
|
53
|
+
}
|
|
54
|
+
SideNav.displayName = "SideNav";
|
|
55
|
+
//# sourceMappingURL=SideNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideNav.js","sourceRoot":"","sources":["../../src/components/SideNav.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAwExD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,MAAM;IACf,mBAAmB,EAAE,UAAU;IAC/B,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,GAAG;CACb,CAAC,CAAC,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,EACL,SAAS,GAAG,GAAG,EACf,cAA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AAI,CAAC,KAAK,CAgBX,CACP,CAAC,IACE,EAGN,KAAC,GAAG,IACF,EAAE,EAAE;oBACF,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,CAAC;oBACP,EAAE,EAAE,CAAC;oBACL,CAAC,EAAE,CAAC;oBACJ,OAAO,EAAE,iBAAiB;oBAC1B,YAAY,EAAE,YAAY;oBAC1B,SAAS,EAAE,MAAM;oBACjB,SAAS,EAAE,MAAM;oBACjB,QAAQ,EAAE,UAAU;oBACpB,SAAS,EAAE,MAAM,EAAE,yDAAyD;iBAC7E,YAED,KAAC,eAAe,IAAC,IAAI,EAAC,MAAM,YAC1B,KAAC,MAAM,CAAC,GAAG,IAET,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAC9B,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAC5B,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAC7B,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAEvB,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO,IAPtB,WAAW,CAQL,GACG,GACd,IAEI,CACb,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DrawerProps } from '@/types/Drawer';
|
|
3
|
+
/**
|
|
4
|
+
* Layout desktop responsável por exibir:
|
|
5
|
+
* - AppBar com botão de menu e informações do usuário;
|
|
6
|
+
* - Drawer lateral (mini/expandido) com itens de navegação;
|
|
7
|
+
* - Conteúdo principal à direita.
|
|
8
|
+
*
|
|
9
|
+
* Também suporta um estado de carregamento (`loading`) que exibe um overlay
|
|
10
|
+
* escurecido com um spinner centralizado, desabilitando a interação com a página.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} backgroundHeader Cor de fundo do AppBar.
|
|
13
|
+
* @param {string} backgroundMenuAvatar Cor de fundo do menu Avatar.
|
|
14
|
+
* @param {string} colorItemMenu Cor do ícone do menu e dos itens de menu.
|
|
15
|
+
* @param {string} colorItemMenuSelected Cor do item de menu selecionado.
|
|
16
|
+
* @param {number | string | null} idUsuarioLogado Id do usuário logado.
|
|
17
|
+
* @param {string} nomeUsuarioLogado Nome do usuário logado.
|
|
18
|
+
* @param {string} emailUsuario Email do usuário logado.
|
|
19
|
+
* @param {Array<any>} menuItems Itens exibidos no Drawer.
|
|
20
|
+
* @param {Array<any>} avatarMenuItems Itens exibidos no menu do avatar.
|
|
21
|
+
* @param {string} profileImage URL final da imagem de avatar já tratada.
|
|
22
|
+
* @param {number} selectedIndex Índice do item selecionado.
|
|
23
|
+
* @param {(index: number) => void} onChangeIndex Callback chamado ao alterar o item selecionado.
|
|
24
|
+
* @param {() => void} [onUnauthenticated] Callback chamado se não tiver usuário logado.
|
|
25
|
+
* @param {React.ReactNode} [toolbarContent] Conteúdos genéricos exibidos na barra de ferramentas (texto, ícones, imagens etc.).
|
|
26
|
+
* @param {boolean} [loading=false] Indica se o overlay de loading deve ser exibido sobre toda a tela.
|
|
27
|
+
* @param {string} [loadingBackgroundColor='rgba(0, 0, 0, 0.4)'] Cor de fundo do overlay de loading.
|
|
28
|
+
* @param {number} [loadingSpinnerSize=48] Tamanho do spinner de loading.
|
|
29
|
+
* @param {string} [loadingMessage] Texto opcional exibido abaixo do spinner de loading.
|
|
30
|
+
* @param {string} [loadingColor='#ffffff'] Cor do spinner e do texto da mensagem de loading.
|
|
31
|
+
*
|
|
32
|
+
* Exibido apenas em `md` ou acima.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import DesktopDrawer from '@/components/DesktopDrawer';
|
|
37
|
+
*
|
|
38
|
+
* const Example = () => {
|
|
39
|
+
* return (
|
|
40
|
+
* <DesktopDrawer
|
|
41
|
+
* backgroundHeader="#ffffff"
|
|
42
|
+
* backgroundMenuAvatar="#f5f5f5"
|
|
43
|
+
* colorItemMenu="#000000"
|
|
44
|
+
* colorItemMenuSelected="#1976d2"
|
|
45
|
+
* idUsuarioLogado={1}
|
|
46
|
+
* nomeUsuarioLogado="John Doe"
|
|
47
|
+
* emailUsuario="john.doe@email.com"
|
|
48
|
+
* profileImage="/images/default-avatar.png"
|
|
49
|
+
* menuItems={menuItems}
|
|
50
|
+
* avatarMenuItems={avatarMenuItems}
|
|
51
|
+
* selectedIndex={0}
|
|
52
|
+
* onChangeIndex={(index) => console.log(index)}
|
|
53
|
+
* loading={true}
|
|
54
|
+
* loadingBackgroundColor="rgba(0, 0, 0, 0.6)"
|
|
55
|
+
* loadingSpinnerSize={64}
|
|
56
|
+
* loadingMessage="Carregando dados..."
|
|
57
|
+
* loadingColor="#ffffff"
|
|
58
|
+
* />
|
|
59
|
+
* );
|
|
60
|
+
* };
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const DesktopDrawer: React.FC<DrawerProps>;
|
|
64
|
+
export default DesktopDrawer;
|