flowbite-svelte 0.9.4 → 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.
Files changed (48) hide show
  1. package/accordions/AccordionItem.svelte +1 -1
  2. package/accordions/AccordionItem.svelte.d.ts +1 -1
  3. package/auth/Confirm.svelte +23 -0
  4. package/auth/Confirm.svelte.d.ts +19 -0
  5. package/auth/ForgotPassword.svelte +57 -0
  6. package/auth/ForgotPassword.svelte.d.ts +21 -0
  7. package/auth/Login.svelte +128 -0
  8. package/auth/Login.svelte.d.ts +25 -0
  9. package/auth/Register.svelte +116 -0
  10. package/auth/Register.svelte.d.ts +25 -0
  11. package/auth/Reset.svelte +57 -0
  12. package/auth/Reset.svelte.d.ts +22 -0
  13. package/buttons/Button.svelte +16 -15
  14. package/buttons/Button.svelte.d.ts +3 -2
  15. package/buttons/ColorShadowButton.svelte +2 -1
  16. package/buttons/ColorShadowButton.svelte.d.ts +2 -1
  17. package/buttons/GradientDuotoneButton.svelte +2 -1
  18. package/buttons/GradientDuotoneButton.svelte.d.ts +2 -1
  19. package/buttons/GradientMonochromeButton.svelte +2 -1
  20. package/buttons/GradientMonochromeButton.svelte.d.ts +2 -1
  21. package/buttons/GradientOutlineButton.svelte +2 -1
  22. package/buttons/GradientOutlineButton.svelte.d.ts +2 -1
  23. package/cards/Card.svelte +6 -7
  24. package/cards/Card.svelte.d.ts +5 -4
  25. package/cards/EcommerceCard.svelte +1 -1
  26. package/cards/EcommerceCard.svelte.d.ts +1 -1
  27. package/cards/HorizontalCard.svelte +3 -3
  28. package/cards/HorizontalCard.svelte.d.ts +3 -3
  29. package/cards/InteractiveCard.svelte.d.ts +2 -2
  30. package/cards/ListCard.svelte +42 -77
  31. package/cards/ListCard.svelte.d.ts +8 -40
  32. package/cards/SignInCard.svelte +114 -111
  33. package/cards/SignInCard.svelte.d.ts +9 -32
  34. package/dropdowns/DropdownDefault.svelte +84 -93
  35. package/dropdowns/DropdownDefault.svelte.d.ts +7 -35
  36. package/index.d.ts +6 -1
  37. package/index.js +14 -0
  38. package/list-group/List.svelte +42 -74
  39. package/list-group/List.svelte.d.ts +7 -23
  40. package/navbar/DropdownNavbar.svelte +16 -19
  41. package/navbar/DropdownNavbar.svelte.d.ts +7 -0
  42. package/navbar/Navbar.svelte +10 -13
  43. package/navbar/Navbar.svelte.d.ts +4 -0
  44. package/package.json +7 -2
  45. package/spinners/Spinner.svelte +1 -1
  46. package/spinners/Spinner.svelte.d.ts +1 -1
  47. package/spinners/SpinnerButton.svelte +1 -1
  48. package/types.d.ts +13 -5
@@ -2,6 +2,7 @@
2
2
  export let color = 'blue';
3
3
  export let name = 'Read more';
4
4
  let btnClass;
5
+ export let type = 'button';
5
6
  if (color === 'blue') {
6
7
  btnClass = `text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
7
8
  }
@@ -31,4 +32,4 @@ else {
31
32
  }
32
33
  </script>
33
34
 
34
- <button type="button" class={btnClass} on:click>{name}</button>
35
+ <button {type} class={btnClass} on:click>{name}</button>
@@ -1,10 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { Buttonshadows, Textsize } from '../types';
2
+ import type { Buttonshadows, Textsize, ButtonType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  textSize?: Textsize;
6
6
  color?: Buttonshadows;
7
7
  name?: string;
8
+ type?: ButtonType;
8
9
  };
9
10
  events: {
10
11
  click: MouseEvent;
@@ -1,6 +1,7 @@
1
1
  <script >export let textSize = 'text-sm';
2
2
  export let color = 'purple2blue';
3
3
  export let name = 'Read more';
4
+ export let type = 'button';
4
5
  let btnClass;
5
6
  let spanClass;
6
7
  if (color === 'purple2blue') {
@@ -45,6 +46,6 @@ else {
45
46
  }
46
47
  </script>
47
48
 
48
- <button class={btnClass}>
49
+ <button class={btnClass} {type}>
49
50
  <span class={spanClass} on:click>{name}</span>
50
51
  </button>
@@ -1,10 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { Gradientduotones, Textsize } from '../types';
2
+ import type { Gradientduotones, Textsize, ButtonType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  textSize?: Textsize;
6
6
  color?: Gradientduotones;
7
7
  name?: string;
8
+ type?: ButtonType;
8
9
  };
9
10
  events: {
10
11
  click: MouseEvent;
package/cards/Card.svelte CHANGED
@@ -1,10 +1,11 @@
1
- <script >export let link;
2
- export let rel;
3
- export let alt;
4
- export let img;
1
+ <script >export let link = '';
2
+ export let rel = '';
3
+ export let alt = '';
4
+ export let img = '';
5
5
  export let btnLabel = 'Read more';
6
6
  export let btnColor = 'blue';
7
7
  export let header = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
8
+ export let divClass = 'max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700';
8
9
  let buttonClass;
9
10
  if (btnColor === 'blue') {
10
11
  buttonClass =
@@ -44,9 +45,7 @@ else {
44
45
  }
45
46
  </script>
46
47
 
47
- <div
48
- class="max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700"
49
- >
48
+ <div class={divClass}>
50
49
  {#if img}
51
50
  <a href={link} {rel}>
52
51
  <img class="rounded-t-lg" src={img} {alt} />
@@ -2,13 +2,14 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { Colors } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- link: string;
6
- rel: string;
7
- alt: string;
8
- img: string;
5
+ link?: string;
6
+ rel?: string;
7
+ alt?: string;
8
+ img?: string;
9
9
  btnLabel?: string;
10
10
  btnColor?: Colors;
11
11
  header?: string;
12
+ divClass?: string;
12
13
  };
13
14
  events: {
14
15
  [evt: string]: CustomEvent<any>;
@@ -4,7 +4,7 @@
4
4
  };
5
5
  export let link = '/';
6
6
  export let btnColor = 'blue';
7
- export let rel;
7
+ export let rel = '';
8
8
  export let title = 'Apple Watch Series 7 GPS, Aluminium Case, Starlight Sport';
9
9
  export let stars = 5;
10
10
  export let price = '$555';
@@ -5,7 +5,7 @@ declare const __propDef: {
5
5
  img?: ImgType;
6
6
  link?: string;
7
7
  btnColor?: Colors;
8
- rel: string;
8
+ rel?: string;
9
9
  title?: string;
10
10
  stars?: number;
11
11
  price?: string;
@@ -1,7 +1,7 @@
1
- <script >export let link;
2
- export let rel;
1
+ <script >export let link = '';
2
+ export let rel = '';
3
3
  export let img = '/images/image-4.jpeg';
4
- export let alt;
4
+ export let alt = '';
5
5
  export let header = 'Lorem ipsum dolor sit ametit.';
6
6
  </script>
7
7
 
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- link: string;
5
- rel: string;
4
+ link?: string;
5
+ rel?: string;
6
6
  img?: string;
7
- alt: string;
7
+ alt?: string;
8
8
  header?: string;
9
9
  };
10
10
  events: {
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { DropdownLinkType, ImgType, LinkType } from '../types';
2
+ import type { LinkType, ImgType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- dropdownLinks: DropdownLinkType[];
5
+ dropdownLinks: LinkType[];
6
6
  img: ImgType;
7
7
  header?: string;
8
8
  content?: string;
@@ -1,82 +1,47 @@
1
- <script>
2
- export let lists = [
3
- {
4
- img: {
5
- src: "/images/profile-picture-1.jpeg",
6
- alt: "Neil Sims",
7
- },
8
- field1: "Neil Sims",
9
- field2: "email@windster.com",
10
- field3: "Advisor",
11
- },
12
- {
13
- img: {
14
- src: "/images/profile-picture-2.jpeg",
15
- alt: "Bonnie Green",
16
- },
17
- field1: "Bonnie Green",
18
- field2: "email@windster.com",
19
- field3: "Developer",
20
- },
21
- {
22
- img: {
23
- src: "/images/profile-picture-3.jpeg",
24
- alt: "Michael Gough",
25
- },
26
- field1: "Michael Gough",
27
- field2: "email@windster.com",
28
- field3: "Marketing",
29
- },
30
- ];
31
- export let title = "Latest Customers";
32
- export let action = {
33
- link: "/#",
34
- title: "View all",
35
- rel: "",
36
- };
1
+ <script >export let lists;
2
+ export let title = 'Latest Customers';
3
+ export let action;
37
4
  </script>
38
5
 
39
6
  <div
40
- class="p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700"
7
+ class="p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700"
41
8
  >
42
- <div class="flex justify-between items-center mb-4">
43
- <h3 class="text-xl font-bold leading-none text-gray-900 dark:text-white">
44
- {title}
45
- </h3>
46
- <a
47
- href={action.link}
48
- rel={action.rel}
49
- class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
50
- >
51
- {action.title}
52
- </a>
53
- </div>
54
- <div class="flow-root">
55
- <ul class="divide-y divide-gray-200 dark:divide-gray-700">
56
- {#each lists as { img, field1, field2, field3 }}
57
- <li class="py-3 sm:py-4">
58
- <div class="flex items-center space-x-4">
59
- <div class="flex-shrink-0">
60
- <img class="w-8 h-8 rounded-full" src={img.src} alt={img.alt} />
61
- </div>
62
- <div class="flex-1 min-w-0">
63
- <p
64
- class="text-sm font-medium text-gray-900 truncate dark:text-white"
65
- >
66
- {field1}
67
- </p>
68
- <p class="text-sm text-gray-500 truncate dark:text-gray-400">
69
- {field2}
70
- </p>
71
- </div>
72
- <div
73
- class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white"
74
- >
75
- {field3}
76
- </div>
77
- </div>
78
- </li>
79
- {/each}
80
- </ul>
81
- </div>
9
+ <div class="flex justify-between items-center mb-4">
10
+ <h3 class="text-xl font-bold leading-none text-gray-900 dark:text-white">
11
+ {title}
12
+ </h3>
13
+ <a
14
+ href={action.href}
15
+ rel={action.rel}
16
+ class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
17
+ >
18
+ {action.name}
19
+ </a>
20
+ </div>
21
+ <div class="flow-root">
22
+ <ul class="divide-y divide-gray-200 dark:divide-gray-700">
23
+ {#each lists as { img, field1, field2, field3 }}
24
+ <li class="py-3 sm:py-4">
25
+ <div class="flex items-center space-x-4">
26
+ <div class="flex-shrink-0">
27
+ <img class="w-8 h-8 rounded-full" src={img.src} alt={img.alt} />
28
+ </div>
29
+ <div class="flex-1 min-w-0">
30
+ <p class="text-sm font-medium text-gray-900 truncate dark:text-white">
31
+ {field1}
32
+ </p>
33
+ <p class="text-sm text-gray-500 truncate dark:text-gray-400">
34
+ {field2}
35
+ </p>
36
+ </div>
37
+ <div
38
+ class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white"
39
+ >
40
+ {field3}
41
+ </div>
42
+ </div>
43
+ </li>
44
+ {/each}
45
+ </ul>
46
+ </div>
82
47
  </div>
@@ -1,51 +1,19 @@
1
- /** @typedef {typeof __propDef.props} ListCardProps */
2
- /** @typedef {typeof __propDef.events} ListCardEvents */
3
- /** @typedef {typeof __propDef.slots} ListCardSlots */
4
- export default class ListCard extends SvelteComponentTyped<{
5
- lists?: {
6
- img: {
7
- src: string;
8
- alt: string;
9
- };
10
- field1: string;
11
- field2: string;
12
- field3: string;
13
- }[];
14
- title?: string;
15
- action?: {
16
- link: string;
17
- title: string;
18
- rel: string;
19
- };
20
- }, {
21
- [evt: string]: CustomEvent<any>;
22
- }, {}> {
23
- }
24
- export type ListCardProps = typeof __propDef.props;
25
- export type ListCardEvents = typeof __propDef.events;
26
- export type ListCardSlots = typeof __propDef.slots;
27
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { LinkType, ListCardType } from '../types';
28
3
  declare const __propDef: {
29
4
  props: {
30
- lists?: {
31
- img: {
32
- src: string;
33
- alt: string;
34
- };
35
- field1: string;
36
- field2: string;
37
- field3: string;
38
- }[];
5
+ lists: ListCardType[];
39
6
  title?: string;
40
- action?: {
41
- link: string;
42
- title: string;
43
- rel: string;
44
- };
7
+ action: LinkType;
45
8
  };
46
9
  events: {
47
10
  [evt: string]: CustomEvent<any>;
48
11
  };
49
12
  slots: {};
50
13
  };
14
+ export declare type ListCardProps = typeof __propDef.props;
15
+ export declare type ListCardEvents = typeof __propDef.events;
16
+ export declare type ListCardSlots = typeof __propDef.slots;
17
+ export default class ListCard extends SvelteComponentTyped<ListCardProps, ListCardEvents, ListCardSlots> {
18
+ }
51
19
  export {};
@@ -1,125 +1,128 @@
1
- <script>
2
- export let title = "Sign in";
3
- export let action;
4
- export let btnSignInColor = "blue";
5
- export let rememberMe = false;
6
- export let signupLink = {
7
- href: "",
8
- rel: "",
9
- };
10
- export let lostPasswordLink = {
11
- href: "",
12
- rel: "",
13
- };
14
-
15
- let submitClass;
16
-
17
- if (btnSignInColor === "blue") {
1
+ <script >import Alert from '../alerts/Alert.svelte';
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
+ let email;
9
+ let password;
10
+ let error;
11
+ let submitClass;
12
+ if (btnSignInColor === 'blue') {
18
13
  submitClass =
19
- "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";
20
- } else if (btnSignInColor === "gray") {
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') {
21
17
  submitClass =
22
- "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";
23
- } else if (btnSignInColor === "red") {
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') {
24
21
  submitClass =
25
- "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";
26
- } else if (btnSignInColor === "yellow") {
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') {
27
25
  submitClass =
28
- "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";
29
- } else if (btnSignInColor === "green") {
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') {
30
29
  submitClass =
31
- "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";
32
- } else if (btnSignInColor === "indigo") {
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
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
- } else if (btnSignInColor === "purple") {
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') {
36
37
  submitClass =
37
- "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";
38
- } else if (btnSignInColor === "pink") {
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') {
39
41
  submitClass =
40
- "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";
41
- } else {
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 {
42
45
  submitClass =
43
- "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";
44
- }
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
+ }
45
48
  </script>
46
49
 
47
50
  <div
48
- 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"
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"
49
52
  >
50
- <form class="space-y-6" {action}>
51
- <h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
52
- <div>
53
- <label
54
- for="email"
55
- class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
56
- >Email</label
57
- >
58
- <input
59
- type="email"
60
- name="email"
61
- id="email"
62
- 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"
63
- placeholder="name@company.com"
64
- required
65
- />
66
- </div>
67
- <div>
68
- <label
69
- for="password"
70
- 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
- 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"
79
- required
80
- />
81
- </div>
82
- <div class="flex items-start">
83
- {#if rememberMe}
84
- <div class="flex items-start">
85
- <div class="flex items-center h-5">
86
- <input
87
- id="remember"
88
- aria-describedby="remember"
89
- type="checkbox"
90
- 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"
91
- required=""
92
- />
93
- </div>
94
- <div class="ml-3 text-sm">
95
- <label
96
- for="remember"
97
- class="font-medium text-gray-900 dark:text-gray-300"
98
- >Remember me</label
99
- >
100
- </div>
101
- </div>
102
- {/if}
103
- {#if lostPasswordLink}
104
- <a
105
- href={lostPasswordLink.href}
106
- rel={lostPasswordLink.rel}
107
- class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500"
108
- >Lost Password?</a
109
- >
110
- {/if}
111
- </div>
112
- <button type="submit" class={submitClass}>Login to your account</button>
113
-
114
- {#if signupLink}
115
- <div class="text-sm font-medium text-gray-500 dark:text-gray-300">
116
- Not registered? <a
117
- href={signupLink.href}
118
- rel={signupLink.rel}
119
- class="text-blue-700 hover:underline dark:text-blue-500"
120
- >Create account</a
121
- >
122
- </div>
123
- {/if}
124
- </form>
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>
125
128
  </div>
@@ -1,45 +1,22 @@
1
- /** @typedef {typeof __propDef.props} SignInCardProps */
2
- /** @typedef {typeof __propDef.events} SignInCardEvents */
3
- /** @typedef {typeof __propDef.slots} SignInCardSlots */
4
- export default class SignInCard extends SvelteComponentTyped<{
5
- action: any;
6
- title?: string;
7
- btnSignInColor?: string;
8
- rememberMe?: boolean;
9
- signupLink?: {
10
- href: string;
11
- rel: string;
12
- };
13
- lostPasswordLink?: {
14
- href: string;
15
- rel: string;
16
- };
17
- }, {
18
- [evt: string]: CustomEvent<any>;
19
- }, {}> {
20
- }
21
- export type SignInCardProps = typeof __propDef.props;
22
- export type SignInCardEvents = typeof __propDef.events;
23
- export type SignInCardSlots = typeof __propDef.slots;
24
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { AuthFunctionType, LinkType } from '../types';
25
3
  declare const __propDef: {
26
4
  props: {
27
- action: any;
5
+ login: AuthFunctionType;
28
6
  title?: string;
29
7
  btnSignInColor?: string;
30
8
  rememberMe?: boolean;
31
- signupLink?: {
32
- href: string;
33
- rel: string;
34
- };
35
- lostPasswordLink?: {
36
- href: string;
37
- rel: string;
38
- };
9
+ signup: LinkType;
10
+ lostPassword: LinkType;
39
11
  };
40
12
  events: {
41
13
  [evt: string]: CustomEvent<any>;
42
14
  };
43
15
  slots: {};
44
16
  };
17
+ export declare type SignInCardProps = typeof __propDef.props;
18
+ export declare type SignInCardEvents = typeof __propDef.events;
19
+ export declare type SignInCardSlots = typeof __propDef.slots;
20
+ export default class SignInCard extends SvelteComponentTyped<SignInCardProps, SignInCardEvents, SignInCardSlots> {
21
+ }
45
22
  export {};