@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.
Files changed (55) hide show
  1. package/LICENSE +78 -0
  2. package/README.md +162 -0
  3. package/dist/app/layout.d.ts +6 -0
  4. package/dist/app/layout.js +19 -0
  5. package/dist/app/layout.js.map +1 -0
  6. package/dist/app/page.d.ts +1 -0
  7. package/dist/app/page.js +6 -0
  8. package/dist/app/page.js.map +1 -0
  9. package/dist/components/FormStyled.d.ts +37 -0
  10. package/dist/components/FormStyled.js +120 -0
  11. package/dist/components/FormStyled.js.map +1 -0
  12. package/dist/components/GoogleButton.d.ts +60 -0
  13. package/dist/components/GoogleButton.js +110 -0
  14. package/dist/components/GoogleButton.js.map +1 -0
  15. package/dist/components/LoginForm.d.ts +29 -0
  16. package/dist/components/LoginForm.js +143 -0
  17. package/dist/components/LoginForm.js.map +1 -0
  18. package/dist/components/RecaptchaForm.d.ts +21 -0
  19. package/dist/components/RecaptchaForm.js +118 -0
  20. package/dist/components/RecaptchaForm.js.map +1 -0
  21. package/dist/components/RecaptchaInvisible.d.ts +10 -0
  22. package/dist/components/RecaptchaInvisible.js +29 -0
  23. package/dist/components/RecaptchaInvisible.js.map +1 -0
  24. package/dist/components/RecaptchaMessage.d.ts +5 -0
  25. package/dist/components/RecaptchaMessage.js +46 -0
  26. package/dist/components/RecaptchaMessage.js.map +1 -0
  27. package/dist/components/RecuperarSenhaForm.d.ts +23 -0
  28. package/dist/components/RecuperarSenhaForm.js +98 -0
  29. package/dist/components/RecuperarSenhaForm.js.map +1 -0
  30. package/dist/components/SignUpForm.d.ts +26 -0
  31. package/dist/components/SignUpForm.js +149 -0
  32. package/dist/components/SignUpForm.js.map +1 -0
  33. package/dist/components/TextFieldValidate.d.ts +108 -0
  34. package/dist/components/TextFieldValidate.js +181 -0
  35. package/dist/components/TextFieldValidate.js.map +1 -0
  36. package/dist/index.d.ts +8 -0
  37. package/dist/index.js +9 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/pages/_app.d.ts +2 -0
  40. package/dist/pages/_app.js +20 -0
  41. package/dist/pages/_app.js.map +1 -0
  42. package/dist/pages/_document.d.ts +9 -0
  43. package/dist/pages/_document.js +33 -0
  44. package/dist/pages/_document.js.map +1 -0
  45. package/dist/theme.d.ts +35 -0
  46. package/dist/theme.js +142 -0
  47. package/dist/theme.js.map +1 -0
  48. package/dist/tsconfig.tsbuildinfo +1 -0
  49. package/dist/utils/validateEmail.d.ts +37 -0
  50. package/dist/utils/validateEmail.js +50 -0
  51. package/dist/utils/validateEmail.js.map +1 -0
  52. package/dist/utils/validateTelefone.d.ts +36 -0
  53. package/dist/utils/validateTelefone.js +47 -0
  54. package/dist/utils/validateTelefone.js.map +1 -0
  55. package/package.json +64 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * validateEmail Utility
3
+ *
4
+ * Função utilitária para validação de endereços de e-mail.
5
+ * Usa uma expressão regular simples que verifica a presença de caracteres antes e depois de '@' e '.'.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { validateEmail } from '@/utils/validateEmail';
10
+ *
11
+ * const isValid = validateEmail('usuario@dominio.com'); // true
12
+ * const isInvalid = validateEmail('usuario@dominio'); // false
13
+ * ```
14
+ *
15
+ * @param email - String contendo o endereço de e-mail a ser validado.
16
+ * @returns `true` se o e-mail for válido, caso contrário `false`.
17
+ */
18
+ export declare const validateEmail: (email: string) => boolean;
19
+ /**
20
+ * validateEmailMessage Utility
21
+ *
22
+ * Versão da validação de e-mail adaptada para uso direto no componente `TextFiledCustom`.
23
+ * Retorna `null` se válido, ou uma mensagem de erro se o e-mail for inválido.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <TextFiledCustom
28
+ * label=\"E-mail\"
29
+ * placeholder=\"Digite seu e-mail\"
30
+ * validate={validateEmailMessage}
31
+ * />
32
+ * ```
33
+ *
34
+ * @param email - String contendo o endereço de e-mail.
35
+ * @returns `null` se válido, ou uma string com mensagem de erro se inválido.
36
+ */
37
+ export declare const validateEmailMessage: (email: string) => string | null;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * validateEmail Utility
3
+ *
4
+ * Função utilitária para validação de endereços de e-mail.
5
+ * Usa uma expressão regular simples que verifica a presença de caracteres antes e depois de '@' e '.'.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { validateEmail } from '@/utils/validateEmail';
10
+ *
11
+ * const isValid = validateEmail('usuario@dominio.com'); // true
12
+ * const isInvalid = validateEmail('usuario@dominio'); // false
13
+ * ```
14
+ *
15
+ * @param email - String contendo o endereço de e-mail a ser validado.
16
+ * @returns `true` se o e-mail for válido, caso contrário `false`.
17
+ */
18
+ export const validateEmail = (email) => {
19
+ if (!email) {
20
+ return false;
21
+ }
22
+ const cleanedEmail = email.trim();
23
+ const regex = /^\S+@\S+\.\S+$/;
24
+ const isValid = regex.test(cleanedEmail);
25
+ return isValid;
26
+ };
27
+ /**
28
+ * validateEmailMessage Utility
29
+ *
30
+ * Versão da validação de e-mail adaptada para uso direto no componente `TextFiledCustom`.
31
+ * Retorna `null` se válido, ou uma mensagem de erro se o e-mail for inválido.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <TextFiledCustom
36
+ * label=\"E-mail\"
37
+ * placeholder=\"Digite seu e-mail\"
38
+ * validate={validateEmailMessage}
39
+ * />
40
+ * ```
41
+ *
42
+ * @param email - String contendo o endereço de e-mail.
43
+ * @returns `null` se válido, ou uma string com mensagem de erro se inválido.
44
+ */
45
+ export const validateEmailMessage = (email) => {
46
+ return validateEmail(email)
47
+ ? null
48
+ : 'E-mail inválido. Use um formato válido (ex: exemplo@dominio.com)';
49
+ };
50
+ //# sourceMappingURL=validateEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateEmail.js","sourceRoot":"","sources":["../../src/utils/validateEmail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE;IAEtD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,KAAK,GAAG,gBAAgB,CAAC;IAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAiB,EAAE;IACnE,OAAO,aAAa,CAAC,KAAK,CAAC;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,kEAAkE,CAAC;AACzE,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * validateTelefone Utility
3
+ *
4
+ * Função utilitária para validação de números de telefone brasileiros.
5
+ * Aceita apenas dígitos e valida o formato DDD + número (total de 11 dígitos).
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { validateTelefone } from '@/utils/validateTelefone';
10
+ *
11
+ * const isValid = validateTelefone('11987654321'); // true
12
+ * const isInvalid = validateTelefone('12345'); // false
13
+ * ```
14
+ *
15
+ * @param telefone - String contendo o número do telefone.
16
+ * @returns `true` se o telefone for válido, caso contrário `false`.
17
+ */
18
+ export declare const validateTelefone: (telefone?: string) => boolean;
19
+ /**
20
+ * Função auxiliar para uso direto no TextFiledCustom.
21
+ *
22
+ * Retorna `null` se válido, ou uma mensagem de erro se inválido.
23
+ * Pode ser usada diretamente na prop `validate` do componente.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <TextFiledCustom
28
+ * label=\"Telefone\"
29
+ * validate={validateTelefoneMessage}
30
+ * />
31
+ * ```
32
+ *
33
+ * @param telefone - String com o valor do campo.
34
+ * @returns Mensagem de erro ou `null`.
35
+ */
36
+ export declare const validateTelefoneMessage: (telefone: string) => string | null;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * validateTelefone Utility
3
+ *
4
+ * Função utilitária para validação de números de telefone brasileiros.
5
+ * Aceita apenas dígitos e valida o formato DDD + número (total de 11 dígitos).
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { validateTelefone } from '@/utils/validateTelefone';
10
+ *
11
+ * const isValid = validateTelefone('11987654321'); // true
12
+ * const isInvalid = validateTelefone('12345'); // false
13
+ * ```
14
+ *
15
+ * @param telefone - String contendo o número do telefone.
16
+ * @returns `true` se o telefone for válido, caso contrário `false`.
17
+ */
18
+ export const validateTelefone = (telefone) => {
19
+ if (!telefone)
20
+ return false;
21
+ const digits = telefone.trim().replace(/\D/g, '');
22
+ const isValid = /^\d{11}$/.test(digits);
23
+ return isValid;
24
+ };
25
+ /**
26
+ * Função auxiliar para uso direto no TextFiledCustom.
27
+ *
28
+ * Retorna `null` se válido, ou uma mensagem de erro se inválido.
29
+ * Pode ser usada diretamente na prop `validate` do componente.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <TextFiledCustom
34
+ * label=\"Telefone\"
35
+ * validate={validateTelefoneMessage}
36
+ * />
37
+ * ```
38
+ *
39
+ * @param telefone - String com o valor do campo.
40
+ * @returns Mensagem de erro ou `null`.
41
+ */
42
+ export const validateTelefoneMessage = (telefone) => {
43
+ return validateTelefone(telefone)
44
+ ? null
45
+ : 'Telefone inválido. Use o formato DDD + número (ex: 11987654321)';
46
+ };
47
+ //# sourceMappingURL=validateTelefone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateTelefone.js","sourceRoot":"","sources":["../../src/utils/validateTelefone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAiB,EAAW,EAAE;IAE7D,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAiB,EAAE;IACzE,OAAO,gBAAgB,CAAC,QAAQ,CAAC;QAC/B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,iEAAiE,CAAC;AACxE,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@pipelinesolucoes/form",
3
+ "version": "1.0.0-beta.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/pipeline-solucoes/form.git"
7
+ },
8
+ "homepage": "https://github.com/pipeline-solucoes/form#readme",
9
+ "bugs": {
10
+ "url": "https://github.com/pipeline-solucoes/form/issues"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "dist/index.js",
16
+ "module": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/index.js",
24
+ "require": "./dist/index.js"
25
+ }
26
+ },
27
+ "scripts": {
28
+ "build": "tsc",
29
+ "prepare": "npm run build",
30
+ "start": "next start",
31
+ "lint": "next lint",
32
+ "release-beta": "npm run build && npm publish --tag beta"
33
+ },
34
+ "dependencies": {
35
+ "react-google-recaptcha": "^3.1.0"
36
+ },
37
+ "peerDependencies": {
38
+ "@emotion/react": "^11.14.0",
39
+ "@emotion/styled": "^11.14.1",
40
+ "@mui/icons-material": "^6.4.4 || ^7.3.0",
41
+ "@mui/material": "^6.4.4 || ^7.3.0",
42
+ "react": "^18.0.0 || ^19.0.0",
43
+ "react-dom": "^18.0.0 || ^19.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@emotion/css": "^11.13.5",
47
+ "@emotion/react": "^11.14.0",
48
+ "@emotion/server": "^11.11.0",
49
+ "@emotion/styled": "^11.14.1",
50
+ "@eslint/eslintrc": "^3",
51
+ "@mui/icons-material": "^7.3.0",
52
+ "@mui/material": "^7.3.0",
53
+ "@types/node": "^20",
54
+ "@types/react": "^19.0.8",
55
+ "@types/react-dom": "^19",
56
+ "@types/react-google-recaptcha": "^2.1.9",
57
+ "@types/react-input-mask": "^3.0.6",
58
+ "eslint": "^9",
59
+ "eslint-config-next": "15.1.6",
60
+ "framer-motion": "^12.9.4",
61
+ "next": "^16.0.7",
62
+ "typescript": "^5"
63
+ }
64
+ }