@pipelinesolucoes/button 1.0.0-beta.0
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/README.md +44 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +19 -0
- package/dist/app/layout.js.map +1 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/page.js +6 -0
- package/dist/app/page.js.map +1 -0
- package/dist/components/ActionButton.d.ts +45 -0
- package/dist/components/ActionButton.js +39 -0
- package/dist/components/ActionButton.js.map +1 -0
- package/dist/components/CircularIconLink.d.ts +43 -0
- package/dist/components/CircularIconLink.js +35 -0
- package/dist/components/CircularIconLink.js.map +1 -0
- package/dist/components/DownloadButton.d.ts +116 -0
- package/dist/components/DownloadButton.js +80 -0
- package/dist/components/DownloadButton.js.map +1 -0
- package/dist/components/FormButtonGroup.d.ts +55 -0
- package/dist/components/FormButtonGroup.js +78 -0
- package/dist/components/FormButtonGroup.js.map +1 -0
- package/dist/components/NavigationButton.d.ts +48 -0
- package/dist/components/NavigationButton.js +80 -0
- package/dist/components/NavigationButton.js.map +1 -0
- package/dist/components/NavigationLink.d.ts +73 -0
- package/dist/components/NavigationLink.js +101 -0
- package/dist/components/NavigationLink.js.map +1 -0
- package/dist/components/ScrollToTopButton.d.ts +10 -0
- package/dist/components/ScrollToTopButton.js +44 -0
- package/dist/components/ScrollToTopButton.js.map +1 -0
- package/dist/components/StyledButton.d.ts +6 -0
- package/dist/components/StyledButton.js +39 -0
- package/dist/components/StyledButton.js.map +1 -0
- package/dist/components/WhatsAppButton.d.ts +28 -0
- package/dist/components/WhatsAppButton.js +40 -0
- package/dist/components/WhatsAppButton.js.map +1 -0
- package/dist/components/WhatsAppIcon.d.ts +28 -0
- package/dist/components/WhatsAppIcon.js +31 -0
- package/dist/components/WhatsAppIcon.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/_app.d.ts +2 -0
- package/dist/pages/_app.js +20 -0
- package/dist/pages/_app.js.map +1 -0
- package/dist/pages/_document.d.ts +9 -0
- package/dist/pages/_document.js +33 -0
- package/dist/pages/_document.js.map +1 -0
- package/dist/theme.d.ts +29 -0
- package/dist/theme.js +232 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/ButtonKind.d.ts +4 -0
- package/dist/types/ButtonKind.js +2 -0
- package/dist/types/ButtonKind.js.map +1 -0
- package/dist/types/CommonForwardProps.d.ts +1 -0
- package/dist/types/CommonForwardProps.js +13 -0
- package/dist/types/CommonForwardProps.js.map +1 -0
- package/dist/types/DataCard.d.ts +6 -0
- package/dist/types/DataCard.js +2 -0
- package/dist/types/DataCard.js.map +1 -0
- package/dist/types/ShadowConfig.d.ts +6 -0
- package/dist/types/ShadowConfig.js +2 -0
- package/dist/types/ShadowConfig.js.map +1 -0
- package/dist/types/style/BorderProps.d.ts +5 -0
- package/dist/types/style/BorderProps.js +2 -0
- package/dist/types/style/BorderProps.js.map +1 -0
- package/dist/types/style/ColorProps.d.ts +6 -0
- package/dist/types/style/ColorProps.js +2 -0
- package/dist/types/style/ColorProps.js.map +1 -0
- package/dist/types/style/CommonStyleProps.d.ts +5 -0
- package/dist/types/style/CommonStyleProps.js +2 -0
- package/dist/types/style/CommonStyleProps.js.map +1 -0
- package/dist/types/style/LayoutProps.d.ts +6 -0
- package/dist/types/style/LayoutProps.js +2 -0
- package/dist/types/style/LayoutProps.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { COMMON_STYLE_FORWARD_PROPS } from '../types/CommonForwardProps';
|
|
5
|
+
import { Typography } from '@mui/material';
|
|
6
|
+
const ButtonStyled = styled('a', {
|
|
7
|
+
shouldForwardProp: (prop) => !['kind', ...COMMON_STYLE_FORWARD_PROPS].includes(prop),
|
|
8
|
+
})(({ theme, kind, background, backgroundHover, colorText, colorHover, padding, borderRadius, border, width, margin, boxShadow, }) => {
|
|
9
|
+
const tokens = kind === 'primary'
|
|
10
|
+
? theme.palette.custom.primaryButton
|
|
11
|
+
: kind === 'secondary'
|
|
12
|
+
? theme.palette.custom.secondaryButton
|
|
13
|
+
: kind === 'delete'
|
|
14
|
+
? theme.palette.custom.deleteButton
|
|
15
|
+
: undefined;
|
|
16
|
+
return {
|
|
17
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
18
|
+
margin: margin !== null && margin !== void 0 ? margin : '0',
|
|
19
|
+
padding: tokens ? tokens.padding : padding,
|
|
20
|
+
borderRadius: tokens ? tokens.borderRadius : borderRadius,
|
|
21
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
22
|
+
border,
|
|
23
|
+
textDecoration: 'none',
|
|
24
|
+
textTransform: 'none',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
background: tokens ? tokens.background : background,
|
|
28
|
+
color: tokens ? tokens.color : colorText,
|
|
29
|
+
'&:hover': {
|
|
30
|
+
background: tokens
|
|
31
|
+
? tokens.backgroundHover
|
|
32
|
+
: backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover : background,
|
|
33
|
+
color: tokens ? tokens.colorHover : colorHover !== null && colorHover !== void 0 ? colorHover : colorText,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Botão de navegação reutilizável baseado em um link (`<a>`), estilizado com Material UI.
|
|
39
|
+
*
|
|
40
|
+
* Regras de navegação:
|
|
41
|
+
* - Se `url` contiver `http`, o link é tratado como externo e abre em nova aba.
|
|
42
|
+
* - Caso contrário, é tratado como link interno ou âncora.
|
|
43
|
+
*
|
|
44
|
+
* @param {ButtonKind} [kind="none"] Tipo de botão baseado nos tokens do tema.
|
|
45
|
+
* @param {string} url URL ou âncora de destino.
|
|
46
|
+
* @param {string} aria_label Texto para acessibilidade.
|
|
47
|
+
* @param {string} [background] Cor de fundo do botão.
|
|
48
|
+
* @param {string} [backgroundHover] Cor de fundo no hover.
|
|
49
|
+
* @param {string} [colorText] Cor do texto.
|
|
50
|
+
* @param {string} [colorHover] Cor do texto no hover.
|
|
51
|
+
* @param {string} [border="none"] Borda do botão.
|
|
52
|
+
* @param {string} [borderRadius="0"] Raio da borda.
|
|
53
|
+
* @param {string} [boxShadow="none"] Sombra do botão.
|
|
54
|
+
* @param {string} width Largura do botão.
|
|
55
|
+
* @param {string} [margin="0"] Margem externa.
|
|
56
|
+
* @param {string} [padding="8px 24px"] Espaçamento interno.
|
|
57
|
+
* @param {string} [text] Texto do botão.
|
|
58
|
+
* @param {TypographyVariant} [variant="body1"] Variante da tipografia usada no texto.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <NavigationButton
|
|
63
|
+
* kind="primary"
|
|
64
|
+
* url="#contato"
|
|
65
|
+
* aria_label="Ir para contato"
|
|
66
|
+
* width="fit-content"
|
|
67
|
+
* >
|
|
68
|
+
* Fale conosco
|
|
69
|
+
* </NavigationButton>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
const NavigationButton = ({ url, text, kind = 'none', aria_label, background, backgroundHover, colorText, colorHover, borderRadius = '0', border = 'none', boxShadow = 'none', width, margin = '0', padding = '8px 24px', variant = "body1", }) => {
|
|
73
|
+
if (url.includes('http')) {
|
|
74
|
+
return (_jsx(ButtonStyled, { kind: kind, href: url, width: width, background: background, backgroundHover: backgroundHover, colorText: colorText, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: margin, "aria-label": aria_label, target: "_blank", rel: "noopener noreferrer", boxShadow: boxShadow, children: _jsx(Typography, { variant: variant, children: text }) }));
|
|
75
|
+
}
|
|
76
|
+
return (_jsx(ButtonStyled, { kind: kind, href: url, width: width, background: background, backgroundHover: backgroundHover, colorText: colorText, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: margin, "aria-label": aria_label, boxShadow: boxShadow, children: _jsx(Typography, { variant: variant, children: text }) }));
|
|
77
|
+
};
|
|
78
|
+
NavigationButton.displayName = 'NavigationButton';
|
|
79
|
+
export default NavigationButton;
|
|
80
|
+
//# sourceMappingURL=NavigationButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationButton.js","sourceRoot":"","sources":["../../src/components/NavigationButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,MAAM,EAAqB,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC,CAAE,MAAM,EAAE,GAAG,0BAA0B,CAAE,CAAC,QAAQ,CAAC,IAAc,CAAC;CACtE,CAAC,CACA,CAAC,EACC,KAAK,EACL,IAAI,EACJ,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,EAAE;IACH,MAAM,MAAM,GACV,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa;QACpC,CAAC,CAAC,IAAI,KAAK,WAAW;YACtB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe;YACtC,CAAC,CAAC,IAAI,KAAK,QAAQ;gBACnB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY;gBACnC,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO;QACL,KAAK,EAAE,KAAK,a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AAG,UAAU,EACpB,OAAO,GAAG,OAAO,GAClB,EAAE,EAAE;IACH,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,CACL,KAAC,YAAY,IACX,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,gBACF,UAAU,EACtB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAE,SAAS,YAEpB,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,GAAc,GACpC,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,YAAY,IACX,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,gBACF,UAAU,EACtB,SAAS,EAAE,SAAS,YAEpB,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,GAAc,GACpC,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAClD,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TypographyVariant } from '@mui/material/styles';
|
|
3
|
+
import { LayoutProps } from '../types/style/LayoutProps';
|
|
4
|
+
import { ColorProps } from '../types/style/ColorProps';
|
|
5
|
+
export interface LinkStyleProps extends LayoutProps, ColorProps {
|
|
6
|
+
textDecoration: 'none' | 'underline';
|
|
7
|
+
}
|
|
8
|
+
interface NavigationLinkProps extends LinkStyleProps {
|
|
9
|
+
url: string;
|
|
10
|
+
aria_label: string;
|
|
11
|
+
textDecoration: 'none' | 'underline';
|
|
12
|
+
text: string;
|
|
13
|
+
variant?: TypographyVariant;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Componente que renderiza um link de navegação estilizado usando `styled` do Material UI.
|
|
17
|
+
* Ele aplica estilos customizáveis (layout e cores) e encapsula o texto com `Typography`.
|
|
18
|
+
*
|
|
19
|
+
* Quando a `url` contém `"http"`, o link é tratado como **externo** e abre em uma nova aba
|
|
20
|
+
* com `target="_blank"` e `rel="noopener noreferrer"`. Caso contrário, o link é tratado como **interno**
|
|
21
|
+
* e abre na mesma aba.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} url URL de destino do link. Se contiver "http", será considerado link externo.
|
|
24
|
+
* @param {string} aria_label Rótulo de acessibilidade aplicado em `aria-label` no elemento `<a>`.
|
|
25
|
+
* @param {string} [background_color='transparent'] Cor de fundo do link.
|
|
26
|
+
* @param {string} [background_color_hover] Cor de fundo no hover. Se não for informada, usa `background_color`.
|
|
27
|
+
* @param {string} color Cor do texto do link.
|
|
28
|
+
* @param {string} [color_hover] Cor do texto no hover. Se não for informada, usa `color`.
|
|
29
|
+
* @param {'none' | 'underline'} [text_decoration='none'] Estilo de decoração do texto (`text-decoration`) do link.
|
|
30
|
+
* @param {string} width Largura do link (ex.: `'100%'`, `'auto'`, `'200px'`).
|
|
31
|
+
* @param {string} [margin='0'] Margem externa do link.
|
|
32
|
+
* @param {string} [padding='0'] Espaçamento interno do link.
|
|
33
|
+
* @param {string} text Texto exibido dentro do link.
|
|
34
|
+
* @param {TypographyVariant} [variant='body1'] Variante do `Typography` do Material UI utilizada para renderizar o texto.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* import { NavigationLink } from '@/components/NavigationLink';
|
|
39
|
+
*
|
|
40
|
+
* export const Example = () => {
|
|
41
|
+
* return (
|
|
42
|
+
* <>
|
|
43
|
+
* <NavigationLink
|
|
44
|
+
* url="/about"
|
|
45
|
+
* aria_label="Ir para a página Sobre"
|
|
46
|
+
* color="#222"
|
|
47
|
+
* text="Sobre"
|
|
48
|
+
* width="auto"
|
|
49
|
+
* padding="8px 12px"
|
|
50
|
+
* text_decoration="none"
|
|
51
|
+
* variant="body2"
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* <NavigationLink
|
|
55
|
+
* url="https://example.com"
|
|
56
|
+
* aria_label="Abrir site externo"
|
|
57
|
+
* color="#1976d2"
|
|
58
|
+
* color_hover="#0d47a1"
|
|
59
|
+
* background_color="transparent"
|
|
60
|
+
* background_color_hover="transparent"
|
|
61
|
+
* text="Site externo"
|
|
62
|
+
* width="auto"
|
|
63
|
+
* margin="0 0 0 12px"
|
|
64
|
+
* padding="8px 12px"
|
|
65
|
+
* text_decoration="underline"
|
|
66
|
+
* />
|
|
67
|
+
* </>
|
|
68
|
+
* );
|
|
69
|
+
* };
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare const NavigationLink: React.FC<NavigationLinkProps>;
|
|
73
|
+
export default NavigationLink;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { Typography } from '@mui/material';
|
|
5
|
+
const ButtonStyled = styled('a', {
|
|
6
|
+
shouldForwardProp: (prop) => ![
|
|
7
|
+
"width",
|
|
8
|
+
"height",
|
|
9
|
+
"padding",
|
|
10
|
+
"margin",
|
|
11
|
+
"background",
|
|
12
|
+
"backgroundHover",
|
|
13
|
+
"colorText",
|
|
14
|
+
"colorHover",
|
|
15
|
+
].includes(prop),
|
|
16
|
+
})(({ background, backgroundHover, colorText, colorHover, padding, width, margin, textDecoration }) => ({
|
|
17
|
+
width: width,
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
textDecoration: textDecoration,
|
|
20
|
+
textTransform: 'none',
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
backgroundColor: background,
|
|
23
|
+
color: colorText,
|
|
24
|
+
padding: padding,
|
|
25
|
+
margin: margin,
|
|
26
|
+
'&:hover': {
|
|
27
|
+
backgroundColor: backgroundHover,
|
|
28
|
+
borderBottom: `1px solid ${colorHover}`,
|
|
29
|
+
color: colorHover,
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
32
|
+
/**
|
|
33
|
+
* Componente que renderiza um link de navegação estilizado usando `styled` do Material UI.
|
|
34
|
+
* Ele aplica estilos customizáveis (layout e cores) e encapsula o texto com `Typography`.
|
|
35
|
+
*
|
|
36
|
+
* Quando a `url` contém `"http"`, o link é tratado como **externo** e abre em uma nova aba
|
|
37
|
+
* com `target="_blank"` e `rel="noopener noreferrer"`. Caso contrário, o link é tratado como **interno**
|
|
38
|
+
* e abre na mesma aba.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} url URL de destino do link. Se contiver "http", será considerado link externo.
|
|
41
|
+
* @param {string} aria_label Rótulo de acessibilidade aplicado em `aria-label` no elemento `<a>`.
|
|
42
|
+
* @param {string} [background_color='transparent'] Cor de fundo do link.
|
|
43
|
+
* @param {string} [background_color_hover] Cor de fundo no hover. Se não for informada, usa `background_color`.
|
|
44
|
+
* @param {string} color Cor do texto do link.
|
|
45
|
+
* @param {string} [color_hover] Cor do texto no hover. Se não for informada, usa `color`.
|
|
46
|
+
* @param {'none' | 'underline'} [text_decoration='none'] Estilo de decoração do texto (`text-decoration`) do link.
|
|
47
|
+
* @param {string} width Largura do link (ex.: `'100%'`, `'auto'`, `'200px'`).
|
|
48
|
+
* @param {string} [margin='0'] Margem externa do link.
|
|
49
|
+
* @param {string} [padding='0'] Espaçamento interno do link.
|
|
50
|
+
* @param {string} text Texto exibido dentro do link.
|
|
51
|
+
* @param {TypographyVariant} [variant='body1'] Variante do `Typography` do Material UI utilizada para renderizar o texto.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* import { NavigationLink } from '@/components/NavigationLink';
|
|
56
|
+
*
|
|
57
|
+
* export const Example = () => {
|
|
58
|
+
* return (
|
|
59
|
+
* <>
|
|
60
|
+
* <NavigationLink
|
|
61
|
+
* url="/about"
|
|
62
|
+
* aria_label="Ir para a página Sobre"
|
|
63
|
+
* color="#222"
|
|
64
|
+
* text="Sobre"
|
|
65
|
+
* width="auto"
|
|
66
|
+
* padding="8px 12px"
|
|
67
|
+
* text_decoration="none"
|
|
68
|
+
* variant="body2"
|
|
69
|
+
* />
|
|
70
|
+
*
|
|
71
|
+
* <NavigationLink
|
|
72
|
+
* url="https://example.com"
|
|
73
|
+
* aria_label="Abrir site externo"
|
|
74
|
+
* color="#1976d2"
|
|
75
|
+
* color_hover="#0d47a1"
|
|
76
|
+
* background_color="transparent"
|
|
77
|
+
* background_color_hover="transparent"
|
|
78
|
+
* text="Site externo"
|
|
79
|
+
* width="auto"
|
|
80
|
+
* margin="0 0 0 12px"
|
|
81
|
+
* padding="8px 12px"
|
|
82
|
+
* text_decoration="underline"
|
|
83
|
+
* />
|
|
84
|
+
* </>
|
|
85
|
+
* );
|
|
86
|
+
* };
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
const NavigationLink = ({ url, aria_label, background = 'transparent', backgroundHover, colorText, colorHover, textDecoration = 'none', width, margin = '0', padding = '0', text, variant = "body1", }) => {
|
|
90
|
+
const backgroundColor = background;
|
|
91
|
+
const backgroundColorHover = backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover : backgroundColor;
|
|
92
|
+
const color_hover = colorHover ? colorHover : (colorText !== null && colorText !== void 0 ? colorText : 'black');
|
|
93
|
+
if (url.indexOf('http') != -1) {
|
|
94
|
+
return (_jsx(ButtonStyled, { href: url, width: width, background: backgroundColor, backgroundHover: backgroundColorHover, colorText: colorText, colorHover: color_hover, padding: padding, margin: margin, textDecoration: textDecoration, "aria-label": aria_label, target: "_blank", rel: "noopener noreferrer", children: _jsx(Typography, { variant: variant, children: text }) }));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return (_jsx(ButtonStyled, { href: url, width: width, background: backgroundColor, backgroundHover: backgroundColorHover, colorText: colorText, colorHover: color_hover, padding: padding, margin: margin, "aria-label": aria_label, textDecoration: textDecoration, children: _jsx(Typography, { variant: variant, children: text }) }));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export default NavigationLink;
|
|
101
|
+
//# sourceMappingURL=NavigationLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationLink.js","sourceRoot":"","sources":["../../src/components/NavigationLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,MAAM,EAAqB,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,OAAO;QACP,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,iBAAiB;QACjB,WAAW;QACX,YAAY;KACb,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAAiB,CAAC,EAClB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,MAAM,EACN,cAAc,EACf,EAAE,EAAE,CAAC,CAAC;IACL,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,cAAc;IAC9B,aAAa,EAAE,MAAM;IACrB,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE,UAAU;IAC3B,KAAK,EAA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AAC;IACJ,CAAC;SACG,CAAC;QAEH,OAAO,CACL,KAAC,YAAY,IACX,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,eAAe,EAC3B,eAAe,EAAE,oBAAoB,EACrC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,gBACD,UAAU,EACvB,cAAc,EAAE,cAAc,YAE9B,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,GAAc,GACpC,CAChB,CAAC;IACJ,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ScrollToTopButtonProps {
|
|
3
|
+
show: boolean;
|
|
4
|
+
border_radius: string;
|
|
5
|
+
background_color: string;
|
|
6
|
+
background_color_hover: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const ScrollToTopButton: React.FC<ScrollToTopButtonProps>;
|
|
10
|
+
export default ScrollToTopButton;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import IconButton from '@mui/material/IconButton';
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
6
|
+
const ButtonStyled = styled(IconButton, {
|
|
7
|
+
shouldForwardProp: (prop) => !['$show', '$background_color', '$border_radius', '$background_color_hover'].includes(prop),
|
|
8
|
+
})(({ $show, $background_color, $border_radius, $background_color_hover }) => ({
|
|
9
|
+
display: $show === 'true' ? 'flex' : 'none',
|
|
10
|
+
position: 'fixed',
|
|
11
|
+
bottom: '165px',
|
|
12
|
+
right: '20px',
|
|
13
|
+
cursor: 'pointer',
|
|
14
|
+
zIndex: 1000,
|
|
15
|
+
width: 'auto',
|
|
16
|
+
height: 'auto',
|
|
17
|
+
border: `1px solid ${$background_color || '#00000000'}`,
|
|
18
|
+
backgroundColor: $background_color || '#00000000',
|
|
19
|
+
borderRadius: $border_radius,
|
|
20
|
+
'&:hover': {
|
|
21
|
+
backgroundColor: $background_color_hover || $background_color,
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
const ScrollToTopButton = ({ show, border_radius, background_color, background_color_hover, children }) => {
|
|
25
|
+
const [showButton, setshowButton] = useState(show);
|
|
26
|
+
const handleScroll = () => {
|
|
27
|
+
setshowButton(window.scrollY > 0);
|
|
28
|
+
};
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
window.addEventListener('scroll', handleScroll);
|
|
31
|
+
return () => {
|
|
32
|
+
window.removeEventListener('scroll', handleScroll);
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
const scrollToTop = () => {
|
|
36
|
+
window.scrollTo({
|
|
37
|
+
top: 0,
|
|
38
|
+
behavior: 'smooth',
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
return (_jsx(ButtonStyled, { "$background_color": background_color, "$border_radius": border_radius, "$background_color_hover": background_color_hover, onClick: scrollToTop, "aria-label": "ir para o topo", "$show": showButton.toString(), children: children }));
|
|
42
|
+
};
|
|
43
|
+
export default ScrollToTopButton;
|
|
44
|
+
//# sourceMappingURL=ScrollToTopButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollToTopButton.js","sourceRoot":"","sources":["../../src/components/ScrollToTopButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,EAAE;IACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CA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AAG,GAAG,EAAE;QACvB,MAAM,CAAC,QAAQ,CAAC;YACd,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,yBACQ,gBAAgB,oBACnB,aAAa,6BACJ,sBAAsB,EAC/C,OAAO,EAAE,WAAW,gBAAa,gBAAgB,WAC1C,UAAU,CAAC,QAAQ,EAAE,YAC3B,QAAQ,GACI,CAChB,CAAC;AACV,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ButtonKind } from "../types/ButtonKind";
|
|
2
|
+
import { CommonStyleProps } from "../types/style/CommonStyleProps";
|
|
3
|
+
export interface ButtonStyleProps extends CommonStyleProps {
|
|
4
|
+
kind: ButtonKind;
|
|
5
|
+
}
|
|
6
|
+
export declare const StyledButtonKind: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style" | "color" | "children" | "sx" | "className" | "tabIndex" | "classes" | "href" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "disableElevation" | "endIcon" | "fullWidth" | "loadingPosition" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ButtonStyleProps, {}, {}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { COMMON_STYLE_FORWARD_PROPS } from '../types/CommonForwardProps';
|
|
2
|
+
import { Button, styled } from "@mui/material";
|
|
3
|
+
export const StyledButtonKind = styled(Button, {
|
|
4
|
+
shouldForwardProp: (prop) => !["kind", ...COMMON_STYLE_FORWARD_PROPS].includes(prop),
|
|
5
|
+
})(({ theme, kind = "primary", width, height, padding, margin, background, backgroundHover, colorText, colorHover, borderRadius, boxShadow }) => {
|
|
6
|
+
const tokens = kind === "primary"
|
|
7
|
+
? theme.palette.custom.primaryButton
|
|
8
|
+
: kind === "secondary"
|
|
9
|
+
? theme.palette.custom.secondaryButton
|
|
10
|
+
: kind === "delete"
|
|
11
|
+
? theme.palette.custom.deleteButton
|
|
12
|
+
: undefined;
|
|
13
|
+
return {
|
|
14
|
+
// Dimensões
|
|
15
|
+
width: width,
|
|
16
|
+
height: height,
|
|
17
|
+
margin: margin,
|
|
18
|
+
padding: tokens ? tokens.padding : padding,
|
|
19
|
+
// Visual
|
|
20
|
+
textTransform: "none",
|
|
21
|
+
borderRadius: tokens ? tokens.borderRadius : borderRadius,
|
|
22
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
23
|
+
// Cores
|
|
24
|
+
background: tokens ? tokens.background : background,
|
|
25
|
+
color: tokens ? tokens.color : colorText,
|
|
26
|
+
"&:hover": {
|
|
27
|
+
background: tokens ? tokens.backgroundHover : (backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover : background),
|
|
28
|
+
color: tokens ? tokens.colorHover : (colorHover !== null && colorHover !== void 0 ? colorHover : colorText),
|
|
29
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
30
|
+
},
|
|
31
|
+
// Estado disabled
|
|
32
|
+
"&.Mui-disabled": {
|
|
33
|
+
background: theme.palette.grey[300],
|
|
34
|
+
color: theme.palette.text.disabled,
|
|
35
|
+
boxShadow: "none",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=StyledButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledButton.js","sourceRoot":"","sources":["../../src/components/StyledButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,0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M,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;QACnD,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAExC,SAAS,EAAE;YACT,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,UAAU,CAAC;YAC9E,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,SAAS,CAAC;YAC7D,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SACjD;QAED,kBAAkB;QAClB,gBAAgB,EAAE;YAChB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;YACnC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;YAClC,SAAS,EAAE,MAAM;SAClB;KACF,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Propriedades do componente `WhatsAppButton`.
|
|
4
|
+
*/
|
|
5
|
+
interface WhatsAppButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* Número de telefone para iniciar a conversa no WhatsApp.
|
|
8
|
+
*
|
|
9
|
+
* - Deve ser informado **apenas com dígitos**, incluindo o código do país.
|
|
10
|
+
* - Exemplo para Brasil: `"5511999999999"` (55 = DDI, 11 = DDD).
|
|
11
|
+
*/
|
|
12
|
+
whatsapp: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Botão flutuante do WhatsApp que abre uma conversa no **WhatsApp** em uma nova aba,
|
|
16
|
+
* usando o número fornecido na propriedade `whatsapp`.
|
|
17
|
+
*
|
|
18
|
+
* - Fica posicionado no canto inferior direito da tela.
|
|
19
|
+
* - Estilizado com a cor oficial do WhatsApp (#25D366).
|
|
20
|
+
* - Ao clicar, redireciona para `https://wa.me/{whatsapp}`
|
|
21
|
+
*
|
|
22
|
+
* Exemplo de uso:
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <WhatsAppButton whatsapp="5511999999999" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const WhatsAppButton: React.FC<WhatsAppButtonProps>;
|
|
28
|
+
export default WhatsAppButton;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { WhatsApp } from '@mui/icons-material';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import Fab from '@mui/material/Fab';
|
|
6
|
+
const StyledFab = styled(Fab)({
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
bottom: '20px',
|
|
9
|
+
right: '20px',
|
|
10
|
+
zIndex: 1000,
|
|
11
|
+
backgroundColor: '#25D366',
|
|
12
|
+
color: 'white',
|
|
13
|
+
'&:hover': {
|
|
14
|
+
backgroundColor: '#1EBE5D',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Botão flutuante do WhatsApp que abre uma conversa no **WhatsApp** em uma nova aba,
|
|
19
|
+
* usando o número fornecido na propriedade `whatsapp`.
|
|
20
|
+
*
|
|
21
|
+
* - Fica posicionado no canto inferior direito da tela.
|
|
22
|
+
* - Estilizado com a cor oficial do WhatsApp (#25D366).
|
|
23
|
+
* - Ao clicar, redireciona para `https://wa.me/{whatsapp}`
|
|
24
|
+
*
|
|
25
|
+
* Exemplo de uso:
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <WhatsAppButton whatsapp="5511999999999" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const WhatsAppButton = ({ whatsapp }) => {
|
|
31
|
+
/**
|
|
32
|
+
* Abre uma nova aba com o link oficial `wa.me/{whatsapp}` para iniciar a conversa.
|
|
33
|
+
*/
|
|
34
|
+
const handleClick = () => {
|
|
35
|
+
window.open(`https://wa.me/${whatsapp}`, '_blank');
|
|
36
|
+
};
|
|
37
|
+
return (_jsx(StyledFab, { "aria-label": "button whatsapp", onClick: handleClick, children: _jsx(WhatsApp, {}) }));
|
|
38
|
+
};
|
|
39
|
+
export default WhatsAppButton;
|
|
40
|
+
//# sourceMappingURL=WhatsAppButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhatsAppButton.js","sourceRoot":"","sources":["../../src/components/WhatsAppButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,SAAS;IAC1B,KAAK,EAAE,OAAO;IAEd,SAAS,EAAE;QACT,eAAe,EAAE,SAAS;KAC3B;CACF,CAAC,CAAC;AAeH;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAkC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACrE;;OAEG;IACH,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,iBAAiB,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,kBAAY,iBAAiB,EAAC,OAAO,EAAE,WAAW,YAC1D,KAAC,QAAQ,KAAG,GACF,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Propriedades do componente `WhatsAppIcon`.
|
|
4
|
+
*/
|
|
5
|
+
export interface WhatsAppIconProps {
|
|
6
|
+
/**
|
|
7
|
+
* Número de telefone para iniciar a conversa no WhatsApp.
|
|
8
|
+
*
|
|
9
|
+
* - Use **apenas dígitos**, incluindo o código do país.
|
|
10
|
+
* - Exemplo (Brasil): `"5511999999999"` (55 = DDI, 11 = DDD).
|
|
11
|
+
*/
|
|
12
|
+
whatsapp: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Ícone clicável do WhatsApp envolto em um container circular personalizável,
|
|
16
|
+
* que pode ser posicionado livremente em qualquer lugar da tela.
|
|
17
|
+
*
|
|
18
|
+
* - Ao clicar, abre uma nova aba com o link `https://wa.me/{whatsapp}`.
|
|
19
|
+
* - A cor de fundo do círculo é a cor oficial do WhatsApp (`#25D366`).
|
|
20
|
+
* - Ideal para ser usado dentro de layouts onde você controla o `position` via CSS/Box pai.
|
|
21
|
+
*
|
|
22
|
+
* Exemplo de uso:
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <WhatsAppIcon whatsapp="5511999999999" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const WhatsAppIcon: React.FC<WhatsAppIconProps>;
|
|
28
|
+
export default WhatsAppIcon;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Box, IconButton, styled } from '@mui/material';
|
|
4
|
+
import { WhatsApp } from '@mui/icons-material';
|
|
5
|
+
const StyledBox = styled(Box, {
|
|
6
|
+
shouldForwardProp: (prop) => !['background_color'].includes(prop),
|
|
7
|
+
})(({ background_color }) => ({
|
|
8
|
+
backgroundColor: background_color,
|
|
9
|
+
padding: '4px',
|
|
10
|
+
borderRadius: '50%',
|
|
11
|
+
display: 'inline-block',
|
|
12
|
+
border: '2px solid transparent',
|
|
13
|
+
}));
|
|
14
|
+
/**
|
|
15
|
+
* Ícone clicável do WhatsApp envolto em um container circular personalizável,
|
|
16
|
+
* que pode ser posicionado livremente em qualquer lugar da tela.
|
|
17
|
+
*
|
|
18
|
+
* - Ao clicar, abre uma nova aba com o link `https://wa.me/{whatsapp}`.
|
|
19
|
+
* - A cor de fundo do círculo é a cor oficial do WhatsApp (`#25D366`).
|
|
20
|
+
* - Ideal para ser usado dentro de layouts onde você controla o `position` via CSS/Box pai.
|
|
21
|
+
*
|
|
22
|
+
* Exemplo de uso:
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <WhatsAppIcon whatsapp="5511999999999" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
const WhatsAppIcon = ({ whatsapp }) => {
|
|
28
|
+
return (_jsx(StyledBox, { background_color: "#25D366", children: _jsx(IconButton, { "aria-label": "icone whatsapp", onClick: () => window.open(`https://wa.me/${whatsapp}`, '_blank', 'noopener noreferrer'), children: _jsx(WhatsApp, { sx: { color: 'white', fontSize: 24 } }) }) }));
|
|
29
|
+
};
|
|
30
|
+
export default WhatsAppIcon;
|
|
31
|
+
//# sourceMappingURL=WhatsAppIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhatsAppIcon.js","sourceRoot":"","sources":["../../src/components/WhatsAppIcon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE;IAC5B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC5E,CAAC,CAA+B,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,eAAe,EAAE,gBAAgB;IACjC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,uBAAuB;CAChC,CAAC,CAAC,CAAC;AAeJ;;;;;;;;;;;;GAYG;AACH,MAAM,YAAY,GAAgC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjE,OAAO,CACL,KAAC,SAAS,IAAC,gBAAgB,EAAC,SAAS,YACnC,KAAC,UAAU,kBACE,gBAAgB,EAC3B,OAAO,EAAE,GAAG,EAAE,CACZ,MAAM,CAAC,IAAI,CAAC,iBAAiB,QAAQ,EAAE,EAAE,QAAQ,EAAE,qBAAqB,CAAC,YAG3E,KAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI,GACvC,GACH,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as CircularIconLink } from './components/CircularIconLink';
|
|
2
|
+
export { default as NavigationButton } from './components/NavigationButton';
|
|
3
|
+
export { default as DownloadButton } from './components/DownloadButton';
|
|
4
|
+
export { default as NavigationLink } from './components/NavigationLink';
|
|
5
|
+
export { default as ScrollToTopButton } from './components/ScrollToTopButton';
|
|
6
|
+
export { default as WhatsAppButton } from './components/WhatsAppButton';
|
|
7
|
+
export { default as WhatsAppIcon } from './components/WhatsAppIcon';
|
|
8
|
+
export { default as ActionButton } from "./components/ActionButton";
|
|
9
|
+
export { default as FormButtonGroup } from "./components/FormButtonGroup";
|
|
10
|
+
export type { ButtonKind } from "./types/ButtonKind";
|
|
11
|
+
export type { BorderProps } from "./types/style/BorderProps";
|
|
12
|
+
export type { ColorProps } from "./types/style/ColorProps";
|
|
13
|
+
export type { LayoutProps } from "./types/style/LayoutProps";
|
|
14
|
+
export type { CommonStyleProps } from "./types/style/CommonStyleProps";
|
|
15
|
+
export { COMMON_STYLE_FORWARD_PROPS } from './types/CommonForwardProps';
|
|
16
|
+
export * from './components/StyledButton';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as CircularIconLink } from './components/CircularIconLink';
|
|
2
|
+
export { default as NavigationButton } from './components/NavigationButton';
|
|
3
|
+
export { default as DownloadButton } from './components/DownloadButton';
|
|
4
|
+
export { default as NavigationLink } from './components/NavigationLink';
|
|
5
|
+
export { default as ScrollToTopButton } from './components/ScrollToTopButton';
|
|
6
|
+
export { default as WhatsAppButton } from './components/WhatsAppButton';
|
|
7
|
+
export { default as WhatsAppIcon } from './components/WhatsAppIcon';
|
|
8
|
+
export { default as ActionButton } from "./components/ActionButton";
|
|
9
|
+
export { default as FormButtonGroup } from "./components/FormButtonGroup";
|
|
10
|
+
export { COMMON_STYLE_FORWARD_PROPS } from './types/CommonForwardProps';
|
|
11
|
+
export * from './components/StyledButton';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
5
|
+
import { CacheProvider } from '@emotion/react';
|
|
6
|
+
import createCache from '@emotion/cache';
|
|
7
|
+
import { theme } from '@/theme';
|
|
8
|
+
// Crie uma instância de cache para o Emotion
|
|
9
|
+
const cache = createCache({ key: 'css', prepend: true });
|
|
10
|
+
export default function MyApp({ Component, pageProps }) {
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
// Remove o CSS injetado pelo servidor, se existir
|
|
13
|
+
const jssStyles = document.querySelector('#jss-server-side');
|
|
14
|
+
if (jssStyles && jssStyles.parentElement) {
|
|
15
|
+
jssStyles.parentElement.removeChild(jssStyles);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
return (_jsx(CacheProvider, { value: cache, children: _jsxs(MuiThemeProvider, { theme: theme, children: [_jsx(CssBaseline, {}), _jsx(Component, Object.assign({}, pageProps))] }) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=_app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_app.js","sourceRoot":"","sources":["../../src/pages/_app.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,6CAA6C;AAC7C,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,EAAY;IAC9D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,kDAAkD;QAClD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,SAAS,IAAI,SAAS,CAAC,aAAa,EAAE,CAAC;YACzC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YACzB,MAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,aAC5B,KAAC,WAAW,KAAe,EAC3B,KAAC,SAAS,oBAAK,SAAS,EAAe,IACtB,GACL,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Document, { DocumentContext } from "next/document";
|
|
2
|
+
export default class MyDocument extends Document {
|
|
3
|
+
static getInitialProps(ctx: DocumentContext): Promise<{
|
|
4
|
+
styles: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
html: string;
|
|
6
|
+
head?: Array<import("react").JSX.Element | null>;
|
|
7
|
+
}>;
|
|
8
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
3
|
+
import createCache from "@emotion/cache";
|
|
4
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
5
|
+
import { CacheProvider } from "@emotion/react";
|
|
6
|
+
// Função para criar o cache do Emotion
|
|
7
|
+
const createEmotionCache = () => {
|
|
8
|
+
return createCache({ key: "css", prepend: true });
|
|
9
|
+
};
|
|
10
|
+
export default class MyDocument extends Document {
|
|
11
|
+
static async getInitialProps(ctx) {
|
|
12
|
+
const cache = createEmotionCache();
|
|
13
|
+
const { extractCriticalToChunks } = createEmotionServer(cache);
|
|
14
|
+
const originalRenderPage = ctx.renderPage;
|
|
15
|
+
try {
|
|
16
|
+
ctx.renderPage = () => originalRenderPage({
|
|
17
|
+
enhanceApp: (App) => (props) => (_jsx(CacheProvider, { value: cache, children: _jsx(App, Object.assign({}, props)) })),
|
|
18
|
+
});
|
|
19
|
+
const initialProps = await Document.getInitialProps(ctx);
|
|
20
|
+
// Extrai os estilos críticos para renderização no lado do servidor
|
|
21
|
+
const emotionStyles = extractCriticalToChunks(initialProps.html);
|
|
22
|
+
const emotionStyleTags = emotionStyles.styles.map((style) => (_jsx("style", { "data-emotion": `${style.key} ${style.ids.join(" ")}`, dangerouslySetInnerHTML: { __html: style.css } }, style.key)));
|
|
23
|
+
return Object.assign(Object.assign({}, initialProps), { styles: (_jsxs(_Fragment, { children: [initialProps.styles, emotionStyleTags] })) });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
// Nada a liberar como no caso do styled-components
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (_jsxs(Html, { lang: "pt", children: [_jsx(Head, {}), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=_document.js.map
|