pipesol-button 1.0.1-beta.7 → 1.0.1-beta.8

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.
@@ -12,6 +12,8 @@ interface DownloadButtonProps {
12
12
  * que será aberta em nova aba para que o usuário faça o download.
13
13
  */
14
14
  file: string;
15
+ /** Nome do arquivo salvo no computador (por exemplo, "meu-arquivo.pdf"). */
16
+ download: string;
15
17
  /** Texto para acessibilidade (atributo `aria-label`). */
16
18
  aria_label: string;
17
19
  /** Cor de fundo padrão do botão (ex: `#1976d2` ou `transparent`). */
@@ -55,15 +55,14 @@ const ButtonStyled = styled('a', {
55
55
  * </DownloadButton>
56
56
  * ```
57
57
  */
58
- const DownloadButton = ({ file, aria_label, background_color, background_color_hover, color, color_hover, border_radius = '0', border_color = 'transparent', box_shadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
58
+ const DownloadButton = ({ file, download, aria_label, background_color, background_color_hover, color, color_hover, border_radius = '0', border_color = 'transparent', box_shadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
59
59
  const backgroundColor = background_color !== null && background_color !== void 0 ? background_color : 'transparent';
60
60
  const backgroundColorHover = background_color_hover !== null && background_color_hover !== void 0 ? background_color_hover : backgroundColor;
61
61
  const colorHover = color_hover !== null && color_hover !== void 0 ? color_hover : color;
62
62
  // Se sua rota de download for algo como /api/files/[file]/download,
63
63
  // você pode ajustar aqui:
64
64
  const downloadHref = `${file}/download`;
65
- return (_jsx(ButtonStyled, { href: downloadHref, download // faz o navegador baixar ao invés de abrir, se suportado
66
- : true, width: width, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: border_radius, border_color: border_color, padding: padding, margin: margin, "aria-label": aria_label, boxshadow: box_shadow, children: children }));
65
+ return (_jsx(ButtonStyled, { href: downloadHref, download: download, width: width, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: border_radius, border_color: border_color, padding: padding, margin: margin, "aria-label": aria_label, boxshadow: box_shadow, children: children }));
67
66
  };
68
67
  export default DownloadButton;
69
68
  //# sourceMappingURL=DownloadButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadButton.js","sourceRoot":"","sources":["../../src/components/DownloadButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,kBAAkB;QAClB,wBAAwB;QACxB,OAAO;QACP,aAAa;QACb,SAAS;QACT,eAAe;QACf,cAAc;QACd,aAAa;QACb,OAAO;QACP,QAAQ;QACR,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAYA,CAAC,EACC,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,EAAE,CAAC,CAAC;IACL,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,MAAM;IACtB,aAAa,EAAE,MAAM;IACrB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,gBAAgB;IACjC,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,aAAa,YAAY,EAAE;IACnC,YAAY,EAAE,aAAa;IAC3B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;IAEd,SAAS,EAAE;QACT,eAAe,EAAE,sBAAsB;QACvC,KAAK,EAAE,WAAW;KACnB;CACF,CAAC,CACH,CAAC;AAoEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,cAAc,GAAkC,CAAC,EACrD,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EAC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