pipesol-button 1.0.1-beta.9 → 1.0.2
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/dist/components/ActionButton.d.ts +52 -0
- package/dist/components/ActionButton.js +38 -0
- package/dist/components/ActionButton.js.map +1 -0
- package/dist/components/DownloadButton.d.ts +95 -16
- package/dist/components/DownloadButton.js +44 -8
- package/dist/components/DownloadButton.js.map +1 -1
- package/dist/components/FormButtonGroup.d.ts +42 -0
- package/dist/components/FormButtonGroup.js +53 -0
- package/dist/components/FormButtonGroup.js.map +1 -0
- package/dist/components/NavigationButton.d.ts +15 -9
- package/dist/components/NavigationButton.js +37 -33
- package/dist/components/NavigationButton.js.map +1 -1
- package/dist/components/PrimaryButton.d.ts +37 -0
- package/dist/components/PrimaryButton.js +48 -0
- package/dist/components/PrimaryButton.js.map +1 -0
- package/dist/components/StyledButton.d.ts +14 -0
- package/dist/components/StyledButton.js +48 -0
- package/dist/components/StyledButton.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +14 -23
- package/dist/theme.js +115 -35
- package/dist/theme.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ButtonKind.d.ts +4 -0
- package/dist/types/ButtonKind.js +2 -0
- package/dist/types/ButtonKind.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonKind } from "@/types/ButtonKind";
|
|
3
|
+
import { TypographyVariant } from "@mui/material/styles";
|
|
4
|
+
export interface ActionButtonProps {
|
|
5
|
+
kind?: ButtonKind;
|
|
6
|
+
width?: string;
|
|
7
|
+
height?: string;
|
|
8
|
+
padding?: string;
|
|
9
|
+
margin?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
boxShadow?: string;
|
|
14
|
+
background?: string;
|
|
15
|
+
backgroundHover?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
colorHover?: string;
|
|
18
|
+
borderRadius?: string;
|
|
19
|
+
variant?: TypographyVariant;
|
|
20
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Botão estilizado baseado no tema e com tipografia configurável via `variant`.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} [text=""] Texto exibido dentro do botão.
|
|
26
|
+
* @param {TypographyVariant} [variant="body1"] Variante da tipografia usada no texto.
|
|
27
|
+
* @param {React.ReactNode} icon Ícone opcional exibido antes do texto.
|
|
28
|
+
* @param {'none' | 'primary' | 'secondary'} [kind="none"] Token visual aplicado ao botão.
|
|
29
|
+
* @param {string} [width="auto"] Largura do botão.
|
|
30
|
+
* @param {string} [height="auto"] Altura do botão.
|
|
31
|
+
* @param {string} [padding="12px 20px"] Espaçamento interno.
|
|
32
|
+
* @param {string} [margin="0"] Margem externa.
|
|
33
|
+
* @param {boolean} [disabled=false] Estado desabilitado.
|
|
34
|
+
* @param {string} [background="transparent"] Cor de fundo.
|
|
35
|
+
* @param {string} backgroundHover Cor de fundo no hover.
|
|
36
|
+
* @param {string} color Cor do texto.
|
|
37
|
+
* @param {string} colorHover Cor do texto no hover.
|
|
38
|
+
* @param {string} [borderRadius="0"] Raio da borda.
|
|
39
|
+
* @param {string} [boxShadow="none"] Sombra do botão.
|
|
40
|
+
* @param {Function} onClick Evento de clique.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <ActionButton
|
|
45
|
+
* text="Enviar"
|
|
46
|
+
* variant="h6"
|
|
47
|
+
* onClick={() => console.log("clicou")}
|
|
48
|
+
* />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const ActionButton: React.FC<ActionButtonProps>;
|
|
52
|
+
export default ActionButton;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Typography from "@mui/material/Typography";
|
|
3
|
+
import { StyledButtonKind } from "./StyledButton";
|
|
4
|
+
/**
|
|
5
|
+
* Botão estilizado baseado no tema e com tipografia configurável via `variant`.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} [text=""] Texto exibido dentro do botão.
|
|
8
|
+
* @param {TypographyVariant} [variant="body1"] Variante da tipografia usada no texto.
|
|
9
|
+
* @param {React.ReactNode} icon Ícone opcional exibido antes do texto.
|
|
10
|
+
* @param {'none' | 'primary' | 'secondary'} [kind="none"] Token visual aplicado ao botão.
|
|
11
|
+
* @param {string} [width="auto"] Largura do botão.
|
|
12
|
+
* @param {string} [height="auto"] Altura do botão.
|
|
13
|
+
* @param {string} [padding="12px 20px"] Espaçamento interno.
|
|
14
|
+
* @param {string} [margin="0"] Margem externa.
|
|
15
|
+
* @param {boolean} [disabled=false] Estado desabilitado.
|
|
16
|
+
* @param {string} [background="transparent"] Cor de fundo.
|
|
17
|
+
* @param {string} backgroundHover Cor de fundo no hover.
|
|
18
|
+
* @param {string} color Cor do texto.
|
|
19
|
+
* @param {string} colorHover Cor do texto no hover.
|
|
20
|
+
* @param {string} [borderRadius="0"] Raio da borda.
|
|
21
|
+
* @param {string} [boxShadow="none"] Sombra do botão.
|
|
22
|
+
* @param {Function} onClick Evento de clique.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <ActionButton
|
|
27
|
+
* text="Enviar"
|
|
28
|
+
* variant="h6"
|
|
29
|
+
* onClick={() => console.log("clicou")}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
const ActionButton = ({ kind = "none", width = "auto", height = "auto", padding = "12px 20px", margin = "0", text = "", icon, disabled = false, onClick, background = "transparent", backgroundHover, color, colorHover, borderRadius = "0", boxShadow = "none", variant = "body1", }) => {
|
|
34
|
+
return (_jsx(StyledButtonKind, { kind: kind, width: width, height: height, padding: padding, margin: margin, disabled: disabled, startIcon: icon, onClick: onClick, background: background, backgroundHover: backgroundHover, colorText: color, colorHover: colorHover, borderRadius: borderRadius, boxShadow: boxShadow, children: _jsx(Typography, { variant: variant, children: text }) }));
|
|
35
|
+
};
|
|
36
|
+
ActionButton.displayName = "ActionButton";
|
|
37
|
+
export default ActionButton;
|
|
38
|
+
//# sourceMappingURL=ActionButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButton.js","sourceRoot":"","sources":["../../src/components/ActionButton.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAsBlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,YAAY,GAAgC,CAAC,EACjD,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,WAAW,EACrB,MAAM,GAAG,GAAG,EACZ,IAAI,GAAG,EAAE,EACT,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,UAAU,GAAG,aAAa,EAC1B,eAAe,EACf,KAAK,EACL,UAAU,EACV,YAAY,GAAG,GAAG,EAClB,SAAS,GAAG,MAAM,EAClB,OAAO,GAAG,OAAO,GAClB,EAAE,EAAE;IACH,OAAO,CACL,KAAC,gBAAgB,IACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,YAEpB,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,GAAc,GAChC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,eAAe,YAAY,CAAC"}
|
|
@@ -1,37 +1,116 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Interface de propriedades para o componente `DownloadButton`.
|
|
4
|
+
*
|
|
5
|
+
* Use este botão para disponibilizar o download de um arquivo mantendo
|
|
6
|
+
* controle total sobre cores, raio de borda, sombra, dimensões e ícone.
|
|
7
|
+
*
|
|
8
|
+
* As propriedades marcadas com `@default` indicam o valor que será utilizado
|
|
9
|
+
* quando a prop não for fornecida ao componente.
|
|
4
10
|
*/
|
|
5
11
|
export interface DownloadButtonProps {
|
|
6
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* URL do arquivo a ser baixado.
|
|
14
|
+
*/
|
|
7
15
|
file: string;
|
|
8
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Nome do arquivo que será salvo no disco.
|
|
18
|
+
*/
|
|
9
19
|
fileName: string;
|
|
10
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Cor de fundo do botão.
|
|
22
|
+
* @default "#1976d2"
|
|
23
|
+
*/
|
|
11
24
|
background?: string;
|
|
12
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Cor de fundo exibida no estado hover.
|
|
27
|
+
* @default "#1565c0"
|
|
28
|
+
*/
|
|
13
29
|
backgroundHover?: string;
|
|
14
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Cor do texto do botão.
|
|
32
|
+
* @default "#fff"
|
|
33
|
+
*/
|
|
15
34
|
color?: string;
|
|
16
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Cor do texto exibida no estado hover.
|
|
37
|
+
* Se não informada, herda a mesma cor definida em `color`.
|
|
38
|
+
*/
|
|
17
39
|
colorHover?: string;
|
|
18
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Raio da borda do botão (qualquer valor CSS válido).
|
|
42
|
+
* @default "8px"
|
|
43
|
+
*/
|
|
19
44
|
borderRadius?: string;
|
|
20
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Sombra do botão (valor CSS de box-shadow).
|
|
47
|
+
* @default "none"
|
|
48
|
+
*/
|
|
21
49
|
boxShadow?: string;
|
|
22
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Ícone opcional exibido à esquerda do conteúdo.
|
|
52
|
+
*/
|
|
23
53
|
icon?: React.ReactNode;
|
|
24
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Conteúdo textual do botão (recomendado utilizar `Typography`).
|
|
56
|
+
*/
|
|
25
57
|
children: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Texto de acessibilidade que descreve a função do botão
|
|
60
|
+
* para leitores de tela (atributo `aria-label`).
|
|
61
|
+
*/
|
|
62
|
+
arialLabel: string;
|
|
63
|
+
/**
|
|
64
|
+
* Largura do botão (valor CSS).
|
|
65
|
+
* @default "auto"
|
|
66
|
+
*/
|
|
67
|
+
width?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Altura do botão (valor CSS).
|
|
70
|
+
* @default "fit-content"
|
|
71
|
+
*/
|
|
72
|
+
height?: string;
|
|
26
73
|
}
|
|
27
74
|
/**
|
|
28
|
-
* Botão de download customizável com suporte a ícone e
|
|
75
|
+
* Botão de download customizável com suporte a ícone e conteúdo centralizado.
|
|
29
76
|
* O texto deve ser passado via `Typography` como children.
|
|
30
77
|
*
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
34
|
-
* @
|
|
78
|
+
* ### Parâmetros
|
|
79
|
+
* @param {string} file URL do arquivo a ser baixado.
|
|
80
|
+
* @param {string} fileName Nome do arquivo que será salvo.
|
|
81
|
+
* @param {string} [background="#1976d2"] Cor de fundo padrão do botão. **@default** "#1976d2"
|
|
82
|
+
* @param {string} [backgroundHover="#1565c0"] Cor de fundo no hover. **@default** "#1565c0"
|
|
83
|
+
* @param {string} [color="#fff"] Cor do texto padrão. **@default** "#fff"
|
|
84
|
+
* @param {string} [colorHover] Cor do texto no hover (herda `color` quando ausente).
|
|
85
|
+
* @param {string} [borderRadius="8px"] Raio da borda do botão. **@default** "8px"
|
|
86
|
+
* @param {string} [boxShadow="none"] Sombra do botão. **@default** "none"
|
|
87
|
+
* @param {string} arialLabel Texto de acessibilidade (atributo `aria-label`).
|
|
88
|
+
* @param {React.ReactNode} [icon] Ícone opcional exibido à esquerda do conteúdo.
|
|
89
|
+
* @param {React.ReactNode} children Conteúdo do botão (ex.: `Typography`).
|
|
90
|
+
* @param {string} [width="auto"] Largura do botão (valor CSS). **@default** "auto"
|
|
91
|
+
* @param {string} [height="fit-content"] Altura do botão (valor CSS). **@default** "fit-content"
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* import { Typography } from '@mui/material';
|
|
96
|
+
* import { Download as DownloadIcon } from '@mui/icons-material';
|
|
97
|
+
*
|
|
98
|
+
* <DownloadButton
|
|
99
|
+
* file="/docs/manual.pdf"
|
|
100
|
+
* fileName="manual.pdf"
|
|
101
|
+
* arialLabel="Baixar manual do produto"
|
|
102
|
+
* background="#28a745"
|
|
103
|
+
* backgroundHover="#218838"
|
|
104
|
+
* color="#fff"
|
|
105
|
+
* borderRadius="12px"
|
|
106
|
+
* boxShadow="0 2px 8px rgba(0,0,0,0.15)"
|
|
107
|
+
* width="220px"
|
|
108
|
+
* height="44px"
|
|
109
|
+
* icon={<DownloadIcon />}
|
|
110
|
+
* >
|
|
111
|
+
* <Typography variant="button">Baixar Manual</Typography>
|
|
112
|
+
* </DownloadButton>
|
|
113
|
+
* ```
|
|
35
114
|
*/
|
|
36
115
|
declare const DownloadButton: React.FC<DownloadButtonProps>;
|
|
37
116
|
export default DownloadButton;
|
|
@@ -8,8 +8,12 @@ const StyledLink = styled('a', {
|
|
|
8
8
|
'colorHover',
|
|
9
9
|
'borderRadius',
|
|
10
10
|
'boxShadow',
|
|
11
|
+
'width',
|
|
12
|
+
'height'
|
|
11
13
|
].includes(prop),
|
|
12
|
-
})(({ background, backgroundHover, color, colorHover, borderRadius, boxShadow }) => ({
|
|
14
|
+
})(({ background, backgroundHover, color, colorHover, borderRadius, boxShadow, width, height }) => ({
|
|
15
|
+
width: width,
|
|
16
|
+
height: height,
|
|
13
17
|
display: 'inline-flex',
|
|
14
18
|
alignItems: 'center',
|
|
15
19
|
justifyContent: 'center',
|
|
@@ -28,16 +32,48 @@ const StyledLink = styled('a', {
|
|
|
28
32
|
},
|
|
29
33
|
}));
|
|
30
34
|
/**
|
|
31
|
-
* Botão de download customizável com suporte a ícone e
|
|
35
|
+
* Botão de download customizável com suporte a ícone e conteúdo centralizado.
|
|
32
36
|
* O texto deve ser passado via `Typography` como children.
|
|
33
37
|
*
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
36
|
-
* @
|
|
37
|
-
* @
|
|
38
|
+
* ### Parâmetros
|
|
39
|
+
* @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"
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* import { Typography } from '@mui/material';
|
|
56
|
+
* import { Download as DownloadIcon } from '@mui/icons-material';
|
|
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>
|
|
73
|
+
* ```
|
|
38
74
|
*/
|
|
39
|
-
const DownloadButton = ({ file, fileName, background, backgroundHover, color, colorHover, borderRadius, boxShadow, icon, children, }) => {
|
|
40
|
-
return (_jsxs(StyledLink, { href: file, download: fileName, background: background, backgroundHover: backgroundHover, color: color, colorHover: colorHover, borderRadius: borderRadius, boxShadow: boxShadow, children: [icon && _jsx("span", { children: icon }), children] }));
|
|
75
|
+
const DownloadButton = ({ width = 'auto', height = 'fit-content', file, fileName, background, backgroundHover, color, colorHover, borderRadius, boxShadow, arialLabel, icon, children, }) => {
|
|
76
|
+
return (_jsxs(StyledLink, { href: file, download: fileName, background: background, backgroundHover: backgroundHover, color: color, colorHover: colorHover, borderRadius: borderRadius, boxShadow: boxShadow, "aria-label": arialLabel, width: width, height: height, children: [icon && _jsx("span", { children: icon }), children] }));
|
|
41
77
|
};
|
|
42
78
|
DownloadButton.displayName = 'DownloadButton';
|
|
43
79
|
export default DownloadButton;
|
|
@@ -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;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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FormButtonGroupProps {
|
|
3
|
+
onCancel?: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Agrupador de botões "Cancelar" e "Salvar" para uso **dentro** de formulários.
|
|
7
|
+
*
|
|
8
|
+
* O botão **"Salvar"** possui `type="submit"` e dispara o `onSubmit` do `<form>`.
|
|
9
|
+
*
|
|
10
|
+
* @param {() => void} [onCancel]
|
|
11
|
+
* Função disparada ao clicar em **"Cancelar"**.
|
|
12
|
+
* Ideal para fechar modal, navegar de volta, limpar estado ou desfazer alterações.
|
|
13
|
+
*
|
|
14
|
+
* @default onCancel = () => {}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import React from 'react';
|
|
19
|
+
* import Box from '@mui/material/Box';
|
|
20
|
+
* import TextField from '@mui/material/TextField';
|
|
21
|
+
* import { FormButtonGroup } from './FormButtonGroup';
|
|
22
|
+
*
|
|
23
|
+
* const MyForm: React.FC = () => {
|
|
24
|
+
* const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
25
|
+
* event.preventDefault();
|
|
26
|
+
* // sua lógica de envio...
|
|
27
|
+
* console.log('Form submetido');
|
|
28
|
+
* };
|
|
29
|
+
*
|
|
30
|
+
* return (
|
|
31
|
+
* <Box component="form" onSubmit={handleSubmit} noValidate>
|
|
32
|
+
* <TextField label="Nome" fullWidth margin="normal" />
|
|
33
|
+
* <FormButtonGroup
|
|
34
|
+
* onCancel={() => console.log('cancelado')}
|
|
35
|
+
* />
|
|
36
|
+
* </Box>
|
|
37
|
+
* );
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const FormButtonGroup: React.FC<FormButtonGroupProps>;
|
|
42
|
+
export default FormButtonGroup;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { StyledButtonKind } from './StyledButton';
|
|
4
|
+
const ActionsContainer = styled('div', {
|
|
5
|
+
shouldForwardProp: (prop) => !['onCancel'].includes(prop),
|
|
6
|
+
})(() => ({
|
|
7
|
+
display: 'flex',
|
|
8
|
+
gap: '8px',
|
|
9
|
+
justifyContent: 'flex-end',
|
|
10
|
+
width: '100%',
|
|
11
|
+
}));
|
|
12
|
+
/**
|
|
13
|
+
* Agrupador de botões "Cancelar" e "Salvar" para uso **dentro** de formulários.
|
|
14
|
+
*
|
|
15
|
+
* O botão **"Salvar"** possui `type="submit"` e dispara o `onSubmit` do `<form>`.
|
|
16
|
+
*
|
|
17
|
+
* @param {() => void} [onCancel]
|
|
18
|
+
* Função disparada ao clicar em **"Cancelar"**.
|
|
19
|
+
* Ideal para fechar modal, navegar de volta, limpar estado ou desfazer alterações.
|
|
20
|
+
*
|
|
21
|
+
* @default onCancel = () => {}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import React from 'react';
|
|
26
|
+
* import Box from '@mui/material/Box';
|
|
27
|
+
* import TextField from '@mui/material/TextField';
|
|
28
|
+
* import { FormButtonGroup } from './FormButtonGroup';
|
|
29
|
+
*
|
|
30
|
+
* const MyForm: React.FC = () => {
|
|
31
|
+
* const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
32
|
+
* event.preventDefault();
|
|
33
|
+
* // sua lógica de envio...
|
|
34
|
+
* console.log('Form submetido');
|
|
35
|
+
* };
|
|
36
|
+
*
|
|
37
|
+
* return (
|
|
38
|
+
* <Box component="form" onSubmit={handleSubmit} noValidate>
|
|
39
|
+
* <TextField label="Nome" fullWidth margin="normal" />
|
|
40
|
+
* <FormButtonGroup
|
|
41
|
+
* onCancel={() => console.log('cancelado')}
|
|
42
|
+
* />
|
|
43
|
+
* </Box>
|
|
44
|
+
* );
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
const FormButtonGroup = ({ onCancel = () => { }, }) => {
|
|
49
|
+
return (_jsxs(ActionsContainer, { onCancel: onCancel, children: [_jsx(StyledButtonKind, { kind: "secondary", type: "button", onClick: onCancel, sx: { width: 'auto' }, children: "Cancelar" }), _jsx(StyledButtonKind, { kind: "primary", type: "submit", sx: { width: 'auto' }, children: "Salvar" })] }));
|
|
50
|
+
};
|
|
51
|
+
FormButtonGroup.displayName = 'FormButtonGroup';
|
|
52
|
+
export default FormButtonGroup;
|
|
53
|
+
//# sourceMappingURL=FormButtonGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormButtonGroup.js","sourceRoot":"","sources":["../../src/components/FormButtonGroup.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE;IACrC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAE,CAAC,UAAU,CAAc,CAAC,QAAQ,CAAC,IAAc,CAAC;CAClF,CAAC,CAAyC,GAAG,EAAE,CAAC,CAAC;IAChD,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,KAAK;IACV,cAAc,EAAE,UAAU;IAC1B,KAAK,EAAE,MAAM;CACd,CAAC,CAAC,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,GACpB,EAAE,EAAE;IACH,OAAO,CACL,MAAC,gBAAgB,IAAC,QAAQ,EAAE,QAAQ,aAClC,KAAC,gBAAgB,IACf,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,yBAGJ,EAEnB,KAAC,gBAAgB,IACf,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,uBAGJ,IACF,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAChD,eAAe,eAAe,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ButtonKind } from '@/types/ButtonKind';
|
|
2
3
|
/**
|
|
3
4
|
* Propriedades do componente `NavigationButton`.
|
|
4
5
|
*/
|
|
5
6
|
interface NavigationButtonProps {
|
|
7
|
+
/**
|
|
8
|
+
* Seleciona o conjunto de tokens do tema.
|
|
9
|
+
* @default "none"
|
|
10
|
+
*/
|
|
11
|
+
kind?: ButtonKind;
|
|
6
12
|
/**
|
|
7
13
|
* URL ou âncora para onde o botão deve navegar.
|
|
8
14
|
* - Se começar com `http`, abre em nova aba.
|
|
@@ -12,28 +18,28 @@ interface NavigationButtonProps {
|
|
|
12
18
|
/** Texto para acessibilidade (atributo `aria-label`). */
|
|
13
19
|
aria_label: string;
|
|
14
20
|
/** Cor de fundo padrão do botão (ex: `#1976d2` ou `transparent`). */
|
|
15
|
-
|
|
21
|
+
backgroundColor?: string;
|
|
16
22
|
/** Cor de fundo quando o botão é focado/hover. Se não informado, usa a cor padrão. */
|
|
17
|
-
|
|
23
|
+
backgroundColorHover?: string;
|
|
18
24
|
/** Cor do texto padrão (ex: `#fff`). */
|
|
19
|
-
color
|
|
25
|
+
color?: string;
|
|
20
26
|
/** Cor do texto no hover. Se não informado, usa a mesma cor padrão. */
|
|
21
|
-
|
|
27
|
+
colorHover?: string;
|
|
22
28
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @default "
|
|
29
|
+
* Borda do Botao (1px solid #fff)
|
|
30
|
+
* @default "none"
|
|
25
31
|
*/
|
|
26
|
-
|
|
32
|
+
border?: string;
|
|
27
33
|
/**
|
|
28
34
|
* Raio de borda (ex: `8px`, `50%`).
|
|
29
35
|
* @default "0"
|
|
30
36
|
*/
|
|
31
|
-
|
|
37
|
+
borderRadius?: string;
|
|
32
38
|
/**
|
|
33
39
|
* Sombra CSS (ex: `0 2px 4px rgba(0,0,0,0.2)`).
|
|
34
40
|
* @default "none"
|
|
35
41
|
*/
|
|
36
|
-
|
|
42
|
+
boxShadow?: string;
|
|
37
43
|
/** Largura do botão (ex: `200px`, `100%`). */
|
|
38
44
|
width: string;
|
|
39
45
|
/**
|
|
@@ -3,54 +3,58 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
const ButtonStyled = styled('a', {
|
|
5
5
|
shouldForwardProp: (prop) => ![
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
6
|
+
'kind',
|
|
7
|
+
'backgroundColor',
|
|
8
|
+
'backgroundColorHover',
|
|
9
|
+
'colorText',
|
|
10
|
+
'colorHover',
|
|
10
11
|
'padding',
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'color_hover',
|
|
12
|
+
'borderRadius',
|
|
13
|
+
'border',
|
|
14
14
|
'width',
|
|
15
15
|
'margin',
|
|
16
|
-
'
|
|
16
|
+
'boxShadow',
|
|
17
17
|
].includes(prop),
|
|
18
|
-
})(({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
})(({ theme, kind, backgroundColor, backgroundColorHover, colorText, colorHover, padding, borderRadius, border, width, margin, boxShadow, }) => {
|
|
19
|
+
const tokens = kind === "primary"
|
|
20
|
+
? theme.palette.custom.primaryButton
|
|
21
|
+
: (kind === "secondary" ? theme.palette.custom.secondaryButton : undefined);
|
|
22
|
+
return {
|
|
23
|
+
// Dimensões
|
|
24
|
+
width: width !== null && width !== void 0 ? width : "auto",
|
|
25
|
+
padding: padding !== null && padding !== void 0 ? padding : "12px 20px",
|
|
26
|
+
margin: margin !== null && margin !== void 0 ? margin : "0",
|
|
27
|
+
// Visual
|
|
28
|
+
borderRadius: tokens ? tokens.borderRadius : borderRadius,
|
|
29
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
30
|
+
border: border,
|
|
31
|
+
textDecoration: 'none',
|
|
32
|
+
textTransform: 'none',
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
textAlign: 'center',
|
|
35
|
+
// Cores
|
|
36
|
+
background: tokens ? tokens.background : backgroundColor,
|
|
37
|
+
color: tokens ? tokens.color : colorText,
|
|
38
|
+
"&:hover": {
|
|
39
|
+
background: tokens ? tokens.backgroundHover : (backgroundColorHover !== null && backgroundColorHover !== void 0 ? backgroundColorHover : backgroundColor),
|
|
40
|
+
color: tokens ? tokens.colorHover : (colorHover !== null && colorHover !== void 0 ? colorHover : colorText),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
});
|
|
36
44
|
/**
|
|
37
45
|
* Botão de navegação reutilizável.
|
|
38
46
|
* Cria um link estilizado que pode ser usado para redirecionar
|
|
39
47
|
* para páginas externas ou seções internas.
|
|
40
48
|
*/
|
|
41
|
-
const NavigationButton = ({ url, aria_label,
|
|
42
|
-
const backgroundColor = background_color !== null && background_color !== void 0 ? background_color : 'transparent';
|
|
43
|
-
const backgroundColorHover = background_color_hover !== null && background_color_hover !== void 0 ? background_color_hover : backgroundColor;
|
|
44
|
-
const colorHover = color_hover !== null && color_hover !== void 0 ? color_hover : color;
|
|
45
|
-
const borderRadius = border_radius;
|
|
49
|
+
const NavigationButton = ({ url, kind = "none", aria_label, backgroundColor, backgroundColorHover, color, colorHover, borderRadius = '0', border = 'none', boxShadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
|
|
46
50
|
const marginButton = margin;
|
|
47
51
|
if (url.indexOf('http') !== -1) {
|
|
48
52
|
// Link externo: abre em nova aba
|
|
49
|
-
return (_jsx(ButtonStyled, { href: url, width: width,
|
|
53
|
+
return (_jsx(ButtonStyled, { kind: kind, href: url, width: width, backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, color: color, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: marginButton, "aria-label": aria_label, target: "_blank", boxShadow: boxShadow, rel: "noopener noreferrer", children: children }));
|
|
50
54
|
}
|
|
51
55
|
else {
|
|
52
56
|
// Link interno ou âncora
|
|
53
|
-
return (_jsx(ButtonStyled, { href: url, width: width,
|
|
57
|
+
return (_jsx(ButtonStyled, { kind: kind, href: url, width: width, backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, color: color, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: marginButton, "aria-label": aria_label, boxShadow: boxShadow, children: children }));
|
|
54
58
|
}
|
|
55
59
|
};
|
|
56
60
|
export default NavigationButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationButton.js","sourceRoot":"","sources":["../../src/components/NavigationButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationButton.js","sourceRoot":"","sources":["../../src/components/NavigationButton.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Interface das props do PrimaryButton
|
|
4
|
+
*/
|
|
5
|
+
export interface PrimaryButtonProps {
|
|
6
|
+
/** Largura do botão */
|
|
7
|
+
width?: string;
|
|
8
|
+
/** Altura do botão */
|
|
9
|
+
height?: string;
|
|
10
|
+
/** Padding interno */
|
|
11
|
+
padding?: string;
|
|
12
|
+
/** Margin externa */
|
|
13
|
+
margin?: string;
|
|
14
|
+
/** Desabilita o botão */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Ícone opcional à esquerda */
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
/** Texto do botão */
|
|
19
|
+
text: string;
|
|
20
|
+
/** Função chamada no clique */
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Botão estilizado baseado no tema customizado
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <PrimaryButton
|
|
29
|
+
* text="Clique Aqui"
|
|
30
|
+
* onClick={() => alert("Clicado!")}
|
|
31
|
+
* width="200px"
|
|
32
|
+
* icon={<SomeIcon />}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const PrimaryButton: React.FC<PrimaryButtonProps>;
|
|
37
|
+
export default PrimaryButton;
|