pipesol-button 1.0.1-beta.3 → 1.0.1-beta.5
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.
|
@@ -14,16 +14,28 @@ export interface CircularIconLinkProps {
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
children: ReactElement<HTMLImageElement> | ReactElement<SvgIconProps>;
|
|
17
|
-
/** URL a ser aberta
|
|
17
|
+
/** URL a ser aberta */
|
|
18
18
|
url: string;
|
|
19
|
-
/** Cor de fundo do círculo
|
|
19
|
+
/** Cor de fundo do círculo */
|
|
20
20
|
background_color: string;
|
|
21
|
-
/** Texto para acessibilidade (`aria-label`)
|
|
21
|
+
/** Texto para acessibilidade (`aria-label`) */
|
|
22
22
|
aria_label: string;
|
|
23
23
|
/** Padding interno do círculo. @default "4px" */
|
|
24
24
|
padding?: string;
|
|
25
25
|
/** Estilo da borda. @default "2px solid transparent" */
|
|
26
26
|
border?: string;
|
|
27
|
+
/** Define se o link será aberto em nova aba. @default true */
|
|
28
|
+
openInNewTab?: boolean;
|
|
27
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* **CircularIconLink**
|
|
32
|
+
*
|
|
33
|
+
* Componente que exibe um **ícone ou imagem dentro de um círculo clicável**,
|
|
34
|
+
* permitindo criar links visuais para redes sociais, sites ou qualquer URL externa.
|
|
35
|
+
*
|
|
36
|
+
* - Aceita ícones do Material UI (`<SvgIcon>`) ou imagens (`<img>`).
|
|
37
|
+
* - O círculo possui cor de fundo, padding e borda personalizáveis.
|
|
38
|
+
* - Ao clicar, abre o link em nova aba ou na mesma aba, dependendo da prop `openInNewTab`.
|
|
39
|
+
*/
|
|
28
40
|
declare const CircularIconLink: React.FC<CircularIconLinkProps>;
|
|
29
41
|
export default CircularIconLink;
|
|
@@ -6,13 +6,28 @@ const StyledBox = styled(Box, {
|
|
|
6
6
|
shouldForwardProp: (prop) => !['background_color', 'padding', 'border'].includes(prop),
|
|
7
7
|
})(({ background_color, padding, border }) => ({
|
|
8
8
|
backgroundColor: background_color,
|
|
9
|
-
padding,
|
|
9
|
+
padding: padding,
|
|
10
10
|
borderRadius: '50%',
|
|
11
11
|
display: 'inline-block',
|
|
12
|
-
border,
|
|
12
|
+
border: border,
|
|
13
13
|
}));
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* **CircularIconLink**
|
|
16
|
+
*
|
|
17
|
+
* Componente que exibe um **ícone ou imagem dentro de um círculo clicável**,
|
|
18
|
+
* permitindo criar links visuais para redes sociais, sites ou qualquer URL externa.
|
|
19
|
+
*
|
|
20
|
+
* - Aceita ícones do Material UI (`<SvgIcon>`) ou imagens (`<img>`).
|
|
21
|
+
* - O círculo possui cor de fundo, padding e borda personalizáveis.
|
|
22
|
+
* - Ao clicar, abre o link em nova aba ou na mesma aba, dependendo da prop `openInNewTab`.
|
|
23
|
+
*/
|
|
24
|
+
const CircularIconLink = ({ url, background_color = 'transparent', aria_label, padding = '4px', border = 'none', children, openInNewTab = true, }) => {
|
|
25
|
+
const handleClick = () => {
|
|
26
|
+
const target = openInNewTab ? '_blank' : '_self';
|
|
27
|
+
const features = openInNewTab ? 'noopener noreferrer' : '';
|
|
28
|
+
window.open(url, target, features);
|
|
29
|
+
};
|
|
30
|
+
return (_jsx(StyledBox, { background_color: background_color, padding: padding, border: border, children: _jsx(IconButton, { "aria-label": aria_label, onClick: handleClick, children: children }) }));
|
|
16
31
|
};
|
|
17
32
|
export default CircularIconLink;
|
|
18
33
|
//# sourceMappingURL=CircularIconLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularIconLink.js","sourceRoot":"","sources":["../../src/components/CircularIconLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"CircularIconLink.js","sourceRoot":"","sources":["../../src/components/CircularIconLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,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