wca-designsystem 1.0.52 → 1.0.53
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 +1 -1
- package/src/components/modules/Cabecalho/Cabecalho.stories.tsx +0 -1
- package/src/components/modules/Cabecalho/index.tsx +18 -38
- package/src/components/modules/Cabecalho/styles.ts +5 -18
- package/src/components/modules/ConchaAplicacao/index.tsx +5 -6
- package/src/components/modules/Navbar/Navbar.stories.tsx +10 -9
- package/src/components/modules/Navbar/index.tsx +41 -27
- package/src/components/modules/Navbar/styles.ts +21 -7
package/package.json
CHANGED
|
@@ -18,7 +18,6 @@ export const Primary: Story = {
|
|
|
18
18
|
'Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,' +
|
|
19
19
|
'when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
|
|
20
20
|
temNotificacoes: false,
|
|
21
|
-
temChatBot: true,
|
|
22
21
|
icone: iconExample,
|
|
23
22
|
notificacoes: {
|
|
24
23
|
abre: false,
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Icone from '../../atomos/Icone'
|
|
3
|
-
import * as S from './styles'
|
|
4
|
-
import ajuda from '../../../assets/imagens/icons/Ajuda.svg'
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import HoverPopUp from '../../atomos/HoverPopUp';
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Icone from '../../atomos/Icone'
|
|
3
|
+
import * as S from './styles'
|
|
4
|
+
import ajuda from '../../../assets/imagens/icons/Ajuda.svg'
|
|
5
|
+
import { theme } from '../../../styles/theme'
|
|
6
|
+
import HoverPopUp from '../../atomos/HoverPopUp'
|
|
8
7
|
import UsuarioNotifications, {
|
|
9
8
|
NotificationsProps,
|
|
10
|
-
} from '../../atomos/UsuarioNotification'
|
|
11
|
-
import { Flex } from '@mantine/core';
|
|
9
|
+
} from '../../atomos/UsuarioNotification'
|
|
12
10
|
|
|
13
11
|
export interface CabecalhoProps {
|
|
14
|
-
notificacoes: NotificationsProps
|
|
15
|
-
temNotificacoes?: boolean
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
subTitulo: string;
|
|
22
|
-
info: string;
|
|
12
|
+
notificacoes: NotificationsProps
|
|
13
|
+
temNotificacoes?: boolean
|
|
14
|
+
color?: string
|
|
15
|
+
icone: string
|
|
16
|
+
titulo: string
|
|
17
|
+
subTitulo: string
|
|
18
|
+
info: string
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
const Cabecalho = ({
|
|
26
22
|
notificacoes,
|
|
27
23
|
temNotificacoes,
|
|
28
|
-
temChatBot = false,
|
|
29
|
-
openChatBot,
|
|
30
24
|
icone,
|
|
31
25
|
info,
|
|
32
26
|
subTitulo,
|
|
@@ -54,23 +48,9 @@ const Cabecalho = ({
|
|
|
54
48
|
</HoverPopUp>
|
|
55
49
|
</S.CabecalhoInfoWrapper>
|
|
56
50
|
|
|
57
|
-
<
|
|
58
|
-
{temChatBot && (
|
|
59
|
-
<HoverPopUp texto={'CHATBOT'}>
|
|
60
|
-
<S.ChatBotAnchor
|
|
61
|
-
onClick={openChatBot}
|
|
62
|
-
color={theme.colors.yellowWca}
|
|
63
|
-
>
|
|
64
|
-
<Icone fill="#fff" svg={chat} />
|
|
65
|
-
</S.ChatBotAnchor>
|
|
66
|
-
</HoverPopUp>
|
|
67
|
-
)}
|
|
68
|
-
{temNotificacoes && (
|
|
69
|
-
<UsuarioNotifications notificacoes={notificacoes} />
|
|
70
|
-
)}
|
|
71
|
-
</Flex>
|
|
51
|
+
{temNotificacoes && <UsuarioNotifications notificacoes={notificacoes} />}
|
|
72
52
|
</S.CabecalhoContainer>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
75
55
|
|
|
76
|
-
export default Cabecalho
|
|
56
|
+
export default Cabecalho
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components'
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
2
|
|
|
3
3
|
type CabecalhoProps = {
|
|
4
|
-
color?: string
|
|
5
|
-
}
|
|
4
|
+
color?: string
|
|
5
|
+
}
|
|
6
6
|
|
|
7
7
|
export const CabecalhoContainer = styled.header`
|
|
8
8
|
display: flex;
|
|
@@ -11,7 +11,7 @@ export const CabecalhoContainer = styled.header`
|
|
|
11
11
|
width: 100%;
|
|
12
12
|
margin-bottom: 35px;
|
|
13
13
|
position: relative;
|
|
14
|
-
|
|
14
|
+
`
|
|
15
15
|
|
|
16
16
|
export const CabecalhoInfoWrapper = styled.div<CabecalhoProps>`
|
|
17
17
|
${({ theme, color }) => css`
|
|
@@ -80,17 +80,4 @@ export const CabecalhoInfoWrapper = styled.div<CabecalhoProps>`
|
|
|
80
80
|
display: flex;
|
|
81
81
|
}
|
|
82
82
|
`}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export const ChatBotAnchor = styled.div<{ color?: string }>`
|
|
86
|
-
${({ color }) => css`
|
|
87
|
-
width: 48px;
|
|
88
|
-
height: 48px;
|
|
89
|
-
border-radius: 50%;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
background-color: ${color};
|
|
95
|
-
`}
|
|
96
|
-
`;
|
|
83
|
+
`
|
|
@@ -58,20 +58,20 @@ export function ConchaAplicacao({
|
|
|
58
58
|
>
|
|
59
59
|
<S.NavbarWrapper color={color} ref={navbarRef} data-active={isNavHover}>
|
|
60
60
|
<Navbar
|
|
61
|
+
links={links}
|
|
61
62
|
color={color}
|
|
62
|
-
sairFunc={sairFunc}
|
|
63
|
-
activeLink={activeLink}
|
|
64
63
|
modulo={modulo}
|
|
64
|
+
sairFunc={sairFunc}
|
|
65
65
|
isHover={isNavHover}
|
|
66
|
-
|
|
66
|
+
activeLink={activeLink}
|
|
67
|
+
temChatBot={temChatBot}
|
|
68
|
+
openChatBot={openChatBot}
|
|
67
69
|
onTrocarModulos={onTrocarModulos!}
|
|
68
70
|
/>
|
|
69
71
|
</S.NavbarWrapper>
|
|
70
72
|
<S.ConchaAplicacaoMainWrapper>
|
|
71
73
|
<Container size={1500}>
|
|
72
74
|
<Cabecalho
|
|
73
|
-
temChatBot={temChatBot}
|
|
74
|
-
openChatBot={openChatBot}
|
|
75
75
|
icone={icone}
|
|
76
76
|
info={info}
|
|
77
77
|
subTitulo={subTitulo}
|
|
@@ -80,7 +80,6 @@ export function ConchaAplicacao({
|
|
|
80
80
|
temNotificacoes={temNotificacoes}
|
|
81
81
|
notificacoes={notificacoes}
|
|
82
82
|
/>
|
|
83
|
-
|
|
84
83
|
{children}
|
|
85
84
|
</Container>
|
|
86
85
|
</S.ConchaAplicacaoMainWrapper>
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Meta } from '@storybook/react'
|
|
3
|
-
import Navbar, { NavbarType } from '.'
|
|
4
|
-
import { LinksDinamicosMock } from './mocks'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Meta } from '@storybook/react'
|
|
3
|
+
import Navbar, { NavbarType } from '.'
|
|
4
|
+
import { LinksDinamicosMock } from './mocks'
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/modules/Navbar',
|
|
8
8
|
component: Navbar,
|
|
9
|
-
} as Meta
|
|
9
|
+
} as Meta
|
|
10
10
|
|
|
11
11
|
const props = {
|
|
12
12
|
isHover: true,
|
|
13
13
|
links: LinksDinamicosMock,
|
|
14
|
+
temChatBot: true,
|
|
14
15
|
module: 'Exemplo',
|
|
15
16
|
activeLink: 'Usuários',
|
|
16
17
|
onTrocarModulos: () => console.log('aqui'),
|
|
17
|
-
}
|
|
18
|
+
}
|
|
18
19
|
|
|
19
20
|
const Template: any = (args: NavbarType) => (
|
|
20
21
|
<div style={{ maxWidth: args.isHover ? 280 : 80 }}>
|
|
21
22
|
<Navbar {...args} />
|
|
22
23
|
</div>
|
|
23
|
-
)
|
|
24
|
+
)
|
|
24
25
|
|
|
25
26
|
export const NavbarStory = Template.bind({
|
|
26
27
|
...props,
|
|
27
|
-
})
|
|
28
|
+
})
|
|
28
29
|
|
|
29
30
|
NavbarStory.args = {
|
|
30
31
|
...props,
|
|
31
|
-
}
|
|
32
|
+
}
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import * as S from './styles'
|
|
3
|
-
import IconeBotao from '../../atomos/IconeBotao'
|
|
4
|
-
import Icone from '../../atomos/Icone'
|
|
5
|
-
import { theme } from '../../../styles/theme'
|
|
6
|
-
import Version from '../../atomos/Versao'
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import * as S from './styles'
|
|
3
|
+
import IconeBotao from '../../atomos/IconeBotao'
|
|
4
|
+
import Icone from '../../atomos/Icone'
|
|
5
|
+
import { theme } from '../../../styles/theme'
|
|
6
|
+
import Version from '../../atomos/Versao'
|
|
7
|
+
import chat from '../../../assets/imagens/icons/Chat.svg'
|
|
8
|
+
import GrupoDeLinks, { LinksProps } from '../../molecules/GrupoDeLinks'
|
|
9
|
+
import NavbarTituloHeader from '../../atomos/NavbarTituloHeader'
|
|
10
|
+
import Sair from '../../../assets/imagens/icons/RecolheMenu.svg'
|
|
11
|
+
import CiclosEncerrados from '../../../assets/imagens/icons/CiclosEncerrados.svg'
|
|
12
|
+
import Logo from '../../../assets/imagens/novos-icones/STI_nomeCor.svg'
|
|
13
|
+
import LogoInitial from '../../../assets/imagens/novos-icones/STI_iconeBranco.svg'
|
|
14
|
+
import { useMemo } from 'react'
|
|
15
|
+
import HoverPopUp from '../../atomos/HoverPopUp'
|
|
15
16
|
|
|
16
17
|
export type NavbarType = {
|
|
17
|
-
isHover: boolean
|
|
18
|
-
modulo: string
|
|
19
|
-
links?: LinksProps[]
|
|
20
|
-
activeLink: string
|
|
21
|
-
sairFunc: () => void
|
|
22
|
-
color?: string
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
isHover: boolean
|
|
19
|
+
modulo: string
|
|
20
|
+
links?: LinksProps[]
|
|
21
|
+
activeLink: string
|
|
22
|
+
sairFunc: () => void
|
|
23
|
+
color?: string
|
|
24
|
+
temChatBot?: boolean
|
|
25
|
+
openChatBot?: () => void
|
|
26
|
+
onTrocarModulos?: (() => void) | undefined
|
|
27
|
+
}
|
|
25
28
|
const Navbar = ({
|
|
26
29
|
isHover,
|
|
27
30
|
sairFunc,
|
|
28
31
|
links,
|
|
29
32
|
onTrocarModulos,
|
|
33
|
+
openChatBot,
|
|
34
|
+
temChatBot = false,
|
|
30
35
|
modulo,
|
|
31
36
|
activeLink,
|
|
32
37
|
color = theme.colors.blue,
|
|
33
38
|
}: NavbarType) => {
|
|
34
|
-
const LogoHeader = useMemo(() => (isHover ? Logo : LogoInitial), [isHover])
|
|
39
|
+
const LogoHeader = useMemo(() => (isHover ? Logo : LogoInitial), [isHover])
|
|
35
40
|
|
|
36
41
|
return (
|
|
37
42
|
<S.NavbarWrapper
|
|
@@ -91,7 +96,16 @@ const Navbar = ({
|
|
|
91
96
|
data-testid="footer-navbar"
|
|
92
97
|
style={{ width: isHover ? '280px' : '80px' }}
|
|
93
98
|
>
|
|
94
|
-
|
|
99
|
+
{temChatBot && (
|
|
100
|
+
<HoverPopUp texto={'CHATBOT'}>
|
|
101
|
+
<S.ChatBotAnchor
|
|
102
|
+
onClick={openChatBot}
|
|
103
|
+
color={theme.colors.yellowWca}
|
|
104
|
+
>
|
|
105
|
+
<Icone fill="#fff" svg={chat} />
|
|
106
|
+
</S.ChatBotAnchor>
|
|
107
|
+
</HoverPopUp>
|
|
108
|
+
)}
|
|
95
109
|
|
|
96
110
|
<Version
|
|
97
111
|
isNavHover={isHover}
|
|
@@ -100,7 +114,7 @@ const Navbar = ({
|
|
|
100
114
|
/>
|
|
101
115
|
</S.NavbarFooter>
|
|
102
116
|
</S.NavbarWrapper>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
105
119
|
|
|
106
|
-
export default Navbar
|
|
120
|
+
export default Navbar
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components'
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
2
|
|
|
3
3
|
type NavbarWrapperProps = {
|
|
4
|
-
color?: string
|
|
5
|
-
}
|
|
4
|
+
color?: string
|
|
5
|
+
}
|
|
6
6
|
|
|
7
7
|
export const NavbarWrapper = styled.div<NavbarWrapperProps>`
|
|
8
8
|
${({ color }) => css`
|
|
@@ -26,7 +26,7 @@ export const NavbarWrapper = styled.div<NavbarWrapperProps>`
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
`}
|
|
29
|
-
|
|
29
|
+
`
|
|
30
30
|
|
|
31
31
|
export const NavbarHeader = styled.div`
|
|
32
32
|
${() => css`
|
|
@@ -40,7 +40,7 @@ export const NavbarHeader = styled.div`
|
|
|
40
40
|
margin-top: 15px;
|
|
41
41
|
}
|
|
42
42
|
`}
|
|
43
|
-
|
|
43
|
+
`
|
|
44
44
|
|
|
45
45
|
export const NabarBody = styled.div<NavbarWrapperProps>`
|
|
46
46
|
${({ theme, color }) => css`
|
|
@@ -57,7 +57,7 @@ export const NabarBody = styled.div<NavbarWrapperProps>`
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
`}
|
|
60
|
-
|
|
60
|
+
`
|
|
61
61
|
|
|
62
62
|
export const NavbarFooter = styled.div`
|
|
63
63
|
${({ theme }) => css`
|
|
@@ -65,4 +65,18 @@ export const NavbarFooter = styled.div`
|
|
|
65
65
|
color: ${theme.colors.gray['700']};
|
|
66
66
|
margin-bottom: 30px;
|
|
67
67
|
`}
|
|
68
|
-
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
export const ChatBotAnchor = styled.div<{ color?: string }>`
|
|
71
|
+
${({ color }) => css`
|
|
72
|
+
width: 48px;
|
|
73
|
+
height: 48px;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
margin: 0 auto;
|
|
80
|
+
background-color: ${color};
|
|
81
|
+
`}
|
|
82
|
+
`
|