@tanglemedia/svelte-starter-auth-shadcn 0.0.2 → 0.1.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/dist/app.css +174 -0
- package/dist/app.html +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/components/types.d.ts +13 -0
- package/dist/lib/components/types.js +1 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-content-top.svelte +15 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-content-top.svelte.d.ts +8 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-content.svelte +15 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-content.svelte.d.ts +8 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-feature-info.svelte +45 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-feature-info.svelte.d.ts +12 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-feature.svelte +24 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-feature.svelte.d.ts +8 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-logo.svelte +99 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-logo.svelte.d.ts +63 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-main.svelte +17 -0
- package/dist/lib/components/ui/auth-layout/auth-layout-main.svelte.d.ts +8 -0
- package/dist/lib/components/ui/auth-layout/auth-layout.svelte +22 -82
- package/dist/lib/components/ui/auth-layout/auth-layout.svelte.d.ts +4 -11
- package/dist/lib/components/ui/auth-layout/index.d.ts +8 -2
- package/dist/lib/components/ui/auth-layout/index.js +10 -2
- package/dist/lib/components/ui/forgot-password/forgot-password-container.svelte +27 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-container.svelte.d.ts +8 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-form.svelte +70 -81
- package/dist/lib/components/ui/forgot-password/forgot-password-form.svelte.d.ts +12 -7
- package/dist/lib/components/ui/forgot-password/forgot-password-header.svelte +34 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-header.svelte.d.ts +13 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-login.svelte +19 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-login.svelte.d.ts +9 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-provider.svelte +13 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-provider.svelte.d.ts +25 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-submit.svelte +17 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-submit.svelte.d.ts +7 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-user-input.svelte +21 -0
- package/dist/lib/components/ui/forgot-password/forgot-password-user-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/forgot-password/forgot-password.schema.d.ts +5 -0
- package/dist/lib/components/ui/forgot-password/forgot-password.schema.js +4 -0
- package/dist/lib/components/ui/forgot-password/index.d.ts +9 -2
- package/dist/lib/components/ui/forgot-password/index.js +9 -2
- package/dist/lib/components/ui/index.d.ts +5 -0
- package/dist/lib/components/ui/index.js +6 -0
- package/dist/lib/components/ui/login-form/index.d.ts +11 -2
- package/dist/lib/components/ui/login-form/index.js +13 -2
- package/dist/lib/components/ui/login-form/login-container.svelte +27 -0
- package/dist/lib/components/ui/login-form/login-container.svelte.d.ts +8 -0
- package/dist/lib/components/ui/login-form/login-context.d.ts +2 -0
- package/dist/lib/components/ui/login-form/login-context.js +13 -0
- package/dist/lib/components/ui/login-form/login-forgot-password.svelte +19 -0
- package/dist/lib/components/ui/login-form/login-forgot-password.svelte.d.ts +9 -0
- package/dist/lib/components/ui/login-form/login-form.svelte +68 -111
- package/dist/lib/components/ui/login-form/login-form.svelte.d.ts +10 -7
- package/dist/lib/components/ui/login-form/login-header.svelte +34 -0
- package/dist/lib/components/ui/login-form/login-header.svelte.d.ts +13 -0
- package/dist/lib/components/ui/login-form/login-password-input.svelte +21 -0
- package/dist/lib/components/ui/login-form/login-password-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/login-form/login-provider.svelte +13 -0
- package/dist/lib/components/ui/login-form/login-provider.svelte.d.ts +25 -0
- package/dist/lib/components/ui/login-form/login-submit.svelte +17 -0
- package/dist/lib/components/ui/login-form/login-submit.svelte.d.ts +7 -0
- package/dist/lib/components/ui/login-form/login-user-input.svelte +21 -0
- package/dist/lib/components/ui/login-form/login-user-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/login-form/login.schema.d.ts +6 -0
- package/dist/lib/components/ui/login-form/login.schema.js +5 -0
- package/dist/lib/components/ui/register-form/index.d.ts +10 -2
- package/dist/lib/components/ui/register-form/index.js +10 -2
- package/dist/lib/components/ui/register-form/register-container.svelte +27 -0
- package/dist/lib/components/ui/register-form/register-container.svelte.d.ts +8 -0
- package/dist/lib/components/ui/register-form/register-form.svelte +67 -170
- package/dist/lib/components/ui/register-form/register-form.svelte.d.ts +10 -5
- package/dist/lib/components/ui/register-form/register-header.svelte +34 -0
- package/dist/lib/components/ui/register-form/register-header.svelte.d.ts +13 -0
- package/dist/lib/components/ui/register-form/register-name-input.svelte +21 -0
- package/dist/lib/components/ui/register-form/register-name-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/register-form/register-password-input.svelte +21 -0
- package/dist/lib/components/ui/register-form/register-password-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/register-form/register-provider.svelte +13 -0
- package/dist/lib/components/ui/register-form/register-provider.svelte.d.ts +25 -0
- package/dist/lib/components/ui/register-form/register-submit.svelte +17 -0
- package/dist/lib/components/ui/register-form/register-submit.svelte.d.ts +7 -0
- package/dist/lib/components/ui/register-form/register-user-input.svelte +21 -0
- package/dist/lib/components/ui/register-form/register-user-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/register-form/register.schema.d.ts +8 -0
- package/dist/lib/components/ui/register-form/register.schema.js +7 -0
- package/dist/lib/components/ui/reset-password/index.d.ts +8 -2
- package/dist/lib/components/ui/reset-password/index.js +8 -2
- package/dist/lib/components/ui/reset-password/reset-password-container.svelte +27 -0
- package/dist/lib/components/ui/reset-password/reset-password-container.svelte.d.ts +8 -0
- package/dist/lib/components/ui/reset-password/reset-password-form.svelte +91 -0
- package/dist/lib/components/ui/reset-password/reset-password-form.svelte.d.ts +20 -0
- package/dist/lib/components/ui/reset-password/reset-password-header.svelte +34 -0
- package/dist/lib/components/ui/reset-password/reset-password-header.svelte.d.ts +13 -0
- package/dist/lib/components/ui/reset-password/reset-password-password-input.svelte +21 -0
- package/dist/lib/components/ui/reset-password/reset-password-password-input.svelte.d.ts +26 -0
- package/dist/lib/components/ui/reset-password/reset-password-provider.svelte +13 -0
- package/dist/lib/components/ui/reset-password/reset-password-provider.svelte.d.ts +25 -0
- package/dist/lib/components/ui/reset-password/reset-password-submit.svelte +17 -0
- package/dist/lib/components/ui/reset-password/reset-password-submit.svelte.d.ts +7 -0
- package/dist/lib/components/ui/reset-password/reset-password.schema.d.ts +6 -0
- package/dist/lib/components/ui/reset-password/reset-password.schema.js +9 -0
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/index.js +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +3 -0
- package/dist/lib/utils.d.ts +10 -0
- package/package.json +40 -69
- package/src/app.css +174 -0
- package/src/app.html +0 -1
- package/src/index.ts +1 -0
- package/src/lib/components/types.ts +24 -0
- package/src/lib/components/ui/auth-layout/auth-layout-content-top.svelte +15 -0
- package/src/lib/components/ui/auth-layout/auth-layout-content.svelte +15 -0
- package/src/lib/components/ui/auth-layout/auth-layout-feature-info.svelte +45 -0
- package/src/lib/components/ui/auth-layout/auth-layout-feature.svelte +24 -0
- package/src/lib/components/ui/auth-layout/auth-layout-logo.svelte +99 -0
- package/src/lib/components/ui/auth-layout/auth-layout-main.svelte +17 -0
- package/src/lib/components/ui/auth-layout/auth-layout.svelte +22 -88
- package/src/lib/components/ui/auth-layout/index.ts +20 -2
- package/src/lib/components/ui/forgot-password/forgot-password-container.svelte +27 -0
- package/src/lib/components/ui/forgot-password/forgot-password-form.svelte +70 -81
- package/src/lib/components/ui/forgot-password/forgot-password-header.svelte +34 -0
- package/src/lib/components/ui/forgot-password/forgot-password-login.svelte +19 -0
- package/src/lib/components/ui/forgot-password/forgot-password-provider.svelte +13 -0
- package/src/lib/components/ui/forgot-password/forgot-password-submit.svelte +17 -0
- package/src/lib/components/ui/forgot-password/forgot-password-user-input.svelte +21 -0
- package/src/lib/components/ui/forgot-password/forgot-password.schema.ts +7 -0
- package/src/lib/components/ui/forgot-password/index.ts +19 -2
- package/src/lib/components/ui/index.ts +6 -0
- package/src/lib/components/ui/login-form/index.ts +26 -2
- package/src/lib/components/ui/login-form/login-container.svelte +27 -0
- package/src/lib/components/ui/login-form/login-context.ts +16 -0
- package/src/lib/components/ui/login-form/login-forgot-password.svelte +19 -0
- package/src/lib/components/ui/login-form/login-form.svelte +68 -111
- package/src/lib/components/ui/login-form/login-header.svelte +34 -0
- package/src/lib/components/ui/login-form/login-password-input.svelte +21 -0
- package/src/lib/components/ui/login-form/login-provider.svelte +13 -0
- package/src/lib/components/ui/login-form/login-submit.svelte +17 -0
- package/src/lib/components/ui/login-form/login-user-input.svelte +21 -0
- package/src/lib/components/ui/login-form/login.schema.ts +8 -0
- package/src/lib/components/ui/register-form/index.ts +21 -2
- package/src/lib/components/ui/register-form/register-container.svelte +27 -0
- package/src/lib/components/ui/register-form/register-form.svelte +67 -170
- package/src/lib/components/ui/register-form/register-header.svelte +34 -0
- package/src/lib/components/ui/register-form/register-name-input.svelte +21 -0
- package/src/lib/components/ui/register-form/register-password-input.svelte +21 -0
- package/src/lib/components/ui/register-form/register-provider.svelte +13 -0
- package/src/lib/components/ui/register-form/register-submit.svelte +17 -0
- package/src/lib/components/ui/register-form/register-user-input.svelte +21 -0
- package/src/lib/components/ui/register-form/register.schema.ts +10 -0
- package/src/lib/components/ui/reset-password/index.ts +17 -2
- package/src/lib/components/ui/reset-password/reset-password-container.svelte +27 -0
- package/src/lib/components/ui/reset-password/reset-password-form.svelte +91 -0
- package/src/lib/components/ui/reset-password/reset-password-header.svelte +34 -0
- package/src/lib/components/ui/reset-password/reset-password-password-input.svelte +21 -0
- package/src/lib/components/ui/reset-password/reset-password-provider.svelte +13 -0
- package/src/lib/components/ui/reset-password/reset-password-submit.svelte +17 -0
- package/src/lib/components/ui/reset-password/reset-password.schema.ts +12 -0
- package/src/lib/hooks/index.ts +1 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/utils.ts +8 -1
- package/dist/lib/components/ui/reset-password/reset-form.svelte +0 -120
- package/dist/lib/components/ui/reset-password/reset-form.svelte.d.ts +0 -16
- package/src/lib/components/ui/reset-password/reset-form.svelte +0 -120
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Root from "./auth-layout.svelte";
|
|
2
|
+
import Feature from "./auth-layout-feature.svelte";
|
|
3
|
+
import Info from "./auth-layout-feature-info.svelte";
|
|
4
|
+
import Content from './auth-layout-content.svelte';
|
|
5
|
+
import Main from './auth-layout-main.svelte';
|
|
6
|
+
import ContentTop from './auth-layout-content-top.svelte';
|
|
7
|
+
import Logo from './auth-layout-logo.svelte';
|
|
8
|
+
export { Root, Feature, Info, Content, ContentTop, Main, Logo, Root as AuthLayout, Feature as AuthLayoutFeature, Info as AuthLayoutFeatureInfo };
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Root from "./auth-layout.svelte";
|
|
2
|
+
import Feature from "./auth-layout-feature.svelte";
|
|
3
|
+
import Info from "./auth-layout-feature-info.svelte";
|
|
4
|
+
import Content from './auth-layout-content.svelte';
|
|
5
|
+
import Main from './auth-layout-main.svelte';
|
|
6
|
+
import ContentTop from './auth-layout-content-top.svelte';
|
|
7
|
+
import Logo from './auth-layout-logo.svelte';
|
|
8
|
+
export { Root, Feature, Info, Content, ContentTop, Main, Logo,
|
|
9
|
+
//
|
|
10
|
+
Root as AuthLayout, Feature as AuthLayoutFeature, Info as AuthLayoutFeatureInfo };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Card } from '@tanglemedia/svelte-starter-ui-shadcn';
|
|
3
|
+
import type { WithChild } from 'svelte-toolbelt';
|
|
4
|
+
import { cn } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
type ForgotPasswordContainerProps = Omit<WithChild, 'child'> & {
|
|
7
|
+
class?: string;
|
|
8
|
+
card?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
children,
|
|
13
|
+
class: cls,
|
|
14
|
+
card = true,
|
|
15
|
+
...rest
|
|
16
|
+
}: ForgotPasswordContainerProps = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#if !card}
|
|
20
|
+
<div class={cn('mx-auto max-w-sm', cls)} {...rest}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
23
|
+
{:else}
|
|
24
|
+
<Card.Root class={cn('mx-auto max-w-sm', cls)} {...rest}>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</Card.Root>
|
|
27
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WithChild } from 'svelte-toolbelt';
|
|
2
|
+
type ForgotPasswordContainerProps = Omit<WithChild, 'child'> & {
|
|
3
|
+
class?: string;
|
|
4
|
+
card?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const ForgotPasswordContainer: import("svelte").Component<ForgotPasswordContainerProps, {}, "">;
|
|
7
|
+
type ForgotPasswordContainer = ReturnType<typeof ForgotPasswordContainer>;
|
|
8
|
+
export default ForgotPasswordContainer;
|
|
@@ -1,102 +1,91 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { Card } from "@tanglemedia/svelte-starter-ui-shadcn";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import SuperDebug, {
|
|
5
|
+
defaults,
|
|
6
|
+
superForm,
|
|
7
|
+
type Infer,
|
|
8
|
+
type SuperForm,
|
|
9
|
+
type SuperValidated,
|
|
10
|
+
} from "sveltekit-superforms";
|
|
11
|
+
import { zod4 } from "sveltekit-superforms/adapters";
|
|
12
|
+
import ForgotPasswordContainer from "./forgot-password-container.svelte";
|
|
13
|
+
import ForgotPasswordUserInput from "./forgot-password-user-input.svelte";
|
|
14
|
+
import ForgotPasswordHeader from "./forgot-password-header.svelte";
|
|
15
|
+
import ForgotPasswordProvider from "./forgot-password-provider.svelte";
|
|
16
|
+
import ForgotPasswordSubmit from "./forgot-password-submit.svelte";
|
|
17
|
+
import ForgotPasswordLogin from "./forgot-password-login.svelte";
|
|
18
|
+
import { forgotPasswordSchema, type ForgotPasswordSchema } from "./forgot-password.schema.js";
|
|
19
|
+
import { ServerError } from "@tanglemedia/svelte-starter-form-shadcn";
|
|
8
20
|
|
|
9
21
|
interface Props {
|
|
10
|
-
superform
|
|
22
|
+
superform?: SuperForm<Infer<ForgotPasswordSchema>> | null;
|
|
11
23
|
card?: boolean;
|
|
12
|
-
cardClass?: string;
|
|
24
|
+
// cardClass?: string;
|
|
13
25
|
title?: string;
|
|
14
26
|
description?: string;
|
|
15
|
-
|
|
27
|
+
// forgotPassword?: boolean;
|
|
16
28
|
loginLink?: string;
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
register?: boolean;
|
|
30
|
+
registerLink?: string;
|
|
31
|
+
lead?: Snippet;
|
|
32
|
+
tail?: Snippet;
|
|
19
33
|
children?: Snippet;
|
|
34
|
+
form?: SuperValidated<Infer<ForgotPasswordSchema>>;
|
|
35
|
+
action?: string;
|
|
36
|
+
|
|
37
|
+
debug?: boolean;
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
let {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
let {
|
|
41
|
+
debug = false,
|
|
42
|
+
form,
|
|
43
|
+
superform: superforms = $bindable(null),
|
|
44
|
+
card = true,
|
|
45
|
+
title = "Forgot Password",
|
|
27
46
|
description = "Enter your email below to request a password reset",
|
|
28
|
-
|
|
47
|
+
// forgotPassword = true,
|
|
29
48
|
loginLink = "/login",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
register = true,
|
|
50
|
+
registerLink = "/register",
|
|
51
|
+
lead,
|
|
52
|
+
tail,
|
|
53
|
+
action = "?/forgot-password",
|
|
33
54
|
}: Props = $props();
|
|
34
55
|
|
|
35
|
-
|
|
56
|
+
superforms = superforms || superForm(form || defaults(zod4(forgotPasswordSchema)));
|
|
57
|
+
|
|
58
|
+
const { errors, message } = superforms;
|
|
36
59
|
</script>
|
|
37
60
|
|
|
38
|
-
{
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<Card.Title class="text-2xl">{title}</Card.Title>
|
|
42
|
-
<Card.Description>{description}</Card.Description>
|
|
43
|
-
</Card.Header>
|
|
61
|
+
<ForgotPasswordProvider {superforms} {action}>
|
|
62
|
+
<ForgotPasswordContainer {card}>
|
|
63
|
+
<ForgotPasswordHeader text={title} desc={description} />
|
|
44
64
|
<Card.Content>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<Input {...props} bind:value={$formData.email} type="email" required />
|
|
55
|
-
{/snippet}
|
|
56
|
-
</Form.Control>
|
|
57
|
-
<Form.FieldErrors />
|
|
58
|
-
</Form.Field>
|
|
59
|
-
{/if}
|
|
60
|
-
<Form.Button type="submit" class="w-full">Request Password</Form.Button>
|
|
61
|
-
{@render formTail?.()}
|
|
62
|
-
</form>
|
|
63
|
-
{#if login}
|
|
65
|
+
{@render lead?.()}
|
|
66
|
+
<ServerError class="mb-4" />
|
|
67
|
+
<ForgotPasswordUserInput name={"email"}>
|
|
68
|
+
{#snippet asideLabel()}
|
|
69
|
+
<ForgotPasswordLogin href={loginLink} />
|
|
70
|
+
{/snippet}
|
|
71
|
+
</ForgotPasswordUserInput>
|
|
72
|
+
<ForgotPasswordSubmit />
|
|
73
|
+
{#if register}
|
|
64
74
|
<div class="mt-4 text-center text-sm">
|
|
65
|
-
|
|
66
|
-
<a href={
|
|
75
|
+
Don't have an account?
|
|
76
|
+
<a href={registerLink} class="underline"> Sign up </a>
|
|
67
77
|
</div>
|
|
68
78
|
{/if}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{@render formHead?.()}
|
|
79
|
-
{#if children}
|
|
80
|
-
{@render children?.()}
|
|
81
|
-
{:else}
|
|
82
|
-
<Form.Field form={superform} name="email">
|
|
83
|
-
<Form.Control>
|
|
84
|
-
{#snippet children({ props })}
|
|
85
|
-
<Form.Label>Email</Form.Label>
|
|
86
|
-
<Input {...props} bind:value={$formData.email} type="email" required />
|
|
87
|
-
{/snippet}
|
|
88
|
-
</Form.Control>
|
|
89
|
-
<Form.FieldErrors />
|
|
90
|
-
</Form.Field>
|
|
79
|
+
{@render tail?.()}
|
|
80
|
+
|
|
81
|
+
{#if debug}
|
|
82
|
+
<div class="mb-6">
|
|
83
|
+
<h4>Errors</h4>
|
|
84
|
+
<SuperDebug data={errors} />
|
|
85
|
+
</div>
|
|
86
|
+
<h4>Message</h4>
|
|
87
|
+
<SuperDebug data={$message} />
|
|
91
88
|
{/if}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{#if login}
|
|
96
|
-
<div class="mt-4 text-center text-sm">
|
|
97
|
-
Remember your password?
|
|
98
|
-
<a href={loginLink} class="underline"> Sign in </a>
|
|
99
|
-
</div>
|
|
100
|
-
{/if}
|
|
101
|
-
</div>
|
|
102
|
-
{/if}
|
|
89
|
+
</Card.Content>
|
|
90
|
+
</ForgotPasswordContainer>
|
|
91
|
+
</ForgotPasswordProvider>
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import { type Infer, type SuperForm, type SuperValidated } from "sveltekit-superforms";
|
|
3
|
+
import { type ForgotPasswordSchema } from "./forgot-password.schema.js";
|
|
2
4
|
interface Props {
|
|
3
|
-
superform
|
|
5
|
+
superform?: SuperForm<Infer<ForgotPasswordSchema>> | null;
|
|
4
6
|
card?: boolean;
|
|
5
|
-
cardClass?: string;
|
|
6
7
|
title?: string;
|
|
7
8
|
description?: string;
|
|
8
|
-
login?: boolean;
|
|
9
9
|
loginLink?: string;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
register?: boolean;
|
|
11
|
+
registerLink?: string;
|
|
12
|
+
lead?: Snippet;
|
|
13
|
+
tail?: Snippet;
|
|
12
14
|
children?: Snippet;
|
|
15
|
+
form?: SuperValidated<Infer<ForgotPasswordSchema>>;
|
|
16
|
+
action?: string;
|
|
17
|
+
debug?: boolean;
|
|
13
18
|
}
|
|
14
|
-
declare const ForgotPasswordForm: import("svelte").Component<Props, {}, "">;
|
|
19
|
+
declare const ForgotPasswordForm: import("svelte").Component<Props, {}, "superform">;
|
|
15
20
|
type ForgotPasswordForm = ReturnType<typeof ForgotPasswordForm>;
|
|
16
21
|
export default ForgotPasswordForm;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Card } from '@tanglemedia/svelte-starter-ui-shadcn';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type LoginHeaderAttr = {
|
|
6
|
+
text?: string;
|
|
7
|
+
desc?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type LoginHeaderProps = LoginHeaderAttr & {
|
|
11
|
+
title?: Snippet<[LoginHeaderAttr]>;
|
|
12
|
+
description?: Snippet<[LoginHeaderAttr]>;
|
|
13
|
+
children?: Snippet<[LoginHeaderAttr]>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let { title, children, description, ...restProps }: LoginHeaderProps = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Card.Header>
|
|
20
|
+
<Card.Title class="text-2xl">
|
|
21
|
+
{#if title}
|
|
22
|
+
{@render title(restProps)}
|
|
23
|
+
{:else if children}
|
|
24
|
+
{@render children?.(restProps)}
|
|
25
|
+
{:else}
|
|
26
|
+
{restProps.text}
|
|
27
|
+
{/if}
|
|
28
|
+
</Card.Title>
|
|
29
|
+
{#if description}
|
|
30
|
+
<Card.Description>{@render description(restProps)}</Card.Description>
|
|
31
|
+
{:else if restProps.desc}
|
|
32
|
+
<Card.Description>{restProps.desc}</Card.Description>
|
|
33
|
+
{/if}
|
|
34
|
+
</Card.Header>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type LoginHeaderAttr = {
|
|
3
|
+
text?: string;
|
|
4
|
+
desc?: string;
|
|
5
|
+
};
|
|
6
|
+
type LoginHeaderProps = LoginHeaderAttr & {
|
|
7
|
+
title?: Snippet<[LoginHeaderAttr]>;
|
|
8
|
+
description?: Snippet<[LoginHeaderAttr]>;
|
|
9
|
+
children?: Snippet<[LoginHeaderAttr]>;
|
|
10
|
+
};
|
|
11
|
+
declare const ForgotPasswordHeader: import("svelte").Component<LoginHeaderProps, {}, "">;
|
|
12
|
+
type ForgotPasswordHeader = ReturnType<typeof ForgotPasswordHeader>;
|
|
13
|
+
export default ForgotPasswordHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
type LoginForgotPasswordProps = {
|
|
6
|
+
href: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
const { href, class: cls, children }: LoginForgotPasswordProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<a {href} class={cn("ml-auto inline-block text-sm underline", cls)}>
|
|
14
|
+
{#if children}
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
{:else}
|
|
17
|
+
Back to login
|
|
18
|
+
{/if}
|
|
19
|
+
</a>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type LoginForgotPasswordProps = {
|
|
3
|
+
href: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const ForgotPasswordLogin: import("svelte").Component<LoginForgotPasswordProps, {}, "">;
|
|
8
|
+
type ForgotPasswordLogin = ReturnType<typeof ForgotPasswordLogin>;
|
|
9
|
+
export default ForgotPasswordLogin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
type T = Record<string, unknown>;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" generics="T extends Record<string, unknown>">
|
|
6
|
+
import {
|
|
7
|
+
Form,
|
|
8
|
+
type FormProviderProps,
|
|
9
|
+
} from "@tanglemedia/svelte-starter-form-shadcn";
|
|
10
|
+
let rest: FormProviderProps<T> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Form.Provider {...rest} />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type FormProviderProps } from "@tanglemedia/svelte-starter-form-shadcn";
|
|
2
|
+
declare function $$render<T extends Record<string, unknown>>(): {
|
|
3
|
+
props: FormProviderProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T extends Record<string, unknown>> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T extends Record<string, unknown>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T extends Record<string, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const ForgotPasswordProvider: $$IsomorphicComponent;
|
|
24
|
+
type ForgotPasswordProvider<T extends Record<string, unknown>> = InstanceType<typeof ForgotPasswordProvider<T>>;
|
|
25
|
+
export default ForgotPasswordProvider;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Form } from "@tanglemedia/svelte-starter-form-shadcn";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
type LoginSubmitProps = {
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
};
|
|
8
|
+
const { children }: LoginSubmitProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Form.Submit class="w-full">
|
|
12
|
+
{#if children}
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
{:else}
|
|
15
|
+
Submit
|
|
16
|
+
{/if}
|
|
17
|
+
</Form.Submit>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type LoginSubmitProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
};
|
|
5
|
+
declare const ForgotPasswordSubmit: import("svelte").Component<LoginSubmitProps, {}, "">;
|
|
6
|
+
type ForgotPasswordSubmit = ReturnType<typeof ForgotPasswordSubmit>;
|
|
7
|
+
export default ForgotPasswordSubmit;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { type FormPathLeaves as _FormPathLeaves } from 'sveltekit-superforms';
|
|
3
|
+
|
|
4
|
+
type T = Record<string, unknown>;
|
|
5
|
+
type U = _FormPathLeaves<T, any>;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script
|
|
9
|
+
lang="ts"
|
|
10
|
+
generics="T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>"
|
|
11
|
+
>
|
|
12
|
+
import {
|
|
13
|
+
Field,
|
|
14
|
+
type InputFieldProps,
|
|
15
|
+
} from '@tanglemedia/svelte-starter-form-shadcn';
|
|
16
|
+
|
|
17
|
+
type LoginUserInputProps = InputFieldProps<T, U>;
|
|
18
|
+
const { name = 'email' as U, label, ...rest }: LoginUserInputProps = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<Field.Input type={'email'} {name} label={label || 'Email'} {...rest}></Field.Input>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type FormPathLeaves as _FormPathLeaves } from 'sveltekit-superforms';
|
|
2
|
+
import { type InputFieldProps } from '@tanglemedia/svelte-starter-form-shadcn';
|
|
3
|
+
declare function $$render<T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>>(): {
|
|
4
|
+
props: InputFieldProps<T, U>;
|
|
5
|
+
exports: {};
|
|
6
|
+
bindings: "";
|
|
7
|
+
slots: {};
|
|
8
|
+
events: {};
|
|
9
|
+
};
|
|
10
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>> {
|
|
11
|
+
props(): ReturnType<typeof $$render<T, U>>['props'];
|
|
12
|
+
events(): ReturnType<typeof $$render<T, U>>['events'];
|
|
13
|
+
slots(): ReturnType<typeof $$render<T, U>>['slots'];
|
|
14
|
+
bindings(): "";
|
|
15
|
+
exports(): {};
|
|
16
|
+
}
|
|
17
|
+
interface $$IsomorphicComponent {
|
|
18
|
+
new <T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, U>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, U>['props']>, ReturnType<__sveltets_Render<T, U>['events']>, ReturnType<__sveltets_Render<T, U>['slots']>> & {
|
|
19
|
+
$$bindings?: ReturnType<__sveltets_Render<T, U>['bindings']>;
|
|
20
|
+
} & ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
21
|
+
<T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>>(internal: unknown, props: ReturnType<__sveltets_Render<T, U>['props']> & {}): ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
23
|
+
}
|
|
24
|
+
declare const ForgotPasswordUserInput: $$IsomorphicComponent;
|
|
25
|
+
type ForgotPasswordUserInput<T extends Record<string, unknown>, U extends _FormPathLeaves<T, any>> = InstanceType<typeof ForgotPasswordUserInput<T, U>>;
|
|
26
|
+
export default ForgotPasswordUserInput;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Form from './forgot-password-form.svelte';
|
|
2
|
+
import Provider from './forgot-password-provider.svelte';
|
|
3
|
+
import Header from './forgot-password-header.svelte';
|
|
4
|
+
import { forgotPasswordSchema as schema, type ForgotPasswordSchema } from './forgot-password.schema.ts';
|
|
5
|
+
import Container from './forgot-password-container.svelte';
|
|
6
|
+
import ForgotPasswordLogin from './forgot-password-login.svelte';
|
|
7
|
+
import Submit from './forgot-password-submit.svelte';
|
|
8
|
+
import UserInput from './forgot-password-user-input.svelte';
|
|
9
|
+
export { Form, Provider, Header, Container, schema, ForgotPasswordLogin, Submit, UserInput, type ForgotPasswordSchema, };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Form from './forgot-password-form.svelte';
|
|
2
|
+
import Provider from './forgot-password-provider.svelte';
|
|
3
|
+
import Header from './forgot-password-header.svelte';
|
|
4
|
+
import { forgotPasswordSchema as schema } from "./forgot-password.schema.js";
|
|
5
|
+
import Container from './forgot-password-container.svelte';
|
|
6
|
+
import ForgotPasswordLogin from './forgot-password-login.svelte';
|
|
7
|
+
import Submit from './forgot-password-submit.svelte';
|
|
8
|
+
import UserInput from './forgot-password-user-input.svelte';
|
|
9
|
+
export { Form, Provider, Header, Container, schema, ForgotPasswordLogin, Submit, UserInput, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as Auth from './auth-layout/index.ts';
|
|
2
|
+
export * as Login from './login-form/index.ts';
|
|
3
|
+
export * as ForgotPassword from './forgot-password/index.ts';
|
|
4
|
+
export * as Register from './register-form/index.ts';
|
|
5
|
+
export * as ResetPassword from './reset-password/index.ts';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as Auth from "./auth-layout/index.js";
|
|
2
|
+
export * as Login from "./login-form/index.js";
|
|
3
|
+
export * as ForgotPassword from "./forgot-password/index.js";
|
|
4
|
+
export * as Register from "./register-form/index.js";
|
|
5
|
+
export * as ResetPassword from "./reset-password/index.js";
|
|
6
|
+
// export * from './forgot-password/index.ts';
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Form from './login-form.svelte';
|
|
2
|
+
import Provider from './login-provider.svelte';
|
|
3
|
+
import Header from './login-header.svelte';
|
|
4
|
+
import { loginSchema as schema, type LoginSchema } from './login.schema.ts';
|
|
5
|
+
import Container from './login-container.svelte';
|
|
6
|
+
import ForgotPasswordLink from './login-forgot-password.svelte';
|
|
7
|
+
import Submit from './login-submit.svelte';
|
|
8
|
+
import UserInput from './login-user-input.svelte';
|
|
9
|
+
import PasswordInput from './login-password-input.svelte';
|
|
10
|
+
export * from './login-context.ts';
|
|
11
|
+
export { Form, Provider, Header, Container, schema, ForgotPasswordLink, Submit, UserInput, PasswordInput, type LoginSchema, };
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import Form from './login-form.svelte';
|
|
2
|
+
import Provider from './login-provider.svelte';
|
|
3
|
+
import Header from './login-header.svelte';
|
|
4
|
+
import { loginSchema as schema } from "./login.schema.js";
|
|
5
|
+
import Container from './login-container.svelte';
|
|
6
|
+
import ForgotPasswordLink from './login-forgot-password.svelte';
|
|
7
|
+
import Submit from './login-submit.svelte';
|
|
8
|
+
import UserInput from './login-user-input.svelte';
|
|
9
|
+
import PasswordInput from './login-password-input.svelte';
|
|
10
|
+
// import { Field } from '@tanglemedia/svelte-starter-form-shadcn';
|
|
11
|
+
export * from "./login-context.js";
|
|
12
|
+
// const PasswordField = Field.PasswordField;
|
|
13
|
+
export { Form, Provider, Header, Container, schema, ForgotPasswordLink, Submit, UserInput, PasswordInput, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Card } from '@tanglemedia/svelte-starter-ui-shadcn';
|
|
3
|
+
import type { WithChild } from 'svelte-toolbelt';
|
|
4
|
+
import { cn } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
type LoginContainerProps = Omit<WithChild, 'child'> & {
|
|
7
|
+
class?: string;
|
|
8
|
+
card?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
children,
|
|
13
|
+
class: cls,
|
|
14
|
+
card = true,
|
|
15
|
+
...rest
|
|
16
|
+
}: LoginContainerProps = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#if !card}
|
|
20
|
+
<div class={cn('mx-auto max-w-sm', cls)} {...rest}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
23
|
+
{:else}
|
|
24
|
+
<Card.Root class={cn('mx-auto max-w-sm', cls)} {...rest}>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</Card.Root>
|
|
27
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WithChild } from 'svelte-toolbelt';
|
|
2
|
+
type LoginContainerProps = Omit<WithChild, 'child'> & {
|
|
3
|
+
class?: string;
|
|
4
|
+
card?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const LoginContainer: import("svelte").Component<LoginContainerProps, {}, "">;
|
|
7
|
+
type LoginContainer = ReturnType<typeof LoginContainer>;
|
|
8
|
+
export default LoginContainer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useForm } from '@tanglemedia/svelte-starter-form-shadcn';
|
|
2
|
+
export { useForm };
|
|
3
|
+
// import { getContext, setContext } from 'svelte';
|
|
4
|
+
// import type { SuperForm } from 'sveltekit-superforms';
|
|
5
|
+
// const ctx = '--auth-superform';
|
|
6
|
+
// export function setForm<T extends Record<string, unknown>>(
|
|
7
|
+
// superform: SuperForm<T>
|
|
8
|
+
// ) {
|
|
9
|
+
// setContext(ctx, superform);
|
|
10
|
+
// }
|
|
11
|
+
// export function useForm<T extends Record<string, unknown>>() {
|
|
12
|
+
// return getContext<SuperForm<T>>(ctx);
|
|
13
|
+
// }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
type LoginForgotPasswordProps = {
|
|
6
|
+
href: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
const { href, class: cls, children }: LoginForgotPasswordProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<a {href} class={cn("ml-auto inline-block text-sm underline", cls)}>
|
|
14
|
+
{#if children}
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
{:else}
|
|
17
|
+
Forgot your password?
|
|
18
|
+
{/if}
|
|
19
|
+
</a>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type LoginForgotPasswordProps = {
|
|
3
|
+
href: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const LoginForgotPassword: import("svelte").Component<LoginForgotPasswordProps, {}, "">;
|
|
8
|
+
type LoginForgotPassword = ReturnType<typeof LoginForgotPassword>;
|
|
9
|
+
export default LoginForgotPassword;
|