wca-designsystem 0.0.63 → 0.0.65

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.63",
2
+ "version": "0.0.65",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -9,6 +9,7 @@ export type IconProps = {
9
9
  style?: React.CSSProperties | undefined;
10
10
  className?: string;
11
11
  onClick?: () => void;
12
+ disabled?: boolean;
12
13
  };
13
14
 
14
15
  const Icone = ({
@@ -19,6 +20,7 @@ const Icone = ({
19
20
  fill,
20
21
  style,
21
22
  className,
23
+ disabled,
22
24
  }: IconProps) => {
23
25
  const fetchSvg = async () => {
24
26
  try {
@@ -45,7 +47,7 @@ const Icone = ({
45
47
  width={width}
46
48
  height={height}
47
49
  viewBox={`0 0 ${width} ${height}`}
48
- fill={fill}
50
+ fill={disabled ? 'gray' : fill}
49
51
  dangerouslySetInnerHTML={{ __html: svgContent }} // Injeta o SVG como HTML interno
50
52
  />
51
53
  );
@@ -17,6 +17,9 @@ const props: CardDestaqueProps = {
17
17
  verLogProcesso: () => console.log('aqui'),
18
18
  onClickDownload: () => console.log('download'),
19
19
  onClickUpload: () => console.log('upload'),
20
+ colorTitulo: 'black',
21
+ liberaDownload: true,
22
+ liberaUpload: false,
20
23
  };
21
24
 
22
25
  const Template: any = (args: CardDestaqueProps) => (
@@ -24,6 +24,9 @@ export type CardDestaqueProps = {
24
24
  verLogProcesso: () => void;
25
25
  onClickDownload?: () => void;
26
26
  onClickUpload?: () => void;
27
+ colorTitulo?: string;
28
+ liberaDownload?: boolean;
29
+ liberaUpload?: boolean;
27
30
  };
28
31
 
29
32
  function CardDestaque({
@@ -36,6 +39,9 @@ function CardDestaque({
36
39
  verLogProcesso,
37
40
  qtdLinhas,
38
41
  ultimaExec,
42
+ colorTitulo,
43
+ liberaDownload,
44
+ liberaUpload,
39
45
  }: CardDestaqueProps) {
40
46
  const statusTipo = useCallback(
41
47
  (status: string) => {
@@ -65,10 +71,11 @@ function CardDestaque({
65
71
  );
66
72
  return (
67
73
  <S.CardDestaqueWrapper>
68
- <S.CardDestaqueCabecalho>
69
- <h3>{titulo}</h3>
74
+ <S.CardDestaqueCabecalho cor={colorTitulo}>
75
+ <h3 color={theme.colors.purpleSec}>{titulo}</h3>
70
76
  <div className="botoes">
71
77
  <IconeBotao
78
+ disabled={!liberaDownload}
72
79
  tipo="table"
73
80
  toolTipInfo="Download"
74
81
  color={theme.colors.gray['300']}
@@ -79,6 +86,7 @@ function CardDestaque({
79
86
  fill={theme.colors.blue}
80
87
  width={14}
81
88
  height={14}
89
+ disabled={!liberaDownload}
82
90
  />
83
91
  </IconeBotao>
84
92
 
@@ -87,12 +95,14 @@ function CardDestaque({
87
95
  tipo="table"
88
96
  color={theme.colors.gray['300']}
89
97
  onClick={onClickUpload!}
98
+ disabled={!liberaUpload}
90
99
  >
91
100
  <Icone
92
101
  svg={upload}
93
102
  fill={theme.colors.blue}
94
103
  width={14}
95
104
  height={14}
105
+ disabled={!liberaUpload}
96
106
  />
97
107
  </IconeBotao>
98
108
  </div>
@@ -10,14 +10,14 @@ export const CardDestaqueWrapper = styled.div`
10
10
  `}
11
11
  `;
12
12
 
13
- export const CardDestaqueCabecalho = styled.div`
14
- ${({ theme }) => css`
13
+ export const CardDestaqueCabecalho = styled.div<{ cor: string | undefined }>`
14
+ ${({ theme, cor }) => css`
15
15
  display: flex;
16
16
  justify-content: space-between;
17
17
  align-items: center;
18
18
 
19
19
  h3 {
20
- color: ${theme.colors.blue};
20
+ color: ${cor || theme.colors.blue};
21
21
  font-weight: bold;
22
22
  }
23
23
 
@@ -20,7 +20,7 @@ const passos: PassoProps[] = [
20
20
  titulo: 'Execução do Desdobramento',
21
21
  subTitulo: 'Duas linhas de resumo sobre este passo.',
22
22
  id: 1,
23
- desabilitado: true,
23
+ desabilitado: false,
24
24
  },
25
25
  {
26
26
  titulo: 'Execução do Desdobramento',
@@ -176,7 +176,16 @@ function Passos({
176
176
  color={color}
177
177
  radius={'8px'}
178
178
  disabled={passo === passos.length || verificaProximoPasso(passo)}
179
- leftSection={<Icone svg={proximo} fill={color} />}
179
+ leftSection={
180
+ <Icone
181
+ svg={proximo}
182
+ fill={
183
+ passo === passos.length || verificaProximoPasso(passo)
184
+ ? theme.colors.gray['300']
185
+ : color
186
+ }
187
+ />
188
+ }
180
189
  onClick={() => setPasso(passo + 1)}
181
190
  tipo="default"
182
191
  >
@@ -73,7 +73,8 @@ const TabelaHeader = <T extends { id: string | number; children: Array<T> }>({
73
73
  { value: 'Menor', label: 'Ordenar por: Crescente' },
74
74
  ]}
75
75
  onChange={(_value, option) => setOrdenarPor!(option)}
76
- value={ordenarPor ? ordenarPor.value : null}
76
+ value={ordenarPor ? ordenarPor.value : 'Maior'}
77
+ clearable={false}
77
78
  placeholder={`Ordenar por ${ordenarPor}`}
78
79
  color={color}
79
80
  maw={200}
@@ -75,7 +75,6 @@ TabelaProps.args = {
75
75
  columns: columns,
76
76
  color: theme.colors.blue,
77
77
  hasFiltersButtons: true,
78
-
79
78
  ordenarPor: {
80
79
  label: 'Ordenar por: Maior',
81
80
  value: 'Maior',
@@ -90,6 +89,7 @@ TabelaProps.args = {
90
89
  fetchMoreData: () => console.log('fetchMoreData'),
91
90
  hasInfinitScrool: true,
92
91
  hasMoreData: true,
92
+ hasOrder: true,
93
93
  setGlobalFilter: () => console.log('aqui'),
94
94
  setPagination: () => console.log('aqui'),
95
95
  quantidadeDeRegistros: 10,
@@ -107,7 +107,7 @@ export const TabelaBody = styled.tbody<ColorsProp>`
107
107
  .select {
108
108
  background-color: ${color};
109
109
  position: absolute;
110
- left: 17px;
110
+ /* left: 17px; */
111
111
  }
112
112
 
113
113
  .expand {