flowbite-svelte 0.12.3 → 0.13.1
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 +5 -0
- package/accordions/AccordionItem.svelte +4 -8
- package/accordions/AccordionItem.svelte.d.ts +2 -0
- package/alerts/BorderAlert.svelte +11 -36
- package/avatar/Avatar.svelte +2 -20
- package/avatar/Avatar.svelte.d.ts +1 -1
- package/badges/BadgeLink.svelte +2 -2
- package/badges/BadgeLink.svelte.d.ts +1 -1
- package/buttons/Button.svelte +1 -2
- package/buttons/GradientOutlineButton.svelte +8 -16
- package/cards/Card.svelte +11 -30
- package/cards/EcommerceCard.svelte +24 -53
- package/cards/EcommerceCard.svelte.d.ts +2 -2
- package/cards/InteractiveCard.svelte +14 -51
- package/cards/InteractiveCard.svelte.d.ts +2 -2
- package/cards/ListCard.svelte +2 -8
- package/cards/SignInCard.svelte +18 -65
- package/cards/SignInCard.svelte.d.ts +2 -2
- package/darkmode/DarkMode.svelte +4 -28
- package/dropdowns/DropdownDefault.svelte +5 -24
- package/dropdowns/DropdownDefault.svelte.d.ts +2 -2
- package/footer/SitemapFooter.svelte +1 -3
- package/forms/Checkbox.svelte +2 -16
- package/forms/Checkbox.svelte.d.ts +2 -7
- package/forms/FloatingLabelInput.svelte +2 -1
- package/forms/FloatingLabelInput.svelte.d.ts +3 -2
- package/forms/Iconinput.svelte +3 -2
- package/forms/Iconinput.svelte.d.ts +3 -2
- package/forms/Input.svelte +4 -13
- package/forms/Input.svelte.d.ts +2 -1
- package/forms/Radio.svelte +2 -30
- package/forms/Radio.svelte.d.ts +2 -7
- package/forms/Select.svelte +4 -3
- package/forms/SingleCheckbox.svelte +4 -11
- package/forms/SingleCheckbox.svelte.d.ts +1 -1
- package/forms/Textarea.svelte +3 -2
- package/forms/Toggle.svelte +5 -4
- package/index.d.ts +3 -0
- package/index.js +7 -0
- package/list-group/List.svelte +1 -3
- package/modals/ExtraLargeModal.svelte +42 -99
- package/modals/LargeModal.svelte +42 -99
- package/modals/MediumModal.svelte +39 -93
- package/modals/ModalButton.svelte +10 -19
- package/modals/ModalButton.svelte.d.ts +1 -0
- package/modals/SignInModal.svelte +22 -94
- package/modals/SmallModal.svelte +42 -99
- package/navbar/DropdownNavbar.svelte +5 -43
- package/navbar/Navbar.svelte +4 -31
- package/package.json +5 -2
- package/paginations/Next.svelte +1 -11
- package/paginations/Pagination.svelte +2 -22
- package/paginations/Previous.svelte +1 -11
- package/progressbars/Progressbar.svelte +47 -0
- package/progressbars/Progressbar.svelte.d.ts +21 -0
- package/spinners/Spinner.svelte +4 -22
- package/tables/Table.svelte +21 -3
- package/tables/Table.svelte.d.ts +12 -16
- package/tables/TableDefaultRow.svelte +57 -0
- package/tables/TableDefaultRow.svelte.d.ts +17 -0
- package/tabs/IconTabs.svelte +2 -10
- package/tabs/InteractiveTabHead.svelte +2 -17
- package/tabs/InteractiveTabs.svelte +2 -15
- package/tabs/UnderlineTabs.svelte +1 -8
- package/toasts/Toast.svelte +9 -27
- package/toasts/Toast.svelte.d.ts +2 -2
- package/tooltips/Tooltip.svelte +1 -9
- package/types.d.ts +22 -0
- package/utils/generateId.d.ts +1 -0
- package/utils/generateId.js +5 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { LinkType, ImgType } from '../types';
|
|
2
|
+
import type { LinkType, ImgType, Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
dropdownLinks: LinkType[];
|
|
6
6
|
img: ImgType;
|
|
7
7
|
header?: string;
|
|
8
8
|
content?: string;
|
|
9
|
-
buttonColor?:
|
|
9
|
+
buttonColor?: Colors;
|
|
10
10
|
link1: LinkType;
|
|
11
11
|
link2: LinkType;
|
|
12
12
|
headerClass?: string;
|
package/cards/ListCard.svelte
CHANGED
|
@@ -9,11 +9,7 @@ export let divClass = 'p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8
|
|
|
9
9
|
<h3 class="text-xl font-bold leading-none text-gray-900 dark:text-white">
|
|
10
10
|
{title}
|
|
11
11
|
</h3>
|
|
12
|
-
<a
|
|
13
|
-
href={action.href}
|
|
14
|
-
rel={action.rel}
|
|
15
|
-
class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
|
|
16
|
-
>
|
|
12
|
+
<a href={action.href} rel={action.rel} class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-500">
|
|
17
13
|
{action.name}
|
|
18
14
|
</a>
|
|
19
15
|
</div>
|
|
@@ -33,9 +29,7 @@ export let divClass = 'p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8
|
|
|
33
29
|
{field2}
|
|
34
30
|
</p>
|
|
35
31
|
</div>
|
|
36
|
-
<div
|
|
37
|
-
class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white"
|
|
38
|
-
>
|
|
32
|
+
<div class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">
|
|
39
33
|
{field3}
|
|
40
34
|
</div>
|
|
41
35
|
</div>
|
package/cards/SignInCard.svelte
CHANGED
|
@@ -10,101 +10,58 @@ let password;
|
|
|
10
10
|
let error;
|
|
11
11
|
let submitClass;
|
|
12
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';
|
|
13
|
+
submitClass = '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
14
|
}
|
|
16
15
|
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';
|
|
16
|
+
submitClass = '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
17
|
}
|
|
20
18
|
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';
|
|
19
|
+
submitClass = '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
20
|
}
|
|
24
21
|
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';
|
|
22
|
+
submitClass = '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
23
|
}
|
|
28
24
|
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';
|
|
25
|
+
submitClass = '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
26
|
}
|
|
32
27
|
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';
|
|
28
|
+
submitClass = '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
29
|
}
|
|
36
30
|
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';
|
|
31
|
+
submitClass = '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
32
|
}
|
|
40
33
|
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';
|
|
34
|
+
submitClass = '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
35
|
}
|
|
44
36
|
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';
|
|
37
|
+
submitClass = '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
38
|
}
|
|
48
39
|
</script>
|
|
49
40
|
|
|
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
|
-
>
|
|
41
|
+
<div 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">
|
|
53
42
|
<form class="space-y-6" on:submit|preventDefault={login}>
|
|
54
43
|
<h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
|
|
55
44
|
<div>
|
|
56
|
-
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
57
|
-
|
|
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
|
-
/>
|
|
45
|
+
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">Email</label>
|
|
46
|
+
<input type="email" name="email" id="email" bind:value={email} 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" placeholder="name@company.com" required />
|
|
68
47
|
</div>
|
|
69
48
|
<div>
|
|
70
|
-
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
71
|
-
|
|
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
|
-
/>
|
|
49
|
+
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">Your password</label>
|
|
50
|
+
<input type="password" name="password" id="password" placeholder="••••••••" bind:value={password} 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" required />
|
|
82
51
|
</div>
|
|
83
52
|
<div class="flex items-start">
|
|
84
53
|
{#if rememberMe}
|
|
85
54
|
<div class="flex items-start">
|
|
86
55
|
<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
|
-
/>
|
|
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" />
|
|
93
57
|
</div>
|
|
94
58
|
<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
|
-
>
|
|
59
|
+
<label for="remember" class="font-medium text-gray-900 dark:text-gray-300">Remember me</label>
|
|
98
60
|
</div>
|
|
99
61
|
</div>
|
|
100
62
|
{/if}
|
|
101
63
|
{#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
|
-
>
|
|
64
|
+
<a href={lostPassword.href} rel={lostPassword.rel} class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500">{lostPassword.name}</a>
|
|
108
65
|
{/if}
|
|
109
66
|
</div>
|
|
110
67
|
{#if error}
|
|
@@ -117,11 +74,7 @@ else {
|
|
|
117
74
|
<button type="submit" class={submitClass}>Login to your account</button>
|
|
118
75
|
{#if signup}
|
|
119
76
|
<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
|
-
>
|
|
77
|
+
Not registered? <a href={signup.href} rel={signup.rel} class="text-blue-700 hover:underline dark:text-blue-500">{signup.name}</a>
|
|
125
78
|
</div>
|
|
126
79
|
{/if}
|
|
127
80
|
</form>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { AuthFunctionType, LinkType } from '../types';
|
|
2
|
+
import type { AuthFunctionType, LinkType, Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
login: AuthFunctionType;
|
|
6
6
|
title?: string;
|
|
7
|
-
btnSignInColor?:
|
|
7
|
+
btnSignInColor?: Colors;
|
|
8
8
|
rememberMe?: boolean;
|
|
9
9
|
signup: LinkType;
|
|
10
10
|
lostPassword: LinkType;
|
package/darkmode/DarkMode.svelte
CHANGED
|
@@ -21,9 +21,7 @@ const toggleTheme = () => {
|
|
|
21
21
|
onMount(() => {
|
|
22
22
|
let themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
|
|
23
23
|
let themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
|
|
24
|
-
if (localStorage.getItem('color-theme') === 'dark' ||
|
|
25
|
-
(!('color-theme' in localStorage) &&
|
|
26
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
24
|
+
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
27
25
|
document.documentElement.classList.add('dark');
|
|
28
26
|
themeToggleDarkIcon.classList.add('hidden');
|
|
29
27
|
}
|
|
@@ -34,32 +32,10 @@ onMount(() => {
|
|
|
34
32
|
});
|
|
35
33
|
</script>
|
|
36
34
|
|
|
37
|
-
<button
|
|
38
|
-
on:click={
|
|
39
|
-
aria-label="Dark mode"
|
|
40
|
-
id="theme-toggle"
|
|
41
|
-
type="button"
|
|
42
|
-
class={btnClass}
|
|
43
|
-
>
|
|
44
|
-
<svg
|
|
45
|
-
class:hidden={mode === 'light'}
|
|
46
|
-
on:click={() => (mode = 'dark')}
|
|
47
|
-
id="theme-toggle-dark-icon"
|
|
48
|
-
class="hidden w-5 h-5"
|
|
49
|
-
fill="currentColor"
|
|
50
|
-
viewBox="0 0 20 20"
|
|
51
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
-
><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" /></svg
|
|
53
|
-
>
|
|
35
|
+
<button on:click={toggleTheme} aria-label="Dark mode" id="theme-toggle" type="button" class={btnClass}>
|
|
36
|
+
<svg class:hidden={mode === 'light'} on:click={() => (mode = 'dark')} id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" /></svg>
|
|
54
37
|
|
|
55
|
-
<svg
|
|
56
|
-
class:hidden={mode === 'dark'}
|
|
57
|
-
on:click={() => (mode = 'light')}
|
|
58
|
-
id="theme-toggle-light-icon"
|
|
59
|
-
class="hidden w-5 h-5"
|
|
60
|
-
fill="currentColor"
|
|
61
|
-
viewBox="0 0 20 20"
|
|
62
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
+
<svg class:hidden={mode === 'dark'} on:click={() => (mode = 'light')} id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
|
|
63
39
|
><path
|
|
64
40
|
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
|
|
65
41
|
fill-rule="evenodd"
|
|
@@ -30,8 +30,7 @@ else if (color === 'blue-outline') {
|
|
|
30
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`;
|
|
31
31
|
}
|
|
32
32
|
else if (color === 'dark') {
|
|
33
|
-
buttonClass =
|
|
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`;
|
|
33
|
+
buttonClass = 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
34
|
}
|
|
36
35
|
else if (color === 'dark-outline') {
|
|
37
36
|
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`;
|
|
@@ -71,20 +70,10 @@ else {
|
|
|
71
70
|
|
|
72
71
|
<button on:click={handleToggle} class={buttonClass} type="button"
|
|
73
72
|
>{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>
|
|
73
|
+
<svg class="ml-2 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> </svg>
|
|
82
74
|
</button>
|
|
83
75
|
|
|
84
|
-
<div
|
|
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"
|
|
87
|
-
>
|
|
76
|
+
<div class:hidden={toggleHidden} class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700">
|
|
88
77
|
{#if $$slots.header}
|
|
89
78
|
<div class="py-3 px-4 text-gray-900 dark:text-white">
|
|
90
79
|
<slot name="header" />
|
|
@@ -92,16 +81,8 @@ else {
|
|
|
92
81
|
{/if}
|
|
93
82
|
<ul class="py-1" aria-labelledby="dropdownButton">
|
|
94
83
|
{#each items as { href, name, divider }}
|
|
95
|
-
<li
|
|
96
|
-
class:
|
|
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
|
-
>
|
|
84
|
+
<li class:border-b={divider} class:border-gray-100={divider} class:dark:border-gray-500={divider}>
|
|
85
|
+
<a {href} 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">{name}</a>
|
|
105
86
|
</li>
|
|
106
87
|
{/each}
|
|
107
88
|
</ul>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { DropdownType } from '../types';
|
|
2
|
+
import type { DropdownType, Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
label?: string;
|
|
6
6
|
rounded?: boolean;
|
|
7
7
|
textSize?: string;
|
|
8
|
-
color?:
|
|
8
|
+
color?: Colors;
|
|
9
9
|
items: DropdownType[];
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
@@ -33,9 +33,7 @@ export let allRightsReserved = 'All Rights Reserved.';
|
|
|
33
33
|
{/each}
|
|
34
34
|
</div>
|
|
35
35
|
<div class={copyrightDivClass}>
|
|
36
|
-
<span class={copyrightClass}
|
|
37
|
-
>{copyrightYear} <a href={site.href}>{site.name}</a>. {allRightsReserved}
|
|
38
|
-
</span>
|
|
36
|
+
<span class={copyrightClass}>{copyrightYear} <a href={site.href}>{site.name}</a>. {allRightsReserved} </span>
|
|
39
37
|
<div class={socialMediaDivClass}>
|
|
40
38
|
{#each socialMedia as { href, icon }}
|
|
41
39
|
<a {href} class={socialMediaLinkClass}>
|
package/forms/Checkbox.svelte
CHANGED
|
@@ -12,14 +12,7 @@ export let options;
|
|
|
12
12
|
{#if option.helper}
|
|
13
13
|
<div class="flex mb-4">
|
|
14
14
|
<div class="flex items-center h-5">
|
|
15
|
-
<input
|
|
16
|
-
id={option.id}
|
|
17
|
-
aria-describedby={option.id}
|
|
18
|
-
type="checkbox"
|
|
19
|
-
class={inputClass}
|
|
20
|
-
bind:checked={option.checked}
|
|
21
|
-
disabled={option.disabled}
|
|
22
|
-
/>
|
|
15
|
+
<input id={option.id} aria-describedby={option.id} type="checkbox" class={inputClass} bind:checked={option.checked} disabled={option.disabled} />
|
|
23
16
|
</div>
|
|
24
17
|
<div class="ml-3 text-sm">
|
|
25
18
|
<label for={option.id} class={helperLabelClass}>{option.label}</label>
|
|
@@ -32,14 +25,7 @@ export let options;
|
|
|
32
25
|
</div>
|
|
33
26
|
{:else}
|
|
34
27
|
<div class={divClass}>
|
|
35
|
-
<input
|
|
36
|
-
id={option.id}
|
|
37
|
-
aria-describedby={option.id}
|
|
38
|
-
type="checkbox"
|
|
39
|
-
class={inputClass}
|
|
40
|
-
checked={option.checked}
|
|
41
|
-
disabled={option.disabled}
|
|
42
|
-
/>
|
|
28
|
+
<input id={option.id} aria-describedby={option.id} type="checkbox" class={inputClass} checked={option.checked} disabled={option.disabled} />
|
|
43
29
|
<label for={option.id} class={labelClass}>{option.label}</label>
|
|
44
30
|
</div>
|
|
45
31
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { CheckboxType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
legend?: string;
|
|
@@ -6,13 +7,7 @@ declare const __propDef: {
|
|
|
6
7
|
inputClass?: string;
|
|
7
8
|
labelClass?: string;
|
|
8
9
|
helperLabelClass?: string;
|
|
9
|
-
options:
|
|
10
|
-
id: string;
|
|
11
|
-
label: string;
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
helper?: string;
|
|
15
|
-
}[];
|
|
10
|
+
options: CheckboxType[];
|
|
16
11
|
};
|
|
17
12
|
events: {
|
|
18
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { InputType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
id
|
|
5
|
-
type:
|
|
5
|
+
id?: string;
|
|
6
|
+
type: InputType;
|
|
6
7
|
value?: string;
|
|
7
8
|
name?: string;
|
|
8
9
|
label?: string;
|
package/forms/Iconinput.svelte
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { InputType } from '../types';
|
|
2
3
|
import type { SvelteComponent } from 'svelte';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
[x: string]: any;
|
|
6
7
|
label: string;
|
|
7
|
-
id
|
|
8
|
-
type:
|
|
8
|
+
id?: string;
|
|
9
|
+
type: InputType;
|
|
9
10
|
value?: string;
|
|
10
11
|
icon: typeof SvelteComponent;
|
|
11
12
|
helper?: string;
|
package/forms/Input.svelte
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
<script >
|
|
1
|
+
<script >import generateId from '../utils/generateId.js';
|
|
2
|
+
export let type = 'text';
|
|
2
3
|
export let value = '';
|
|
3
4
|
export let name = '';
|
|
4
|
-
export let id =
|
|
5
|
+
export let id = generateId();
|
|
5
6
|
export let label = '';
|
|
6
7
|
export let required = false;
|
|
7
8
|
export let placeholder = '';
|
|
@@ -20,17 +21,7 @@ function setType(node) {
|
|
|
20
21
|
|
|
21
22
|
<div class={$$props.class}>
|
|
22
23
|
<label for={id} class={labelClass}>{label}</label>
|
|
23
|
-
<input
|
|
24
|
-
bind:value
|
|
25
|
-
{name}
|
|
26
|
-
use:setType
|
|
27
|
-
{id}
|
|
28
|
-
class={inputClass}
|
|
29
|
-
{placeholder}
|
|
30
|
-
{required}
|
|
31
|
-
{disabled}
|
|
32
|
-
{readonly}
|
|
33
|
-
/>
|
|
24
|
+
<input bind:value {name} use:setType {id} class={inputClass} {placeholder} {required} {disabled} {readonly} />
|
|
34
25
|
{#if helper}
|
|
35
26
|
<p class={helperClass}>{@html helper}</p>
|
|
36
27
|
{/if}
|
package/forms/Input.svelte.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { InputType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
|
-
type?:
|
|
6
|
+
type?: InputType;
|
|
6
7
|
value?: string;
|
|
7
8
|
name?: string;
|
|
8
9
|
id?: string;
|
package/forms/Radio.svelte
CHANGED
|
@@ -3,42 +3,14 @@ export let divClass = 'flex items-center mb-4';
|
|
|
3
3
|
export let inputClass = 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600';
|
|
4
4
|
export let labelClass = 'block ml-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
5
5
|
export let name = 'countries';
|
|
6
|
-
export let options
|
|
7
|
-
{
|
|
8
|
-
id: 'country-option-1',
|
|
9
|
-
value: 'USA',
|
|
10
|
-
checked: true,
|
|
11
|
-
label: 'United States'
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: 'country-option-2',
|
|
15
|
-
label: 'Germany',
|
|
16
|
-
value: 'Germany'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: 'country-option-3',
|
|
20
|
-
label: 'Spain',
|
|
21
|
-
value: 'Spain',
|
|
22
|
-
disabled: true
|
|
23
|
-
}
|
|
24
|
-
];
|
|
6
|
+
export let options;
|
|
25
7
|
</script>
|
|
26
8
|
|
|
27
9
|
<fieldset>
|
|
28
10
|
<legend class="sr-only">{legend}</legend>
|
|
29
11
|
{#each options as option}
|
|
30
12
|
<div class={divClass}>
|
|
31
|
-
<input
|
|
32
|
-
id={option.id}
|
|
33
|
-
type="radio"
|
|
34
|
-
{name}
|
|
35
|
-
value={option.value}
|
|
36
|
-
class={inputClass}
|
|
37
|
-
aria-labelledby={option.id}
|
|
38
|
-
aria-describedby={option.id}
|
|
39
|
-
checked={option.checked}
|
|
40
|
-
disabled={option.disabled}
|
|
41
|
-
/>
|
|
13
|
+
<input id={option.id} type="radio" {name} value={option.value} class={inputClass} aria-labelledby={option.id} aria-describedby={option.id} checked={option.checked} disabled={option.disabled} />
|
|
42
14
|
<label for={option.id} class={labelClass}>
|
|
43
15
|
{option.label}
|
|
44
16
|
</label>
|
package/forms/Radio.svelte.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { RadioType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
legend?: string;
|
|
@@ -6,13 +7,7 @@ declare const __propDef: {
|
|
|
6
7
|
inputClass?: string;
|
|
7
8
|
labelClass?: string;
|
|
8
9
|
name?: string;
|
|
9
|
-
options
|
|
10
|
-
id: string;
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
checked?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
}[];
|
|
10
|
+
options: RadioType[];
|
|
16
11
|
};
|
|
17
12
|
events: {
|
|
18
13
|
[evt: string]: CustomEvent<any>;
|
package/forms/Select.svelte
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
<script >
|
|
2
|
-
export let
|
|
1
|
+
<script >import generateId from '../utils/generateId.js';
|
|
2
|
+
export let value;
|
|
3
|
+
export let id = generateId();
|
|
3
4
|
export let name = '';
|
|
4
5
|
export let label = '';
|
|
5
6
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400';
|
|
6
7
|
export let selectClass = '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-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
|
-
<label for=
|
|
10
|
+
<label for={id} class={labelClass}>{label}</label>
|
|
10
11
|
<select bind:value {id} {name} class={selectClass}>
|
|
11
12
|
<slot />
|
|
12
13
|
</select>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<script >
|
|
2
|
-
export let
|
|
1
|
+
<script >import generateId from '../utils/generateId.js';
|
|
2
|
+
export let checked = false;
|
|
3
|
+
export let id = generateId();
|
|
3
4
|
export let required = false;
|
|
4
5
|
export let label;
|
|
5
6
|
export let name;
|
|
@@ -9,15 +10,7 @@ export let labelClass = 'font-medium text-gray-900 dark:text-gray-300';
|
|
|
9
10
|
|
|
10
11
|
<div class="flex items-start">
|
|
11
12
|
<div class="flex items-center h-5">
|
|
12
|
-
<input
|
|
13
|
-
bind:checked
|
|
14
|
-
{id}
|
|
15
|
-
aria-describedby={id}
|
|
16
|
-
{name}
|
|
17
|
-
type="checkbox"
|
|
18
|
-
class={inputClass}
|
|
19
|
-
{required}
|
|
20
|
-
/>
|
|
13
|
+
<input bind:checked {id} aria-describedby={id} {name} type="checkbox" class={inputClass} {required} />
|
|
21
14
|
</div>
|
|
22
15
|
<div class="ml-3 text-sm">
|
|
23
16
|
<label for={id} class={labelClass}>{label}</label>
|
package/forms/Textarea.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<script >
|
|
2
|
-
export let
|
|
1
|
+
<script >import generateId from '../utils/generateId.js';
|
|
2
|
+
export let value = '';
|
|
3
|
+
export let id = generateId();
|
|
3
4
|
export let name = 'message';
|
|
4
5
|
export let label = 'Your message';
|
|
5
6
|
export let rows = 4;
|
package/forms/Toggle.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<script >
|
|
2
|
-
export let
|
|
1
|
+
<script >import generateId from '../utils/generateId.js';
|
|
2
|
+
export let name = 'toggle-example';
|
|
3
|
+
export let id = generateId();
|
|
3
4
|
export let label = 'Toggle me';
|
|
4
5
|
export let checked = false;
|
|
5
6
|
export let disabled = false;
|
|
@@ -8,8 +9,8 @@ export let divClass = 'w-11 h-6 bg-gray-200 rounded-full border border-gray-200
|
|
|
8
9
|
export let spanClass = 'ml-3 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<label for={
|
|
12
|
-
<input type="checkbox" {id} class="sr-only" {checked} {disabled} />
|
|
12
|
+
<label for={id} class={labelClass}>
|
|
13
|
+
<input type="checkbox" {id} class="sr-only" {checked} {name} {disabled} />
|
|
13
14
|
<div class={divClass} />
|
|
14
15
|
<span class={spanClass}>{label}</span>
|
|
15
16
|
</label>
|
package/index.d.ts
CHANGED
|
@@ -56,9 +56,12 @@ export { default as Pagination } from "./paginations/Pagination.svelte";
|
|
|
56
56
|
export { default as Previous } from "./paginations/Previous.svelte";
|
|
57
57
|
export { default as Next } from "./paginations/Next.svelte";
|
|
58
58
|
export { default as TableData } from "./paginations/TableData.svelte";
|
|
59
|
+
export { default as Progressbar } from "./progressbars/Progressbar.svelte";
|
|
59
60
|
export { default as Sidebar } from "./sidebars/Sidebar.svelte";
|
|
60
61
|
export { default as Spinner } from "./spinners/Spinner.svelte";
|
|
61
62
|
export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
|
|
63
|
+
export { default as Table } from "./tables/Table.svelte";
|
|
64
|
+
export { default as TableDefaultRow } from "./tables/TableDefaultRow.svelte";
|
|
62
65
|
export { default as InteractiveTabHead } from "./tabs/InteractiveTabHead.svelte";
|
|
63
66
|
export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
|
|
64
67
|
export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
|