@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.
@@ -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: width,
16
- height: 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
- * Botão de download customizável com suporte a ícone e conteúdo centralizado.
36
- * O texto deve ser passado via `Typography` como children.
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 padrão do botão. **@default** "#1976d2"
42
- * @param {string} [backgroundHover="#1565c0"] Cor de fundo no hover. **@default** "#1565c0"
43
- * @param {string} [color="#fff"] Cor do texto padrão. **@default** "#fff"
44
- * @param {string} [colorHover] Cor do texto no hover (herda `color` quando ausente).
45
- * @param {string} [borderRadius="8px"] Raio da borda do botão. **@default** "8px"
46
- * @param {string} [boxShadow="none"] Sombra do botão. **@default** "none"
47
- * @param {string} arialLabel Texto de acessibilidade (atributo `aria-label`).
48
- * @param {React.ReactNode} [icon] Ícone opcional exibido à esquerda do conteúdo.
49
- * @param {React.ReactNode} children Conteúdo do botão (ex.: `Typography`).
50
- * @param {string} [width="auto"] Largura do botão (valor CSS). **@default** "auto"
51
- * @param {string} [height="fit-content"] Altura do botão (valor CSS). **@default** "fit-content"
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 { Download as DownloadIcon } from '@mui/icons-material';
56
+ * import { DownloadButton } from '@/components/DownloadButton';
57
57
  *
58
- * <DownloadButton
59
- * file="/docs/manual.pdf"
60
- * fileName="manual.pdf"
61
- * arialLabel="Baixar manual do produto"
62
- * background="#28a745"
63
- * backgroundHover="#218838"
64
- * color="#fff"
65
- * borderRadius="12px"
66
- * boxShadow="0 2px 8px rgba(0,0,0,0.15)"
67
- * width="220px"
68
- * height="44px"
69
- * icon={<DownloadIcon />}
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;AAuF9C,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,CASC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAClG,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,UAAU,IAAI,SAAS;IACnC,KAAK,EAAE,KAAK,IAAI,MAAM;IACtB,YAAY,EAAE,YAAY,IAAI,KAAK;IACnC,SAAS,EAAE,SAAS,IAAI,MAAM;IAC9B,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE;QACT,UAAU,EAAE,eAAe,IAAI,SAAS;QACxC,KAAK,EAAE,UAAU,IAAI,KAAK,IAAI,MAAM;KACrC;CACF,CAAC,CAAC,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,cAAc,GAAkC,CAAC,EACrD,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,aAAa,EACtB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,IAAI,EACJ,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,gBACR,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,aAEb,IAAI,IAAI,yBAAO,IAAI,GAAQ,EAC3B,QAAQ,IACE,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,eAAe,cAAc,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,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,GAAG,EAAE,KAAK;IACV,UAAU,E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