wca-designsystem 1.0.26 → 1.0.28

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": "1.0.26",
2
+ "version": "1.0.28",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -17,6 +17,11 @@ const props = {
17
17
  critica: '122333.0',
18
18
  absorcao: '221444.0',
19
19
  desdobramento: '12011112233330.0',
20
+ mensagens: [
21
+ 'Fora do período da Agenda',
22
+ 'Período Crítico deve estar liberado e executando',
23
+ ],
24
+ podeExecutar: false,
20
25
  };
21
26
 
22
27
  const Template: any = (args: any) => (
@@ -5,6 +5,7 @@ import { Box, Flex } from '@mantine/core';
5
5
  import IconeBotao from '../../atomos/IconeBotao';
6
6
  import Icone from '../../atomos/Icone';
7
7
  import alocar from '../../../assets/imagens/icons/Mais.svg';
8
+ import ajuda from '../../../assets/imagens/icons/Ajuda.svg';
8
9
  import retirar from '../../../assets/imagens/icons/Menos.svg';
9
10
 
10
11
  interface MosaicoCriticaProps {
@@ -12,8 +13,10 @@ interface MosaicoCriticaProps {
12
13
  nome?: string;
13
14
  saldo?: string;
14
15
  media?: string;
15
- absorcao?: string;
16
16
  critica?: string;
17
+ mensagens?: string[];
18
+ absorcao?: string;
19
+ podeExecutar?: boolean;
17
20
  desdobramento?: string;
18
21
  disabledAlocar?: boolean;
19
22
  disabledRetirar?: boolean;
@@ -27,11 +30,13 @@ const MosaicoCritica = ({
27
30
  media,
28
31
  critica,
29
32
  absorcao,
33
+ mensagens,
30
34
  desdobramento,
31
- disabledAlocar,
32
- disabledRetirar,
33
35
  onClickAlocar,
34
36
  onClickRetirar,
37
+ disabledAlocar,
38
+ disabledRetirar,
39
+ podeExecutar = true,
35
40
  color = theme.colors.purpleSec,
36
41
  }: MosaicoCriticaProps) => {
37
42
  return (
@@ -73,39 +78,51 @@ const MosaicoCritica = ({
73
78
  </Box>
74
79
 
75
80
  <Box>
76
- <Flex gap={10}>
77
- <IconeBotao
78
- toolTipInfo="Alocar"
79
- tipo="table"
80
- color={color}
81
- onClick={onClickAlocar}
82
- disabled={disabledAlocar}
83
- >
84
- <Icone
81
+ {podeExecutar ? (
82
+ <Flex gap={10}>
83
+ <IconeBotao
84
+ toolTipInfo="Alocar"
85
+ tipo="table"
86
+ color={color}
87
+ onClick={onClickAlocar}
85
88
  disabled={disabledAlocar}
86
- svg={alocar}
87
- fill={color}
88
- width={14}
89
- height={14}
90
- />
91
- </IconeBotao>
89
+ >
90
+ <Icone
91
+ disabled={disabledAlocar}
92
+ svg={alocar}
93
+ fill={color}
94
+ width={14}
95
+ height={14}
96
+ />
97
+ </IconeBotao>
92
98
 
93
- <IconeBotao
94
- toolTipInfo="Retirar"
95
- tipo="table"
96
- color={color}
97
- onClick={onClickRetirar}
98
- disabled={disabledRetirar}
99
- >
100
- <Icone
99
+ <IconeBotao
100
+ toolTipInfo="Retirar"
101
+ tipo="table"
102
+ color={color}
103
+ onClick={onClickRetirar}
101
104
  disabled={disabledRetirar}
102
- svg={retirar}
103
- fill={color}
104
- width={14}
105
- height={14}
106
- />
107
- </IconeBotao>
108
- </Flex>
105
+ >
106
+ <Icone
107
+ disabled={disabledRetirar}
108
+ svg={retirar}
109
+ fill={color}
110
+ width={14}
111
+ height={14}
112
+ />
113
+ </IconeBotao>
114
+ </Flex>
115
+ ) : (
116
+ mensagens?.length !== 0 && (
117
+ <IconeBotao
118
+ toolTipInfo={mensagens!.map(m => `• ${m}`).join('\n')}
119
+ tipo="round"
120
+ color={theme.colors.gray[300]}
121
+ >
122
+ <Icone svg={ajuda} fill={color} width={14} height={14} />
123
+ </IconeBotao>
124
+ )
125
+ )}
109
126
  </Box>
110
127
  </Flex>
111
128
  </S.MosaicoCriticaContainer>
@@ -17,7 +17,7 @@ function SkeletonTable<T extends { id: number | string }>({
17
17
  return (
18
18
  <>
19
19
  {data?.length === 0 ? (
20
- <S.TabelaSemDados>
20
+ <S.TabelaSemDados color={color}>
21
21
  <tr>
22
22
  <td
23
23
  style={{
@@ -67,10 +67,11 @@ const Template: any = (args: any) => (
67
67
  export const TabelaProps = Template.bind({});
68
68
 
69
69
  TabelaProps.args = {
70
- data: data,
70
+ data: [],
71
71
  footer: footer,
72
72
  hasExpand: false,
73
73
  hasSelect: false,
74
+ isLoading: true,
74
75
  acoesChildren: (row: any): JSX.Element => (
75
76
  <>
76
77
  <Botao onClick={() => console.log(row)} tipo={'table'} children={'▶'} />
@@ -34,7 +34,6 @@ export const StyledTable = styled.table`
34
34
  th,
35
35
  td {
36
36
  border-bottom: 1px solid ${theme.colors.gray['300']};
37
- font-size: ${theme.sizes.meddium};
38
37
  }
39
38
 
40
39
  th {
@@ -50,7 +49,9 @@ export const StyledTable = styled.table`
50
49
  background-color: ${theme.colors.gray['700']};
51
50
  }
52
51
 
53
- tr:hover:has(h2) {
52
+ tr:hover:has(h2),
53
+ tr:hover:has(.mantine-Loader-root),
54
+ tfoot tr:hover {
54
55
  background-color: unset;
55
56
  }
56
57
 
@@ -278,6 +279,6 @@ export const FooterRow = styled.tr`
278
279
 
279
280
  export const FooterCell = styled.td<{ tdMinWidth: string; color?: string }>`
280
281
  min-width: ${({ tdMinWidth }) => tdMinWidth};
281
- padding: 0.75rem;
282
+ padding: 5px;
282
283
  border-top: 1px solid ${({ theme }) => theme.colors.gray[500]};
283
284
  `;
@@ -31,6 +31,7 @@ export const secColors = {
31
31
  orangeSec: '#E96C2D',
32
32
  magentaSec: '#FD3E81',
33
33
  purpleSec: '#b930c5',
34
+ purpleDarkSec: '#632D76',
34
35
  greenSec: '#339642',
35
36
  };
36
37
  export const fontSizes = {