flowbite-svelte 0.9.2 → 0.9.5
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/accordions/AccordionItem.svelte +1 -1
- package/accordions/AccordionItem.svelte.d.ts +1 -1
- package/auth/Confirm.svelte +23 -0
- package/auth/Confirm.svelte.d.ts +19 -0
- package/auth/ForgotPassword.svelte +57 -0
- package/auth/ForgotPassword.svelte.d.ts +21 -0
- package/auth/Login.svelte +128 -0
- package/auth/Login.svelte.d.ts +25 -0
- package/auth/Register.svelte +116 -0
- package/auth/Register.svelte.d.ts +25 -0
- package/auth/Reset.svelte +57 -0
- package/auth/Reset.svelte.d.ts +22 -0
- package/buttongroups/ButtonGroup.svelte +7 -7
- package/buttongroups/ButtonGroupOutline.svelte +7 -7
- package/buttons/Button.svelte +16 -15
- package/buttons/Button.svelte.d.ts +3 -2
- package/buttons/ColorShadowButton.svelte +2 -1
- package/buttons/ColorShadowButton.svelte.d.ts +2 -1
- package/buttons/GradientDuotoneButton.svelte +2 -1
- package/buttons/GradientDuotoneButton.svelte.d.ts +2 -1
- package/buttons/GradientMonochromeButton.svelte +2 -1
- package/buttons/GradientMonochromeButton.svelte.d.ts +2 -1
- package/buttons/GradientOutlineButton.svelte +2 -1
- package/buttons/GradientOutlineButton.svelte.d.ts +2 -1
- package/cards/Card.svelte +6 -7
- package/cards/Card.svelte.d.ts +5 -4
- package/cards/CtaCard.svelte +2 -2
- package/cards/EcommerceCard.svelte +1 -1
- package/cards/EcommerceCard.svelte.d.ts +1 -1
- package/cards/HorizontalCard.svelte +3 -3
- package/cards/HorizontalCard.svelte.d.ts +3 -3
- package/cards/InteractiveCard.svelte +6 -6
- package/cards/InteractiveCard.svelte.d.ts +2 -2
- package/cards/ListCard.svelte +42 -77
- package/cards/ListCard.svelte.d.ts +8 -40
- package/cards/SignInCard.svelte +114 -111
- package/cards/SignInCard.svelte.d.ts +9 -32
- package/dropdowns/DropdownDefault.svelte +84 -93
- package/dropdowns/DropdownDefault.svelte.d.ts +7 -35
- package/footer/LogoFooter.svelte +4 -4
- package/footer/SimpleFooter.svelte +3 -3
- package/footer/SitemapFooter.svelte +5 -5
- package/footer/SitemapFooter.svelte.d.ts +2 -2
- package/footer/SocialMediaFooter.svelte +59 -106
- package/footer/SocialMediaFooter.svelte.d.ts +9 -61
- package/index.d.ts +6 -1
- package/index.js +14 -0
- package/list-group/List.svelte +42 -74
- package/list-group/List.svelte.d.ts +7 -23
- package/modals/ExtraLargeModal.svelte +187 -191
- package/modals/ExtraLargeModal.svelte.d.ts +9 -27
- package/modals/LargeModal.svelte +188 -191
- package/modals/LargeModal.svelte.d.ts +9 -27
- package/modals/MediumModal.svelte +191 -200
- package/modals/MediumModal.svelte.d.ts +9 -27
- package/modals/ModalButton.svelte +40 -35
- package/modals/ModalButton.svelte.d.ts +7 -17
- package/modals/SignInModal.svelte +151 -160
- package/modals/SignInModal.svelte.d.ts +10 -24
- package/modals/SmallModal.svelte +188 -191
- package/modals/SmallModal.svelte.d.ts +9 -27
- package/modals/modalStores.d.ts +2 -1
- package/modals/modalStores.js +1 -2
- package/navbar/DropdownNavbar.svelte +21 -24
- package/navbar/DropdownNavbar.svelte.d.ts +7 -0
- package/navbar/Navbar.svelte +11 -14
- package/navbar/Navbar.svelte.d.ts +4 -0
- package/package.json +7 -3
- package/spinners/Spinner.svelte +1 -1
- package/spinners/Spinner.svelte.d.ts +1 -1
- package/spinners/SpinnerButton.svelte +1 -1
- package/tabs/DefaultTabs.svelte +2 -2
- package/tabs/InteractiveTabs.svelte +6 -6
- package/tabs/PillTabs.svelte +2 -2
- package/types.d.ts +25 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script >import { getContext } from 'svelte';
|
|
2
2
|
import collapse from 'svelte-collapse';
|
|
3
3
|
import { ChevronDownIconSolid, ChevronUpIconSolid } from '@codewithshin/svelte-heroicons';
|
|
4
|
-
export let id;
|
|
4
|
+
export let id = '';
|
|
5
5
|
const store = getContext('svelte-collapsible-accordion');
|
|
6
6
|
$: params = {
|
|
7
7
|
open: $store.id === id,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script >import { Button, Alert, Spinner } from '../index';
|
|
2
|
+
export let loginLink;
|
|
3
|
+
export let success;
|
|
4
|
+
export let error;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div
|
|
8
|
+
class="p-4 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700 w-full"
|
|
9
|
+
>
|
|
10
|
+
{#if success}
|
|
11
|
+
<h1 class="text-xl w-full mb-4 font-medium text-gray-900 dark:text-white">
|
|
12
|
+
Your email is confirmed.
|
|
13
|
+
</h1>
|
|
14
|
+
<a href={loginLink.href} class="py-4">
|
|
15
|
+
<Button name={loginLink.name} textSize="text-sm" />
|
|
16
|
+
</a>
|
|
17
|
+
{:else}
|
|
18
|
+
<Spinner />
|
|
19
|
+
{/if}
|
|
20
|
+
{#if error}
|
|
21
|
+
<Alert alertId="alert-red" color="red" closeBtn>{error}</Alert>
|
|
22
|
+
{/if}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { LinkType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
loginLink: LinkType;
|
|
6
|
+
success: string;
|
|
7
|
+
error: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type ConfirmProps = typeof __propDef.props;
|
|
15
|
+
export declare type ConfirmEvents = typeof __propDef.events;
|
|
16
|
+
export declare type ConfirmSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Confirm extends SvelteComponentTyped<ConfirmProps, ConfirmEvents, ConfirmSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script >import { Alert } from '../index';
|
|
2
|
+
export let forgot;
|
|
3
|
+
export let email;
|
|
4
|
+
export let error;
|
|
5
|
+
export let message;
|
|
6
|
+
export let data;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
class="p-4 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700 w-full"
|
|
11
|
+
>
|
|
12
|
+
<form class="space-y-6" on:submit|preventDefault={forgot}>
|
|
13
|
+
<div class="heading">
|
|
14
|
+
<a class="back" href="/"><i class="bi bi-arrow-left dark:text-white" /></a>
|
|
15
|
+
<h2 class="text-xl font-medium text-gray-900 dark:text-white">Forgot password</h2>
|
|
16
|
+
</div>
|
|
17
|
+
<div>
|
|
18
|
+
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
19
|
+
>Email</label
|
|
20
|
+
>
|
|
21
|
+
<input
|
|
22
|
+
type="email"
|
|
23
|
+
required
|
|
24
|
+
name="email"
|
|
25
|
+
placeholder="Enter your email"
|
|
26
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
27
|
+
bind:value={email}
|
|
28
|
+
/>
|
|
29
|
+
{#if data}
|
|
30
|
+
<div class="mt-6">
|
|
31
|
+
<Alert alertId="alert-green" color="yellow" closeBtn>
|
|
32
|
+
{data}
|
|
33
|
+
</Alert>
|
|
34
|
+
</div>
|
|
35
|
+
{/if}
|
|
36
|
+
{#if message}
|
|
37
|
+
<div class="mt-6">
|
|
38
|
+
<Alert alertId="alert-green" color="green" closeBtn>
|
|
39
|
+
{message}
|
|
40
|
+
</Alert>
|
|
41
|
+
</div>
|
|
42
|
+
{/if}
|
|
43
|
+
{#if error}
|
|
44
|
+
<div class="mt-6">
|
|
45
|
+
<Alert alertId="alert-green" color="red" closeBtn>
|
|
46
|
+
{error}
|
|
47
|
+
</Alert>
|
|
48
|
+
</div>
|
|
49
|
+
{/if}
|
|
50
|
+
</div>
|
|
51
|
+
<button
|
|
52
|
+
type="submit"
|
|
53
|
+
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
54
|
+
>Send recovery email</button
|
|
55
|
+
>
|
|
56
|
+
</form>
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AuthFunctionType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
forgot: AuthFunctionType;
|
|
6
|
+
email: string;
|
|
7
|
+
error: string;
|
|
8
|
+
message: string;
|
|
9
|
+
data: string;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export declare type ForgotPasswordProps = typeof __propDef.props;
|
|
17
|
+
export declare type ForgotPasswordEvents = typeof __propDef.events;
|
|
18
|
+
export declare type ForgotPasswordSlots = typeof __propDef.slots;
|
|
19
|
+
export default class ForgotPassword extends SvelteComponentTyped<ForgotPasswordProps, ForgotPasswordEvents, ForgotPasswordSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script >import { Alert } from '../index';
|
|
2
|
+
export let login;
|
|
3
|
+
export let title = 'Sign in';
|
|
4
|
+
export let btnSignInColor = 'blue';
|
|
5
|
+
export let rememberMe = false;
|
|
6
|
+
export let signup;
|
|
7
|
+
export let lostPassword;
|
|
8
|
+
export let email;
|
|
9
|
+
export let password;
|
|
10
|
+
export let error;
|
|
11
|
+
let submitClass;
|
|
12
|
+
if (btnSignInColor === 'blue') {
|
|
13
|
+
submitClass =
|
|
14
|
+
'w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
15
|
+
}
|
|
16
|
+
else if (btnSignInColor === 'gray') {
|
|
17
|
+
submitClass =
|
|
18
|
+
'w-full text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
19
|
+
}
|
|
20
|
+
else if (btnSignInColor === 'red') {
|
|
21
|
+
submitClass =
|
|
22
|
+
'w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
23
|
+
}
|
|
24
|
+
else if (btnSignInColor === 'yellow') {
|
|
25
|
+
submitClass =
|
|
26
|
+
'w-full text-white bg-yellow-700 hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
27
|
+
}
|
|
28
|
+
else if (btnSignInColor === 'green') {
|
|
29
|
+
submitClass =
|
|
30
|
+
'w-full text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
31
|
+
}
|
|
32
|
+
else if (btnSignInColor === 'indigo') {
|
|
33
|
+
submitClass =
|
|
34
|
+
'w-full text-white bg-indigo-700 hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
35
|
+
}
|
|
36
|
+
else if (btnSignInColor === 'purple') {
|
|
37
|
+
submitClass =
|
|
38
|
+
'w-full text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
39
|
+
}
|
|
40
|
+
else if (btnSignInColor === 'pink') {
|
|
41
|
+
submitClass =
|
|
42
|
+
'w-full text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
submitClass =
|
|
46
|
+
'w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
class="p-4 max-w-sm w-full bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700"
|
|
52
|
+
>
|
|
53
|
+
<form class="space-y-6" on:submit|preventDefault={login}>
|
|
54
|
+
<h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
|
|
55
|
+
<div>
|
|
56
|
+
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
57
|
+
>Email</label
|
|
58
|
+
>
|
|
59
|
+
<input
|
|
60
|
+
type="email"
|
|
61
|
+
name="email"
|
|
62
|
+
id="email"
|
|
63
|
+
bind:value={email}
|
|
64
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
65
|
+
placeholder="name@company.com"
|
|
66
|
+
required
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
<div>
|
|
70
|
+
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
71
|
+
>Your password</label
|
|
72
|
+
>
|
|
73
|
+
<input
|
|
74
|
+
type="password"
|
|
75
|
+
name="password"
|
|
76
|
+
id="password"
|
|
77
|
+
placeholder="••••••••"
|
|
78
|
+
bind:value={password}
|
|
79
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
80
|
+
required
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="flex items-start">
|
|
84
|
+
{#if rememberMe}
|
|
85
|
+
<div class="flex items-start">
|
|
86
|
+
<div class="flex items-center h-5">
|
|
87
|
+
<input
|
|
88
|
+
id="remember"
|
|
89
|
+
aria-describedby="remember"
|
|
90
|
+
type="checkbox"
|
|
91
|
+
class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="ml-3 text-sm">
|
|
95
|
+
<label for="remember" class="font-medium text-gray-900 dark:text-gray-300"
|
|
96
|
+
>Remember me</label
|
|
97
|
+
>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
{/if}
|
|
101
|
+
{#if lostPassword}
|
|
102
|
+
<a
|
|
103
|
+
href={lostPassword.href}
|
|
104
|
+
rel={lostPassword.rel}
|
|
105
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500"
|
|
106
|
+
>{lostPassword.name}</a
|
|
107
|
+
>
|
|
108
|
+
{/if}
|
|
109
|
+
</div>
|
|
110
|
+
{#if error}
|
|
111
|
+
<div class="mt-6">
|
|
112
|
+
<Alert alertId="alert-red" color="red" closeBtn>
|
|
113
|
+
{error}
|
|
114
|
+
</Alert>
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
117
|
+
<button type="submit" class={submitClass}>Login to your account</button>
|
|
118
|
+
{#if signup}
|
|
119
|
+
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">
|
|
120
|
+
Not registered? <a
|
|
121
|
+
href={signup.href}
|
|
122
|
+
rel={signup.rel}
|
|
123
|
+
class="text-blue-700 hover:underline dark:text-blue-500">{signup.name}</a
|
|
124
|
+
>
|
|
125
|
+
</div>
|
|
126
|
+
{/if}
|
|
127
|
+
</form>
|
|
128
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AuthFunctionType, LinkType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
login: AuthFunctionType;
|
|
6
|
+
title?: string;
|
|
7
|
+
btnSignInColor?: string;
|
|
8
|
+
rememberMe?: boolean;
|
|
9
|
+
signup: LinkType;
|
|
10
|
+
lostPassword: LinkType;
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export declare type LoginProps = typeof __propDef.props;
|
|
21
|
+
export declare type LoginEvents = typeof __propDef.events;
|
|
22
|
+
export declare type LoginSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Login extends SvelteComponentTyped<LoginProps, LoginEvents, LoginSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script >import { Alert } from '../index';
|
|
2
|
+
export let register;
|
|
3
|
+
export let error;
|
|
4
|
+
export let login;
|
|
5
|
+
export let rememberMe;
|
|
6
|
+
export let lostPassword;
|
|
7
|
+
export let message;
|
|
8
|
+
// Variables bound to respective inputs via bind:value
|
|
9
|
+
export let email;
|
|
10
|
+
export let password;
|
|
11
|
+
export let name;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
class="p-4 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700 w-full"
|
|
16
|
+
>
|
|
17
|
+
<form class="space-y-6" on:submit|preventDefault={register}>
|
|
18
|
+
{#if message}
|
|
19
|
+
<div class="mt-6">
|
|
20
|
+
<Alert alertId="alert-green" color="green" closeBtn>
|
|
21
|
+
{message}
|
|
22
|
+
</Alert>
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
|
+
<div class="heading">
|
|
26
|
+
<a class="back" href="/"><i class="bi bi-arrow-left dark:text-white" /></a>
|
|
27
|
+
<h3 class="text-xl font-medium text-gray-900 dark:text-white">Register</h3>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
31
|
+
>Name</label
|
|
32
|
+
>
|
|
33
|
+
<input
|
|
34
|
+
type="text"
|
|
35
|
+
required
|
|
36
|
+
name="name"
|
|
37
|
+
placeholder="Enter your name"
|
|
38
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
39
|
+
bind:value={name}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
44
|
+
>Email</label
|
|
45
|
+
>
|
|
46
|
+
<input
|
|
47
|
+
type="email"
|
|
48
|
+
required
|
|
49
|
+
name="email"
|
|
50
|
+
placeholder="Enter your email"
|
|
51
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
52
|
+
bind:value={email}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
57
|
+
>Your password</label
|
|
58
|
+
>
|
|
59
|
+
<input
|
|
60
|
+
type="password"
|
|
61
|
+
required
|
|
62
|
+
name="password"
|
|
63
|
+
placeholder="Enter your password"
|
|
64
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
65
|
+
bind:value={password}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
{#if error}
|
|
69
|
+
<div class="mt-6">
|
|
70
|
+
<Alert alertId="alert-green" color="red" closeBtn>
|
|
71
|
+
{error}
|
|
72
|
+
</Alert>
|
|
73
|
+
</div>
|
|
74
|
+
{/if}
|
|
75
|
+
<div class="flex items-start">
|
|
76
|
+
{#if rememberMe}
|
|
77
|
+
<div class="flex items-start">
|
|
78
|
+
<div class="flex items-center h-5">
|
|
79
|
+
<input
|
|
80
|
+
id="remember"
|
|
81
|
+
aria-describedby="remember"
|
|
82
|
+
type="checkbox"
|
|
83
|
+
class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800"
|
|
84
|
+
required
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="ml-3 text-sm">
|
|
88
|
+
<label for="remember" class="font-medium text-gray-900 dark:text-gray-300"
|
|
89
|
+
>Remember me</label
|
|
90
|
+
>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
{/if}
|
|
94
|
+
{#if lostPassword}
|
|
95
|
+
<a
|
|
96
|
+
href={lostPassword.href}
|
|
97
|
+
rel={lostPassword.rel}
|
|
98
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500"
|
|
99
|
+
>{lostPassword.name}</a
|
|
100
|
+
>
|
|
101
|
+
{/if}
|
|
102
|
+
</div>
|
|
103
|
+
<button
|
|
104
|
+
type="submit"
|
|
105
|
+
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
106
|
+
>Register</button
|
|
107
|
+
>
|
|
108
|
+
{#if login}
|
|
109
|
+
<a
|
|
110
|
+
href={login.href}
|
|
111
|
+
rel={login.rel}
|
|
112
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500">{login.name}</a
|
|
113
|
+
>
|
|
114
|
+
{/if}
|
|
115
|
+
</form>
|
|
116
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AuthFunctionType, LinkType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
register: AuthFunctionType;
|
|
6
|
+
error: string;
|
|
7
|
+
login: LinkType;
|
|
8
|
+
rememberMe: boolean;
|
|
9
|
+
lostPassword: LinkType;
|
|
10
|
+
message: string;
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export declare type RegisterProps = typeof __propDef.props;
|
|
21
|
+
export declare type RegisterEvents = typeof __propDef.events;
|
|
22
|
+
export declare type RegisterSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Register extends SvelteComponentTyped<RegisterProps, RegisterEvents, RegisterSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script >import { Alert } from '../index';
|
|
2
|
+
export let resetpw;
|
|
3
|
+
export let password;
|
|
4
|
+
export let email;
|
|
5
|
+
export let confirmpw;
|
|
6
|
+
export let error;
|
|
7
|
+
export let message;
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
class="p-4 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700 w-full"
|
|
12
|
+
>
|
|
13
|
+
<form class="space-y-6" on:submit|preventDefault={resetpw}>
|
|
14
|
+
<div class="heading">
|
|
15
|
+
<h2 class="text-xl font-medium text-gray-900 dark:text-white">Reset password</h2>
|
|
16
|
+
</div>
|
|
17
|
+
<input
|
|
18
|
+
type="password"
|
|
19
|
+
required
|
|
20
|
+
name="password"
|
|
21
|
+
placeholder="Enter your password."
|
|
22
|
+
bind:value={password}
|
|
23
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
24
|
+
/>
|
|
25
|
+
<input
|
|
26
|
+
type="password"
|
|
27
|
+
required
|
|
28
|
+
name="confirmpw"
|
|
29
|
+
placeholder="Confirm your password."
|
|
30
|
+
bind:value={confirmpw}
|
|
31
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
32
|
+
/>
|
|
33
|
+
<input type="hidden" required name="email" bind:value={email} />
|
|
34
|
+
{#if error}
|
|
35
|
+
<div class="mt-6">
|
|
36
|
+
<Alert alertId="alert-green" color="red" closeBtn>
|
|
37
|
+
{error}
|
|
38
|
+
</Alert>
|
|
39
|
+
</div>
|
|
40
|
+
{/if}
|
|
41
|
+
{#if message}
|
|
42
|
+
<div class="mt-6">
|
|
43
|
+
<Alert alertId="alert-green" color="green" closeBtn>
|
|
44
|
+
{message}
|
|
45
|
+
</Alert>
|
|
46
|
+
<a
|
|
47
|
+
href="/auth/login"
|
|
48
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500">Go to Login</a
|
|
49
|
+
>
|
|
50
|
+
</div>
|
|
51
|
+
{/if}
|
|
52
|
+
<button
|
|
53
|
+
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
54
|
+
type="submit">Reset</button
|
|
55
|
+
>
|
|
56
|
+
</form>
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AuthFunctionType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
resetpw: AuthFunctionType;
|
|
6
|
+
password: string;
|
|
7
|
+
email: string;
|
|
8
|
+
confirmpw: string;
|
|
9
|
+
error: string;
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type ResetProps = typeof __propDef.props;
|
|
18
|
+
export declare type ResetEvents = typeof __propDef.events;
|
|
19
|
+
export declare type ResetSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Reset extends SvelteComponentTyped<ResetProps, ResetEvents, ResetSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -6,14 +6,14 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div class="inline-flex rounded-md shadow-sm" role="group">
|
|
9
|
-
{#each buttons as { name, icon,
|
|
9
|
+
{#each buttons as { name, icon, href, rel }, i}
|
|
10
10
|
{#if i === 0}
|
|
11
11
|
<button type="button" class={classFirst}>
|
|
12
12
|
{#if icon}
|
|
13
13
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
14
14
|
{/if}
|
|
15
|
-
{#if
|
|
16
|
-
<a href
|
|
15
|
+
{#if href}
|
|
16
|
+
<a {href} {rel}>{name}</a>
|
|
17
17
|
{:else}
|
|
18
18
|
{name}
|
|
19
19
|
{/if}
|
|
@@ -23,8 +23,8 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
23
23
|
{#if icon}
|
|
24
24
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
25
25
|
{/if}
|
|
26
|
-
{#if
|
|
27
|
-
<a href
|
|
26
|
+
{#if href}
|
|
27
|
+
<a {href} {rel}>{name}</a>
|
|
28
28
|
{:else}
|
|
29
29
|
{name}
|
|
30
30
|
{/if}
|
|
@@ -34,8 +34,8 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
34
34
|
{#if icon}
|
|
35
35
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
36
36
|
{/if}
|
|
37
|
-
{#if
|
|
38
|
-
<a href
|
|
37
|
+
{#if href}
|
|
38
|
+
<a {href} {rel}>{name}</a>
|
|
39
39
|
{:else}
|
|
40
40
|
{name}
|
|
41
41
|
{/if}
|
|
@@ -6,14 +6,14 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div class="inline-flex rounded-md shadow-sm">
|
|
9
|
-
{#each buttons as {
|
|
9
|
+
{#each buttons as { href, name, rel, icon }, i}
|
|
10
10
|
{#if i === 0}
|
|
11
11
|
<button type="button" class={classFirst}>
|
|
12
12
|
{#if icon}
|
|
13
13
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
14
14
|
{/if}
|
|
15
|
-
{#if
|
|
16
|
-
<a href
|
|
15
|
+
{#if href}
|
|
16
|
+
<a {href} {rel}>{name}</a>
|
|
17
17
|
{:else}
|
|
18
18
|
{name}
|
|
19
19
|
{/if}
|
|
@@ -23,8 +23,8 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
23
23
|
{#if icon}
|
|
24
24
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
25
25
|
{/if}
|
|
26
|
-
{#if
|
|
27
|
-
<a href
|
|
26
|
+
{#if href}
|
|
27
|
+
<a {href} {rel}>{name}</a>
|
|
28
28
|
{:else}
|
|
29
29
|
{name}
|
|
30
30
|
{/if}
|
|
@@ -34,8 +34,8 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
34
34
|
{#if icon}
|
|
35
35
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
36
36
|
{/if}
|
|
37
|
-
{#if
|
|
38
|
-
<a href
|
|
37
|
+
{#if href}
|
|
38
|
+
<a {href} {rel}>{name}</a>
|
|
39
39
|
{:else}
|
|
40
40
|
{name}
|
|
41
41
|
{/if}
|