flowbite-svelte 0.6.0
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/README.md +33 -0
- package/accordions/AccordionDefault.svelte +26 -0
- package/accordions/AccordionDefault.svelte.d.ts +35 -0
- package/accordions/AccordionItem.svelte +44 -0
- package/accordions/AccordionItem.svelte.d.ts +29 -0
- package/alerts/Alert.svelte +111 -0
- package/alerts/Alert.svelte.d.ts +31 -0
- package/alerts/BorderAlert.svelte +118 -0
- package/alerts/BorderAlert.svelte.d.ts +31 -0
- package/alerts/InfoAlert.svelte +125 -0
- package/alerts/InfoAlert.svelte.d.ts +35 -0
- package/badges/Badge.svelte +28 -0
- package/badges/Badge.svelte.d.ts +27 -0
- package/badges/BadgeIcon.svelte +31 -0
- package/badges/BadgeIcon.svelte.d.ts +31 -0
- package/badges/BadgeLink.svelte +29 -0
- package/badges/BadgeLink.svelte.d.ts +29 -0
- package/buttongroups/ButtonGroup.svelte +68 -0
- package/buttongroups/ButtonGroup.svelte.d.ts +33 -0
- package/buttongroups/ButtonGroupOutline.svelte +70 -0
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +33 -0
- package/buttons/Button.svelte +60 -0
- package/buttons/Button.svelte.d.ts +33 -0
- package/buttons/ColorShadowButton.svelte +35 -0
- package/buttons/ColorShadowButton.svelte.d.ts +31 -0
- package/buttons/GradientDuotoneButton.svelte +33 -0
- package/buttons/GradientDuotoneButton.svelte.d.ts +31 -0
- package/buttons/GradientMonochromeButton.svelte +35 -0
- package/buttons/GradientMonochromeButton.svelte.d.ts +31 -0
- package/buttons/GradientOutlineButton.svelte +52 -0
- package/buttons/GradientOutlineButton.svelte.d.ts +31 -0
- package/cards/Card.svelte +86 -0
- package/cards/Card.svelte.d.ts +39 -0
- package/cards/CtaCard.svelte +63 -0
- package/cards/CtaCard.svelte.d.ts +45 -0
- package/cards/EcommerceCard.svelte +98 -0
- package/cards/EcommerceCard.svelte.d.ts +41 -0
- package/cards/HorizontalCard.svelte +29 -0
- package/cards/HorizontalCard.svelte.d.ts +35 -0
- package/cards/InteractiveCard.svelte +127 -0
- package/cards/InteractiveCard.svelte.d.ts +63 -0
- package/cards/ListCard.svelte +82 -0
- package/cards/ListCard.svelte.d.ts +51 -0
- package/cards/SignInCard.svelte +125 -0
- package/cards/SignInCard.svelte.d.ts +45 -0
- package/darkmode/DarkMode.svelte +78 -0
- package/darkmode/DarkMode.svelte.d.ts +23 -0
- package/dropdowns/DropdownDefault.svelte +117 -0
- package/dropdowns/DropdownDefault.svelte.d.ts +51 -0
- package/footer/SimpleFooter.svelte +32 -0
- package/footer/SimpleFooter.svelte.d.ts +45 -0
- package/index.d.ts +39 -0
- package/index.js +116 -0
- package/list-group/List.svelte +79 -0
- package/list-group/List.svelte.d.ts +33 -0
- package/modals/ExtraLargeModal.svelte +236 -0
- package/modals/ExtraLargeModal.svelte.d.ts +45 -0
- package/modals/LargeModal.svelte +236 -0
- package/modals/LargeModal.svelte.d.ts +45 -0
- package/modals/MediumModal.svelte +242 -0
- package/modals/MediumModal.svelte.d.ts +45 -0
- package/modals/ModalButton.svelte +48 -0
- package/modals/ModalButton.svelte.d.ts +29 -0
- package/modals/SignInModal.svelte +174 -0
- package/modals/SignInModal.svelte.d.ts +37 -0
- package/modals/SmallModal.svelte +236 -0
- package/modals/SmallModal.svelte.d.ts +45 -0
- package/modals/modalStores.d.ts +1 -0
- package/modals/modalStores.js +3 -0
- package/navbar/DropdownNavbar.svelte +210 -0
- package/navbar/DropdownNavbar.svelte.d.ts +65 -0
- package/navbar/Navbar.svelte +96 -0
- package/navbar/Navbar.svelte.d.ts +39 -0
- package/package.json +92 -0
- package/tabs/DefaultTabs.svelte +43 -0
- package/tabs/DefaultTabs.svelte.d.ts +33 -0
- package/tabs/InteractiveTabs.svelte +68 -0
- package/tabs/InteractiveTabs.svelte.d.ts +47 -0
- package/tabs/PillTabs.svelte +38 -0
- package/tabs/PillTabs.svelte.d.ts +31 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} InteractiveCardProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} InteractiveCardEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} InteractiveCardSlots */
|
|
4
|
+
export default class InteractiveCard extends SvelteComponentTyped<{
|
|
5
|
+
header?: string;
|
|
6
|
+
img?: {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
};
|
|
10
|
+
dropdownLinks?: {
|
|
11
|
+
href: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
content?: string;
|
|
15
|
+
buttonColor?: string;
|
|
16
|
+
link1?: {
|
|
17
|
+
href: string;
|
|
18
|
+
title: string;
|
|
19
|
+
rel: string;
|
|
20
|
+
};
|
|
21
|
+
link2?: {
|
|
22
|
+
href: string;
|
|
23
|
+
title: string;
|
|
24
|
+
rel: string;
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {}> {
|
|
29
|
+
}
|
|
30
|
+
export type InteractiveCardProps = typeof __propDef.props;
|
|
31
|
+
export type InteractiveCardEvents = typeof __propDef.events;
|
|
32
|
+
export type InteractiveCardSlots = typeof __propDef.slots;
|
|
33
|
+
import { SvelteComponentTyped } from "svelte";
|
|
34
|
+
declare const __propDef: {
|
|
35
|
+
props: {
|
|
36
|
+
header?: string;
|
|
37
|
+
img?: {
|
|
38
|
+
src: string;
|
|
39
|
+
alt: string;
|
|
40
|
+
};
|
|
41
|
+
dropdownLinks?: {
|
|
42
|
+
href: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}[];
|
|
45
|
+
content?: string;
|
|
46
|
+
buttonColor?: string;
|
|
47
|
+
link1?: {
|
|
48
|
+
href: string;
|
|
49
|
+
title: string;
|
|
50
|
+
rel: string;
|
|
51
|
+
};
|
|
52
|
+
link2?: {
|
|
53
|
+
href: string;
|
|
54
|
+
title: string;
|
|
55
|
+
rel: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
events: {
|
|
59
|
+
[evt: string]: CustomEvent<any>;
|
|
60
|
+
};
|
|
61
|
+
slots: {};
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let lists = [
|
|
3
|
+
{
|
|
4
|
+
img: {
|
|
5
|
+
src: "/images/profile-picture-1.jpeg",
|
|
6
|
+
alt: "Neil Sims",
|
|
7
|
+
},
|
|
8
|
+
field1: "Neil Sims",
|
|
9
|
+
field2: "email@windster.com",
|
|
10
|
+
field3: "Advisor",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
img: {
|
|
14
|
+
src: "/images/profile-picture-2.jpeg",
|
|
15
|
+
alt: "Bonnie Green",
|
|
16
|
+
},
|
|
17
|
+
field1: "Bonnie Green",
|
|
18
|
+
field2: "email@windster.com",
|
|
19
|
+
field3: "Developer",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
img: {
|
|
23
|
+
src: "/images/profile-picture-3.jpeg",
|
|
24
|
+
alt: "Michael Gough",
|
|
25
|
+
},
|
|
26
|
+
field1: "Michael Gough",
|
|
27
|
+
field2: "email@windster.com",
|
|
28
|
+
field3: "Marketing",
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
export let title = "Latest Customers";
|
|
32
|
+
export let action = {
|
|
33
|
+
link: "/#",
|
|
34
|
+
title: "View all",
|
|
35
|
+
rel: "",
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
class="p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700"
|
|
41
|
+
>
|
|
42
|
+
<div class="flex justify-between items-center mb-4">
|
|
43
|
+
<h3 class="text-xl font-bold leading-none text-gray-900 dark:text-white">
|
|
44
|
+
{title}
|
|
45
|
+
</h3>
|
|
46
|
+
<a
|
|
47
|
+
href={action.link}
|
|
48
|
+
rel={action.rel}
|
|
49
|
+
class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
|
|
50
|
+
>
|
|
51
|
+
{action.title}
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="flow-root">
|
|
55
|
+
<ul class="divide-y divide-gray-200 dark:divide-gray-700">
|
|
56
|
+
{#each lists as { img, field1, field2, field3 }}
|
|
57
|
+
<li class="py-3 sm:py-4">
|
|
58
|
+
<div class="flex items-center space-x-4">
|
|
59
|
+
<div class="flex-shrink-0">
|
|
60
|
+
<img class="w-8 h-8 rounded-full" src={img.src} alt={img.alt} />
|
|
61
|
+
</div>
|
|
62
|
+
<div class="flex-1 min-w-0">
|
|
63
|
+
<p
|
|
64
|
+
class="text-sm font-medium text-gray-900 truncate dark:text-white"
|
|
65
|
+
>
|
|
66
|
+
{field1}
|
|
67
|
+
</p>
|
|
68
|
+
<p class="text-sm text-gray-500 truncate dark:text-gray-400">
|
|
69
|
+
{field2}
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white"
|
|
74
|
+
>
|
|
75
|
+
{field3}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</li>
|
|
79
|
+
{/each}
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ListCardProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ListCardEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ListCardSlots */
|
|
4
|
+
export default class ListCard extends SvelteComponentTyped<{
|
|
5
|
+
lists?: {
|
|
6
|
+
img: {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
};
|
|
10
|
+
field1: string;
|
|
11
|
+
field2: string;
|
|
12
|
+
field3: string;
|
|
13
|
+
}[];
|
|
14
|
+
title?: string;
|
|
15
|
+
action?: {
|
|
16
|
+
link: string;
|
|
17
|
+
title: string;
|
|
18
|
+
rel: string;
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> {
|
|
23
|
+
}
|
|
24
|
+
export type ListCardProps = typeof __propDef.props;
|
|
25
|
+
export type ListCardEvents = typeof __propDef.events;
|
|
26
|
+
export type ListCardSlots = typeof __propDef.slots;
|
|
27
|
+
import { SvelteComponentTyped } from "svelte";
|
|
28
|
+
declare const __propDef: {
|
|
29
|
+
props: {
|
|
30
|
+
lists?: {
|
|
31
|
+
img: {
|
|
32
|
+
src: string;
|
|
33
|
+
alt: string;
|
|
34
|
+
};
|
|
35
|
+
field1: string;
|
|
36
|
+
field2: string;
|
|
37
|
+
field3: string;
|
|
38
|
+
}[];
|
|
39
|
+
title?: string;
|
|
40
|
+
action?: {
|
|
41
|
+
link: string;
|
|
42
|
+
title: string;
|
|
43
|
+
rel: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
events: {
|
|
47
|
+
[evt: string]: CustomEvent<any>;
|
|
48
|
+
};
|
|
49
|
+
slots: {};
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let title = "Sign in";
|
|
3
|
+
export let action;
|
|
4
|
+
export let btnSignInColor = "blue";
|
|
5
|
+
export let rememberMe = false;
|
|
6
|
+
export let signupLink = {
|
|
7
|
+
href: "",
|
|
8
|
+
rel: "",
|
|
9
|
+
};
|
|
10
|
+
export let lostPasswordLink = {
|
|
11
|
+
href: "",
|
|
12
|
+
rel: "",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let submitClass;
|
|
16
|
+
|
|
17
|
+
if (btnSignInColor === "blue") {
|
|
18
|
+
submitClass =
|
|
19
|
+
"w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
|
|
20
|
+
} else if (btnSignInColor === "gray") {
|
|
21
|
+
submitClass =
|
|
22
|
+
"w-full text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800";
|
|
23
|
+
} else if (btnSignInColor === "red") {
|
|
24
|
+
submitClass =
|
|
25
|
+
"w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800";
|
|
26
|
+
} else if (btnSignInColor === "yellow") {
|
|
27
|
+
submitClass =
|
|
28
|
+
"w-full text-white bg-yellow-700 hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800";
|
|
29
|
+
} else if (btnSignInColor === "green") {
|
|
30
|
+
submitClass =
|
|
31
|
+
"w-full text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800";
|
|
32
|
+
} else if (btnSignInColor === "indigo") {
|
|
33
|
+
submitClass =
|
|
34
|
+
"w-full text-white bg-indigo-700 hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800";
|
|
35
|
+
} else if (btnSignInColor === "purple") {
|
|
36
|
+
submitClass =
|
|
37
|
+
"w-full text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800";
|
|
38
|
+
} else if (btnSignInColor === "pink") {
|
|
39
|
+
submitClass =
|
|
40
|
+
"w-full text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800";
|
|
41
|
+
} else {
|
|
42
|
+
submitClass =
|
|
43
|
+
"w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<div
|
|
48
|
+
class="p-4 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md sm:p-6 lg:p-8 dark:bg-gray-800 dark:border-gray-700"
|
|
49
|
+
>
|
|
50
|
+
<form class="space-y-6" {action}>
|
|
51
|
+
<h3 class="text-xl font-medium text-gray-900 dark:text-white">{title}</h3>
|
|
52
|
+
<div>
|
|
53
|
+
<label
|
|
54
|
+
for="email"
|
|
55
|
+
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
56
|
+
>Email</label
|
|
57
|
+
>
|
|
58
|
+
<input
|
|
59
|
+
type="email"
|
|
60
|
+
name="email"
|
|
61
|
+
id="email"
|
|
62
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
63
|
+
placeholder="name@company.com"
|
|
64
|
+
required
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<label
|
|
69
|
+
for="password"
|
|
70
|
+
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
71
|
+
>Your password</label
|
|
72
|
+
>
|
|
73
|
+
<input
|
|
74
|
+
type="password"
|
|
75
|
+
name="password"
|
|
76
|
+
id="password"
|
|
77
|
+
placeholder="••••••••"
|
|
78
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
79
|
+
required
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="flex items-start">
|
|
83
|
+
{#if rememberMe}
|
|
84
|
+
<div class="flex items-start">
|
|
85
|
+
<div class="flex items-center h-5">
|
|
86
|
+
<input
|
|
87
|
+
id="remember"
|
|
88
|
+
aria-describedby="remember"
|
|
89
|
+
type="checkbox"
|
|
90
|
+
class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800"
|
|
91
|
+
required=""
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="ml-3 text-sm">
|
|
95
|
+
<label
|
|
96
|
+
for="remember"
|
|
97
|
+
class="font-medium text-gray-900 dark:text-gray-300"
|
|
98
|
+
>Remember me</label
|
|
99
|
+
>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
{/if}
|
|
103
|
+
{#if lostPasswordLink}
|
|
104
|
+
<a
|
|
105
|
+
href={lostPasswordLink.href}
|
|
106
|
+
rel={lostPasswordLink.rel}
|
|
107
|
+
class="ml-auto text-sm text-blue-700 hover:underline dark:text-blue-500"
|
|
108
|
+
>Lost Password?</a
|
|
109
|
+
>
|
|
110
|
+
{/if}
|
|
111
|
+
</div>
|
|
112
|
+
<button type="submit" class={submitClass}>Login to your account</button>
|
|
113
|
+
|
|
114
|
+
{#if signupLink}
|
|
115
|
+
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">
|
|
116
|
+
Not registered? <a
|
|
117
|
+
href={signupLink.href}
|
|
118
|
+
rel={signupLink.rel}
|
|
119
|
+
class="text-blue-700 hover:underline dark:text-blue-500"
|
|
120
|
+
>Create account</a
|
|
121
|
+
>
|
|
122
|
+
</div>
|
|
123
|
+
{/if}
|
|
124
|
+
</form>
|
|
125
|
+
</div>
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
action: any;
|
|
28
|
+
title?: string;
|
|
29
|
+
btnSignInColor?: string;
|
|
30
|
+
rememberMe?: boolean;
|
|
31
|
+
signupLink?: {
|
|
32
|
+
href: string;
|
|
33
|
+
rel: string;
|
|
34
|
+
};
|
|
35
|
+
lostPasswordLink?: {
|
|
36
|
+
href: string;
|
|
37
|
+
rel: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
events: {
|
|
41
|
+
[evt: string]: CustomEvent<any>;
|
|
42
|
+
};
|
|
43
|
+
slots: {};
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
export let btnClass =
|
|
4
|
+
"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 fixed left-0 top-8 z-50";
|
|
5
|
+
|
|
6
|
+
let mode;
|
|
7
|
+
|
|
8
|
+
const toggleTheme = () => {
|
|
9
|
+
// console.log("clicked theme icon");
|
|
10
|
+
if (localStorage.getItem("color-theme") === "dark") {
|
|
11
|
+
console.log("it's dark");
|
|
12
|
+
mode = "dark";
|
|
13
|
+
window.document.documentElement.classList.remove("dark");
|
|
14
|
+
window.document.documentElement.classList.add("light");
|
|
15
|
+
localStorage.setItem("color-theme", "light");
|
|
16
|
+
} else {
|
|
17
|
+
console.log("it's light");
|
|
18
|
+
mode = "light";
|
|
19
|
+
window.document.documentElement.classList.remove("light");
|
|
20
|
+
window.document.documentElement.classList.add("dark");
|
|
21
|
+
localStorage.setItem("color-theme", "dark");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
onMount(() => {
|
|
26
|
+
let themeToggleDarkIcon = document.getElementById("theme-toggle-dark-icon");
|
|
27
|
+
let themeToggleLightIcon = document.getElementById(
|
|
28
|
+
"theme-toggle-light-icon"
|
|
29
|
+
);
|
|
30
|
+
if (
|
|
31
|
+
localStorage.getItem("color-theme") === "dark" ||
|
|
32
|
+
(!("color-theme" in localStorage) &&
|
|
33
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches)
|
|
34
|
+
) {
|
|
35
|
+
document.documentElement.classList.add("dark");
|
|
36
|
+
themeToggleDarkIcon.classList.add("hidden");
|
|
37
|
+
} else {
|
|
38
|
+
document.documentElement.classList.remove("dark");
|
|
39
|
+
themeToggleLightIcon.classList.add("hidden");
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<button
|
|
45
|
+
on:click={toggleTheme}
|
|
46
|
+
aria-label="Dark mode"
|
|
47
|
+
id="theme-toggle"
|
|
48
|
+
type="button"
|
|
49
|
+
class={btnClass}
|
|
50
|
+
>
|
|
51
|
+
<svg
|
|
52
|
+
class:hidden={mode === "light"}
|
|
53
|
+
on:click={() => (mode = "dark")}
|
|
54
|
+
id="theme-toggle-dark-icon"
|
|
55
|
+
class="hidden w-5 h-5"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
viewBox="0 0 20 20"
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
><path
|
|
60
|
+
d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
|
|
61
|
+
/></svg
|
|
62
|
+
>
|
|
63
|
+
|
|
64
|
+
<svg
|
|
65
|
+
class:hidden={mode === "dark"}
|
|
66
|
+
on:click={() => (mode = "light")}
|
|
67
|
+
id="theme-toggle-light-icon"
|
|
68
|
+
class="hidden w-5 h-5"
|
|
69
|
+
fill="currentColor"
|
|
70
|
+
viewBox="0 0 20 20"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
><path
|
|
73
|
+
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"
|
|
74
|
+
fill-rule="evenodd"
|
|
75
|
+
clip-rule="evenodd"
|
|
76
|
+
/></svg
|
|
77
|
+
>
|
|
78
|
+
</button>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} DarkModeProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} DarkModeEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} DarkModeSlots */
|
|
4
|
+
export default class DarkMode extends SvelteComponentTyped<{
|
|
5
|
+
btnClass?: string;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type DarkModeProps = typeof __propDef.props;
|
|
11
|
+
export type DarkModeEvents = typeof __propDef.events;
|
|
12
|
+
export type DarkModeSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
btnClass?: string;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let label = "Dropdown button";
|
|
3
|
+
export let rounded = false;
|
|
4
|
+
export let textSize = "text-sm";
|
|
5
|
+
export let color = "blue";
|
|
6
|
+
|
|
7
|
+
let paddings;
|
|
8
|
+
if (textSize === "text-xs") {
|
|
9
|
+
paddings = "py-2 px-3";
|
|
10
|
+
} else if (textSize === "text-sm") {
|
|
11
|
+
paddings = "py-2.5 px-5";
|
|
12
|
+
} else if (textSize === "text-base") {
|
|
13
|
+
paddings = "py-3 px-6";
|
|
14
|
+
} else {
|
|
15
|
+
paddings = "py-2.5 px-5";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let buttonClass;
|
|
19
|
+
let round = rounded ? "rounded-full" : "rounded-lg";
|
|
20
|
+
|
|
21
|
+
let toggleHidden = true;
|
|
22
|
+
|
|
23
|
+
const handleToggle = () => {
|
|
24
|
+
console.log("toggle clicked.");
|
|
25
|
+
toggleHidden = !toggleHidden;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export let items = [
|
|
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") {
|
|
44
|
+
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
|
+
} else if (color === "blue-outline") {
|
|
46
|
+
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
|
+
} else if (color === "dark") {
|
|
48
|
+
buttonClass =
|
|
49
|
+
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`;
|
|
50
|
+
} else if (color === "dark-outline") {
|
|
51
|
+
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
|
+
} else if (color === "light") {
|
|
53
|
+
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
|
+
} else if (color === "green") {
|
|
55
|
+
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
|
+
} else if (color === "green-outline") {
|
|
57
|
+
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
|
+
} else if (color === "red") {
|
|
59
|
+
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
|
+
} else if (color === "red-outline") {
|
|
61
|
+
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
|
+
} else if (color === "yellow") {
|
|
63
|
+
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
|
+
} else if (color === "yellow-outline") {
|
|
65
|
+
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
|
+
} else if (color === "purple") {
|
|
67
|
+
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
|
+
} else if (color === "purple-outline") {
|
|
69
|
+
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
|
+
} else {
|
|
71
|
+
// blue
|
|
72
|
+
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
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<button on:click={handleToggle} class={buttonClass} type="button"
|
|
77
|
+
>{label}
|
|
78
|
+
<svg
|
|
79
|
+
class="ml-2 w-4 h-4"
|
|
80
|
+
fill="none"
|
|
81
|
+
stroke="currentColor"
|
|
82
|
+
viewBox="0 0 24 24"
|
|
83
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
+
><path
|
|
85
|
+
stroke-linecap="round"
|
|
86
|
+
stroke-linejoin="round"
|
|
87
|
+
stroke-width="2"
|
|
88
|
+
d="M19 9l-7 7-7-7"
|
|
89
|
+
/>
|
|
90
|
+
</svg>
|
|
91
|
+
</button>
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
class:hidden={toggleHidden}
|
|
95
|
+
class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700"
|
|
96
|
+
>
|
|
97
|
+
{#if $$slots.header}
|
|
98
|
+
<div class="py-3 px-4 text-gray-900 dark:text-white">
|
|
99
|
+
<slot name="header" />
|
|
100
|
+
</div>
|
|
101
|
+
{/if}
|
|
102
|
+
<ul class="py-1" aria-labelledby="dropdownButton">
|
|
103
|
+
{#each items as { link, label, divider }}
|
|
104
|
+
<li
|
|
105
|
+
class:border-b={divider}
|
|
106
|
+
class:border-gray-100={divider}
|
|
107
|
+
class:dark:border-gray-500={divider}
|
|
108
|
+
>
|
|
109
|
+
<a
|
|
110
|
+
href={link}
|
|
111
|
+
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"
|
|
112
|
+
>{label}</a
|
|
113
|
+
>
|
|
114
|
+
</li>
|
|
115
|
+
{/each}
|
|
116
|
+
</ul>
|
|
117
|
+
</div>
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
rounded?: boolean;
|
|
6
|
+
textSize?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
label?: 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
|
+
import { SvelteComponentTyped } from "svelte";
|
|
28
|
+
declare const __propDef: {
|
|
29
|
+
props: {
|
|
30
|
+
rounded?: boolean;
|
|
31
|
+
textSize?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
items?: ({
|
|
35
|
+
link: string;
|
|
36
|
+
label: string;
|
|
37
|
+
divider?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
link: string;
|
|
40
|
+
label: string;
|
|
41
|
+
divider: boolean;
|
|
42
|
+
})[];
|
|
43
|
+
};
|
|
44
|
+
events: {
|
|
45
|
+
[evt: string]: CustomEvent<any>;
|
|
46
|
+
};
|
|
47
|
+
slots: {
|
|
48
|
+
header: {};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let link = undefined;
|
|
3
|
+
export let siteName = "Svelte flow";
|
|
4
|
+
export let links = [
|
|
5
|
+
{ name: "About", link: "about", rel: undefined },
|
|
6
|
+
{ name: "Privacy Policy", link: "policy", rel: undefined },
|
|
7
|
+
{ name: "Licensing", link: "licensing", rel: undefined },
|
|
8
|
+
{ name: "Contact", link: "contact", rel: undefined },
|
|
9
|
+
];
|
|
10
|
+
export let footerClass =
|
|
11
|
+
"p-4 bg-white rounded-lg shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800";
|
|
12
|
+
export let spanClass =
|
|
13
|
+
"text-sm text-gray-500 sm:text-center dark:text-gray-400";
|
|
14
|
+
export let ulClass = "flex flex-wrap items-center mt-3 sm:mt-0";
|
|
15
|
+
export let aClass =
|
|
16
|
+
"mr-4 text-sm text-gray-500 hover:underline md:mr-6 dark:text-gray-400";
|
|
17
|
+
export let spanLinkClass = "hover:underline";
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<footer class={footerClass}>
|
|
21
|
+
<span class={spanClass}
|
|
22
|
+
>© 2022 <a href={link} class={spanLinkClass} target="_blank">{siteName}</a>.
|
|
23
|
+
All Rights Reserved.
|
|
24
|
+
</span>
|
|
25
|
+
<ul class={ulClass}>
|
|
26
|
+
{#each links as { name, link, rel }}
|
|
27
|
+
<li>
|
|
28
|
+
<a href={link} {rel} class={aClass}>{name}</a>
|
|
29
|
+
</li>
|
|
30
|
+
{/each}
|
|
31
|
+
</ul>
|
|
32
|
+
</footer>
|