@autenticar-me/vue 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -4
- package/dist/components/Buttons/SignInButton.vue.d.ts +5 -1
- package/dist/components/Buttons/SignInButton.vue.d.ts.map +1 -1
- package/dist/components/Buttons/SignUpButton.vue.d.ts +5 -1
- package/dist/components/Buttons/SignUpButton.vue.d.ts.map +1 -1
- package/dist/components/Modals/SignInModal.vue.d.ts +7 -3
- package/dist/components/Modals/SignInModal.vue.d.ts.map +1 -1
- package/dist/components/Modals/SignUpModal.vue.d.ts +7 -3
- package/dist/components/Modals/SignUpModal.vue.d.ts.map +1 -1
- package/dist/components/SignIn.vue.d.ts +7 -3
- package/dist/components/SignIn.vue.d.ts.map +1 -1
- package/dist/components/SignUp.vue.d.ts +7 -3
- package/dist/components/SignUp.vue.d.ts.map +1 -1
- package/dist/index.cjs +113 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,9 +40,13 @@ app.mount('#app')
|
|
|
40
40
|
### Componentes Disponíveis
|
|
41
41
|
|
|
42
42
|
#### Botões
|
|
43
|
-
- `SignInButton` - Botão de login
|
|
43
|
+
- `SignInButton` - Botão de login que abre modal
|
|
44
44
|
- `SignOutButton` - Botão de logout
|
|
45
|
-
- `SignUpButton` - Botão de cadastro
|
|
45
|
+
- `SignUpButton` - Botão de cadastro que abre modal
|
|
46
|
+
|
|
47
|
+
#### Formulários
|
|
48
|
+
- `SignIn` - Formulário de login completo com logo e rodapé
|
|
49
|
+
- `SignUp` - Formulário de cadastro completo com logo e rodapé
|
|
46
50
|
|
|
47
51
|
#### Layouts
|
|
48
52
|
- `SignedIn` - Wrapper para conteúdo visível apenas para usuários autenticados
|
|
@@ -50,11 +54,83 @@ app.mount('#app')
|
|
|
50
54
|
|
|
51
55
|
#### Outros
|
|
52
56
|
- `AuthSwitcher` - Alterna entre estados autenticado/não autenticado
|
|
53
|
-
- `SignIn` - Formulário de login completo
|
|
54
|
-
- `SignUp` - Formulário de cadastro completo
|
|
55
57
|
- `UserProfile` - Perfil do usuário
|
|
56
58
|
- `Notification` - Sistema de notificações
|
|
57
59
|
|
|
60
|
+
### Exemplos de Uso
|
|
61
|
+
|
|
62
|
+
#### Usando Botões com Modal (Mais Simples)
|
|
63
|
+
|
|
64
|
+
Os botões abrem modais com os formulários e permitem alternância automática entre login/cadastro:
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
<template>
|
|
68
|
+
<SignInButton redirect="/dashboard" signUpLink="/cadastro" />
|
|
69
|
+
<SignUpButton redirect="/onboarding" signInLink="/login" />
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script setup>
|
|
73
|
+
import { SignInButton, SignUpButton } from '@autenticar-me/vue'
|
|
74
|
+
</script>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Comportamento:**
|
|
78
|
+
- **SignInButton**: Abre modal com formulário de login. Se usuário clicar em "Cadastre aqui", alterna para formulário de cadastro dentro do modal (ou navega para `signUpLink` se fornecido)
|
|
79
|
+
- **SignUpButton**: Abre modal com formulário de cadastro. Se usuário clicar em "Já tem uma conta?", alterna para formulário de login dentro do modal (ou navega para `signInLink` se fornecido)
|
|
80
|
+
- Após autenticação bem-sucedida, fecha o modal e redireciona para a rota especificada em `redirect`
|
|
81
|
+
|
|
82
|
+
#### Usando Formulários com Redirecionamento e Navegação
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<template>
|
|
86
|
+
<div class="login-page">
|
|
87
|
+
<h1>Faça login</h1>
|
|
88
|
+
<SignIn redirect="/dashboard" signUpLink="/cadastro" />
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<script setup>
|
|
93
|
+
import { SignIn } from '@autenticar-me/vue'
|
|
94
|
+
</script>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<template>
|
|
99
|
+
<div class="signup-page">
|
|
100
|
+
<h1>Criar conta</h1>
|
|
101
|
+
<SignUp redirect="/onboarding" signInLink="/login" />
|
|
102
|
+
</div>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script setup>
|
|
106
|
+
import { SignUp } from '@autenticar-me/vue'
|
|
107
|
+
</script>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Props disponíveis:**
|
|
111
|
+
- `redirect` - Rota para redirecionar após login/cadastro bem-sucedido
|
|
112
|
+
- `signUpLink` (SignIn) - Rota para a página de cadastro (ao clicar em "Cadastre aqui")
|
|
113
|
+
- `signInLink` (SignUp) - Rota para a página de login (ao clicar em "Já tem uma conta?")
|
|
114
|
+
|
|
115
|
+
#### Redirecionamento Customizado
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<template>
|
|
119
|
+
<SignIn @completed="handleLogin" />
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<script setup>
|
|
123
|
+
import { SignIn } from '@autenticar-me/vue'
|
|
124
|
+
import { useRouter } from 'vue-router'
|
|
125
|
+
|
|
126
|
+
const router = useRouter()
|
|
127
|
+
|
|
128
|
+
const handleLogin = () => {
|
|
129
|
+
router.push('/minha-rota')
|
|
130
|
+
}
|
|
131
|
+
</script>
|
|
132
|
+
```
|
|
133
|
+
|
|
58
134
|
## Tipos
|
|
59
135
|
|
|
60
136
|
O pacote exporta tipos TypeScript para:
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signUpLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
2
6
|
export default _default;
|
|
3
7
|
//# sourceMappingURL=SignInButton.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Buttons/SignInButton.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SignInButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Buttons/SignInButton.vue"],"names":[],"mappings":"AA0GA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;AAsHD,wBAMG"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signInLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
2
6
|
export default _default;
|
|
3
7
|
//# sourceMappingURL=SignUpButton.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Buttons/SignUpButton.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SignUpButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Buttons/SignUpButton.vue"],"names":[],"mappings":"AAgFA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;AAyFD,wBAMG"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signUpLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
6
|
close: (...args: any[]) => void;
|
|
3
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
4
8
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
9
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
10
|
export default _default;
|
|
7
11
|
//# sourceMappingURL=SignInModal.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modals/SignInModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignInModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modals/SignInModal.vue"],"names":[],"mappings":"AA0EA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;;;;;AAmKD,wBAQG"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signInLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
6
|
close: (...args: any[]) => void;
|
|
3
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
4
8
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
9
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
10
|
export default _default;
|
|
7
11
|
//# sourceMappingURL=SignUpModal.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modals/SignUpModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignUpModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modals/SignUpModal.vue"],"names":[],"mappings":"AAoFA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;;;;;AAuLD,wBAQG"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signUpLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
6
|
completed: (...args: any[]) => void;
|
|
3
7
|
"sign-up": (...args: any[]) => void;
|
|
4
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
5
9
|
onCompleted?: ((...args: any[]) => any) | undefined;
|
|
6
10
|
"onSign-up"?: ((...args: any[]) => any) | undefined;
|
|
7
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
8
12
|
emailInput: HTMLInputElement;
|
|
9
13
|
passwordInput: HTMLInputElement;
|
|
10
14
|
}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.vue.d.ts","sourceRoot":"","sources":["../../src/components/SignIn.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignIn.vue.d.ts","sourceRoot":"","sources":["../../src/components/SignIn.vue"],"names":[],"mappings":"AAs1BA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;;;;;;;;;;AA4lBD,wBAQG"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
redirect?: string;
|
|
3
|
+
signInLink?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
2
6
|
completed: () => any;
|
|
3
7
|
"sign-in": () => any;
|
|
4
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
5
9
|
onCompleted?: (() => any) | undefined;
|
|
6
10
|
"onSign-in"?: (() => any) | undefined;
|
|
7
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
8
12
|
firstNameInput: HTMLInputElement;
|
|
9
13
|
emailInput: HTMLInputElement;
|
|
10
14
|
}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUp.vue.d.ts","sourceRoot":"","sources":["../../src/components/SignUp.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignUp.vue.d.ts","sourceRoot":"","sources":["../../src/components/SignUp.vue"],"names":[],"mappings":"AAgrBA,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;;;;;;;;;;;AAgfD,wBAQG"}
|