flowbite-svelte 0.22.25 → 0.22.28
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 +28 -0
- package/avatar/Avatar.svelte +9 -8
- package/avatar/Placeholder.svelte +1 -1
- package/breadcrumbs/Breadcrumb.svelte +1 -1
- package/buttongroups/ButtonGroupItem.svelte +2 -2
- package/buttons/Button.svelte +1 -1
- package/cards/EcommerceCard.svelte +1 -1
- package/carousels/CarouselTransition.svelte +13 -13
- package/drawers/Drawer.svelte +44 -0
- package/drawers/Drawer.svelte.d.ts +26 -0
- package/forms/FloatingLabelInput.svelte +1 -1
- package/forms/Input.svelte +1 -1
- package/forms/Select.svelte +1 -1
- package/forms/SimpleSearch.svelte +2 -2
- package/forms/Toggle.svelte +10 -1
- package/index.d.ts +3 -14
- package/index.js +4 -14
- package/modals/Modal.svelte.d.ts +1 -1
- package/navbar/NavDropdown.svelte +3 -3
- package/navbar/NavUl.svelte +0 -1
- package/package.json +4 -20
- package/paginations/Next.svelte +12 -2
- package/paginations/Pagination.svelte +29 -9
- package/paginations/Previous.svelte +12 -2
- package/paginations/TableData.svelte +3 -3
- package/progressbars/Progressbar.svelte +17 -28
- package/ratings/Rating.svelte +2 -2
- package/skeleton/CardPlaceholder.svelte +6 -1
- package/skeleton/CardPlaceholder.svelte.d.ts +8 -11
- package/skeleton/ImagePlaceholder.svelte +6 -1
- package/skeleton/ImagePlaceholder.svelte.d.ts +8 -11
- package/skeleton/VideoPlaceholder.svelte +6 -1
- package/skeleton/VideoPlaceholder.svelte.d.ts +8 -11
- package/spinners/Spinner.svelte +1 -1
- package/tables/TableHeadCell.svelte +1 -1
- package/tabs/InteractiveTabHead.svelte +17 -2
- package/tabs/InteractiveTabs.svelte +16 -3
- package/tabs/UnderlineTabs.svelte +8 -1
- package/tooltips/Tooltip.svelte +23 -26
- package/types.d.ts +10 -0
- package/cards/CtaCard.svelte +0 -49
- package/cards/CtaCard.svelte.d.ts +0 -22
- package/cards/HorizontalCard.svelte +0 -23
- package/cards/HorizontalCard.svelte.d.ts +0 -27
- package/cards/InteractiveCard.svelte +0 -73
- package/cards/InteractiveCard.svelte.d.ts +0 -25
- package/cards/ListCard.svelte +0 -40
- package/cards/ListCard.svelte.d.ts +0 -20
- package/footer/LogoFooter.svelte +0 -34
- package/footer/LogoFooter.svelte.d.ts +0 -29
- package/footer/SimpleFooter.svelte +0 -22
- package/footer/SimpleFooter.svelte.d.ts +0 -24
- package/footer/SitemapFooter.svelte +0 -45
- package/footer/SitemapFooter.svelte.d.ts +0 -31
- package/footer/SocialMediaFooter.svelte +0 -63
- package/footer/SocialMediaFooter.svelte.d.ts +0 -39
- package/forms/SingleCheckbox.svelte +0 -18
- package/forms/SingleCheckbox.svelte.d.ts +0 -22
- package/modals/ExtraLargeModal.svelte +0 -182
- package/modals/ExtraLargeModal.svelte.d.ts +0 -29
- package/modals/LargeModal.svelte +0 -182
- package/modals/LargeModal.svelte.d.ts +0 -29
- package/modals/MediumModal.svelte +0 -185
- package/modals/MediumModal.svelte.d.ts +0 -29
- package/modals/ModalButton.svelte +0 -52
- package/modals/ModalButton.svelte.d.ts +0 -21
- package/modals/SignInModal.svelte +0 -102
- package/modals/SignInModal.svelte.d.ts +0 -26
- package/modals/SmallModal.svelte +0 -184
- package/modals/SmallModal.svelte.d.ts +0 -29
- package/modals/modalStores.js +0 -3
- package/navbar/DropdownNavbar.svelte +0 -95
- package/navbar/DropdownNavbar.svelte.d.ts +0 -31
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script>import { modalIdStore } from './modalStores';
|
|
2
|
-
import { get } from 'svelte/store';
|
|
3
|
-
export let id = 'modal-id';
|
|
4
|
-
export let btnName = 'Modal Name';
|
|
5
|
-
export let btnColor = 'blue';
|
|
6
|
-
let showModalId;
|
|
7
|
-
export const openFn = (id) => {
|
|
8
|
-
modalIdStore.update((n) => (n = id));
|
|
9
|
-
showModalId = get(modalIdStore);
|
|
10
|
-
};
|
|
11
|
-
let buttonClass;
|
|
12
|
-
if (btnColor === 'blue') {
|
|
13
|
-
buttonClass =
|
|
14
|
-
'block w-full md:w-auto 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 (btnColor === 'gray') {
|
|
17
|
-
buttonClass =
|
|
18
|
-
'block w-full md:w-auto 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 (btnColor === 'red') {
|
|
21
|
-
buttonClass =
|
|
22
|
-
'block w-full md:w-auto 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 (btnColor === 'yellow') {
|
|
25
|
-
buttonClass =
|
|
26
|
-
'block w-full md:w-auto 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 (btnColor === 'green') {
|
|
29
|
-
buttonClass =
|
|
30
|
-
'block w-full md:w-auto 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 (btnColor === 'indigo') {
|
|
33
|
-
buttonClass =
|
|
34
|
-
'block w-full md:w-auto 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 (btnColor === 'purple') {
|
|
37
|
-
buttonClass =
|
|
38
|
-
'block w-full md:w-auto 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 (btnColor === 'pink') {
|
|
41
|
-
buttonClass =
|
|
42
|
-
'block w-full md:w-auto text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
buttonClass =
|
|
46
|
-
'block w-full md:w-auto text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<button on:click={() => openFn(id)} class={buttonClass} type="button">
|
|
51
|
-
{btnName}
|
|
52
|
-
</button>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Colors } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
id?: string;
|
|
6
|
-
btnName?: string;
|
|
7
|
-
btnColor?: Colors;
|
|
8
|
-
openFn?: (id: string) => void;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export declare type ModalButtonProps = typeof __propDef.props;
|
|
16
|
-
export declare type ModalButtonEvents = typeof __propDef.events;
|
|
17
|
-
export declare type ModalButtonSlots = typeof __propDef.slots;
|
|
18
|
-
export default class ModalButton extends SvelteComponentTyped<ModalButtonProps, ModalButtonEvents, ModalButtonSlots> {
|
|
19
|
-
get openFn(): (id: string) => void;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<script>import { modalIdStore } from './modalStores';
|
|
2
|
-
export let id = 'signin-modal';
|
|
3
|
-
export let btnSignInColor = 'blue';
|
|
4
|
-
export let titleSignIn = 'Sign in to our platform';
|
|
5
|
-
export let lostPasswordLink;
|
|
6
|
-
export let rememberMe = false;
|
|
7
|
-
export let signUp;
|
|
8
|
-
export let action;
|
|
9
|
-
export let emailPlaceholder = 'name@company.com';
|
|
10
|
-
export const closeModal = () => {
|
|
11
|
-
modalIdStore.update((value) => (value = null));
|
|
12
|
-
};
|
|
13
|
-
let showModalId;
|
|
14
|
-
modalIdStore.subscribe((value) => {
|
|
15
|
-
showModalId = value;
|
|
16
|
-
});
|
|
17
|
-
let submitClass;
|
|
18
|
-
if (btnSignInColor === 'blue') {
|
|
19
|
-
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';
|
|
20
|
-
}
|
|
21
|
-
else if (btnSignInColor === 'gray') {
|
|
22
|
-
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';
|
|
23
|
-
}
|
|
24
|
-
else if (btnSignInColor === 'red') {
|
|
25
|
-
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';
|
|
26
|
-
}
|
|
27
|
-
else if (btnSignInColor === 'yellow') {
|
|
28
|
-
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';
|
|
29
|
-
}
|
|
30
|
-
else if (btnSignInColor === 'green') {
|
|
31
|
-
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';
|
|
32
|
-
}
|
|
33
|
-
else if (btnSignInColor === 'indigo') {
|
|
34
|
-
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
|
-
}
|
|
36
|
-
else if (btnSignInColor === 'purple') {
|
|
37
|
-
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';
|
|
38
|
-
}
|
|
39
|
-
else if (btnSignInColor === 'pink') {
|
|
40
|
-
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';
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
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';
|
|
44
|
-
}
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
{#if showModalId === id}
|
|
48
|
-
<div
|
|
49
|
-
on:click={closeModal}
|
|
50
|
-
class="bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40 w-full h-full overflow-auto"
|
|
51
|
-
>
|
|
52
|
-
<!-- Main modal -->
|
|
53
|
-
<div
|
|
54
|
-
on:click|stopPropagation={() => {}}
|
|
55
|
-
role="dialog"
|
|
56
|
-
aria-modal="true"
|
|
57
|
-
class="mx-auto my-20 px-4 w-full max-w-md h-full md:h-auto"
|
|
58
|
-
>
|
|
59
|
-
<div class="bg-white rounded-lg shadow dark:bg-gray-700">
|
|
60
|
-
<div class="flex justify-end p-2">
|
|
61
|
-
<button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white" on:click={closeModal}>
|
|
62
|
-
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
|
|
63
|
-
</button>
|
|
64
|
-
</div>
|
|
65
|
-
<form class="px-6 pb-4 space-y-6 lg:px-8 sm:pb-6 xl:pb-8" {action}>
|
|
66
|
-
<h3 class="text-xl font-medium text-gray-900 dark:text-white">
|
|
67
|
-
{titleSignIn}
|
|
68
|
-
</h3>
|
|
69
|
-
<div>
|
|
70
|
-
<label for="email-{id}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">Your email</label>
|
|
71
|
-
<input type="email" name="email" id="email-{id}" 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={emailPlaceholder} required />
|
|
72
|
-
</div>
|
|
73
|
-
<div>
|
|
74
|
-
<label for="password-{id}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">Your password</label>
|
|
75
|
-
<input type="password" name="password" id="password-{id}" placeholder="••••••••" 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 />
|
|
76
|
-
</div>
|
|
77
|
-
<div class="flex justify-between">
|
|
78
|
-
{#if rememberMe}
|
|
79
|
-
<div class="flex items-start">
|
|
80
|
-
<div class="flex items-center h-5">
|
|
81
|
-
<input id="remember-{id}" 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" />
|
|
82
|
-
</div>
|
|
83
|
-
<div class="ml-3 text-sm">
|
|
84
|
-
<label for="remember" class="font-medium text-gray-900 dark:text-gray-300">Remember me</label>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
{/if}
|
|
88
|
-
{#if lostPasswordLink}
|
|
89
|
-
<a href={lostPasswordLink} rel="external" class="text-sm text-blue-700 hover:underline dark:text-blue-500"><button type="button" on:click={closeModal}>Lost Password?</button></a>
|
|
90
|
-
{/if}
|
|
91
|
-
</div>
|
|
92
|
-
<button type="submit" class={submitClass} on:click={closeModal}>Login to your account</button>
|
|
93
|
-
{#if signUp}
|
|
94
|
-
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">
|
|
95
|
-
Not registered? <a href={signUp} rel="external" class="text-blue-700 hover:underline dark:text-blue-500"><button type="button" on:click={closeModal}>Create account</button></a>
|
|
96
|
-
</div>
|
|
97
|
-
{/if}
|
|
98
|
-
</form>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
{/if}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Colors } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
id?: string;
|
|
6
|
-
btnSignInColor?: Colors;
|
|
7
|
-
titleSignIn?: string;
|
|
8
|
-
lostPasswordLink: string;
|
|
9
|
-
rememberMe?: boolean;
|
|
10
|
-
signUp: string;
|
|
11
|
-
action: string;
|
|
12
|
-
emailPlaceholder?: string;
|
|
13
|
-
closeModal?: () => void;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export declare type SignInModalProps = typeof __propDef.props;
|
|
21
|
-
export declare type SignInModalEvents = typeof __propDef.events;
|
|
22
|
-
export declare type SignInModalSlots = typeof __propDef.slots;
|
|
23
|
-
export default class SignInModal extends SvelteComponentTyped<SignInModalProps, SignInModalEvents, SignInModalSlots> {
|
|
24
|
-
get closeModal(): () => void;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
package/modals/SmallModal.svelte
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
-
import { modalIdStore } from './modalStores';
|
|
3
|
-
const dispatch = createEventDispatcher();
|
|
4
|
-
import Button from '../buttons/Button.svelte';
|
|
5
|
-
import CloseButton from '../utils/CloseButton.svelte';
|
|
6
|
-
export let id = 'small-modal';
|
|
7
|
-
export let btnColor = 'blue';
|
|
8
|
-
export let textColor = 'blue';
|
|
9
|
-
export let title = 'Terms of Service';
|
|
10
|
-
export let btn1;
|
|
11
|
-
export let btn2;
|
|
12
|
-
export const closeModal = () => {
|
|
13
|
-
modalIdStore.update((value) => (value = null));
|
|
14
|
-
};
|
|
15
|
-
let showModalId;
|
|
16
|
-
modalIdStore.subscribe((value) => {
|
|
17
|
-
showModalId = value;
|
|
18
|
-
});
|
|
19
|
-
const handlebtn1 = () => {
|
|
20
|
-
dispatch('handlebtn1');
|
|
21
|
-
};
|
|
22
|
-
const handlebtn2 = () => {
|
|
23
|
-
dispatch('handlebtn2');
|
|
24
|
-
};
|
|
25
|
-
let divClass;
|
|
26
|
-
let headDivClass;
|
|
27
|
-
let h3Class;
|
|
28
|
-
let buttonClass;
|
|
29
|
-
let pClass;
|
|
30
|
-
let footerClass;
|
|
31
|
-
let btn2Class;
|
|
32
|
-
if (textColor === 'blue') {
|
|
33
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-blue-700';
|
|
34
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-blue-600';
|
|
35
|
-
h3Class = 'text-xl font-medium text-blue-900 dark:text-white';
|
|
36
|
-
buttonClass =
|
|
37
|
-
'text-blue-400 bg-transparent hover:bg-blue-200 hover:text-blue-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-blue-600 dark:hover:text-white';
|
|
38
|
-
pClass = 'text-base leading-relaxed text-blue-500 dark:text-blue-400';
|
|
39
|
-
footerClass =
|
|
40
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-blue-200 dark:border-blue-600';
|
|
41
|
-
btn2Class =
|
|
42
|
-
'text-blue-500 bg-white hover:bg-blue-100 focus:ring-4 focus:ring-blue-300 rounded-lg border border-blue-200 text-sm font-medium px-5 py-2.5 hover:text-blue-900 focus:z-10 dark:bg-blue-700 dark:text-blue-300 dark:border-blue-500 dark:hover:text-white dark:hover:bg-blue-600';
|
|
43
|
-
}
|
|
44
|
-
else if (textColor === 'gray') {
|
|
45
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-gray-700';
|
|
46
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-gray-600';
|
|
47
|
-
h3Class = 'text-xl font-medium text-gray-900 dark:text-white';
|
|
48
|
-
buttonClass =
|
|
49
|
-
'text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white';
|
|
50
|
-
pClass = 'text-base leading-relaxed text-gray-500 dark:text-gray-400';
|
|
51
|
-
footerClass =
|
|
52
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-gray-200 dark:border-gray-600';
|
|
53
|
-
btn2Class =
|
|
54
|
-
'text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:ring-gray-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600';
|
|
55
|
-
}
|
|
56
|
-
else if (textColor === 'red') {
|
|
57
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-red-700';
|
|
58
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-red-600';
|
|
59
|
-
h3Class = 'text-xl font-medium text-red-900 dark:text-white';
|
|
60
|
-
buttonClass =
|
|
61
|
-
'text-red-400 bg-transparent hover:bg-red-200 hover:text-red-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-red-600 dark:hover:text-white';
|
|
62
|
-
pClass = 'text-base leading-relaxed text-red-500 dark:text-red-400';
|
|
63
|
-
footerClass =
|
|
64
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-red-200 dark:border-red-600';
|
|
65
|
-
btn2Class =
|
|
66
|
-
'text-red-500 bg-white hover:bg-red-100 focus:ring-4 focus:ring-red-300 rounded-lg border border-red-200 text-sm font-medium px-5 py-2.5 hover:text-red-900 focus:z-10 dark:bg-red-700 dark:text-red-300 dark:border-red-500 dark:hover:text-white dark:hover:bg-red-600';
|
|
67
|
-
}
|
|
68
|
-
else if (textColor === 'yellow') {
|
|
69
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-yellow-700';
|
|
70
|
-
headDivClass =
|
|
71
|
-
'flex justify-between items-center p-5 rounded-t border-b dark:border-yellow-600';
|
|
72
|
-
h3Class = 'text-xl font-medium text-yellow-900 dark:text-white';
|
|
73
|
-
buttonClass =
|
|
74
|
-
'text-yellow-400 bg-transparent hover:bg-yellow-200 hover:text-yellow-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-yellow-600 dark:hover:text-white';
|
|
75
|
-
pClass = 'text-base leading-relaxed text-yellow-500 dark:text-yellow-400';
|
|
76
|
-
footerClass =
|
|
77
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-yellow-200 dark:border-yellow-600';
|
|
78
|
-
btn2Class =
|
|
79
|
-
'text-yellow-500 bg-white hover:bg-yellow-100 focus:ring-4 focus:ring-yellow-300 rounded-lg border border-yellow-200 text-sm font-medium px-5 py-2.5 hover:text-yellow-900 focus:z-10 dark:bg-yellow-700 dark:text-yellow-300 dark:border-yellow-500 dark:hover:text-white dark:hover:bg-yellow-600';
|
|
80
|
-
}
|
|
81
|
-
else if (textColor === 'green') {
|
|
82
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-green-700';
|
|
83
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-green-600';
|
|
84
|
-
h3Class = 'text-xl font-medium text-green-900 dark:text-white';
|
|
85
|
-
buttonClass =
|
|
86
|
-
'text-green-400 bg-transparent hover:bg-green-200 hover:text-green-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-green-600 dark:hover:text-white';
|
|
87
|
-
pClass = 'text-base leading-relaxed text-green-500 dark:text-green-400';
|
|
88
|
-
footerClass =
|
|
89
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-green-200 dark:border-green-600';
|
|
90
|
-
btn2Class =
|
|
91
|
-
'text-green-500 bg-white hover:bg-green-100 focus:ring-4 focus:ring-green-300 rounded-lg border border-green-200 text-sm font-medium px-5 py-2.5 hover:text-green-900 focus:z-10 dark:bg-green-700 dark:text-green-300 dark:border-green-500 dark:hover:text-white dark:hover:bg-green-600';
|
|
92
|
-
}
|
|
93
|
-
else if (textColor === 'indigo') {
|
|
94
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-indigo-700';
|
|
95
|
-
headDivClass =
|
|
96
|
-
'flex justify-between items-center p-5 rounded-t border-b dark:border-indigo-600';
|
|
97
|
-
h3Class = 'text-xl font-medium text-indigo-900 dark:text-white';
|
|
98
|
-
buttonClass =
|
|
99
|
-
'text-indigo-400 bg-transparent hover:bg-indigo-200 hover:text-indigo-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-indigo-600 dark:hover:text-white';
|
|
100
|
-
pClass = 'text-base leading-relaxed text-indigo-500 dark:text-indigo-400';
|
|
101
|
-
footerClass =
|
|
102
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-indigo-200 dark:border-indigo-600';
|
|
103
|
-
btn2Class =
|
|
104
|
-
'text-indigo-500 bg-white hover:bg-indigo-100 focus:ring-4 focus:ring-indigo-300 rounded-lg border border-indigo-200 text-sm font-medium px-5 py-2.5 hover:text-indigo-900 focus:z-10 dark:bg-indigo-700 dark:text-indigo-300 dark:border-indigo-500 dark:hover:text-white dark:hover:bg-indigo-600';
|
|
105
|
-
}
|
|
106
|
-
else if (textColor === 'purple') {
|
|
107
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-purple-700';
|
|
108
|
-
headDivClass =
|
|
109
|
-
'flex justify-between items-center p-5 rounded-t border-b dark:border-purple-600';
|
|
110
|
-
h3Class = 'text-xl font-medium text-purple-900 dark:text-white';
|
|
111
|
-
buttonClass =
|
|
112
|
-
'text-purple-400 bg-transparent hover:bg-purple-200 hover:text-purple-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-purple-600 dark:hover:text-white';
|
|
113
|
-
pClass = 'text-base leading-relaxed text-purple-500 dark:text-purple-400';
|
|
114
|
-
footerClass =
|
|
115
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-purple-200 dark:border-purple-600';
|
|
116
|
-
btn2Class =
|
|
117
|
-
'text-purple-500 bg-white hover:bg-purple-100 focus:ring-4 focus:ring-purple-300 rounded-lg border border-purple-200 text-sm font-medium px-5 py-2.5 hover:text-purple-900 focus:z-10 dark:bg-purple-700 dark:text-purple-300 dark:border-purple-500 dark:hover:text-white dark:hover:bg-purple-600';
|
|
118
|
-
}
|
|
119
|
-
else if (textColor === 'pink') {
|
|
120
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-pink-700';
|
|
121
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-pink-600';
|
|
122
|
-
h3Class = 'text-xl font-medium text-pink-900 dark:text-white';
|
|
123
|
-
buttonClass =
|
|
124
|
-
'text-pink-400 bg-transparent hover:bg-pink-200 hover:text-pink-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-pink-600 dark:hover:text-white';
|
|
125
|
-
pClass = 'text-base leading-relaxed text-pink-500 dark:text-pink-400';
|
|
126
|
-
footerClass =
|
|
127
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-pink-200 dark:border-pink-600';
|
|
128
|
-
btn2Class =
|
|
129
|
-
'text-pink-500 bg-white hover:bg-pink-100 focus:ring-4 focus:ring-pink-300 rounded-lg border border-pink-200 text-sm font-medium px-5 py-2.5 hover:text-pink-900 focus:z-10 dark:bg-pink-700 dark:text-pink-300 dark:border-pink-500 dark:hover:text-white dark:hover:bg-pink-600';
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
divClass = 'relative bg-white rounded-lg shadow dark:bg-blue-700';
|
|
133
|
-
headDivClass = 'flex justify-between items-center p-5 rounded-t border-b dark:border-blue-600';
|
|
134
|
-
h3Class = 'text-xl font-medium text-blue-900 dark:text-white';
|
|
135
|
-
buttonClass =
|
|
136
|
-
'text-blue-400 bg-transparent hover:bg-blue-200 hover:text-blue-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-blue-600 dark:hover:text-white';
|
|
137
|
-
pClass = 'text-base leading-relaxed text-blue-500 dark:text-blue-400';
|
|
138
|
-
footerClass =
|
|
139
|
-
'flex items-center p-6 space-x-2 rounded-b border-t border-blue-200 dark:border-blue-600';
|
|
140
|
-
btn2Class =
|
|
141
|
-
'text-blue-500 bg-white hover:bg-blue-100 focus:ring-4 focus:ring-blue-300 rounded-lg border border-blue-200 text-sm font-medium px-5 py-2.5 hover:text-blue-900 focus:z-10 dark:bg-blue-700 dark:text-blue-300 dark:border-blue-500 dark:hover:text-white dark:hover:bg-blue-600';
|
|
142
|
-
}
|
|
143
|
-
</script>
|
|
144
|
-
|
|
145
|
-
{#if showModalId === id}
|
|
146
|
-
<!-- Small Modal Component -->
|
|
147
|
-
<div
|
|
148
|
-
on:click={closeModal}
|
|
149
|
-
class="bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40 w-full h-full overflow-auto"
|
|
150
|
-
>
|
|
151
|
-
<div
|
|
152
|
-
on:click|stopPropagation={() => {}}
|
|
153
|
-
role="dialog"
|
|
154
|
-
aria-modal="true"
|
|
155
|
-
class="mx-auto my-20 px-4 w-full max-w-md h-full md:h-auto"
|
|
156
|
-
>
|
|
157
|
-
<!-- Modal content -->
|
|
158
|
-
<div class={divClass}>
|
|
159
|
-
<!-- Modal header -->
|
|
160
|
-
<div class={headDivClass}>
|
|
161
|
-
<h3 class={h3Class}>
|
|
162
|
-
{title}
|
|
163
|
-
</h3>
|
|
164
|
-
<CloseButton color={textColor} on:click={closeModal} />
|
|
165
|
-
</div>
|
|
166
|
-
<!-- Modal body -->
|
|
167
|
-
<div class="p-6 space-y-6">
|
|
168
|
-
<p class={pClass}>
|
|
169
|
-
<slot />
|
|
170
|
-
</p>
|
|
171
|
-
</div>
|
|
172
|
-
<!-- Modal footer -->
|
|
173
|
-
<div class={footerClass}>
|
|
174
|
-
{#if btn1}
|
|
175
|
-
<Button color={btnColor} on:click={handlebtn1}>{btn1}</Button>
|
|
176
|
-
{/if}
|
|
177
|
-
{#if btn2}
|
|
178
|
-
<Button color={textColor} on:click={handlebtn2}>{btn2}</Button>
|
|
179
|
-
{/if}
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
{/if}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Colors } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
id?: string;
|
|
6
|
-
btnColor?: Colors;
|
|
7
|
-
textColor?: Colors;
|
|
8
|
-
title?: string;
|
|
9
|
-
btn1: string;
|
|
10
|
-
btn2: string;
|
|
11
|
-
closeModal?: () => void;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
handlebtn1: CustomEvent<any>;
|
|
15
|
-
handlebtn2: CustomEvent<any>;
|
|
16
|
-
} & {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
default: {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare type SmallModalProps = typeof __propDef.props;
|
|
24
|
-
export declare type SmallModalEvents = typeof __propDef.events;
|
|
25
|
-
export declare type SmallModalSlots = typeof __propDef.slots;
|
|
26
|
-
export default class SmallModal extends SvelteComponentTyped<SmallModalProps, SmallModalEvents, SmallModalSlots> {
|
|
27
|
-
get closeModal(): () => void;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
package/modals/modalStores.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<script>import { onMount } from 'svelte';
|
|
2
|
-
import NavDropdown from './NavDropdown.svelte';
|
|
3
|
-
export let user = '';
|
|
4
|
-
let pathname = '';
|
|
5
|
-
onMount(() => {
|
|
6
|
-
pathname = window.location.pathname;
|
|
7
|
-
});
|
|
8
|
-
let barHidden = true;
|
|
9
|
-
const handleClickbtn = () => {
|
|
10
|
-
barHidden = !barHidden;
|
|
11
|
-
};
|
|
12
|
-
export let sitename = 'Svelte Flow';
|
|
13
|
-
export let logo = '/images/flowbite-svelte-logo-30.png';
|
|
14
|
-
export let alt;
|
|
15
|
-
export let textsize = 'text-sm';
|
|
16
|
-
export let menus;
|
|
17
|
-
export let navClass = 'px-2 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700';
|
|
18
|
-
const navDivClass = 'container flex flex-wrap justify-between items-center mx-auto';
|
|
19
|
-
export let spanClass = 'self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white';
|
|
20
|
-
export let buttonClass = 'inline-flex justify-center items-center ml-3 text-gray-400 rounded-lg md:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500';
|
|
21
|
-
export let dropdownDiv = 'z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600';
|
|
22
|
-
export let dropdownLinkClassWithChild = `block py-2 px-4 ${textsize} text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white`;
|
|
23
|
-
export let dropdownLinkClassWithoutChild = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent ${textsize}`;
|
|
24
|
-
export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-full ${textsize} font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent`;
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<nav class={navClass}>
|
|
28
|
-
<div class={navDivClass}>
|
|
29
|
-
<a href="/" class="flex">
|
|
30
|
-
<img src={logo} {alt} />
|
|
31
|
-
<span class={spanClass}>{sitename}</span>
|
|
32
|
-
</a>
|
|
33
|
-
<button
|
|
34
|
-
on:click={handleClickbtn}
|
|
35
|
-
type="button"
|
|
36
|
-
class={buttonClass}
|
|
37
|
-
aria-controls="mobile-menu-2"
|
|
38
|
-
aria-expanded="false"
|
|
39
|
-
>
|
|
40
|
-
<span class="sr-only">Open main menu</span>
|
|
41
|
-
<svg
|
|
42
|
-
class="w-6 h-6"
|
|
43
|
-
fill="currentColor"
|
|
44
|
-
viewBox="0 0 20 20"
|
|
45
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
-
><path
|
|
47
|
-
fill-rule="evenodd"
|
|
48
|
-
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
49
|
-
clip-rule="evenodd"
|
|
50
|
-
/></svg
|
|
51
|
-
>
|
|
52
|
-
<svg
|
|
53
|
-
class="hidden w-6 h-6"
|
|
54
|
-
fill="currentColor"
|
|
55
|
-
viewBox="0 0 20 20"
|
|
56
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
-
><path
|
|
58
|
-
fill-rule="evenodd"
|
|
59
|
-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
60
|
-
clip-rule="evenodd"
|
|
61
|
-
/></svg
|
|
62
|
-
>
|
|
63
|
-
</button>
|
|
64
|
-
<div class="w-full md:block md:w-auto" class:hidden={barHidden} id="mobile-menu">
|
|
65
|
-
<ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
|
|
66
|
-
{#each menus as { name, href, rel, child }}
|
|
67
|
-
{#if child}
|
|
68
|
-
<NavDropdown
|
|
69
|
-
{liButtonClass}
|
|
70
|
-
{dropdownDiv}
|
|
71
|
-
{name}
|
|
72
|
-
{child}
|
|
73
|
-
{rel}
|
|
74
|
-
{dropdownLinkClassWithChild}
|
|
75
|
-
/>
|
|
76
|
-
{:else}
|
|
77
|
-
<li>
|
|
78
|
-
<a class:active={pathname === href} {href} {rel} class={dropdownLinkClassWithoutChild}
|
|
79
|
-
>{name}</a
|
|
80
|
-
>
|
|
81
|
-
</li>
|
|
82
|
-
{/if}
|
|
83
|
-
{/each}
|
|
84
|
-
</ul>
|
|
85
|
-
{#if user}
|
|
86
|
-
<slot name="user" />
|
|
87
|
-
{/if}
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</nav>
|
|
91
|
-
|
|
92
|
-
<style>
|
|
93
|
-
#mobile-menu .active {
|
|
94
|
-
color: #fab534;
|
|
95
|
-
}</style>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { NavbarType } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
user?: string;
|
|
6
|
-
sitename?: string;
|
|
7
|
-
logo?: string;
|
|
8
|
-
alt: string;
|
|
9
|
-
textsize?: string;
|
|
10
|
-
menus: NavbarType[];
|
|
11
|
-
navClass?: string;
|
|
12
|
-
spanClass?: string;
|
|
13
|
-
buttonClass?: string;
|
|
14
|
-
dropdownDiv?: string;
|
|
15
|
-
dropdownLinkClassWithChild?: string;
|
|
16
|
-
dropdownLinkClassWithoutChild?: string;
|
|
17
|
-
liButtonClass?: string;
|
|
18
|
-
};
|
|
19
|
-
events: {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
};
|
|
22
|
-
slots: {
|
|
23
|
-
user: {};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare type DropdownNavbarProps = typeof __propDef.props;
|
|
27
|
-
export declare type DropdownNavbarEvents = typeof __propDef.events;
|
|
28
|
-
export declare type DropdownNavbarSlots = typeof __propDef.slots;
|
|
29
|
-
export default class DropdownNavbar extends SvelteComponentTyped<DropdownNavbarProps, DropdownNavbarEvents, DropdownNavbarSlots> {
|
|
30
|
-
}
|
|
31
|
-
export {};
|