pipesol-button 1.0.1-beta.9 → 1.0.9

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.
Files changed (36) hide show
  1. package/README.md +38 -31
  2. package/dist/components/ActionButton.d.ts +52 -0
  3. package/dist/components/ActionButton.js +38 -0
  4. package/dist/components/ActionButton.js.map +1 -0
  5. package/dist/components/DownloadButton.d.ts +95 -16
  6. package/dist/components/DownloadButton.js +44 -8
  7. package/dist/components/DownloadButton.js.map +1 -1
  8. package/dist/components/FormButtonGroup.d.ts +42 -0
  9. package/dist/components/FormButtonGroup.js +53 -0
  10. package/dist/components/FormButtonGroup.js.map +1 -0
  11. package/dist/components/NavigationButton.d.ts +15 -9
  12. package/dist/components/NavigationButton.js +37 -33
  13. package/dist/components/NavigationButton.js.map +1 -1
  14. package/dist/components/StyledButton.d.ts +14 -0
  15. package/dist/components/StyledButton.js +48 -0
  16. package/dist/components/StyledButton.js.map +1 -0
  17. package/dist/index.d.ts +4 -0
  18. package/dist/index.js +3 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/theme.d.ts +14 -23
  21. package/dist/theme.js +115 -35
  22. package/dist/theme.js.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/dist/types/ButtonKind.d.ts +4 -0
  25. package/dist/types/ButtonKind.js +2 -0
  26. package/dist/types/ButtonKind.js.map +1 -0
  27. package/package.json +61 -50
  28. package/dist/components/ButtonStyled.d.ts +0 -18
  29. package/dist/components/ButtonStyled.js +0 -56
  30. package/dist/components/ButtonStyled.js.map +0 -1
  31. package/dist/components/NavigationButtonMotion.d.ts +0 -19
  32. package/dist/components/NavigationButtonMotion.js +0 -64
  33. package/dist/components/NavigationButtonMotion.js.map +0 -1
  34. package/dist/components/NavigationHamburguerButton.d.ts +0 -17
  35. package/dist/components/NavigationHamburguerButton.js +0 -33
  36. package/dist/components/NavigationHamburguerButton.js.map +0 -1
package/README.md CHANGED
@@ -1,31 +1,38 @@
1
- # Sobre
2
-
3
- Este projeto é uma biblioteca React preparada para publicação no npm.
4
- Essa biblioteca contem componentes de barra de notificacao.
5
- Abaixo está o passo a passo para publicar ou atualizar a lib.
6
-
7
- # Pré-requisitos
8
-
9
- 1. Conta no NPM
10
- - Crie uma conta em: https://www.npmjs.com/signup
11
-
12
- 2. Node.js instalado
13
- - Recomenda-se uma versão LTS. Verifique com: node -v
14
- - Login no NPM pelo terminal: npm login
15
- npm: pipeline-solucoes
16
- senha:pipesollinecoes
17
- key: pipeline@12345#
18
-
19
- # Como Publicar a biblioteca:
20
-
21
- 1. Instalar dependências: npm install
22
-
23
- 2. No package.json, altere o campo version de acordo com a semântica de versionamento.
24
- 1.0.1 correção de bug
25
- 1.1.0 – nova funcionalidade compatível
26
- 2.0.0 mudanças incompatíveis
27
-
28
- - para publicar versão beta: "1.0.0-beta.x"
29
-
30
- 3. Comando para versao beta: npm run release-beta
31
- Comando para versao oficial: npm run release
1
+ # Sobre
2
+
3
+ Este projeto é uma biblioteca React preparada para publicação no npm.
4
+ Essa biblioteca contem componentes de botao.
5
+
6
+ Abaixo está o passo a passo para publicar ou atualizar a lib.
7
+
8
+ # Pré-requisitos
9
+
10
+ 1. Node.js instalado
11
+ - Recomenda-se uma versão LTS. Verifique com: node -v
12
+
13
+ # Como Publicar a biblioteca:
14
+
15
+ 1. Instalar dependências: npm install
16
+
17
+ 2. No package.json, altere o campo version de acordo com a semântica de versionamento.
18
+ 1.0.1 – correção de bug
19
+ 1.1.0 nova funcionalidade compatível
20
+ 2.0.0 – mudanças incompatíveis
21
+
22
+ - para publicar versão beta: "1.0.0-beta.x"
23
+
24
+ 3. Este pacote é publicado exclusivamente via CI/CD (GitHub Actions).
25
+
26
+ - Releases são disparados apenas por tags Git (vX.Y.Z)
27
+ - Publicações manuais (npm publish) são desabilitadas
28
+ - A autenticação no npm utiliza Trusted Publishing (OIDC)
29
+ - Nenhum token npm é armazenado ou utilizado
30
+ - Tokens de publicação estão explicitamente desabilitados
31
+ - Autenticação em dois fatores (2FA) é obrigatória
32
+ - Versionamento segue Semantic Versioning (SemVer)
33
+
34
+ Esse modelo garante publicações seguras, rastreáveis e reprodutíveis.
35
+
36
+ # Comando:
37
+
38
+ 1. npm view pipesol-button versions --json - verifica todas as versões publicadas no npm.
@@ -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
- * Props para o componente DownloadButton
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
- /** URL do arquivo a ser baixado */
12
+ /**
13
+ * URL do arquivo a ser baixado.
14
+ */
7
15
  file: string;
8
- /** Nome do arquivo que será salvo */
16
+ /**
17
+ * Nome do arquivo que será salvo no disco.
18
+ */
9
19
  fileName: string;
10
- /** Cor de fundo padrão */
20
+ /**
21
+ * Cor de fundo do botão.
22
+ * @default "#1976d2"
23
+ */
11
24
  background?: string;
12
- /** Cor de fundo no hover */
25
+ /**
26
+ * Cor de fundo exibida no estado hover.
27
+ * @default "#1565c0"
28
+ */
13
29
  backgroundHover?: string;
14
- /** Cor do texto padrão */
30
+ /**
31
+ * Cor do texto do botão.
32
+ * @default "#fff"
33
+ */
15
34
  color?: string;
16
- /** Cor do texto no hover */
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
- /** Raio da borda */
40
+ /**
41
+ * Raio da borda do botão (qualquer valor CSS válido).
42
+ * @default "8px"
43
+ */
19
44
  borderRadius?: string;
20
- /** Sombra do botão */
45
+ /**
46
+ * Sombra do botão (valor CSS de box-shadow).
47
+ * @default "none"
48
+ */
21
49
  boxShadow?: string;
22
- /** Ícone opcional exibido à esquerda do texto */
50
+ /**
51
+ * Ícone opcional exibido à esquerda do conteúdo.
52
+ */
23
53
  icon?: React.ReactNode;
24
- /** Texto do botão passado como children (deve ser um Typography) */
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 texto centralizado.
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
- * @default background="#1976d2"
32
- * @default color="#fff"
33
- * @default borderRadius="8px"
34
- * @default boxShadow="none"
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 texto centralizado.
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
- * @default background="#1976d2"
35
- * @default color="#fff"
36
- * @default borderRadius="8px"
37
- * @default boxShadow="none"
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","sourceRo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AAK,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
- background_color?: string;
21
+ backgroundColor?: string;
16
22
  /** Cor de fundo quando o botão é focado/hover. Se não informado, usa a cor padrão. */
17
- background_color_hover?: string;
23
+ backgroundColorHover?: string;
18
24
  /** Cor do texto padrão (ex: `#fff`). */
19
- color: string;
25
+ color?: string;
20
26
  /** Cor do texto no hover. Se não informado, usa a mesma cor padrão. */
21
- color_hover?: string;
27
+ colorHover?: string;
22
28
  /**
23
- * Cor da borda (ex: `#1976d2`).
24
- * @default "transparent"
29
+ * Borda do Botao (1px solid #fff)
30
+ * @default "none"
25
31
  */
26
- border_color?: string;
32
+ border?: string;
27
33
  /**
28
34
  * Raio de borda (ex: `8px`, `50%`).
29
35
  * @default "0"
30
36
  */
31
- border_radius?: string;
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
- box_shadow?: string;
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
- 'background_color',
7
- 'background_color_hover',
8
- 'color',
9
- 'color_hover',
6
+ 'kind',
7
+ 'backgroundColor',
8
+ 'backgroundColorHover',
9
+ 'colorText',
10
+ 'colorHover',
10
11
  'padding',
11
- 'border_radius',
12
- 'border_color',
13
- 'color_hover',
12
+ 'borderRadius',
13
+ 'border',
14
14
  'width',
15
15
  'margin',
16
- 'boxshadow',
16
+ 'boxShadow',
17
17
  ].includes(prop),
18
- })(({ background_color, background_color_hover, color, color_hover, padding, border_radius, border_color, width, margin, boxshadow, }) => ({
19
- width: width,
20
- cursor: 'pointer',
21
- textDecoration: 'none',
22
- textTransform: 'none',
23
- textAlign: 'center',
24
- boxShadow: boxshadow,
25
- backgroundColor: background_color,
26
- color: color,
27
- border: `1px solid ${border_color}`,
28
- borderRadius: border_radius,
29
- padding: padding,
30
- margin: margin,
31
- '&:hover': {
32
- backgroundColor: background_color_hover,
33
- color: color_hover,
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, background_color, background_color_hover, color, color_hover, border_radius = '0', border_color = 'transparent', box_shadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
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, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: borderRadius, border_color: border_color, padding: padding, margin: marginButton, "aria-label": aria_label, target: "_blank", boxshadow: box_shadow, rel: "noopener noreferrer", children: children }));
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, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: borderRadius, border_color: border_color, padding: padding, margin: marginButton, "aria-label": aria_label, boxshadow: box_shadow, children: children }));
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;