@pipelinesolucoes/button 1.0.0-beta.0 → 1.0.0-beta.1
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/LICENSE +78 -0
- package/README.md +177 -44
- package/dist/components/CircularIconLink.d.ts +30 -25
- package/dist/components/CircularIconLink.js +31 -6
- package/dist/components/CircularIconLink.js.map +1 -1
- package/dist/components/DownloadButton.d.ts +28 -88
- package/dist/components/DownloadButton.js +32 -35
- package/dist/components/DownloadButton.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -57
|
@@ -9,11 +9,11 @@ const StyledLink = styled('a', {
|
|
|
9
9
|
'borderRadius',
|
|
10
10
|
'boxShadow',
|
|
11
11
|
'width',
|
|
12
|
-
'height'
|
|
12
|
+
'height',
|
|
13
13
|
].includes(prop),
|
|
14
|
-
})(({ background, backgroundHover, color, colorHover, borderRadius, boxShadow, width, height }) => ({
|
|
15
|
-
width
|
|
16
|
-
height
|
|
14
|
+
})(({ background, backgroundHover, color, colorHover, borderRadius, boxShadow, width, height, }) => ({
|
|
15
|
+
width,
|
|
16
|
+
height,
|
|
17
17
|
display: 'inline-flex',
|
|
18
18
|
alignItems: 'center',
|
|
19
19
|
justifyContent: 'center',
|
|
@@ -32,44 +32,41 @@ const StyledLink = styled('a', {
|
|
|
32
32
|
},
|
|
33
33
|
}));
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* Componente que renderiza um link estilizado como botão para **download de arquivos**
|
|
36
|
+
* usando a tag `<a>` com o atributo `download`, permitindo customização visual via props.
|
|
37
37
|
*
|
|
38
|
-
* ### Parâmetros
|
|
39
38
|
* @param {string} file URL do arquivo a ser baixado.
|
|
40
|
-
* @param {string} fileName Nome do arquivo que será salvo
|
|
41
|
-
* @param {string} [background="#1976d2"] Cor de fundo
|
|
42
|
-
* @param {string} [backgroundHover="#1565c0"] Cor de fundo no hover.
|
|
43
|
-
* @param {string} [color="#fff"] Cor do texto
|
|
44
|
-
* @param {string} [colorHover] Cor do texto no hover (herda `color`
|
|
45
|
-
* @param {string} [borderRadius="8px"] Raio da borda do botão.
|
|
46
|
-
* @param {string} [boxShadow="none"] Sombra do botão.
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {React.ReactNode}
|
|
49
|
-
* @param {
|
|
50
|
-
* @param {string} [width="auto"] Largura do botão
|
|
51
|
-
* @param {string} [height="fit-content"] Altura do botão
|
|
39
|
+
* @param {string} fileName Nome do arquivo que será salvo no disco via atributo `download`.
|
|
40
|
+
* @param {string} [background="#1976d2"] Cor de fundo do botão.
|
|
41
|
+
* @param {string} [backgroundHover="#1565c0"] Cor de fundo no hover.
|
|
42
|
+
* @param {string} [color="#fff"] Cor do texto do botão.
|
|
43
|
+
* @param {string} [colorHover] Cor do texto no hover (quando ausente, herda `color`).
|
|
44
|
+
* @param {string} [borderRadius="8px"] Raio da borda do botão.
|
|
45
|
+
* @param {string} [boxShadow="none"] Sombra do botão.
|
|
46
|
+
* @param {React.ReactNode} [icon] Ícone exibido à esquerda do conteúdo.
|
|
47
|
+
* @param {React.ReactNode} children Conteúdo do botão.
|
|
48
|
+
* @param {string} arialLabel Texto de acessibilidade (`aria-label`).
|
|
49
|
+
* @param {string} [width="auto"] Largura do botão.
|
|
50
|
+
* @param {string} [height="fit-content"] Altura do botão.
|
|
52
51
|
*
|
|
53
52
|
* @example
|
|
54
53
|
* ```tsx
|
|
54
|
+
* import DownloadIcon from '@mui/icons-material/Download';
|
|
55
55
|
* import { Typography } from '@mui/material';
|
|
56
|
-
* import {
|
|
56
|
+
* import { DownloadButton } from '@/components/DownloadButton';
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* >
|
|
71
|
-
* <Typography variant="button">Baixar Manual</Typography>
|
|
72
|
-
* </DownloadButton>
|
|
58
|
+
* const Example = () => (
|
|
59
|
+
* <DownloadButton
|
|
60
|
+
* file="/docs/manual.pdf"
|
|
61
|
+
* fileName="manual.pdf"
|
|
62
|
+
* arialLabel="Baixar manual"
|
|
63
|
+
* icon={<DownloadIcon />}
|
|
64
|
+
* width="200px"
|
|
65
|
+
* height="44px"
|
|
66
|
+
* >
|
|
67
|
+
* <Typography variant="button">Baixar</Typography>
|
|
68
|
+
* </DownloadButton>
|
|
69
|
+
* );
|
|
73
70
|
* ```
|
|
74
71
|
*/
|
|
75
72
|
const DownloadButton = ({ width = 'auto', height = 'fit-content', file, fileName, background, backgroundHover, color, colorHover, borderRadius, boxShadow, arialLabel, icon, children, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadButton.js","sourceRoot":"","sources":["../../src/components/DownloadButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"DownloadButton.js","sourceRoot":"","sources":["../../src/components/DownloadButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAkB9C,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,EAAE;IAC7B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,YAAY;QACZ,iBAAiB;QACjB,OAAO;QACP,YAAY;QACZ,cAAc;QACd,WAAW;QACX,OAAO;QACP,QAAQ;KACT,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAUA,CAAC,EACC,UAAU,EACV,eAAe,EACf,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,EAAE,CAAC,CAAC;IACL,KAAK;IACL,MAAM;IACN,OAAO,EAAE,aAAa;IACtB,UAAU,E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