flowbite-svelte 0.22.14 → 0.22.15
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/CHANGELOG.md +14 -0
- package/buttons/Button.svelte +22 -8
- package/buttons/Button.svelte.d.ts +1 -0
- package/cards/Card.svelte +28 -86
- package/cards/Card.svelte.d.ts +6 -11
- package/cards/EcommerceCard.svelte +37 -77
- package/cards/EcommerceCard.svelte.d.ts +0 -1
- package/cards/SignInCard.svelte +32 -50
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.22.15](https://github.com/themesberg/flowbite-svelte/compare/v0.22.14...v0.22.15) (2022-07-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* cards - re-written ([1084f38](https://github.com/themesberg/flowbite-svelte/commit/1084f38514e4cac5662ae6b969dde27e829ea24e))
|
|
11
|
+
* cards - re-written ([52716e0](https://github.com/themesberg/flowbite-svelte/commit/52716e08ac0f4446e3c7160fc3dc83e515201d7d))
|
|
12
|
+
* cards - wip ([0948c89](https://github.com/themesberg/flowbite-svelte/commit/0948c89a124662b7c5c238350df341e0956dac8a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* cards layout on index.md pages ([2080f8e](https://github.com/themesberg/flowbite-svelte/commit/2080f8ee29163a8ad5208f37c95ebf498be92c39))
|
|
18
|
+
|
|
5
19
|
### [0.22.14](https://github.com/themesberg/flowbite-svelte/compare/v0.22.13...v0.22.14) (2022-07-25)
|
|
6
20
|
|
|
7
21
|
|
package/buttons/Button.svelte
CHANGED
|
@@ -3,6 +3,7 @@ export let pill = false;
|
|
|
3
3
|
export let outline = false;
|
|
4
4
|
export let gradient = false;
|
|
5
5
|
export let size = 'md';
|
|
6
|
+
export let href = undefined;
|
|
6
7
|
export let color = 'blue';
|
|
7
8
|
export let shadow = null;
|
|
8
9
|
const colorClasses = {
|
|
@@ -64,13 +65,26 @@ $: gradientOutlineClass = classNames('inline-flex items-center justify-center',
|
|
|
64
65
|
'transition-all duration-75 ease-in group-hover:bg-opacity-0 group-hover:text-inherit');
|
|
65
66
|
</script>
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
|
|
68
|
+
{#if href}
|
|
69
|
+
<a {href} {...$$restProps} class={buttonClass}>
|
|
70
|
+
{#if outline && gradient}
|
|
71
|
+
<!-- Trick to prentend outline without using border
|
|
70
72
|
This has a limitation of no supporting transparency as
|
|
71
73
|
background is set to bg-white dark:bg-gray-900 -->
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</
|
|
74
|
+
<span class={gradientOutlineClass}><slot /></span>
|
|
75
|
+
{:else}
|
|
76
|
+
<slot />
|
|
77
|
+
{/if}
|
|
78
|
+
</a>
|
|
79
|
+
{:else}
|
|
80
|
+
<button type="button" {...$$restProps} class={buttonClass} on:click>
|
|
81
|
+
{#if outline && gradient}
|
|
82
|
+
<!-- Trick to prentend outline without using border
|
|
83
|
+
This has a limitation of no supporting transparency as
|
|
84
|
+
background is set to bg-white dark:bg-gray-900 -->
|
|
85
|
+
<span class={gradientOutlineClass}><slot /></span>
|
|
86
|
+
{:else}
|
|
87
|
+
<slot />
|
|
88
|
+
{/if}
|
|
89
|
+
</button>
|
|
90
|
+
{/if}
|
|
@@ -6,6 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
outline?: boolean;
|
|
7
7
|
gradient?: boolean;
|
|
8
8
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
href?: string;
|
|
9
10
|
color?: 'blue' | 'alternative' | 'dark' | 'light' | 'green' | 'red' | 'yellow' | 'purple';
|
|
10
11
|
shadow?: 'blue' | 'green' | 'cyan' | 'teal' | 'lime' | 'red' | 'pink' | 'purple' | null;
|
|
11
12
|
};
|
package/cards/Card.svelte
CHANGED
|
@@ -1,90 +1,32 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
5
|
-
export let
|
|
6
|
-
export let
|
|
7
|
-
export let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
buttonClass +=
|
|
22
|
-
'bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
23
|
-
}
|
|
24
|
-
else if (btnColor === 'green') {
|
|
25
|
-
buttonClass +=
|
|
26
|
-
'bg-green-700 rounded-lg hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
27
|
-
}
|
|
28
|
-
else if (btnColor === 'indigo') {
|
|
29
|
-
buttonClass +=
|
|
30
|
-
'bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
31
|
-
}
|
|
32
|
-
else if (btnColor === 'purple') {
|
|
33
|
-
buttonClass +=
|
|
34
|
-
'bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
35
|
-
}
|
|
36
|
-
else if (btnColor === 'pink') {
|
|
37
|
-
buttonClass +=
|
|
38
|
-
'bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
buttonClass +=
|
|
42
|
-
'bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
43
|
-
}
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import { setContext } from 'svelte';
|
|
3
|
+
export let href = undefined;
|
|
4
|
+
export let horizontal = false;
|
|
5
|
+
export let reverse = false;
|
|
6
|
+
export let img = undefined;
|
|
7
|
+
export let padding = 'lg';
|
|
8
|
+
setContext('background', true);
|
|
9
|
+
const paddings = {
|
|
10
|
+
sm: 'p-4',
|
|
11
|
+
md: 'p-5',
|
|
12
|
+
lg: 'p-6',
|
|
13
|
+
xl: 'p-8'
|
|
14
|
+
};
|
|
15
|
+
let innerPdding;
|
|
16
|
+
$: innerPdding = paddings[padding];
|
|
17
|
+
let cardClass;
|
|
18
|
+
$: cardClass = classNames('block max-w-sm', 'flex', reverse ? 'flex-col-reverse' : 'flex-col', horizontal && (reverse ? 'md:flex-row-reverse md:max-w-xl' : 'md:flex-row md:max-w-xl'), 'bg-white dark:bg-gray-800 shadow-md', 'text-gray-500 dark:text-gray-400', 'rounded-lg border border-gray-200 dark:border-gray-700', href && 'hover:bg-gray-100 dark:hover:bg-gray-700', !img && innerPdding, $$props.class);
|
|
19
|
+
let imgClass;
|
|
20
|
+
$: imgClass = classNames(reverse ? 'rounded-b-lg' : 'rounded-t-lg', horizontal && 'object-cover w-full h-96 md:h-auto md:w-48 md:rounded-none', horizontal && (reverse ? 'md:rounded-r-lg' : 'md:rounded-l-lg'));
|
|
44
21
|
</script>
|
|
45
22
|
|
|
46
|
-
<
|
|
23
|
+
<svelte:element this={href ? 'a' : 'div'} {href} class={cardClass}>
|
|
47
24
|
{#if img}
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{/if}
|
|
25
|
+
<img class={imgClass} src={img} alt="" />
|
|
26
|
+
<div class={innerPdding}>
|
|
27
|
+
<slot />
|
|
28
|
+
</div>
|
|
29
|
+
{:else}
|
|
30
|
+
<div><slot /></div>
|
|
55
31
|
{/if}
|
|
56
|
-
|
|
57
|
-
{#if header}
|
|
58
|
-
{#if link}
|
|
59
|
-
<a href={link} {rel}>
|
|
60
|
-
<h3 class={headerClass}>
|
|
61
|
-
{header}
|
|
62
|
-
</h3>
|
|
63
|
-
</a>
|
|
64
|
-
{:else}
|
|
65
|
-
<h3 class={headerClass}>
|
|
66
|
-
{header}
|
|
67
|
-
</h3>
|
|
68
|
-
{/if}
|
|
69
|
-
{/if}
|
|
70
|
-
{#if $$slots.paragraph}
|
|
71
|
-
<slot name="paragraph" />
|
|
72
|
-
{/if}
|
|
73
|
-
{#if link && btnLabel}
|
|
74
|
-
<a href={link} {rel} class={buttonClass}>
|
|
75
|
-
{btnLabel}
|
|
76
|
-
<svg
|
|
77
|
-
class="ml-2 -mr-1 w-4 h-4"
|
|
78
|
-
fill="currentColor"
|
|
79
|
-
viewBox="0 0 20 20"
|
|
80
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
-
><path
|
|
82
|
-
fill-rule="evenodd"
|
|
83
|
-
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
|
|
84
|
-
clip-rule="evenodd"
|
|
85
|
-
/></svg
|
|
86
|
-
>
|
|
87
|
-
</a>
|
|
88
|
-
{/if}
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
32
|
+
</svelte:element>
|
package/cards/Card.svelte.d.ts
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Colors } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
href?: string;
|
|
6
|
+
horizontal?: boolean;
|
|
7
|
+
reverse?: boolean;
|
|
8
8
|
img?: string;
|
|
9
|
-
|
|
10
|
-
btnColor?: Colors;
|
|
11
|
-
textdivClass?: string;
|
|
12
|
-
headerClass?: string;
|
|
13
|
-
header?: string;
|
|
14
|
-
divClass?: string;
|
|
9
|
+
padding?: 'sm' | 'md' | 'lg';
|
|
15
10
|
};
|
|
16
11
|
events: {
|
|
17
12
|
[evt: string]: CustomEvent<any>;
|
|
18
13
|
};
|
|
19
14
|
slots: {
|
|
20
|
-
|
|
15
|
+
default: {};
|
|
21
16
|
};
|
|
22
17
|
};
|
|
23
18
|
export declare type CardProps = typeof __propDef.props;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import Badge from '../badges/Badge.svelte';
|
|
2
|
+
import Rating from '../ratings/Rating.svelte';
|
|
3
|
+
import Card from './Card.svelte';
|
|
4
|
+
export let img;
|
|
2
5
|
export let href = '/';
|
|
3
6
|
export let btnColor = 'blue';
|
|
4
7
|
export let rel = '';
|
|
@@ -7,86 +10,43 @@ export let stars = 0;
|
|
|
7
10
|
export let price = '';
|
|
8
11
|
export let btnText = '';
|
|
9
12
|
export let headerClass = 'text-xl font-semibold tracking-tight text-gray-900 dark:text-white';
|
|
10
|
-
export let divClass = 'max-w-sm bg-white rounded-lg shadow-md dark:bg-gray-800 dark:border-gray-700';
|
|
11
13
|
export let priceClass = 'text-3xl font-bold text-gray-900 dark:text-white';
|
|
12
|
-
let spanClass = 'text-xs font-semibold mr-2
|
|
14
|
+
let spanClass = 'flex items-center text-xs font-semibold mr-2 py-0.5 rounded';
|
|
13
15
|
let linkClass = 'text-white focus:ring-4 font-medium rounded-lg text-sm px-5 py-2.5 text-center ';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
else if (btnColor === 'yellow') {
|
|
25
|
-
spanClass += 'bg-yellow-100 text-yellow-800 dark:bg-yellow-200 dark:text-yellow-800';
|
|
26
|
-
linkClass +=
|
|
27
|
-
'bg-yellow-700 hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
28
|
-
}
|
|
29
|
-
else if (btnColor === 'green') {
|
|
30
|
-
spanClass += 'bg-green-100 text-green-800 dark:bg-green-200 dark:text-green-800';
|
|
31
|
-
linkClass +=
|
|
32
|
-
'bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
33
|
-
}
|
|
34
|
-
else if (btnColor === 'indigo') {
|
|
35
|
-
spanClass += 'bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-800';
|
|
36
|
-
linkClass +=
|
|
37
|
-
'bg-indigo-700 hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
38
|
-
}
|
|
39
|
-
else if (btnColor === 'purple') {
|
|
40
|
-
spanClass += 'bg-purple-100 text-purple-800 dark:bg-purple-200 dark:text-purple-800';
|
|
41
|
-
linkClass +=
|
|
42
|
-
'bg-purple-700 hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
43
|
-
}
|
|
44
|
-
else if (btnColor === 'pink') {
|
|
45
|
-
spanClass += 'bg-pink-100 text-pink-800 dark:bg-pink-200 dark:text-pink-800';
|
|
46
|
-
linkClass +=
|
|
47
|
-
'bg-pink-700 hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
spanClass += 'bg-blue-100 text-blue-800 dark:bg-blue-200 dark:text-blue-800';
|
|
51
|
-
linkClass +=
|
|
52
|
-
'bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
53
|
-
}
|
|
16
|
+
const linkColors = {
|
|
17
|
+
gray: 'bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800',
|
|
18
|
+
red: 'bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800',
|
|
19
|
+
yellow: 'bg-yellow-700 hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800',
|
|
20
|
+
green: 'bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800',
|
|
21
|
+
indigo: 'bg-indigo-700 hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800',
|
|
22
|
+
purple: 'bg-purple-700 hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800',
|
|
23
|
+
pink: 'bg-pink-700 hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800',
|
|
24
|
+
blue: 'bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800'
|
|
25
|
+
};
|
|
54
26
|
</script>
|
|
55
27
|
|
|
56
|
-
<
|
|
28
|
+
<Card padding="sm">
|
|
57
29
|
<a {href} {rel}>
|
|
58
|
-
<img class="p-
|
|
30
|
+
<img class="p-3 rounded-t-lg" src={img.src} alt={img.alt} />
|
|
59
31
|
</a>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<span class={spanClass}>{stars}</span>
|
|
80
|
-
{/if}
|
|
81
|
-
</div>
|
|
82
|
-
<slot />
|
|
83
|
-
<div class="flex justify-between items-center">
|
|
84
|
-
{#if price}
|
|
85
|
-
<span class={priceClass}>{price}</span>
|
|
86
|
-
{/if}
|
|
87
|
-
{#if btnText}
|
|
88
|
-
<a {href} {rel} class={linkClass}>{btnText}</a>
|
|
89
|
-
{/if}
|
|
90
|
-
</div>
|
|
32
|
+
|
|
33
|
+
<a {href} {rel}>
|
|
34
|
+
<h3 class={headerClass}>
|
|
35
|
+
{title}
|
|
36
|
+
</h3>
|
|
37
|
+
</a>
|
|
38
|
+
{#if stars}
|
|
39
|
+
<Rating rating={stars} divClass={spanClass}>
|
|
40
|
+
<Badge slot="text" color={btnColor}>5</Badge>
|
|
41
|
+
</Rating>
|
|
42
|
+
{/if}
|
|
43
|
+
<slot />
|
|
44
|
+
<div class="flex justify-between items-center">
|
|
45
|
+
{#if price}
|
|
46
|
+
<span class={priceClass}>{price}</span>
|
|
47
|
+
{/if}
|
|
48
|
+
{#if btnText}
|
|
49
|
+
<a {href} {rel} class="{linkClass} {linkColors[btnColor]}">{btnText}</a>
|
|
50
|
+
{/if}
|
|
91
51
|
</div>
|
|
92
|
-
</
|
|
52
|
+
</Card>
|
package/cards/SignInCard.svelte
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script>import Alert from '../alerts/Alert.svelte';
|
|
2
|
+
import Button from '../buttons/Button.svelte';
|
|
3
|
+
import Input from '../forms/Input.svelte';
|
|
4
|
+
import Card from './Card.svelte';
|
|
5
|
+
import Label from '../forms/Label.svelte';
|
|
6
|
+
import Checkbox from '../forms/Checkbox.svelte';
|
|
2
7
|
export let login;
|
|
3
8
|
export let title = 'Sign in';
|
|
4
9
|
export let btnSignInColor = 'blue';
|
|
@@ -8,60 +13,33 @@ export let lostPassword;
|
|
|
8
13
|
let email;
|
|
9
14
|
let password;
|
|
10
15
|
let error;
|
|
11
|
-
let submitClass = 'w-full text-white focus:ring-4 font-medium rounded-lg text-sm px-5 py-2.5 text-center ';
|
|
12
|
-
if (btnSignInColor === 'blue') {
|
|
13
|
-
submitClass += 'bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
14
|
-
}
|
|
15
|
-
else if (btnSignInColor === 'gray') {
|
|
16
|
-
submitClass += 'bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
17
|
-
}
|
|
18
|
-
else if (btnSignInColor === 'red') {
|
|
19
|
-
submitClass += 'bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
20
|
-
}
|
|
21
|
-
else if (btnSignInColor === 'yellow') {
|
|
22
|
-
submitClass += 'bg-yellow-700 hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
23
|
-
}
|
|
24
|
-
else if (btnSignInColor === 'green') {
|
|
25
|
-
submitClass += 'bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
26
|
-
}
|
|
27
|
-
else if (btnSignInColor === 'indigo') {
|
|
28
|
-
submitClass += 'bg-indigo-700 hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
29
|
-
}
|
|
30
|
-
else if (btnSignInColor === 'purple') {
|
|
31
|
-
submitClass += 'bg-purple-700 hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
32
|
-
}
|
|
33
|
-
else if (btnSignInColor === 'pink') {
|
|
34
|
-
submitClass += 'bg-pink-700 hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
submitClass += 'bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
38
|
-
}
|
|
39
16
|
</script>
|
|
40
17
|
|
|
41
|
-
<
|
|
42
|
-
<form class="space-y-6" on:submit|preventDefault={login}>
|
|
18
|
+
<Card>
|
|
19
|
+
<form class="flex flex-col space-y-6" on:submit|preventDefault={login}>
|
|
43
20
|
<h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
21
|
+
|
|
22
|
+
<Label class="space-y-2">
|
|
23
|
+
<span>Email</span>
|
|
24
|
+
<Input type="email" name="email" bind:value={email} placeholder="name@company.com" required />
|
|
25
|
+
</Label>
|
|
26
|
+
|
|
27
|
+
<Label class="space-y-2">
|
|
28
|
+
<span>Your password</span>
|
|
29
|
+
<Input type="password" name="password" placeholder="•••••" bind:value={password} required />
|
|
30
|
+
</Label>
|
|
31
|
+
|
|
52
32
|
<div class="flex items-start">
|
|
53
33
|
{#if rememberMe}
|
|
54
|
-
<
|
|
55
|
-
<div class="flex items-center h-5">
|
|
56
|
-
<input id="remember" aria-describedby="remember" type="checkbox" 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" />
|
|
57
|
-
</div>
|
|
58
|
-
<div class="ml-3 text-sm">
|
|
59
|
-
<label for="remember" class="font-medium text-gray-900 dark:text-gray-300">Remember me</label>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
34
|
+
<Checkbox>Remember me</Checkbox>
|
|
62
35
|
{/if}
|
|
63
36
|
{#if lostPassword}
|
|
64
|
-
<a
|
|
37
|
+
<a
|
|
38
|
+
href={lostPassword.href}
|
|
39
|
+
rel={lostPassword.rel}
|
|
40
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500"
|
|
41
|
+
>{lostPassword.name}</a
|
|
42
|
+
>
|
|
65
43
|
{/if}
|
|
66
44
|
</div>
|
|
67
45
|
{#if error}
|
|
@@ -71,11 +49,15 @@ else {
|
|
|
71
49
|
</Alert>
|
|
72
50
|
</div>
|
|
73
51
|
{/if}
|
|
74
|
-
<
|
|
52
|
+
<Button type="submit" color={btnSignInColor} class="w-full1">Login to your account</Button>
|
|
75
53
|
{#if signup}
|
|
76
54
|
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">
|
|
77
|
-
Not registered? <a
|
|
55
|
+
Not registered? <a
|
|
56
|
+
href={signup.href}
|
|
57
|
+
rel={signup.rel}
|
|
58
|
+
class="text-blue-700 hover:underline dark:text-blue-500">{signup.name}</a
|
|
59
|
+
>
|
|
78
60
|
</div>
|
|
79
61
|
{/if}
|
|
80
62
|
</form>
|
|
81
|
-
</
|
|
63
|
+
</Card>
|