@pipelinesolucoes/form 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/LICENSE +78 -0
- package/README.md +162 -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/FormStyled.d.ts +37 -0
- package/dist/components/FormStyled.js +120 -0
- package/dist/components/FormStyled.js.map +1 -0
- package/dist/components/GoogleButton.d.ts +60 -0
- package/dist/components/GoogleButton.js +110 -0
- package/dist/components/GoogleButton.js.map +1 -0
- package/dist/components/LoginForm.d.ts +29 -0
- package/dist/components/LoginForm.js +143 -0
- package/dist/components/LoginForm.js.map +1 -0
- package/dist/components/RecaptchaForm.d.ts +21 -0
- package/dist/components/RecaptchaForm.js +118 -0
- package/dist/components/RecaptchaForm.js.map +1 -0
- package/dist/components/RecaptchaInvisible.d.ts +10 -0
- package/dist/components/RecaptchaInvisible.js +29 -0
- package/dist/components/RecaptchaInvisible.js.map +1 -0
- package/dist/components/RecaptchaMessage.d.ts +5 -0
- package/dist/components/RecaptchaMessage.js +46 -0
- package/dist/components/RecaptchaMessage.js.map +1 -0
- package/dist/components/RecuperarSenhaForm.d.ts +23 -0
- package/dist/components/RecuperarSenhaForm.js +98 -0
- package/dist/components/RecuperarSenhaForm.js.map +1 -0
- package/dist/components/SignUpForm.d.ts +26 -0
- package/dist/components/SignUpForm.js +149 -0
- package/dist/components/SignUpForm.js.map +1 -0
- package/dist/components/TextFieldValidate.d.ts +108 -0
- package/dist/components/TextFieldValidate.js +181 -0
- package/dist/components/TextFieldValidate.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -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 +35 -0
- package/dist/theme.js +142 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/validateEmail.d.ts +37 -0
- package/dist/utils/validateEmail.js +50 -0
- package/dist/utils/validateEmail.js.map +1 -0
- package/dist/utils/validateTelefone.d.ts +36 -0
- package/dist/utils/validateTelefone.js +47 -0
- package/dist/utils/validateTelefone.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
LICENÇA COMERCIAL – PIPELINE SOLUÇÕES
|
|
2
|
+
|
|
3
|
+
Copyright (c) Pipeline Soluções
|
|
4
|
+
|
|
5
|
+
Este software é de propriedade da Pipeline Soluções e é disponibilizado
|
|
6
|
+
publicamente para instalação e avaliação. O uso comercial está sujeito
|
|
7
|
+
a licenciamento conforme os termos abaixo.
|
|
8
|
+
|
|
9
|
+
────────────────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
1. CONCESSÃO DE LICENÇA
|
|
12
|
+
|
|
13
|
+
A Pipeline Soluções concede ao Licenciado uma licença não exclusiva,
|
|
14
|
+
intransferível e revogável para utilizar este software em 1 (um)
|
|
15
|
+
projeto comercial, mediante aquisição de licença válida.
|
|
16
|
+
|
|
17
|
+
Projeto é definido como uma única aplicação em produção, incluindo
|
|
18
|
+
seus ambientes de desenvolvimento, homologação e staging.
|
|
19
|
+
|
|
20
|
+
────────────────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
2. USO PERMITIDO
|
|
23
|
+
|
|
24
|
+
É permitido:
|
|
25
|
+
- Instalar e avaliar o software livremente.
|
|
26
|
+
- Utilizar o software em projetos comerciais mediante licença válida.
|
|
27
|
+
- Modificar o código para uso interno no projeto licenciado.
|
|
28
|
+
|
|
29
|
+
────────────────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
3. USO PROIBIDO
|
|
32
|
+
|
|
33
|
+
É expressamente proibido:
|
|
34
|
+
- Utilizar o software em projetos comerciais sem licença válida.
|
|
35
|
+
- Redistribuir, sublicenciar, vender ou alugar este software,
|
|
36
|
+
integralmente ou em partes.
|
|
37
|
+
- Publicar o software como parte de outra biblioteca, framework
|
|
38
|
+
ou produto concorrente.
|
|
39
|
+
- Remover ou alterar avisos de copyright ou licenciamento.
|
|
40
|
+
|
|
41
|
+
────────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
4. SUPORTE E ATUALIZAÇÕES
|
|
44
|
+
|
|
45
|
+
A aquisição da licença pode incluir suporte básico e atualizações,
|
|
46
|
+
conforme acordado no momento da compra. A Pipeline Soluções não é
|
|
47
|
+
obrigada a fornecer suporte gratuito.
|
|
48
|
+
|
|
49
|
+
────────────────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
5. GARANTIAS E RESPONSABILIDADE
|
|
52
|
+
|
|
53
|
+
Este software é fornecido "NO ESTADO EM QUE SE ENCONTRA",
|
|
54
|
+
sem garantias de qualquer tipo, expressas ou implícitas.
|
|
55
|
+
Em nenhuma hipótese a Pipeline Soluções será responsabilizada
|
|
56
|
+
por danos diretos ou indiretos decorrentes do uso do software.
|
|
57
|
+
|
|
58
|
+
────────────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
6. RESCISÃO
|
|
61
|
+
|
|
62
|
+
Esta licença será automaticamente rescindida em caso de violação
|
|
63
|
+
de qualquer um dos termos aqui estabelecidos. Em caso de rescisão,
|
|
64
|
+
o uso do software deverá ser interrompido imediatamente.
|
|
65
|
+
|
|
66
|
+
────────────────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
7. CONTATO
|
|
69
|
+
|
|
70
|
+
Para aquisição de licença comercial ou esclarecimento de dúvidas:
|
|
71
|
+
|
|
72
|
+
E-mail: contato@pipelinesolucoes.com.br
|
|
73
|
+
Site: https://www.pipelinesolucoes.com.br
|
|
74
|
+
|
|
75
|
+
────────────────────────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
Ao utilizar este software em um projeto comercial, você declara ter
|
|
78
|
+
lido, compreendido e concordado com os termos desta licença.
|
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# @pipelinesolucoes/form
|
|
2
|
+
|
|
3
|
+
Biblioteca de **componentes de botão para React**, desenvolvida para **padronização visual**, **reutilização** e **escalabilidade** em aplicações modernas e design systems.
|
|
4
|
+
|
|
5
|
+
Este pacote faz parte do ecossistema de componentes da **Pipeline Soluções**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📦 Componentes disponíveis
|
|
10
|
+
|
|
11
|
+
A biblioteca inclui os seguintes componentes:
|
|
12
|
+
|
|
13
|
+
- **Actionform**
|
|
14
|
+
Botão de ação estilizado, baseado no tema e com tipografia configurável via `variant`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ✨ Características
|
|
19
|
+
|
|
20
|
+
- ✅ Pronto para produção
|
|
21
|
+
- 🎨 Integração com Material UI
|
|
22
|
+
- ♿ Foco em acessibilidade
|
|
23
|
+
- 🧩 Ideal para design systems
|
|
24
|
+
- 🔄 Reutilizável em múltiplos projetos
|
|
25
|
+
- 📦 Publicado no npm com versionamento semântico
|
|
26
|
+
- 🔐 Preparado para licenciamento por projeto
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📥 Instalação
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @pipelinesolucoes/form
|
|
34
|
+
ou
|
|
35
|
+
yarn add @pipelinesolucoes/form
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🚀 Uso básico
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
import { Actionform } from "@pipelinesolucoes/form";
|
|
43
|
+
|
|
44
|
+
export function Example() {
|
|
45
|
+
return (
|
|
46
|
+
<Actionform variant="contained" color="primary">
|
|
47
|
+
Ação
|
|
48
|
+
</Actionform>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 🧩 Uso em Design Systems
|
|
54
|
+
|
|
55
|
+
Este pacote foi projetado para:
|
|
56
|
+
|
|
57
|
+
- padronização de ações e navegação
|
|
58
|
+
- reutilização entre projetos
|
|
59
|
+
- evolução incremental de UI
|
|
60
|
+
- integração com temas e tokens de design
|
|
61
|
+
|
|
62
|
+
Pode ser utilizado de forma isolada ou como parte de um design system maior.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🔐 Licença de uso comercial
|
|
67
|
+
|
|
68
|
+
Este pacote é publicamente acessível no npm, porém:
|
|
69
|
+
|
|
70
|
+
O uso comercial é licenciado por projeto.
|
|
71
|
+
|
|
72
|
+
**O que isso significa?**
|
|
73
|
+
|
|
74
|
+
O pacote pode ser instalado e avaliado livremente.
|
|
75
|
+
|
|
76
|
+
Para uso em projetos comerciais, é necessária a aquisição de uma licença válida por projeto.
|
|
77
|
+
|
|
78
|
+
**Definição de projeto**
|
|
79
|
+
|
|
80
|
+
Projeto = 1 aplicação em produção
|
|
81
|
+
(ex.: site institucional, sistema interno ou aplicação SaaS).
|
|
82
|
+
Ambientes de desenvolvimento, staging e homologação estão incluídos no mesmo projeto.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 📄 O que a licença inclui
|
|
87
|
+
|
|
88
|
+
✔ Uso em 1 projeto
|
|
89
|
+
✔ Atualizações enquanto a licença estiver ativa
|
|
90
|
+
✔ Correções de bugs
|
|
91
|
+
✔ Suporte básico
|
|
92
|
+
✔ Evolução contínua do pacote
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## ⚙️ Configuração de licença (mock)
|
|
97
|
+
|
|
98
|
+
Após adquirir a licença, você receberá um Project ID e uma License Key.
|
|
99
|
+
|
|
100
|
+
No projeto, configure as variáveis de ambiente:
|
|
101
|
+
|
|
102
|
+
PIPESOL_PROJECT_ID=meu-projeto
|
|
103
|
+
PIPESOL_form_LICENSE_KEY=SUA-LICENSE-KEY-AQUI
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
Atualmente, a validação é local e não bloqueante, servindo como preparação para automação futura.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 🔁 Versionamento
|
|
111
|
+
|
|
112
|
+
Este projeto segue Semantic Versioning (SemVer):
|
|
113
|
+
|
|
114
|
+
1.0.1 – Correção de bugs
|
|
115
|
+
|
|
116
|
+
1.1.0 – Nova funcionalidade compatível
|
|
117
|
+
|
|
118
|
+
2.0.0 – Mudança incompatível
|
|
119
|
+
|
|
120
|
+
1.0.0-beta.x – Versões beta
|
|
121
|
+
|
|
122
|
+
Para listar as versões publicadas:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
npm view @pipelinesolucoes/form versions --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 🚀 Processo de publicação
|
|
129
|
+
|
|
130
|
+
Este pacote é publicado exclusivamente via CI/CD utilizando GitHub Actions.
|
|
131
|
+
|
|
132
|
+
Características do processo:
|
|
133
|
+
|
|
134
|
+
- Publicação apenas por tags Git (vX.Y.Z)
|
|
135
|
+
- Autenticação via Trusted Publishing (OIDC)
|
|
136
|
+
- Nenhum token npm armazenado
|
|
137
|
+
- Tokens clássicos desabilitados
|
|
138
|
+
- Autenticação em dois fatores (2FA) obrigatória
|
|
139
|
+
- Publicações seguras, rastreáveis e reprodutíveis
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 📬 Aquisição de licença e contato
|
|
144
|
+
|
|
145
|
+
Para adquirir uma licença comercial ou obter mais informações:
|
|
146
|
+
|
|
147
|
+
📧 contato@pipelinesolucoes.com.br
|
|
148
|
+
🌐 https://www.pipelinesolucoes.com.br
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📄 Licença
|
|
153
|
+
|
|
154
|
+
Copyright © Pipeline Soluções
|
|
155
|
+
Este software está sujeito a licença comercial por projeto.
|
|
156
|
+
Consulte o arquivo LICENSE para mais informações.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Se você quiser, eu também posso gerar agora o **arquivo `LICENSE`** (texto curto e claro) no mesmo padrão profissional pra você copiar e colar como `LICENSE` no repo.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
3
|
+
import "./globals.css";
|
|
4
|
+
const geistSans = Geist({
|
|
5
|
+
variable: "--font-geist-sans",
|
|
6
|
+
subsets: ["latin"],
|
|
7
|
+
});
|
|
8
|
+
const geistMono = Geist_Mono({
|
|
9
|
+
variable: "--font-geist-mono",
|
|
10
|
+
subsets: ["latin"],
|
|
11
|
+
});
|
|
12
|
+
export const metadata = {
|
|
13
|
+
title: "Create Next App",
|
|
14
|
+
description: "Generated by create next app",
|
|
15
|
+
};
|
|
16
|
+
export default function RootLayout({ children, }) {
|
|
17
|
+
return (_jsx("html", { lang: "en", children: _jsx("body", { className: `${geistSans.variable} ${geistMono.variable}`, children: children }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/app/layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,eAAe,CAAC;AAEvB,MAAM,SAAS,GAAG,KAAK,CAAC;IACtB,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,CAAC,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,CAAC,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,8BAA8B;CAC5C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,GAGR;IACA,OAAO,CACL,eAAM,IAAI,EAAC,IAAI,YACb,eAAM,SAAS,EAAE,GAAG,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,EAAE,YAC3D,QAAQ,GACJ,GACF,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Home(): import("react/jsx-runtime").JSX.Element;
|
package/dist/app/page.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/app/page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,CAAC,OAAO,UAAU,IAAI;IAC1B,OAAO,CACL,gCAAY,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface TextFieldStyledProps {
|
|
2
|
+
background_color: string;
|
|
3
|
+
text_color: string;
|
|
4
|
+
text_color_error: string;
|
|
5
|
+
border_radius: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TextFieldStyled: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
10
|
+
} & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & TextFieldStyledProps, {}, {}>;
|
|
11
|
+
interface TextFieldFixedSizeStyledProps {
|
|
12
|
+
background_color: string;
|
|
13
|
+
text_color: string;
|
|
14
|
+
text_color_error: string;
|
|
15
|
+
border_radius: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const TextFieldFixedSizeStyled: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
19
|
+
} & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & TextFieldFixedSizeStyledProps, {}, {}>;
|
|
20
|
+
interface ButtonFormStyledProps {
|
|
21
|
+
width: string;
|
|
22
|
+
height: string;
|
|
23
|
+
background_color: string;
|
|
24
|
+
text_color: string;
|
|
25
|
+
border_radius: string;
|
|
26
|
+
border_color?: string;
|
|
27
|
+
margin?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const ButtonFormStyled: 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>, "className" | "style" | "tabIndex" | "color" | "children" | "size" | "variant" | "classes" | "disabled" | "fullWidth" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "loading" | "loadingIndicator" | "loadingPosition" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ButtonFormStyledProps, {}, {}>;
|
|
30
|
+
export declare const LinkFormStyled: 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>, "className" | "style" | "tabIndex" | "color" | "children" | "size" | "variant" | "classes" | "disabled" | "fullWidth" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "loading" | "loadingIndicator" | "loadingPosition" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
31
|
+
width: string;
|
|
32
|
+
height: string;
|
|
33
|
+
text_color: string;
|
|
34
|
+
margin?: string;
|
|
35
|
+
font_size?: string;
|
|
36
|
+
}, {}, {}>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Button } from '@mui/material';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import TextField from '@mui/material/TextField';
|
|
4
|
+
export const TextFieldStyled = styled(TextField, {
|
|
5
|
+
shouldForwardProp: (prop) => !['background_color', 'text_color', 'text_color_error', 'border_radius', 'width'].includes(prop),
|
|
6
|
+
})(({ theme, background_color, text_color, text_color_error, border_radius, error, width = '100%' }) => {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8
|
+
return ({
|
|
9
|
+
'& .MuiInputLabel-root': {
|
|
10
|
+
color: error ? text_color_error : text_color, // Label em vermelho em caso de erro
|
|
11
|
+
},
|
|
12
|
+
'& .MuiInputBase-input::placeholder': {
|
|
13
|
+
color: error ? text_color_error : text_color, // Placeholder também em vermelho, opcional
|
|
14
|
+
},
|
|
15
|
+
'& .MuiInputBase-root': {
|
|
16
|
+
backgroundColor: background_color,
|
|
17
|
+
borderRadius: border_radius,
|
|
18
|
+
color: text_color,
|
|
19
|
+
},
|
|
20
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
21
|
+
borderColor: error ? text_color_error : 'transparent', // Borda em vermelho em caso de erro
|
|
22
|
+
},
|
|
23
|
+
fontFamily: theme.typography.fontFamily,
|
|
24
|
+
fontSize: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontSize,
|
|
25
|
+
fontWeight: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontWeight,
|
|
26
|
+
fontStyle: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.fontStyle,
|
|
27
|
+
lineHeight: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.lineHeight,
|
|
28
|
+
letterSpacing: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.letterSpacing,
|
|
29
|
+
margin: (_f = theme.typography.body1) === null || _f === void 0 ? void 0 : _f.margin,
|
|
30
|
+
width: width,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
export const TextFieldFixedSizeStyled = styled(TextField, {
|
|
34
|
+
shouldForwardProp: (prop) => !['background_color', 'text_color', 'text_color_error', 'border_radius'].includes(prop),
|
|
35
|
+
})(({ theme, background_color, text_color, text_color_error, border_radius, error }) => {
|
|
36
|
+
var _a, _b, _c, _d, _e, _f;
|
|
37
|
+
return ({
|
|
38
|
+
'& .MuiInputLabel-root': {
|
|
39
|
+
color: error ? text_color_error : text_color, // Label em vermelho em caso de erro
|
|
40
|
+
},
|
|
41
|
+
'& .MuiInputBase-input::placeholder': {
|
|
42
|
+
color: error ? text_color_error : text_color, // Placeholder também em vermelho, opcional
|
|
43
|
+
},
|
|
44
|
+
'& .MuiInputBase-root': {
|
|
45
|
+
transition: 'none !important',
|
|
46
|
+
alignItems: 'flex-start',
|
|
47
|
+
width: '100%',
|
|
48
|
+
overflowY: 'auto',
|
|
49
|
+
height: '150px',
|
|
50
|
+
backgroundColor: background_color,
|
|
51
|
+
borderRadius: border_radius,
|
|
52
|
+
color: text_color,
|
|
53
|
+
},
|
|
54
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
55
|
+
borderColor: error ? text_color_error : 'transparent', // Borda em vermelho em caso de erro
|
|
56
|
+
},
|
|
57
|
+
fontFamily: theme.typography.fontFamily,
|
|
58
|
+
fontSize: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontSize,
|
|
59
|
+
fontWeight: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontWeight,
|
|
60
|
+
fontStyle: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.fontStyle,
|
|
61
|
+
lineHeight: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.lineHeight,
|
|
62
|
+
letterSpacing: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.letterSpacing,
|
|
63
|
+
margin: (_f = theme.typography.body1) === null || _f === void 0 ? void 0 : _f.margin,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export const ButtonFormStyled = styled(Button, {
|
|
67
|
+
shouldForwardProp: (prop) => !['width', 'height', 'background_color', 'text_color',
|
|
68
|
+
'border_radius', 'border_color', 'margin'].includes(prop),
|
|
69
|
+
})(({ theme, width, height, background_color, text_color, border_radius, border_color = 'transparent', margin = '0' }) => {
|
|
70
|
+
var _a, _b, _c, _d, _e;
|
|
71
|
+
return ({
|
|
72
|
+
color: text_color,
|
|
73
|
+
backgroundColor: background_color,
|
|
74
|
+
borderRadius: border_radius,
|
|
75
|
+
textTransform: 'none',
|
|
76
|
+
cursor: 'pointer',
|
|
77
|
+
padding: '8px 24px',
|
|
78
|
+
boxShadow: 'none',
|
|
79
|
+
width: width,
|
|
80
|
+
height: height,
|
|
81
|
+
border: (border_color == "transparent" ? "none" : `1px solid ${border_color}`),
|
|
82
|
+
margin: margin,
|
|
83
|
+
// Tipografia
|
|
84
|
+
fontFamily: theme.typography.fontFamily,
|
|
85
|
+
fontWeight: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontWeight,
|
|
86
|
+
fontStyle: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontStyle,
|
|
87
|
+
lineHeight: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
88
|
+
letterSpacing: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.letterSpacing,
|
|
89
|
+
fontSize: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.fontSize,
|
|
90
|
+
// Hover state (opcional)
|
|
91
|
+
'&:hover': {
|
|
92
|
+
backgroundColor: background_color,
|
|
93
|
+
opacity: 0.9,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
export const LinkFormStyled = styled(Button, {
|
|
98
|
+
shouldForwardProp: (prop) => !['width', 'height', 'text_color', 'margin', 'font_size'].includes(prop),
|
|
99
|
+
})(({ theme, width, height, text_color, margin = 0, font_size }) => {
|
|
100
|
+
var _a, _b, _c, _d, _e;
|
|
101
|
+
return ({
|
|
102
|
+
color: text_color,
|
|
103
|
+
width: width,
|
|
104
|
+
height: height,
|
|
105
|
+
textTransform: 'none',
|
|
106
|
+
border: 'none',
|
|
107
|
+
cursor: 'pointer',
|
|
108
|
+
padding: '0',
|
|
109
|
+
boxShadow: 'none',
|
|
110
|
+
margin: margin,
|
|
111
|
+
// Tipografia
|
|
112
|
+
fontFamily: theme.typography.fontFamily,
|
|
113
|
+
fontWeight: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontWeight,
|
|
114
|
+
fontStyle: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontStyle,
|
|
115
|
+
lineHeight: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
116
|
+
letterSpacing: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.letterSpacing,
|
|
117
|
+
fontSize: (font_size ? font_size : (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.fontSize),
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=FormStyled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormStyled.js","sourceRoot":"","sources":["../../src/components/FormStyled.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA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AC,UAAU,CAAC,KAAK,0CAAE,SAAS;QAC5C,UAAU,EAAE,MAAA,KAAK,CAAC,UAAU,CAAC,KAAK,0CAAE,UAAU;QAC9C,aAAa,EAAE,MAAA,KAAK,CAAC,UAAU,CAAC,KAAK,0CAAE,aAAa;QACpD,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,UAAU,CAAC,KAAK,0CAAE,QAAQ,CAAC;KACrE,CAAC,CAAA;CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface GoogleButtonProps {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
messageError?: string;
|
|
5
|
+
errorColor?: string;
|
|
6
|
+
boxShadow?: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
padding?: string;
|
|
10
|
+
margin?: string;
|
|
11
|
+
background?: string;
|
|
12
|
+
border?: string;
|
|
13
|
+
borderRadius?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Componente de botão que chama um endpoint ao clicar.
|
|
18
|
+
* Em caso de erro (status não-2xx ou exceção de rede), exibe `messageError`.
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* @property endpoint - URL que será chamada ao clicar.
|
|
22
|
+
* @property messageError - Mensagem exibida quando a requisição falhar.
|
|
23
|
+
* @property errorColor - Cor do texto da mensagem de erro.
|
|
24
|
+
* @property width - Largura do botão. @default 'auto'
|
|
25
|
+
* @property height - Altura do botão. @default 'auto'
|
|
26
|
+
* @property padding - Espaçamento interno. @default '8px 24px'
|
|
27
|
+
* @property margin - Margem externa. @default '0'
|
|
28
|
+
* @property background - Cor de fundo. @default 'transparent'
|
|
29
|
+
* @property border - Borda do botão. @default 'none'
|
|
30
|
+
* @property borderRadius - Raio da borda. @default '8px'
|
|
31
|
+
* @property boxShadow - Sombra do botão. @default 'none'
|
|
32
|
+
* @property children - Conteúdo interno do botão.
|
|
33
|
+
*
|
|
34
|
+
* @default width 'auto'
|
|
35
|
+
* @default height 'auto'
|
|
36
|
+
* @default padding '8px 24px'
|
|
37
|
+
* @default margin '0'
|
|
38
|
+
* @default background 'transparent'
|
|
39
|
+
* @default border 'none'
|
|
40
|
+
* @default borderRadius '8px'
|
|
41
|
+
* @default boxShadow 'none'
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* <GoogleButton
|
|
45
|
+
* endpoint="/api/auth/google"
|
|
46
|
+
* messageError="Falha ao autenticar com o Google."
|
|
47
|
+
* errorColor="#d32f2f"
|
|
48
|
+
* width="100%"
|
|
49
|
+
* height="40px"
|
|
50
|
+
* background="transparent"
|
|
51
|
+
* border="1px solid #ccc"
|
|
52
|
+
* borderRadius="6px"
|
|
53
|
+
* boxShadow="0 2px 6px rgba(0,0,0,0.1)"
|
|
54
|
+
* >
|
|
55
|
+
* Continuar com Google
|
|
56
|
+
* </GoogleButton>
|
|
57
|
+
*
|
|
58
|
+
**/
|
|
59
|
+
declare const GoogleButton: React.FC<GoogleButtonProps>;
|
|
60
|
+
export default GoogleButton;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button, styled, Typography, Box } from '@mui/material';
|
|
4
|
+
const ButtonFormStyled = styled(Button, {
|
|
5
|
+
shouldForwardProp: (prop) => ![
|
|
6
|
+
'width',
|
|
7
|
+
'height',
|
|
8
|
+
'padding',
|
|
9
|
+
'margin',
|
|
10
|
+
'background',
|
|
11
|
+
'border',
|
|
12
|
+
'borderRadius',
|
|
13
|
+
'boxShadow',
|
|
14
|
+
].includes(prop),
|
|
15
|
+
})(({ theme, width, height, padding, margin, background, border, borderRadius, boxShadow, }) => {
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
return ({
|
|
18
|
+
// Layout
|
|
19
|
+
width: width || 'auto',
|
|
20
|
+
height: height || 'auto',
|
|
21
|
+
padding: padding || '8px 24px',
|
|
22
|
+
margin: margin || '0',
|
|
23
|
+
// Visual
|
|
24
|
+
background: background || 'transparent',
|
|
25
|
+
border: border || 'none',
|
|
26
|
+
borderRadius: borderRadius || '8px',
|
|
27
|
+
boxShadow: boxShadow || 'none',
|
|
28
|
+
textTransform: 'none',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
// Tipografia baseada no tema
|
|
31
|
+
fontFamily: theme.typography.fontFamily,
|
|
32
|
+
fontWeight: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontWeight,
|
|
33
|
+
fontStyle: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontStyle,
|
|
34
|
+
lineHeight: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
35
|
+
letterSpacing: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.letterSpacing,
|
|
36
|
+
fontSize: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.fontSize,
|
|
37
|
+
'&:hover': {
|
|
38
|
+
opacity: 0.9,
|
|
39
|
+
boxShadow: boxShadow || 'none',
|
|
40
|
+
},
|
|
41
|
+
'&:disabled': {
|
|
42
|
+
opacity: 0.6,
|
|
43
|
+
cursor: 'not-allowed',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Componente de botão que chama um endpoint ao clicar.
|
|
49
|
+
* Em caso de erro (status não-2xx ou exceção de rede), exibe `messageError`.
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* @property endpoint - URL que será chamada ao clicar.
|
|
53
|
+
* @property messageError - Mensagem exibida quando a requisição falhar.
|
|
54
|
+
* @property errorColor - Cor do texto da mensagem de erro.
|
|
55
|
+
* @property width - Largura do botão. @default 'auto'
|
|
56
|
+
* @property height - Altura do botão. @default 'auto'
|
|
57
|
+
* @property padding - Espaçamento interno. @default '8px 24px'
|
|
58
|
+
* @property margin - Margem externa. @default '0'
|
|
59
|
+
* @property background - Cor de fundo. @default 'transparent'
|
|
60
|
+
* @property border - Borda do botão. @default 'none'
|
|
61
|
+
* @property borderRadius - Raio da borda. @default '8px'
|
|
62
|
+
* @property boxShadow - Sombra do botão. @default 'none'
|
|
63
|
+
* @property children - Conteúdo interno do botão.
|
|
64
|
+
*
|
|
65
|
+
* @default width 'auto'
|
|
66
|
+
* @default height 'auto'
|
|
67
|
+
* @default padding '8px 24px'
|
|
68
|
+
* @default margin '0'
|
|
69
|
+
* @default background 'transparent'
|
|
70
|
+
* @default border 'none'
|
|
71
|
+
* @default borderRadius '8px'
|
|
72
|
+
* @default boxShadow 'none'
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* <GoogleButton
|
|
76
|
+
* endpoint="/api/auth/google"
|
|
77
|
+
* messageError="Falha ao autenticar com o Google."
|
|
78
|
+
* errorColor="#d32f2f"
|
|
79
|
+
* width="100%"
|
|
80
|
+
* height="40px"
|
|
81
|
+
* background="transparent"
|
|
82
|
+
* border="1px solid #ccc"
|
|
83
|
+
* borderRadius="6px"
|
|
84
|
+
* boxShadow="0 2px 6px rgba(0,0,0,0.1)"
|
|
85
|
+
* >
|
|
86
|
+
* Continuar com Google
|
|
87
|
+
* </GoogleButton>
|
|
88
|
+
*
|
|
89
|
+
**/
|
|
90
|
+
const GoogleButton = ({ endpoint, messageError = 'Ocorreu um erro ao processar sua solicitação.', errorColor = '#d32f2f', boxShadow, width, height, padding, margin, background, border = 'none', borderRadius, children, }) => {
|
|
91
|
+
const [loading, setLoading] = React.useState(false);
|
|
92
|
+
const [errorMsg, setErrorMsg] = React.useState(null);
|
|
93
|
+
const handleClick = async () => {
|
|
94
|
+
setErrorMsg(null);
|
|
95
|
+
setLoading(true);
|
|
96
|
+
try {
|
|
97
|
+
window.location.href = endpoint;
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
setErrorMsg(messageError);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
setLoading(false);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return (_jsxs(Box, { children: [_jsx(ButtonFormStyled, { onClick: handleClick, disabled: loading, width: width, height: height, padding: padding, margin: margin, background: background, border: border, borderRadius: borderRadius, boxShadow: boxShadow, children: loading ? 'Carregando...' : children }), errorMsg && (_jsx(Typography, { role: "alert", variant: "body2", sx: { mt: 1 }, color: errorColor, children: errorMsg }))] }));
|
|
107
|
+
};
|
|
108
|
+
GoogleButton.displayName = 'GoogleButton';
|
|
109
|
+
export default GoogleButton;
|
|
110
|
+
//# sourceMappingURL=GoogleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleButton.js","sourceRoot":"","sources":["../../src/components/GoogleButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGhE,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE;IACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,OAAO;QACP,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAUA,CAAC,EACC,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,MAAM,EACN,YAAY,EACZ,SAAS,GACV,EAAE,EAAE;;IAAC,OAAA,CAAC;QACL,SAAS;QACT,KAAK,EAAE,KAAK,IAAI,MAAM;QACtB,MAAM,EAAE,MAAM,IAAI,MAAM;QACxB,OAAO,EAAE,OAAO,IAAI,UAAU;QAC9B,MAAM,EAAE,MAAM,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,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAEpE,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC7B,WAAW,CAAC,IAAI,CAAC,CAAC;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAA;QACjC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,WAAW,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,eACF,KAAC,gBAAgB,IAChB,OAAO,EAAE,WAAW,EACnB,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,YAEnB,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,GACpB,EAElB,QAAQ,IAAI,CACX,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,UAAU,YAEhB,QAAQ,GACE,CACd,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
interface LoginFormProps {
|
|
4
|
+
Icon?: React.ElementType<SvgIconProps>;
|
|
5
|
+
titulo?: () => React.ReactElement;
|
|
6
|
+
googleButton: () => React.ReactElement;
|
|
7
|
+
color: string;
|
|
8
|
+
background?: string;
|
|
9
|
+
border_radius?: string;
|
|
10
|
+
background_color_field?: string;
|
|
11
|
+
border_radius_field?: string;
|
|
12
|
+
color_button: string;
|
|
13
|
+
background_color_button?: string;
|
|
14
|
+
border_radius_button?: string;
|
|
15
|
+
text_button: string;
|
|
16
|
+
message_sucess: string;
|
|
17
|
+
color_message_sucess: string;
|
|
18
|
+
message_erro?: string;
|
|
19
|
+
color_message_erro: string;
|
|
20
|
+
color_link: string;
|
|
21
|
+
color_separador: string;
|
|
22
|
+
background_color_button_google?: string;
|
|
23
|
+
color_button_google: string;
|
|
24
|
+
urlRecuperarConta: string;
|
|
25
|
+
urlCriarConta: string;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare const LoginForm: React.FC<LoginFormProps>;
|
|
29
|
+
export default LoginForm;
|