wca-designsystem 0.0.21 → 0.0.22
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 +12 -6
- package/src/components/atomos/BadgeModulos/Badge.test.tsx +12 -0
- package/src/components/atomos/BadgeModulos/BadgeModulos.stories.tsx +21 -0
- package/src/components/atomos/BadgeModulos/index.tsx +33 -0
- package/src/components/atomos/BadgeModulos/styles.ts +16 -0
- package/src/components/atomos/Botao/Botao.test.tsx +3 -6
- package/src/components/atomos/Botao/index.tsx +6 -0
- package/src/components/atomos/Botao/styles.ts +12 -12
- package/src/components/atomos/IconeBotao/index.tsx +8 -3
- package/src/components/atomos/IconeBotao/styles.ts +10 -6
- package/src/components/atomos/InputDeData/InputDeData.stories.tsx +16 -0
- package/src/components/atomos/InputDeData/InputDeData.test.tsx +12 -0
- package/src/components/atomos/InputDeData/index.tsx +26 -0
- package/src/components/atomos/InputDeData/styles.ts +16 -0
- package/src/components/atomos/InputDeTexto/InputDeTexto.stories.tsx +2 -0
- package/src/components/atomos/InputDeTexto/index.tsx +7 -4
- package/src/components/atomos/InputDeTexto/styles.ts +15 -8
- package/src/components/atomos/LinkNavbar/index.tsx +4 -2
- package/src/components/atomos/MultiSelect/MultiSelect.stories.tsx +14 -0
- package/src/components/atomos/MultiSelect/MultiSelect.test.tsx +14 -0
- package/src/components/atomos/MultiSelect/index.tsx +33 -0
- package/src/components/atomos/MultiSelect/styles.ts +14 -0
- package/src/components/atomos/NavbarTituloHeader/styles.ts +1 -0
- package/src/components/modules/Cabecalho/index.tsx +7 -2
- package/src/components/modules/Cabecalho/styles.ts +10 -6
- package/src/components/modules/ConchaAplicacao/index.tsx +5 -2
- package/src/components/modules/ConchaAplicacao/styles.ts +8 -4
- package/src/components/modules/Navbar/index.tsx +6 -5
- package/src/components/modules/Navbar/styles.ts +12 -12
- package/src/components/molecules/CardInicial/CardInicial.stories.tsx +1 -0
- package/src/components/molecules/Modal/Modal.stories.tsx +31 -0
- package/src/components/molecules/Modal/Modal.test.tsx +22 -0
- package/src/components/molecules/Modal/index.tsx +46 -0
- package/src/components/molecules/Modal/styles.ts +34 -0
- package/src/components/organismos/Calendario/Calendario.modal.tsx +75 -0
- package/src/components/organismos/Calendario/Calendario.stories.tsx +29 -0
- package/src/components/organismos/Calendario/index.tsx +111 -0
- package/src/components/organismos/Calendario/styles.ts +128 -0
- package/src/components/organismos/Tabela/Tabela.stories.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.22",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"start": "tsdx watch",
|
|
15
15
|
"build": "tsdx build",
|
|
16
|
-
"test": "jest --
|
|
16
|
+
"test": "jest --watchAll=false",
|
|
17
17
|
"lint": "tsdx lint",
|
|
18
18
|
"prepare": "tsdx build",
|
|
19
19
|
"size": "size-limit",
|
|
@@ -88,14 +88,20 @@
|
|
|
88
88
|
"typescript": "^5.4.5"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@
|
|
91
|
+
"@fullcalendar/core": "^6.1.15",
|
|
92
|
+
"@fullcalendar/daygrid": "^6.1.15",
|
|
93
|
+
"@fullcalendar/interaction": "^6.1.15",
|
|
94
|
+
"@fullcalendar/react": "^6.1.15",
|
|
95
|
+
"@fullcalendar/timegrid": "^6.1.15",
|
|
96
|
+
"@mantine/core": "7.13.2",
|
|
97
|
+
"@mantine/dates": "^7.13.2",
|
|
98
|
+
"@mantine/form": "^7.13.2",
|
|
99
|
+
"@mantine/hooks": "7.13.2",
|
|
95
100
|
"@tanstack/query-sync-storage-persister": "^5.40.0",
|
|
96
101
|
"@tanstack/react-query": "^5.40.1",
|
|
97
102
|
"@tanstack/react-query-persist-client": "^5.40.1",
|
|
98
103
|
"axios": "^1.7.2",
|
|
104
|
+
"dayjs": "^1.11.13",
|
|
99
105
|
"mantine-react-table": "^2.0.0-beta.1",
|
|
100
106
|
"react-router-dom": "^6.23.1",
|
|
101
107
|
"styled-components": "^6.1.11",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BadgeModulos from '.';
|
|
3
|
+
import { render } from '../../../test/render';
|
|
4
|
+
|
|
5
|
+
describe('BadgeModulos', () => {
|
|
6
|
+
it('Renderiza corretamente', () => {
|
|
7
|
+
const { getByText } = render(
|
|
8
|
+
<BadgeModulos color="#000" colored title="exemplo" svg="" />
|
|
9
|
+
);
|
|
10
|
+
expect(getByText('exemplo')).toBeDefined();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import BadgeModulos from '.';
|
|
3
|
+
import { theme } from '../../../styles/theme';
|
|
4
|
+
import Ajuda from '../../../assets/imagens/icons/Ajuda.svg';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof BadgeModulos> = {
|
|
7
|
+
component: BadgeModulos,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof BadgeModulos>;
|
|
13
|
+
|
|
14
|
+
export const Primary: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
colored: true,
|
|
17
|
+
color: theme.colors.blue,
|
|
18
|
+
title: 'exemplo',
|
|
19
|
+
svg: Ajuda,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './styles';
|
|
3
|
+
import { theme } from '../../../styles/theme';
|
|
4
|
+
import Icone from '../Icone';
|
|
5
|
+
|
|
6
|
+
type BadgeModulosProps = {
|
|
7
|
+
svg: string;
|
|
8
|
+
title: string;
|
|
9
|
+
color: string;
|
|
10
|
+
colored: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const BadgeModulos = ({ svg, color, title, colored }: BadgeModulosProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<S.BadgeModulosWrapper
|
|
16
|
+
style={{
|
|
17
|
+
boxShadow: `0px 2px 0px ${colored ? color : theme.colors.gray['500']}`,
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<Icone
|
|
21
|
+
svg={svg}
|
|
22
|
+
fill={colored ? color : theme.colors.gray['500']}
|
|
23
|
+
width={15}
|
|
24
|
+
height={15}
|
|
25
|
+
/>
|
|
26
|
+
<p style={{ color: colored ? color : theme.colors.gray['500'] }}>
|
|
27
|
+
{title}
|
|
28
|
+
</p>
|
|
29
|
+
</S.BadgeModulosWrapper>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default BadgeModulos;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const BadgeModulosWrapper = styled.div`
|
|
4
|
+
${({ theme }) => css`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 3px;
|
|
8
|
+
padding: 6px 8px;
|
|
9
|
+
background: ${theme.colors.gray['300']};
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
|
|
12
|
+
p {
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
}
|
|
15
|
+
`}
|
|
16
|
+
`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Botao from './index';
|
|
3
3
|
import { render } from '../../../test/render';
|
|
4
|
-
import { MantineProvider } from '@mantine/core';
|
|
5
4
|
|
|
6
5
|
describe('Botão', () => {
|
|
7
6
|
it('Renderiza corretamente', () => {
|
|
@@ -18,11 +17,9 @@ describe('Botão', () => {
|
|
|
18
17
|
it('Dispara evento onClick', () => {
|
|
19
18
|
const onClickEvent = jest.fn();
|
|
20
19
|
const { getByText } = render(
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</Botao>
|
|
25
|
-
</MantineProvider>
|
|
20
|
+
<Botao onClick={onClickEvent} tipo="default">
|
|
21
|
+
default
|
|
22
|
+
</Botao>
|
|
26
23
|
);
|
|
27
24
|
const botaoDefault = getByText('default');
|
|
28
25
|
botaoDefault.click();
|
|
@@ -2,12 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { ButtonProps } from '@mantine/core';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import * as S from './styles';
|
|
5
|
+
import { theme } from '../../../styles/theme';
|
|
5
6
|
|
|
6
7
|
export interface BotaoProps extends ButtonProps {
|
|
7
8
|
tipo: 'table' | 'default' | 'round';
|
|
8
9
|
children: React.ReactNode;
|
|
9
10
|
onClick?: () => void;
|
|
10
11
|
type?: string;
|
|
12
|
+
color?: string;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
const Botao = ({
|
|
@@ -15,6 +17,7 @@ const Botao = ({
|
|
|
15
17
|
children,
|
|
16
18
|
onClick,
|
|
17
19
|
type,
|
|
20
|
+
color = theme.colors.blue,
|
|
18
21
|
...buttonProps
|
|
19
22
|
}: BotaoProps) => {
|
|
20
23
|
const renderButton = useCallback(
|
|
@@ -22,6 +25,7 @@ const Botao = ({
|
|
|
22
25
|
const botaoTipos = {
|
|
23
26
|
default: (
|
|
24
27
|
<S.BotaoDefault
|
|
28
|
+
color={color}
|
|
25
29
|
type={type}
|
|
26
30
|
tipo="default"
|
|
27
31
|
onClick={onClick}
|
|
@@ -33,6 +37,7 @@ const Botao = ({
|
|
|
33
37
|
table: (
|
|
34
38
|
<S.BotaoTabela
|
|
35
39
|
type={type}
|
|
40
|
+
color={color}
|
|
36
41
|
tipo="table"
|
|
37
42
|
onClick={onClick}
|
|
38
43
|
{...buttonProps}
|
|
@@ -43,6 +48,7 @@ const Botao = ({
|
|
|
43
48
|
round: (
|
|
44
49
|
<S.BotaoRound
|
|
45
50
|
type={type}
|
|
51
|
+
color={color}
|
|
46
52
|
tipo="round"
|
|
47
53
|
onClick={onClick}
|
|
48
54
|
{...buttonProps}
|
|
@@ -7,10 +7,10 @@ export const BotaoDefault = styled(Button)<BotaoProps>`
|
|
|
7
7
|
font-weight: bold;
|
|
8
8
|
|
|
9
9
|
&:hover {
|
|
10
|
-
border: 1px solid ${color
|
|
11
|
-
color: ${color
|
|
10
|
+
border: 1px solid ${color};
|
|
11
|
+
color: ${color};
|
|
12
12
|
background-color: ${theme.colors.white};
|
|
13
|
-
box-shadow: 0px 2px 3px 0px ${color
|
|
13
|
+
box-shadow: 0px 2px 3px 0px ${color};
|
|
14
14
|
}
|
|
15
15
|
&:disabled {
|
|
16
16
|
border: 1px solid ${theme.colors.gray['500']};
|
|
@@ -29,19 +29,19 @@ export const BotaoDefault = styled(Button)<BotaoProps>`
|
|
|
29
29
|
export const BotaoRound = styled(Button)<BotaoProps>`
|
|
30
30
|
${({ theme, color }) => css`
|
|
31
31
|
background-color: ${theme.colors.gray['300']};
|
|
32
|
-
border: 1px solid ${color
|
|
33
|
-
color: ${color
|
|
32
|
+
border: 1px solid ${color};
|
|
33
|
+
color: ${color};
|
|
34
34
|
|
|
35
35
|
font-weight: bold;
|
|
36
36
|
|
|
37
37
|
&:hover {
|
|
38
38
|
background: ${theme.colors.white};
|
|
39
|
-
box-shadow: 0px 2px 2px 0px ${color
|
|
40
|
-
color: ${color
|
|
39
|
+
box-shadow: 0px 2px 2px 0px ${color};
|
|
40
|
+
color: ${color};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&:active {
|
|
44
|
-
box-shadow: 0px 2px 3px 0px ${color
|
|
44
|
+
box-shadow: 0px 2px 3px 0px ${color};
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&:disabled {
|
|
@@ -62,14 +62,14 @@ export const BotaoTabela = styled(Button)<BotaoProps>`
|
|
|
62
62
|
${({ theme, color }) => css`
|
|
63
63
|
height: 25px;
|
|
64
64
|
background: ${theme.colors.gray['300']};
|
|
65
|
-
box-shadow: 0px 2px 3px 0px ${color
|
|
66
|
-
color: ${color
|
|
65
|
+
box-shadow: 0px 2px 3px 0px ${color};
|
|
66
|
+
color: ${color};
|
|
67
67
|
font-weight: bold;
|
|
68
68
|
|
|
69
69
|
&:hover {
|
|
70
70
|
background-color: ${theme.colors.white};
|
|
71
|
-
box-shadow: 0px 1px 2px 0px ${color
|
|
72
|
-
color: ${color
|
|
71
|
+
box-shadow: 0px 1px 2px 0px ${color};
|
|
72
|
+
color: ${color};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
&:disabled {
|
|
@@ -10,18 +10,23 @@ export interface IconeBotaoProps extends ActionIconProps {
|
|
|
10
10
|
toolTipInfo?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const IconeBotao = ({
|
|
13
|
+
const IconeBotao = ({
|
|
14
|
+
tipo,
|
|
15
|
+
color,
|
|
16
|
+
toolTipInfo,
|
|
17
|
+
...props
|
|
18
|
+
}: IconeBotaoProps) => {
|
|
14
19
|
const renderIconButton = useCallback(
|
|
15
20
|
(tipo: 'table' | 'round') => {
|
|
16
21
|
const selectsTipos = {
|
|
17
22
|
round: (
|
|
18
23
|
<HoverPopUp texto={toolTipInfo!} width={75}>
|
|
19
|
-
<S.IconeBotaoDefault {...props} data-testid="round" />
|
|
24
|
+
<S.IconeBotaoDefault color={color} {...props} data-testid="round" />
|
|
20
25
|
</HoverPopUp>
|
|
21
26
|
),
|
|
22
27
|
table: (
|
|
23
28
|
<HoverPopUp texto={toolTipInfo!} width={100}>
|
|
24
|
-
<S.IconeBotaoTable {...props} data-testid="table" />
|
|
29
|
+
<S.IconeBotaoTable color={color} {...props} data-testid="table" />
|
|
25
30
|
</HoverPopUp>
|
|
26
31
|
),
|
|
27
32
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ActionIcon } from '@mantine/core';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type ActionIconProps = {
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const IconeBotaoDefault = styled(ActionIcon)<ActionIconProps>`
|
|
9
|
+
${({ theme, color }) => css`
|
|
6
10
|
&:hover {
|
|
7
|
-
border-left: 2px solid ${
|
|
11
|
+
border-left: 2px solid ${color};
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
&:disabled {
|
|
@@ -19,10 +23,10 @@ export const IconeBotaoDefault = styled(ActionIcon)`
|
|
|
19
23
|
`}
|
|
20
24
|
`;
|
|
21
25
|
|
|
22
|
-
export const IconeBotaoTable = styled(ActionIcon)
|
|
23
|
-
${({ theme }) => css`
|
|
26
|
+
export const IconeBotaoTable = styled(ActionIcon)<ActionIconProps>`
|
|
27
|
+
${({ theme, color }) => css`
|
|
24
28
|
background-color: ${theme.colors.gray['300']};
|
|
25
|
-
box-shadow: -2px 0px 0px 0px ${
|
|
29
|
+
box-shadow: -2px 0px 0px 0px ${color};
|
|
26
30
|
|
|
27
31
|
&:hover {
|
|
28
32
|
background-color: ${theme.colors.white};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import InputDeData from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof InputDeData> = {
|
|
5
|
+
component: InputDeData,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof InputDeData>;
|
|
11
|
+
|
|
12
|
+
export const Primary: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
labelAbaixo: 'exemplo',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '../../../test/render';
|
|
3
|
+
import InputDeData from './index';
|
|
4
|
+
|
|
5
|
+
describe('InputDeData rendering', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { getByTestId } = render(<InputDeData labelAbaixo="exemplo" />);
|
|
8
|
+
|
|
9
|
+
const inputDeArquivo = getByTestId('label-abaixo');
|
|
10
|
+
expect(inputDeArquivo).toBeDefined();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateInput, DateInputProps, DatesProvider } from '@mantine/dates';
|
|
3
|
+
import * as S from './styles';
|
|
4
|
+
import '@mantine/dates/styles.css';
|
|
5
|
+
import 'dayjs/locale/pt-br';
|
|
6
|
+
|
|
7
|
+
interface InputDeDataProps extends DateInputProps {
|
|
8
|
+
labelAbaixo?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const InputDeData = ({ labelAbaixo, ...props }: InputDeDataProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<S.InputDeDataWrapper>
|
|
14
|
+
<DatesProvider settings={{ locale: 'pt-br' }}>
|
|
15
|
+
<DateInput {...props} />
|
|
16
|
+
{labelAbaixo?.length! > 0 && (
|
|
17
|
+
<label className="label-abaixo" data-testid={'label-abaixo'}>
|
|
18
|
+
{labelAbaixo}
|
|
19
|
+
</label>
|
|
20
|
+
)}
|
|
21
|
+
</DatesProvider>
|
|
22
|
+
</S.InputDeDataWrapper>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default InputDeData;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const InputDeDataWrapper = styled.div`
|
|
4
|
+
${({ theme }) => css`
|
|
5
|
+
.mantine-InputPlaceholder-placeholder {
|
|
6
|
+
padding-left: 105px;
|
|
7
|
+
color: ${theme.colors.gray['700']};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.label-abaixo {
|
|
11
|
+
color: ${theme.colors.gray['700']};
|
|
12
|
+
font-size: ${theme.sizes.xSmall};
|
|
13
|
+
font-family: 'Ubunto Mono', monospace;
|
|
14
|
+
}
|
|
15
|
+
`}
|
|
16
|
+
`;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import InputDeTexto from '.';
|
|
3
|
+
import { theme } from '../../../styles/theme';
|
|
3
4
|
|
|
4
5
|
const meta: Meta<typeof InputDeTexto> = {
|
|
5
6
|
component: InputDeTexto,
|
|
@@ -11,6 +12,7 @@ type Story = StoryObj<typeof InputDeTexto>;
|
|
|
11
12
|
|
|
12
13
|
export const Primary: Story = {
|
|
13
14
|
args: {
|
|
15
|
+
color: theme.colors.red,
|
|
14
16
|
tipo: 'round',
|
|
15
17
|
},
|
|
16
18
|
};
|
|
@@ -10,12 +10,14 @@ export interface InputDeTextoProps extends TextInputProps {
|
|
|
10
10
|
tipo: 'table' | 'round' | 'login' | 'password';
|
|
11
11
|
labelAbaixo?: string;
|
|
12
12
|
placeholder?: string;
|
|
13
|
+
color?: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const InputDeTexto = ({
|
|
16
17
|
tipo,
|
|
17
18
|
labelAbaixo,
|
|
18
19
|
placeholder,
|
|
20
|
+
color = theme.colors.blue,
|
|
19
21
|
...props
|
|
20
22
|
}: InputDeTextoProps) => {
|
|
21
23
|
/* Renderiza conforme o tipo que você escolher */
|
|
@@ -23,7 +25,7 @@ const InputDeTexto = ({
|
|
|
23
25
|
(tipo: 'table' | 'round' | 'login' | 'password') => {
|
|
24
26
|
const selectsTipos = {
|
|
25
27
|
round: (
|
|
26
|
-
<S.InputDeTextoRoundWrapper>
|
|
28
|
+
<S.InputDeTextoRoundWrapper color={color}>
|
|
27
29
|
<S.InputDeTextoRound
|
|
28
30
|
radius={8}
|
|
29
31
|
data-testid="round"
|
|
@@ -37,6 +39,7 @@ const InputDeTexto = ({
|
|
|
37
39
|
),
|
|
38
40
|
table: (
|
|
39
41
|
<S.InputDeTextoTabela
|
|
42
|
+
color={color}
|
|
40
43
|
placeholder={placeholder}
|
|
41
44
|
{...props}
|
|
42
45
|
data-testid="table"
|
|
@@ -46,6 +49,7 @@ const InputDeTexto = ({
|
|
|
46
49
|
<S.InputDeTextoLogin
|
|
47
50
|
radius={8}
|
|
48
51
|
placeholder={placeholder}
|
|
52
|
+
color={color}
|
|
49
53
|
leftSection={
|
|
50
54
|
<div
|
|
51
55
|
className="left-section"
|
|
@@ -69,6 +73,7 @@ const InputDeTexto = ({
|
|
|
69
73
|
),
|
|
70
74
|
password: (
|
|
71
75
|
<S.InputDePassword
|
|
76
|
+
color={color}
|
|
72
77
|
placeholder={placeholder}
|
|
73
78
|
onChange={props.onChange}
|
|
74
79
|
error={props.error}
|
|
@@ -78,9 +83,7 @@ const InputDeTexto = ({
|
|
|
78
83
|
<div
|
|
79
84
|
className="right-section"
|
|
80
85
|
style={{
|
|
81
|
-
background: props.error
|
|
82
|
-
? theme.colors.red
|
|
83
|
-
: theme.colors.blue,
|
|
86
|
+
background: props.error ? theme.colors.red : color,
|
|
84
87
|
}}
|
|
85
88
|
>
|
|
86
89
|
<Icone
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { PasswordInput, TextInput } from '@mantine/core';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
|
+
type InputDeTextProps = {
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
4
8
|
export const InputDeTextoRoundWrapper = styled.div`
|
|
5
9
|
${({ theme }) => css`
|
|
6
10
|
.label-abaixo {
|
|
@@ -31,8 +35,8 @@ export const RightSelect = styled.div`
|
|
|
31
35
|
`}
|
|
32
36
|
`;
|
|
33
37
|
|
|
34
|
-
export const InputDeTextoTabela = styled(TextInput)
|
|
35
|
-
${({
|
|
38
|
+
export const InputDeTextoTabela = styled(TextInput)<InputDeTextProps>`
|
|
39
|
+
${({ color }) => css`
|
|
36
40
|
border-radius: 5px;
|
|
37
41
|
|
|
38
42
|
.mantine-TextInput-error {
|
|
@@ -43,25 +47,25 @@ export const InputDeTextoTabela = styled(TextInput)`
|
|
|
43
47
|
min-height: 25px;
|
|
44
48
|
max-width: 200px;
|
|
45
49
|
height: 25px;
|
|
46
|
-
box-shadow: 0px 2px 3px 0px ${
|
|
50
|
+
box-shadow: 0px 2px 3px 0px ${color};
|
|
47
51
|
border: none;
|
|
48
|
-
color: ${
|
|
52
|
+
color: ${color};
|
|
49
53
|
background-color: transparent;
|
|
50
54
|
font-weight: bold;
|
|
51
55
|
|
|
52
56
|
&::placeholder {
|
|
53
|
-
color: ${
|
|
57
|
+
color: ${color};
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
`}
|
|
57
61
|
`;
|
|
58
62
|
|
|
59
|
-
export const InputDeTextoLogin = styled(TextInput)
|
|
60
|
-
${({ theme }) => css`
|
|
63
|
+
export const InputDeTextoLogin = styled(TextInput)<InputDeTextProps>`
|
|
64
|
+
${({ color, theme }) => css`
|
|
61
65
|
.left-section {
|
|
62
66
|
width: 40px;
|
|
63
67
|
height: 100%;
|
|
64
|
-
background-color: ${
|
|
68
|
+
background-color: ${color};
|
|
65
69
|
display: flex;
|
|
66
70
|
align-items: center;
|
|
67
71
|
justify-content: center;
|
|
@@ -93,6 +97,9 @@ export const InputDePassword = styled(PasswordInput)`
|
|
|
93
97
|
border-radius: 8px 0 0 8px;
|
|
94
98
|
}
|
|
95
99
|
|
|
100
|
+
.left-section {
|
|
101
|
+
background-color: red;
|
|
102
|
+
}
|
|
96
103
|
.mantine-PasswordInput-error {
|
|
97
104
|
text-align: start;
|
|
98
105
|
}
|
|
@@ -12,12 +12,14 @@ export type LinkNavbarProps = {
|
|
|
12
12
|
initiallyOpened?: boolean;
|
|
13
13
|
to?: string;
|
|
14
14
|
linksExpand?: { label: string; to: string }[];
|
|
15
|
+
color?: string;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const LinkNavbar = ({
|
|
18
19
|
icon,
|
|
19
20
|
label,
|
|
20
21
|
initiallyOpened,
|
|
22
|
+
color = theme.colors.blue,
|
|
21
23
|
to,
|
|
22
24
|
navHoverIsOpen,
|
|
23
25
|
linksExpand,
|
|
@@ -64,7 +66,7 @@ const LinkNavbar = ({
|
|
|
64
66
|
>
|
|
65
67
|
<S.LinkWrapper data-active={navHoverIsOpen}>
|
|
66
68
|
<S.LinkSvg data-active={navHoverIsOpen}>
|
|
67
|
-
<Icone fill={
|
|
69
|
+
<Icone fill={color} width={25} height={25} svg={icon} />
|
|
68
70
|
</S.LinkSvg>
|
|
69
71
|
<p>{label}</p>
|
|
70
72
|
</S.LinkWrapper>
|
|
@@ -73,7 +75,7 @@ const LinkNavbar = ({
|
|
|
73
75
|
<Icone
|
|
74
76
|
svg={Arrow}
|
|
75
77
|
className="chevron"
|
|
76
|
-
fill={
|
|
78
|
+
fill={color}
|
|
77
79
|
style={{
|
|
78
80
|
transform: opened ? 'rotate(90deg)' : 'none',
|
|
79
81
|
transition: 'transform 200ms ease',
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MultiSelectCustom from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof MultiSelectCustom> = {
|
|
5
|
+
component: MultiSelectCustom,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof MultiSelectCustom>;
|
|
11
|
+
|
|
12
|
+
export const Primary: Story = {
|
|
13
|
+
args: {},
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MultiSelectCustom from './index';
|
|
3
|
+
import { render } from '../../../test/render';
|
|
4
|
+
|
|
5
|
+
describe('LinkNavbar rendering', () => {
|
|
6
|
+
it('renders without crashing', () => {
|
|
7
|
+
const { getByText } = render(
|
|
8
|
+
<MultiSelectCustom value={[]} label="Usuários" />
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const label = getByText('Usuários');
|
|
12
|
+
expect(label).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComboboxData, MultiSelect } from '@mantine/core';
|
|
3
|
+
import { useDisclosure } from '@mantine/hooks';
|
|
4
|
+
import * as S from './styles';
|
|
5
|
+
|
|
6
|
+
type MultiSelectProps = {
|
|
7
|
+
data?: ComboboxData;
|
|
8
|
+
label?: string;
|
|
9
|
+
value: Array<string>;
|
|
10
|
+
onChange?: ((value: string[]) => void) | undefined;
|
|
11
|
+
};
|
|
12
|
+
const MultiSelectCustom = ({
|
|
13
|
+
data,
|
|
14
|
+
label,
|
|
15
|
+
value,
|
|
16
|
+
onChange,
|
|
17
|
+
}: MultiSelectProps) => {
|
|
18
|
+
const [dropdownOpened, { toggle }] = useDisclosure();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<S.MultiSelectWrapper onClick={toggle}>
|
|
22
|
+
<MultiSelect
|
|
23
|
+
data={data}
|
|
24
|
+
dropdownOpened={dropdownOpened}
|
|
25
|
+
value={value}
|
|
26
|
+
onChange={(e) => onChange!(e)}
|
|
27
|
+
/>
|
|
28
|
+
<label className="label-abaixo">{label}</label>
|
|
29
|
+
</S.MultiSelectWrapper>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default MultiSelectCustom;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const MultiSelectWrapper = styled.div`
|
|
4
|
+
${() => css`
|
|
5
|
+
.mantine-Input-input {
|
|
6
|
+
min-width: 185px;
|
|
7
|
+
}
|
|
8
|
+
.label-abaixo {
|
|
9
|
+
color: #87868a;
|
|
10
|
+
font-size: 0.625rem;
|
|
11
|
+
font-family: 'Ubunto Mono', monospace;
|
|
12
|
+
}
|
|
13
|
+
`}
|
|
14
|
+
`;
|
|
@@ -26,9 +26,14 @@ type OpcoesCabecalho = {
|
|
|
26
26
|
export interface CabecalhoProps {
|
|
27
27
|
notificacoes: NotificationsProps;
|
|
28
28
|
temNotificacoes?: boolean;
|
|
29
|
+
color?: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const Cabecalho = ({
|
|
32
|
+
const Cabecalho = ({
|
|
33
|
+
notificacoes,
|
|
34
|
+
temNotificacoes,
|
|
35
|
+
color = theme.colors.blue,
|
|
36
|
+
}: CabecalhoProps) => {
|
|
32
37
|
const rotaAcessada = useLocation();
|
|
33
38
|
const paginaAtual = rotaAcessada.pathname.replace('/', '');
|
|
34
39
|
const CabecalhoInfos = useCallback(
|
|
@@ -79,7 +84,7 @@ const Cabecalho = ({ notificacoes, temNotificacoes }: CabecalhoProps) => {
|
|
|
79
84
|
|
|
80
85
|
return (
|
|
81
86
|
<S.CabecalhoContainer>
|
|
82
|
-
<S.CabecalhoInfoWrapper>
|
|
87
|
+
<S.CabecalhoInfoWrapper color={color}>
|
|
83
88
|
<div className="icon-wrapper">
|
|
84
89
|
<Icone
|
|
85
90
|
fill={theme.colors.white}
|