wca-designsystem 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.5",
2
+ "version": "0.0.6",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -99,7 +99,6 @@
99
99
  "mantine-react-table": "^2.0.0-beta.1",
100
100
  "react-router-dom": "^6.23.1",
101
101
  "styled-components": "^6.1.11",
102
- "xlsx": "^0.18.5",
103
- "zustand": "^4.5.4"
102
+ "xlsx": "^0.18.5"
104
103
  }
105
104
  }
@@ -14,6 +14,8 @@ type Story = StoryObj<typeof ConchaAplicacao>;
14
14
  export const Primary: Story = {
15
15
  args: {
16
16
  links: LinksDinamicosMock,
17
+ isNavHover: true,
18
+ setIsNavHover: (state) => console.log(state),
17
19
  notificacoes: {
18
20
  abre: true,
19
21
  notificacao: {
@@ -6,31 +6,32 @@ import Cabecalho from '../Cabecalho';
6
6
  import { useLocation } from 'react-router-dom';
7
7
  import { NotificationsProps } from '../../atomos/UsuarioNotification';
8
8
  import { LinksProps } from '../../molecules/GrupoDeLinks';
9
- import { useStore } from 'zustand';
10
- import { useLayoutCreator } from '../../../store/layout/use-layout-store';
11
9
 
12
10
  type ConchaAplicacaolType = {
13
11
  children: React.ReactNode;
14
12
  notificacoes: NotificationsProps;
15
13
  links?: LinksProps[];
14
+ isNavHover: boolean;
15
+ setIsNavHover: React.Dispatch<React.SetStateAction<boolean>>;
16
16
  };
17
17
  export function ConchaAplicacao({
18
18
  children,
19
+ isNavHover,
20
+ setIsNavHover,
19
21
  notificacoes,
20
22
  links,
21
23
  }: ConchaAplicacaolType) {
22
24
  const NavbarRef = useRef<HTMLDivElement>(null);
23
25
  const rotaAcessada = useLocation();
24
26
  const paginaAtual = rotaAcessada.pathname.replace('/', '');
25
- const navHover = useStore(useLayoutCreator);
26
27
 
27
28
  useEffect(() => {
28
29
  const handleMouseEnter = () => {
29
- navHover.setNavHover(true);
30
+ setIsNavHover(true);
30
31
  };
31
32
 
32
33
  const handleMouseLeave = () => {
33
- navHover.setNavHover(false);
34
+ setIsNavHover(false);
34
35
  };
35
36
 
36
37
  // Adiciona os listeners de evento quando o componente é montado
@@ -53,18 +54,15 @@ export function ConchaAplicacao({
53
54
  <S.ConchaAplicacaoWrapper
54
55
  data-testid="app-shell-wrapper"
55
56
  navbar={{
56
- width: navHover.isNavHover ? 280 : 80,
57
+ width: isNavHover ? 280 : 80,
57
58
  breakpoint: 0,
58
59
  }}
59
60
  padding="md"
60
61
  transitionTimingFunction="ease-in"
61
62
  transitionDuration={3}
62
63
  >
63
- <S.ConchaAplicacaoNavbarWrapper
64
- ref={NavbarRef}
65
- data-active={navHover.isNavHover}
66
- >
67
- <Navbar isHover={navHover.isNavHover} links={links} />
64
+ <S.ConchaAplicacaoNavbarWrapper ref={NavbarRef} data-active={isNavHover}>
65
+ <Navbar isHover={isNavHover} links={links} />
68
66
  </S.ConchaAplicacaoNavbarWrapper>
69
67
  <S.ConchaAplicacaoMainWrapper>
70
68
  <Container fluid>
@@ -1,11 +0,0 @@
1
- import { type StateCreator } from 'zustand';
2
-
3
- export interface NavbarState {
4
- isNavHover: boolean;
5
- setNavHover: (state: boolean) => void;
6
- }
7
-
8
- export const useLayoutStore: StateCreator<NavbarState> = (set) => ({
9
- isNavHover: false,
10
- setNavHover: (state) => set(() => ({ isNavHover: state })),
11
- });
@@ -1,4 +0,0 @@
1
- import { create } from 'zustand';
2
- import { type NavbarState, useLayoutStore } from './layout-store-creator';
3
-
4
- export const useLayoutCreator = create<NavbarState>()(useLayoutStore);