@indobaseinc/auth-ui-svelte 1.0.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 +24 -0
- package/dist/Auth/Auth.svelte +121 -0
- package/dist/Auth/Auth.svelte.d.ts +43 -0
- package/dist/Auth/Icons.svelte +322 -0
- package/dist/Auth/Icons.svelte.d.ts +17 -0
- package/dist/Auth/index.d.ts +2 -0
- package/dist/Auth/index.js +2 -0
- package/dist/Auth/interfaces/EmailAuth.svelte +165 -0
- package/dist/Auth/interfaces/EmailAuth.svelte.d.ts +33 -0
- package/dist/Auth/interfaces/ForgottenPassword.svelte +81 -0
- package/dist/Auth/interfaces/ForgottenPassword.svelte.d.ts +25 -0
- package/dist/Auth/interfaces/MagicLink.svelte +84 -0
- package/dist/Auth/interfaces/MagicLink.svelte.d.ts +25 -0
- package/dist/Auth/interfaces/SocialAuth.svelte +68 -0
- package/dist/Auth/interfaces/SocialAuth.svelte.d.ts +30 -0
- package/dist/Auth/interfaces/UpdatePassword.svelte +90 -0
- package/dist/Auth/interfaces/UpdatePassword.svelte.d.ts +24 -0
- package/dist/Auth/interfaces/VerifyOtp.svelte +117 -0
- package/dist/Auth/interfaces/VerifyOtp.svelte.d.ts +27 -0
- package/dist/Auth/interfaces/index.d.ts +6 -0
- package/dist/Auth/interfaces/index.js +6 -0
- package/dist/Auth/ui/ForgottenPassword.svelte +18 -0
- package/dist/Auth/ui/ForgottenPassword.svelte.d.ts +26 -0
- package/dist/Auth/ui/MagicLink.svelte +26 -0
- package/dist/Auth/ui/MagicLink.svelte.d.ts +32 -0
- package/dist/Auth/ui/SignIn.svelte +29 -0
- package/dist/Auth/ui/SignIn.svelte.d.ts +34 -0
- package/dist/Auth/ui/SignUp.svelte +35 -0
- package/dist/Auth/ui/SignUp.svelte.d.ts +40 -0
- package/dist/Auth/ui/SocialAuth.svelte +26 -0
- package/dist/Auth/ui/SocialAuth.svelte.d.ts +32 -0
- package/dist/Auth/ui/UpdatePassword.svelte +20 -0
- package/dist/Auth/ui/UpdatePassword.svelte.d.ts +27 -0
- package/dist/Auth/ui/VerifyOtp.svelte +18 -0
- package/dist/Auth/ui/VerifyOtp.svelte.d.ts +25 -0
- package/dist/Auth/ui/index.d.ts +7 -0
- package/dist/Auth/ui/index.js +7 -0
- package/dist/UI/Anchor.svelte +22 -0
- package/dist/UI/Anchor.svelte.d.ts +22 -0
- package/dist/UI/Button.svelte +47 -0
- package/dist/UI/Button.svelte.d.ts +23 -0
- package/dist/UI/Container.svelte +41 -0
- package/dist/UI/Container.svelte.d.ts +16 -0
- package/dist/UI/Divider.svelte +16 -0
- package/dist/UI/Divider.svelte.d.ts +16 -0
- package/dist/UI/Input.svelte +49 -0
- package/dist/UI/Input.svelte.d.ts +14 -0
- package/dist/UI/Label.svelte +16 -0
- package/dist/UI/Label.svelte.d.ts +16 -0
- package/dist/UI/Loader.svelte +30 -0
- package/dist/UI/Loader.svelte.d.ts +14 -0
- package/dist/UI/Message.svelte +34 -0
- package/dist/UI/Message.svelte.d.ts +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.js +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script>import Anchor from '../../UI/Anchor.svelte';
|
|
2
|
+
import Button from '../../UI/Button.svelte';
|
|
3
|
+
import Container from '../../UI/Container.svelte';
|
|
4
|
+
import Input from '../../UI/Input.svelte';
|
|
5
|
+
import Label from '../../UI/Label.svelte';
|
|
6
|
+
import Message from '../../UI/Message.svelte';
|
|
7
|
+
import { VIEWS } from '@indobaseinc/auth-ui-shared';
|
|
8
|
+
export let i18n;
|
|
9
|
+
export let supabaseClient;
|
|
10
|
+
export let authView;
|
|
11
|
+
export let otpType = 'email';
|
|
12
|
+
export let appearance;
|
|
13
|
+
export let showLinks = false;
|
|
14
|
+
export let email = '';
|
|
15
|
+
export let phone = '';
|
|
16
|
+
export let token = '';
|
|
17
|
+
let message = '';
|
|
18
|
+
let error = '';
|
|
19
|
+
let loading = false;
|
|
20
|
+
async function handleSubmit() {
|
|
21
|
+
loading = true;
|
|
22
|
+
error = '';
|
|
23
|
+
message = '';
|
|
24
|
+
let verifyOpts = {
|
|
25
|
+
email,
|
|
26
|
+
token,
|
|
27
|
+
type: otpType
|
|
28
|
+
};
|
|
29
|
+
if (['sms', 'phone_change'].includes(otpType)) {
|
|
30
|
+
verifyOpts = {
|
|
31
|
+
phone,
|
|
32
|
+
token,
|
|
33
|
+
type: otpType
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const { error: err } = await supabaseClient.auth.verifyOtp(verifyOpts);
|
|
37
|
+
if (err)
|
|
38
|
+
error = err.message;
|
|
39
|
+
loading = false;
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<form id="auth-magic-link" method="post" on:submit|preventDefault={handleSubmit}>
|
|
44
|
+
<Container direction="vertical" gap="large" {appearance}>
|
|
45
|
+
{#if ['sms', 'phone_change'].includes(otpType)}
|
|
46
|
+
<div>
|
|
47
|
+
<Label for="phone" {appearance}>{i18n?.verify_otp?.phone_input_label}</Label>
|
|
48
|
+
<Input
|
|
49
|
+
id="phone"
|
|
50
|
+
type="text"
|
|
51
|
+
name="phone"
|
|
52
|
+
autofocus
|
|
53
|
+
placeholder={i18n?.verify_otp?.phone_input_placeholder}
|
|
54
|
+
bind:value={phone}
|
|
55
|
+
autocomplete="phone"
|
|
56
|
+
{appearance}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
{:else}
|
|
60
|
+
<div>
|
|
61
|
+
<Label for="email" {appearance}>{i18n?.verify_otp?.email_input_label}</Label>
|
|
62
|
+
<Input
|
|
63
|
+
id="email"
|
|
64
|
+
type="email"
|
|
65
|
+
name="email"
|
|
66
|
+
autofocus
|
|
67
|
+
placeholder={i18n?.verify_otp?.email_input_placeholder}
|
|
68
|
+
bind:value={email}
|
|
69
|
+
autocomplete="email"
|
|
70
|
+
{appearance}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
<div>
|
|
75
|
+
<Label for="token" {appearance}>{i18n?.verify_otp?.token_input_label}</Label>
|
|
76
|
+
<Input
|
|
77
|
+
id="token"
|
|
78
|
+
type="text"
|
|
79
|
+
name="token"
|
|
80
|
+
placeholder={i18n?.verify_otp?.token_input_placeholder}
|
|
81
|
+
bind:value={token}
|
|
82
|
+
autocomplete="token"
|
|
83
|
+
{appearance}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
<Button type="submit" color="primary" {loading} {appearance}>
|
|
87
|
+
{loading ? i18n?.verify_otp?.loading_button_label : i18n?.verify_otp?.button_label}
|
|
88
|
+
</Button>
|
|
89
|
+
|
|
90
|
+
{#if showLinks}
|
|
91
|
+
<Anchor
|
|
92
|
+
on:click={(e) => {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
authView = VIEWS.SIGN_IN;
|
|
95
|
+
}}
|
|
96
|
+
href="#auth-sign-in"
|
|
97
|
+
{appearance}>{i18n?.sign_in?.link_text}</Anchor
|
|
98
|
+
>
|
|
99
|
+
{/if}
|
|
100
|
+
{#if message}
|
|
101
|
+
<Message {appearance}>
|
|
102
|
+
{message}
|
|
103
|
+
</Message>
|
|
104
|
+
{/if}
|
|
105
|
+
{#if error}
|
|
106
|
+
<Message color="danger" {appearance}>
|
|
107
|
+
{error}
|
|
108
|
+
</Message>
|
|
109
|
+
{/if}
|
|
110
|
+
</Container>
|
|
111
|
+
</form>
|
|
112
|
+
|
|
113
|
+
<style>
|
|
114
|
+
form {
|
|
115
|
+
width: 100%;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
3
|
+
import { type I18nVariables, type ViewType, type OtpType } from '@indobaseinc/auth-ui-shared';
|
|
4
|
+
import type { Appearance } from '../../types';
|
|
5
|
+
declare const __propDef: {
|
|
6
|
+
props: {
|
|
7
|
+
i18n: I18nVariables;
|
|
8
|
+
supabaseClient: IndobaseClient;
|
|
9
|
+
authView: ViewType;
|
|
10
|
+
otpType?: OtpType | undefined;
|
|
11
|
+
appearance: Appearance;
|
|
12
|
+
showLinks?: boolean | undefined;
|
|
13
|
+
email?: string | undefined;
|
|
14
|
+
phone?: string | undefined;
|
|
15
|
+
token?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export type VerifyOtpProps = typeof __propDef.props;
|
|
23
|
+
export type VerifyOtpEvents = typeof __propDef.events;
|
|
24
|
+
export type VerifyOtpSlots = typeof __propDef.slots;
|
|
25
|
+
export default class VerifyOtp extends SvelteComponentTyped<VerifyOtpProps, VerifyOtpEvents, VerifyOtpSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EmailAuth } from './EmailAuth.svelte';
|
|
2
|
+
export { default as ForgottenPassword } from './ForgottenPassword.svelte';
|
|
3
|
+
export { default as MagicLink } from './MagicLink.svelte';
|
|
4
|
+
export { default as SocialAuth } from './SocialAuth.svelte';
|
|
5
|
+
export { default as UpdatePassword } from './UpdatePassword.svelte';
|
|
6
|
+
export { default as VerifyOtp } from './VerifyOtp.svelte';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EmailAuth } from './EmailAuth.svelte';
|
|
2
|
+
export { default as ForgottenPassword } from './ForgottenPassword.svelte';
|
|
3
|
+
export { default as MagicLink } from './MagicLink.svelte';
|
|
4
|
+
export { default as SocialAuth } from './SocialAuth.svelte';
|
|
5
|
+
export { default as UpdatePassword } from './UpdatePassword.svelte';
|
|
6
|
+
export { default as VerifyOtp } from './VerifyOtp.svelte';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let redirectTo = undefined;
|
|
4
|
+
export let showLinks = false;
|
|
5
|
+
export let appearance = {};
|
|
6
|
+
export let theme = 'default';
|
|
7
|
+
export let localization = {};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<Auth
|
|
11
|
+
view="forgotten_password"
|
|
12
|
+
{showLinks}
|
|
13
|
+
{supabaseClient}
|
|
14
|
+
{redirectTo}
|
|
15
|
+
{appearance}
|
|
16
|
+
{theme}
|
|
17
|
+
{localization}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
3
|
+
import type { I18nVariables } from '@indobaseinc/auth-ui-shared';
|
|
4
|
+
import type { Appearance } from '../../types';
|
|
5
|
+
declare const __propDef: {
|
|
6
|
+
props: {
|
|
7
|
+
supabaseClient: IndobaseClient;
|
|
8
|
+
redirectTo?: string | undefined;
|
|
9
|
+
showLinks?: boolean | undefined;
|
|
10
|
+
appearance?: Appearance | undefined;
|
|
11
|
+
theme?: string | undefined;
|
|
12
|
+
localization?: {
|
|
13
|
+
variables?: I18nVariables | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type ForgottenPasswordProps = typeof __propDef.props;
|
|
22
|
+
export type ForgottenPasswordEvents = typeof __propDef.events;
|
|
23
|
+
export type ForgottenPasswordSlots = typeof __propDef.slots;
|
|
24
|
+
export default class ForgottenPassword extends SvelteComponentTyped<ForgottenPasswordProps, ForgottenPasswordEvents, ForgottenPasswordSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let socialLayout = 'vertical';
|
|
4
|
+
export let providers = [];
|
|
5
|
+
export let providerScopes = undefined;
|
|
6
|
+
export let queryParams = undefined;
|
|
7
|
+
export let redirectTo = undefined;
|
|
8
|
+
export let appearance = {};
|
|
9
|
+
export let theme = 'default';
|
|
10
|
+
export let localization = {};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Auth
|
|
14
|
+
{supabaseClient}
|
|
15
|
+
showLinks={false}
|
|
16
|
+
magicLink={false}
|
|
17
|
+
{redirectTo}
|
|
18
|
+
view="magic_link"
|
|
19
|
+
{socialLayout}
|
|
20
|
+
{providers}
|
|
21
|
+
{providerScopes}
|
|
22
|
+
{queryParams}
|
|
23
|
+
{appearance}
|
|
24
|
+
{theme}
|
|
25
|
+
{localization}
|
|
26
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Provider } from '@indobaseinc/auth-js';
|
|
3
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
4
|
+
import type { I18nVariables, ProviderScopes } from '@indobaseinc/auth-ui-shared';
|
|
5
|
+
import type { Appearance } from '../../types';
|
|
6
|
+
declare const __propDef: {
|
|
7
|
+
props: {
|
|
8
|
+
supabaseClient: IndobaseClient;
|
|
9
|
+
socialLayout?: "horizontal" | "vertical" | undefined;
|
|
10
|
+
providers?: Provider[] | undefined;
|
|
11
|
+
providerScopes?: Partial<ProviderScopes> | undefined;
|
|
12
|
+
queryParams?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
redirectTo?: string | undefined;
|
|
16
|
+
appearance?: Appearance | undefined;
|
|
17
|
+
theme?: string | undefined;
|
|
18
|
+
localization?: {
|
|
19
|
+
variables?: I18nVariables | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {};
|
|
26
|
+
};
|
|
27
|
+
export type MagicLinkProps = typeof __propDef.props;
|
|
28
|
+
export type MagicLinkEvents = typeof __propDef.events;
|
|
29
|
+
export type MagicLinkSlots = typeof __propDef.slots;
|
|
30
|
+
export default class MagicLink extends SvelteComponentTyped<MagicLinkProps, MagicLinkEvents, MagicLinkSlots> {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let socialLayout = 'vertical';
|
|
4
|
+
export let providers = [];
|
|
5
|
+
export let providerScopes = undefined;
|
|
6
|
+
export let queryParams = undefined;
|
|
7
|
+
export let redirectTo = undefined;
|
|
8
|
+
export let magicLink = false;
|
|
9
|
+
export let showLinks = false;
|
|
10
|
+
export let appearance = {};
|
|
11
|
+
export let theme = 'default';
|
|
12
|
+
export let localization = {};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Auth
|
|
16
|
+
view="sign_in"
|
|
17
|
+
onlyThirdPartyProviders={false}
|
|
18
|
+
{supabaseClient}
|
|
19
|
+
{showLinks}
|
|
20
|
+
{redirectTo}
|
|
21
|
+
{socialLayout}
|
|
22
|
+
{providers}
|
|
23
|
+
{providerScopes}
|
|
24
|
+
{queryParams}
|
|
25
|
+
{magicLink}
|
|
26
|
+
{appearance}
|
|
27
|
+
{theme}
|
|
28
|
+
{localization}
|
|
29
|
+
/>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Provider } from '@indobaseinc/auth-js';
|
|
3
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
4
|
+
import type { I18nVariables, ProviderScopes } from '@indobaseinc/auth-ui-shared';
|
|
5
|
+
import type { Appearance } from '../../types';
|
|
6
|
+
declare const __propDef: {
|
|
7
|
+
props: {
|
|
8
|
+
supabaseClient: IndobaseClient;
|
|
9
|
+
socialLayout?: "horizontal" | "vertical" | undefined;
|
|
10
|
+
providers?: Provider[] | undefined;
|
|
11
|
+
providerScopes?: Partial<ProviderScopes> | undefined;
|
|
12
|
+
queryParams?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
redirectTo?: string | undefined;
|
|
16
|
+
magicLink?: boolean | undefined;
|
|
17
|
+
showLinks?: boolean | undefined;
|
|
18
|
+
appearance?: Appearance | undefined;
|
|
19
|
+
theme?: string | undefined;
|
|
20
|
+
localization?: {
|
|
21
|
+
variables?: I18nVariables | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {};
|
|
28
|
+
};
|
|
29
|
+
export type SignInProps = typeof __propDef.props;
|
|
30
|
+
export type SignInEvents = typeof __propDef.events;
|
|
31
|
+
export type SignInSlots = typeof __propDef.slots;
|
|
32
|
+
export default class SignIn extends SvelteComponentTyped<SignInProps, SignInEvents, SignInSlots> {
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let socialLayout = 'vertical';
|
|
4
|
+
export let providers = [];
|
|
5
|
+
export let providerScopes = undefined;
|
|
6
|
+
export let queryParams = undefined;
|
|
7
|
+
export let redirectTo = undefined;
|
|
8
|
+
export let magicLink = false;
|
|
9
|
+
export let showLinks = false;
|
|
10
|
+
export let appearance = {};
|
|
11
|
+
export let theme = 'default';
|
|
12
|
+
export let localization = {};
|
|
13
|
+
export let passwordLimit = false;
|
|
14
|
+
export let additionalData = undefined;
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Auth
|
|
18
|
+
view="sign_up"
|
|
19
|
+
onlyThirdPartyProviders={false}
|
|
20
|
+
{supabaseClient}
|
|
21
|
+
{showLinks}
|
|
22
|
+
{redirectTo}
|
|
23
|
+
{socialLayout}
|
|
24
|
+
{providers}
|
|
25
|
+
{providerScopes}
|
|
26
|
+
{queryParams}
|
|
27
|
+
{magicLink}
|
|
28
|
+
{appearance}
|
|
29
|
+
{theme}
|
|
30
|
+
{localization}
|
|
31
|
+
{passwordLimit}
|
|
32
|
+
{additionalData}
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</Auth>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Provider } from '@indobaseinc/auth-js';
|
|
3
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
4
|
+
import type { I18nVariables, ProviderScopes } from '@indobaseinc/auth-ui-shared';
|
|
5
|
+
import type { Appearance } from '../../types';
|
|
6
|
+
declare const __propDef: {
|
|
7
|
+
props: {
|
|
8
|
+
supabaseClient: IndobaseClient;
|
|
9
|
+
socialLayout?: "horizontal" | "vertical" | undefined;
|
|
10
|
+
providers?: Provider[] | undefined;
|
|
11
|
+
providerScopes?: Partial<ProviderScopes> | undefined;
|
|
12
|
+
queryParams?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
redirectTo?: string | undefined;
|
|
16
|
+
magicLink?: boolean | undefined;
|
|
17
|
+
showLinks?: boolean | undefined;
|
|
18
|
+
appearance?: Appearance | undefined;
|
|
19
|
+
theme?: string | undefined;
|
|
20
|
+
localization?: {
|
|
21
|
+
variables?: I18nVariables | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
passwordLimit?: boolean | undefined;
|
|
24
|
+
additionalData?: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
} | undefined;
|
|
27
|
+
};
|
|
28
|
+
events: {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {
|
|
32
|
+
default: {};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type SignUpProps = typeof __propDef.props;
|
|
36
|
+
export type SignUpEvents = typeof __propDef.events;
|
|
37
|
+
export type SignUpSlots = typeof __propDef.slots;
|
|
38
|
+
export default class SignUp extends SvelteComponentTyped<SignUpProps, SignUpEvents, SignUpSlots> {
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let socialLayout = 'vertical';
|
|
4
|
+
export let providers = [];
|
|
5
|
+
export let providerScopes = undefined;
|
|
6
|
+
export let queryParams = undefined;
|
|
7
|
+
export let redirectTo = undefined;
|
|
8
|
+
export let appearance = {};
|
|
9
|
+
export let theme = 'default';
|
|
10
|
+
export let localization = {};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Auth
|
|
14
|
+
view="sign_in"
|
|
15
|
+
showLinks={false}
|
|
16
|
+
onlyThirdPartyProviders={true}
|
|
17
|
+
{supabaseClient}
|
|
18
|
+
{redirectTo}
|
|
19
|
+
{socialLayout}
|
|
20
|
+
{providers}
|
|
21
|
+
{providerScopes}
|
|
22
|
+
{queryParams}
|
|
23
|
+
{appearance}
|
|
24
|
+
{theme}
|
|
25
|
+
{localization}
|
|
26
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Provider } from '@indobaseinc/auth-js';
|
|
3
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
4
|
+
import type { I18nVariables, ProviderScopes } from '@indobaseinc/auth-ui-shared';
|
|
5
|
+
import type { Appearance } from '../../types';
|
|
6
|
+
declare const __propDef: {
|
|
7
|
+
props: {
|
|
8
|
+
supabaseClient: IndobaseClient;
|
|
9
|
+
socialLayout?: "horizontal" | "vertical" | undefined;
|
|
10
|
+
providers?: Provider[] | undefined;
|
|
11
|
+
providerScopes?: Partial<ProviderScopes> | undefined;
|
|
12
|
+
queryParams?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
redirectTo?: string | undefined;
|
|
16
|
+
appearance?: Appearance | undefined;
|
|
17
|
+
theme?: string | undefined;
|
|
18
|
+
localization?: {
|
|
19
|
+
variables?: I18nVariables | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {};
|
|
26
|
+
};
|
|
27
|
+
export type SocialAuthProps = typeof __propDef.props;
|
|
28
|
+
export type SocialAuthEvents = typeof __propDef.events;
|
|
29
|
+
export type SocialAuthSlots = typeof __propDef.slots;
|
|
30
|
+
export default class SocialAuth extends SvelteComponentTyped<SocialAuthProps, SocialAuthEvents, SocialAuthSlots> {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let redirectTo = undefined;
|
|
4
|
+
export let showLinks = false;
|
|
5
|
+
export let appearance = {};
|
|
6
|
+
export let theme = 'default';
|
|
7
|
+
export let passwordLimit = false;
|
|
8
|
+
export let localization = {};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Auth
|
|
12
|
+
view="update_password"
|
|
13
|
+
{showLinks}
|
|
14
|
+
{supabaseClient}
|
|
15
|
+
{redirectTo}
|
|
16
|
+
{appearance}
|
|
17
|
+
{theme}
|
|
18
|
+
{passwordLimit}
|
|
19
|
+
{localization}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
3
|
+
import type { I18nVariables } from '@indobaseinc/auth-ui-shared';
|
|
4
|
+
import type { Appearance } from '../../types';
|
|
5
|
+
declare const __propDef: {
|
|
6
|
+
props: {
|
|
7
|
+
supabaseClient: IndobaseClient;
|
|
8
|
+
redirectTo?: string | undefined;
|
|
9
|
+
showLinks?: boolean | undefined;
|
|
10
|
+
appearance?: Appearance | undefined;
|
|
11
|
+
theme?: string | undefined;
|
|
12
|
+
passwordLimit?: boolean | undefined;
|
|
13
|
+
localization?: {
|
|
14
|
+
variables?: I18nVariables | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export type UpdatePasswordProps = typeof __propDef.props;
|
|
23
|
+
export type UpdatePasswordEvents = typeof __propDef.events;
|
|
24
|
+
export type UpdatePasswordSlots = typeof __propDef.slots;
|
|
25
|
+
export default class UpdatePassword extends SvelteComponentTyped<UpdatePasswordProps, UpdatePasswordEvents, UpdatePasswordSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import Auth from '../Auth.svelte';
|
|
2
|
+
export let supabaseClient;
|
|
3
|
+
export let otpType = 'email';
|
|
4
|
+
export let appearance = {};
|
|
5
|
+
export let theme = 'default';
|
|
6
|
+
export let localization = {};
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Auth
|
|
10
|
+
{supabaseClient}
|
|
11
|
+
showLinks={false}
|
|
12
|
+
magicLink={false}
|
|
13
|
+
view="verify_otp"
|
|
14
|
+
{otpType}
|
|
15
|
+
{appearance}
|
|
16
|
+
{theme}
|
|
17
|
+
{localization}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
3
|
+
import type { I18nVariables, OtpType } from '@indobaseinc/auth-ui-shared';
|
|
4
|
+
import type { Appearance } from '../../types';
|
|
5
|
+
declare const __propDef: {
|
|
6
|
+
props: {
|
|
7
|
+
supabaseClient: IndobaseClient;
|
|
8
|
+
otpType?: OtpType | undefined;
|
|
9
|
+
appearance?: Appearance | undefined;
|
|
10
|
+
theme?: string | undefined;
|
|
11
|
+
localization?: {
|
|
12
|
+
variables?: I18nVariables | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export type VerifyOtpProps = typeof __propDef.props;
|
|
21
|
+
export type VerifyOtpEvents = typeof __propDef.events;
|
|
22
|
+
export type VerifyOtpSlots = typeof __propDef.slots;
|
|
23
|
+
export default class VerifyOtp extends SvelteComponentTyped<VerifyOtpProps, VerifyOtpEvents, VerifyOtpSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as SignUp } from './SignUp.svelte';
|
|
2
|
+
export { default as SignIn } from './SignIn.svelte';
|
|
3
|
+
export { default as MagicLink } from './MagicLink.svelte';
|
|
4
|
+
export { default as SocialAuth } from './SocialAuth.svelte';
|
|
5
|
+
export { default as ForgottenPassword } from './ForgottenPassword.svelte';
|
|
6
|
+
export { default as UpdatePassword } from './UpdatePassword.svelte';
|
|
7
|
+
export { default as VerifyOtp } from './VerifyOtp.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as SignUp } from './SignUp.svelte';
|
|
2
|
+
export { default as SignIn } from './SignIn.svelte';
|
|
3
|
+
export { default as MagicLink } from './MagicLink.svelte';
|
|
4
|
+
export { default as SocialAuth } from './SocialAuth.svelte';
|
|
5
|
+
export { default as ForgottenPassword } from './ForgottenPassword.svelte';
|
|
6
|
+
export { default as UpdatePassword } from './UpdatePassword.svelte';
|
|
7
|
+
export { default as VerifyOtp } from './VerifyOtp.svelte';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { css } from '@stitches/core';
|
|
2
|
+
import { generateClassNames } from '@indobaseinc/auth-ui-shared';
|
|
3
|
+
const anchorHTMLAttributes = css({
|
|
4
|
+
fontFamily: '$bodyFontFamily',
|
|
5
|
+
fontSize: '$baseBodySize',
|
|
6
|
+
marginBottom: '$anchorBottomMargin',
|
|
7
|
+
color: '$anchorTextColor',
|
|
8
|
+
display: 'block',
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
textDecoration: 'underline',
|
|
11
|
+
'&:hover': {
|
|
12
|
+
color: '$anchorTextHoverColor'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export let href;
|
|
16
|
+
export let appearance = {};
|
|
17
|
+
$: classNames = generateClassNames('anchor', anchorHTMLAttributes(), appearance);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<a on:click {href} {...$$restProps} style={appearance?.style?.anchor} class={classNames.join(' ')}>
|
|
21
|
+
<slot />
|
|
22
|
+
</a>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Appearance } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: Omit<svelte.JSX.HTMLAttributes<HTMLAnchorElement>, "href"> & {
|
|
5
|
+
href: string;
|
|
6
|
+
appearance?: Appearance | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
click: MouseEvent;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type AnchorProps_ = typeof __propDef.props;
|
|
18
|
+
export { AnchorProps_ as AnchorProps };
|
|
19
|
+
export type AnchorEvents = typeof __propDef.events;
|
|
20
|
+
export type AnchorSlots = typeof __propDef.slots;
|
|
21
|
+
export default class Anchor extends SvelteComponentTyped<AnchorProps_, AnchorEvents, AnchorSlots> {
|
|
22
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>import { generateClassNames } from '@indobaseinc/auth-ui-shared';
|
|
2
|
+
export let color = 'default';
|
|
3
|
+
export let appearance = {};
|
|
4
|
+
export let loading = false;
|
|
5
|
+
$: classNames = generateClassNames('button', color, appearance);
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<button on:click {...$$restProps} disabled={loading} style={appearance?.style?.button} class={classNames.join(' ')}>
|
|
9
|
+
<slot />
|
|
10
|
+
</button>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
button {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
border-radius: var(--radii-borderRadiusButton);
|
|
19
|
+
font-size: var(--fontSizes-baseButtonSize);
|
|
20
|
+
padding: var(--space-buttonPadding);
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
border-width: var(--borderWidths-buttonBorderWidth);
|
|
23
|
+
border-style: solid;
|
|
24
|
+
width: 100%;
|
|
25
|
+
transition-property: background-color;
|
|
26
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
27
|
+
transition-duration: 100ms;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button.default {
|
|
31
|
+
background-color: var(--colors-defaultButtonBackground);
|
|
32
|
+
color: var(--colors-defaultButtonText);
|
|
33
|
+
border-color: var(--colors-defaultButtonBorder);
|
|
34
|
+
}
|
|
35
|
+
button.default:hover {
|
|
36
|
+
background-color: var(--colors-defaultButtonBackgroundHover);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
button.primary {
|
|
40
|
+
background-color: var(--colors-brand);
|
|
41
|
+
color: var(--colors-brandButtonText);
|
|
42
|
+
border-color: var(--colors-brandAccent);
|
|
43
|
+
}
|
|
44
|
+
button.primary:hover {
|
|
45
|
+
background-color: var(--colors-brandAccent);
|
|
46
|
+
}
|
|
47
|
+
</style>
|