flowbite-svelte 0.9.4 → 0.9.7
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 +24 -0
- package/auth/Register.svelte +116 -0
- package/auth/Register.svelte.d.ts +23 -0
- package/auth/Reset.svelte +57 -0
- package/auth/Reset.svelte.d.ts +22 -0
- 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 -3
- package/cards/CtaCard.svelte.d.ts +1 -0
- package/cards/EcommerceCard.svelte +3 -2
- package/cards/EcommerceCard.svelte.d.ts +2 -1
- package/cards/HorizontalCard.svelte +14 -17
- package/cards/HorizontalCard.svelte.d.ts +8 -3
- package/cards/InteractiveCard.svelte +2 -3
- package/cards/InteractiveCard.svelte.d.ts +3 -2
- package/cards/ListCard.svelte +43 -79
- package/cards/ListCard.svelte.d.ts +9 -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/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/navbar/DropdownNavbar.svelte +16 -19
- package/navbar/DropdownNavbar.svelte.d.ts +7 -0
- package/navbar/Navbar.svelte +10 -13
- package/navbar/Navbar.svelte.d.ts +4 -0
- package/package.json +7 -2
- package/spinners/Spinner.svelte +1 -1
- package/spinners/Spinner.svelte.d.ts +1 -1
- package/spinners/SpinnerButton.svelte +1 -1
- package/types.d.ts +19 -5
package/cards/SignInCard.svelte
CHANGED
|
@@ -1,125 +1,128 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
5
|
+
login: AuthFunctionType;
|
|
28
6
|
title?: string;
|
|
29
7
|
btnSignInColor?: string;
|
|
30
8
|
rememberMe?: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
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 {};
|
|
@@ -1,117 +1,108 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
paddings =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const handleToggle = () => {
|
|
24
|
-
console.log("toggle clicked.");
|
|
1
|
+
<script >export let label = 'Dropdown button';
|
|
2
|
+
export let rounded = false;
|
|
3
|
+
export let textSize = 'text-sm';
|
|
4
|
+
export let color = 'blue';
|
|
5
|
+
let paddings;
|
|
6
|
+
if (textSize === 'text-xs') {
|
|
7
|
+
paddings = 'py-2 px-3';
|
|
8
|
+
}
|
|
9
|
+
else if (textSize === 'text-sm') {
|
|
10
|
+
paddings = 'py-2.5 px-5';
|
|
11
|
+
}
|
|
12
|
+
else if (textSize === 'text-base') {
|
|
13
|
+
paddings = 'py-3 px-6';
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
paddings = 'py-2.5 px-5';
|
|
17
|
+
}
|
|
18
|
+
let buttonClass;
|
|
19
|
+
let round = rounded ? 'rounded-full' : 'rounded-lg';
|
|
20
|
+
let toggleHidden = true;
|
|
21
|
+
const handleToggle = () => {
|
|
22
|
+
console.log('toggle clicked.');
|
|
25
23
|
toggleHidden = !toggleHidden;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
link: "/",
|
|
31
|
-
label: "Dashboard",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
link: "/",
|
|
35
|
-
label: "Settings",
|
|
36
|
-
divider: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
link: "/",
|
|
40
|
-
label: "Sign out",
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
if (color === "blue") {
|
|
24
|
+
};
|
|
25
|
+
export let items;
|
|
26
|
+
if (color === 'blue') {
|
|
44
27
|
buttonClass = `inline-flex items-center text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`;
|
|
45
|
-
|
|
28
|
+
}
|
|
29
|
+
else if (color === 'blue-outline') {
|
|
46
30
|
buttonClass = `inline-flex items-center text-blue-700 hover:text-white border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-blue-500 dark:text-blue-500 dark:hover:text-white dark:hover:bg-blue-600 dark:focus:ring-blue-800`;
|
|
47
|
-
|
|
31
|
+
}
|
|
32
|
+
else if (color === 'dark') {
|
|
48
33
|
buttonClass =
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
buttonClass = `inline-flex items-center text-white bg-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700`;
|
|
35
|
+
}
|
|
36
|
+
else if (color === 'dark-outline') {
|
|
51
37
|
buttonClass = `inline-flex items-center text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-gray-600 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-800`;
|
|
52
|
-
|
|
38
|
+
}
|
|
39
|
+
else if (color === 'light') {
|
|
53
40
|
buttonClass = `inline-flex items-center text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-800`;
|
|
54
|
-
|
|
41
|
+
}
|
|
42
|
+
else if (color === 'green') {
|
|
55
43
|
buttonClass = `inline-flex items-center text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800`;
|
|
56
|
-
|
|
44
|
+
}
|
|
45
|
+
else if (color === 'green-outline') {
|
|
57
46
|
buttonClass = `inline-flex items-center text-green-700 hover:text-white border border-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-green-500 dark:text-green-500 dark:hover:text-white dark:hover:bg-green-600 dark:focus:ring-green-800`;
|
|
58
|
-
|
|
47
|
+
}
|
|
48
|
+
else if (color === 'red') {
|
|
59
49
|
buttonClass = `inline-flex items-center text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900`;
|
|
60
|
-
|
|
50
|
+
}
|
|
51
|
+
else if (color === 'red-outline') {
|
|
61
52
|
buttonClass = `inline-flex items-center text-red-700 hover:text-white border border-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-red-500 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600 dark:focus:ring-red-900`;
|
|
62
|
-
|
|
53
|
+
}
|
|
54
|
+
else if (color === 'yellow') {
|
|
63
55
|
buttonClass = `inline-flex items-center text-white bg-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:focus:ring-yellow-900`;
|
|
64
|
-
|
|
56
|
+
}
|
|
57
|
+
else if (color === 'yellow-outline') {
|
|
65
58
|
buttonClass = `inline-flex items-center text-yellow-400 hover:text-white border border-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-yellow-300 dark:text-yellow-300 dark:hover:text-white dark:hover:bg-yellow-400 dark:focus:ring-yellow-900`;
|
|
66
|
-
|
|
59
|
+
}
|
|
60
|
+
else if (color === 'purple') {
|
|
67
61
|
buttonClass = `inline-flex items-center text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium ${round} ${textSize} ${paddings} text-center mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900`;
|
|
68
|
-
|
|
62
|
+
}
|
|
63
|
+
else if (color === 'purple-outline') {
|
|
69
64
|
buttonClass = `inline-flex items-center text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-purple-400 dark:text-purple-400 dark:hover:text-white dark:hover:bg-purple-500 dark:focus:ring-purple-900`;
|
|
70
|
-
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
71
67
|
// blue
|
|
72
68
|
buttonClass = `inline-flex items-center text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`;
|
|
73
|
-
|
|
69
|
+
}
|
|
74
70
|
</script>
|
|
75
71
|
|
|
76
72
|
<button on:click={handleToggle} class={buttonClass} type="button"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
stroke-linejoin="round"
|
|
87
|
-
stroke-width="2"
|
|
88
|
-
d="M19 9l-7 7-7-7"
|
|
89
|
-
/>
|
|
90
|
-
</svg>
|
|
73
|
+
>{label}
|
|
74
|
+
<svg
|
|
75
|
+
class="ml-2 w-4 h-4"
|
|
76
|
+
fill="none"
|
|
77
|
+
stroke="currentColor"
|
|
78
|
+
viewBox="0 0 24 24"
|
|
79
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
80
|
+
><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
81
|
+
</svg>
|
|
91
82
|
</button>
|
|
92
83
|
|
|
93
84
|
<div
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
class:hidden={toggleHidden}
|
|
86
|
+
class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700"
|
|
96
87
|
>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
88
|
+
{#if $$slots.header}
|
|
89
|
+
<div class="py-3 px-4 text-gray-900 dark:text-white">
|
|
90
|
+
<slot name="header" />
|
|
91
|
+
</div>
|
|
92
|
+
{/if}
|
|
93
|
+
<ul class="py-1" aria-labelledby="dropdownButton">
|
|
94
|
+
{#each items as { href, name, divider }}
|
|
95
|
+
<li
|
|
96
|
+
class:border-b={divider}
|
|
97
|
+
class:border-gray-100={divider}
|
|
98
|
+
class:dark:border-gray-500={divider}
|
|
99
|
+
>
|
|
100
|
+
<a
|
|
101
|
+
{href}
|
|
102
|
+
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
|
|
103
|
+
>{name}</a
|
|
104
|
+
>
|
|
105
|
+
</li>
|
|
106
|
+
{/each}
|
|
107
|
+
</ul>
|
|
117
108
|
</div>
|
|
@@ -1,45 +1,12 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} DropdownDefaultProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} DropdownDefaultEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} DropdownDefaultSlots */
|
|
4
|
-
export default class DropdownDefault extends SvelteComponentTyped<{
|
|
5
|
-
label?: string;
|
|
6
|
-
rounded?: boolean;
|
|
7
|
-
textSize?: string;
|
|
8
|
-
color?: string;
|
|
9
|
-
items?: ({
|
|
10
|
-
link: string;
|
|
11
|
-
label: string;
|
|
12
|
-
divider?: undefined;
|
|
13
|
-
} | {
|
|
14
|
-
link: string;
|
|
15
|
-
label: string;
|
|
16
|
-
divider: boolean;
|
|
17
|
-
})[];
|
|
18
|
-
}, {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
}, {
|
|
21
|
-
header: {};
|
|
22
|
-
}> {
|
|
23
|
-
}
|
|
24
|
-
export type DropdownDefaultProps = typeof __propDef.props;
|
|
25
|
-
export type DropdownDefaultEvents = typeof __propDef.events;
|
|
26
|
-
export type DropdownDefaultSlots = typeof __propDef.slots;
|
|
27
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { DropdownType } from '../types';
|
|
28
3
|
declare const __propDef: {
|
|
29
4
|
props: {
|
|
30
5
|
label?: string;
|
|
31
6
|
rounded?: boolean;
|
|
32
7
|
textSize?: string;
|
|
33
8
|
color?: string;
|
|
34
|
-
items
|
|
35
|
-
link: string;
|
|
36
|
-
label: string;
|
|
37
|
-
divider?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
link: string;
|
|
40
|
-
label: string;
|
|
41
|
-
divider: boolean;
|
|
42
|
-
})[];
|
|
9
|
+
items: DropdownType[];
|
|
43
10
|
};
|
|
44
11
|
events: {
|
|
45
12
|
[evt: string]: CustomEvent<any>;
|
|
@@ -48,4 +15,9 @@ declare const __propDef: {
|
|
|
48
15
|
header: {};
|
|
49
16
|
};
|
|
50
17
|
};
|
|
18
|
+
export declare type DropdownDefaultProps = typeof __propDef.props;
|
|
19
|
+
export declare type DropdownDefaultEvents = typeof __propDef.events;
|
|
20
|
+
export declare type DropdownDefaultSlots = typeof __propDef.slots;
|
|
21
|
+
export default class DropdownDefault extends SvelteComponentTyped<DropdownDefaultProps, DropdownDefaultEvents, DropdownDefaultSlots> {
|
|
22
|
+
}
|
|
51
23
|
export {};
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import AccordionItem from "./accordions/AccordionItem.svelte";
|
|
|
3
3
|
import Alert from "./alerts/Alert.svelte";
|
|
4
4
|
import BorderAlert from "./alerts/BorderAlert.svelte";
|
|
5
5
|
import InfoAlert from "./alerts/InfoAlert.svelte";
|
|
6
|
+
import Confirm from "./auth/Confirm.svelte";
|
|
7
|
+
import ForgotPassword from "./auth/ForgotPassword.svelte";
|
|
8
|
+
import Login from "./auth/Login.svelte";
|
|
9
|
+
import Register from "./auth/Register.svelte";
|
|
10
|
+
import Reset from "./auth/Reset.svelte";
|
|
6
11
|
import Badge from "./badges/Badge.svelte";
|
|
7
12
|
import BadgeIcon from "./badges/BadgeIcon.svelte";
|
|
8
13
|
import BadgeLink from "./badges/BadgeLink.svelte";
|
|
@@ -43,4 +48,4 @@ import DefaultTabs from "./tabs/DefaultTabs.svelte";
|
|
|
43
48
|
import PillTabs from "./tabs/PillTabs.svelte";
|
|
44
49
|
import Tooltip from "./tooltips/Tooltip.svelte";
|
|
45
50
|
import LightTooltip from "./tooltips/LightTooltip.svelte";
|
|
46
|
-
export { Accordion, AccordionItem, Alert, BorderAlert, InfoAlert, Badge, BadgeIcon, BadgeLink, Button, ColorShadowButton, GradientDuotoneButton, GradientMonochromeButton, GradientOutlineButton, ButtonGroup, ButtonGroupOutline, Card, HorizontalCard, InteractiveCard, ListCard, CtaCard, EcommerceCard, SignInCard, DarkMode, Dropdown, SimpleFooter, LogoFooter, SocialMediaFooter, SitemapFooter, List, modalIdStore, ExtraLargeModal, LargeModal, MediumModal, ModalButton, SignInModal, SmallModal, Navbar, DropdownNavbar, Spinner, SpinnerButton, InteractiveTabs, DefaultTabs, PillTabs, Tooltip, LightTooltip };
|
|
51
|
+
export { Accordion, AccordionItem, Alert, BorderAlert, InfoAlert, Confirm, ForgotPassword, Login, Register, Reset, Badge, BadgeIcon, BadgeLink, Button, ColorShadowButton, GradientDuotoneButton, GradientMonochromeButton, GradientOutlineButton, ButtonGroup, ButtonGroupOutline, Card, HorizontalCard, InteractiveCard, ListCard, CtaCard, EcommerceCard, SignInCard, DarkMode, Dropdown, SimpleFooter, LogoFooter, SocialMediaFooter, SitemapFooter, List, modalIdStore, ExtraLargeModal, LargeModal, MediumModal, ModalButton, SignInModal, SmallModal, Navbar, DropdownNavbar, Spinner, SpinnerButton, InteractiveTabs, DefaultTabs, PillTabs, Tooltip, LightTooltip };
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Accordion
|
|
1
2
|
import Accordion from './accordions/AccordionDefault.svelte'
|
|
2
3
|
import AccordionItem from './accordions/AccordionItem.svelte'
|
|
3
4
|
|
|
@@ -6,6 +7,13 @@ import Alert from './alerts/Alert.svelte'
|
|
|
6
7
|
import BorderAlert from './alerts/BorderAlert.svelte'
|
|
7
8
|
import InfoAlert from './alerts/InfoAlert.svelte'
|
|
8
9
|
|
|
10
|
+
// Auth
|
|
11
|
+
import Confirm from './auth/Confirm.svelte'
|
|
12
|
+
import ForgotPassword from './auth/ForgotPassword.svelte'
|
|
13
|
+
import Login from './auth/Login.svelte'
|
|
14
|
+
import Register from './auth/Register.svelte'
|
|
15
|
+
import Reset from './auth/Reset.svelte'
|
|
16
|
+
|
|
9
17
|
// Badges
|
|
10
18
|
import Badge from './badges/Badge.svelte'
|
|
11
19
|
import BadgeIcon from './badges/BadgeIcon.svelte'
|
|
@@ -80,6 +88,12 @@ export {
|
|
|
80
88
|
Alert,
|
|
81
89
|
BorderAlert,
|
|
82
90
|
InfoAlert,
|
|
91
|
+
// auth
|
|
92
|
+
Confirm,
|
|
93
|
+
ForgotPassword,
|
|
94
|
+
Login,
|
|
95
|
+
Register,
|
|
96
|
+
Reset,
|
|
83
97
|
// Badges
|
|
84
98
|
Badge,
|
|
85
99
|
BadgeIcon,
|