flowbite-svelte 0.9.0 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordions/AccordionDefault.svelte +20 -21
- package/accordions/AccordionDefault.svelte.d.ts +6 -19
- package/accordions/AccordionItem.svelte +31 -34
- package/accordions/AccordionItem.svelte.d.ts +6 -16
- package/alerts/Alert.svelte +1 -2
- package/alerts/Alert.svelte.d.ts +2 -1
- package/alerts/BorderAlert.svelte +1 -2
- package/alerts/BorderAlert.svelte.d.ts +2 -1
- package/alerts/InfoAlert.svelte +1 -2
- package/alerts/InfoAlert.svelte.d.ts +2 -1
- package/badges/Badge.svelte +22 -16
- package/badges/Badge.svelte.d.ts +8 -16
- package/badges/BadgeIcon.svelte +24 -18
- package/badges/BadgeIcon.svelte.d.ts +8 -18
- package/badges/BadgeLink.svelte +23 -17
- package/badges/BadgeLink.svelte.d.ts +9 -18
- package/buttongroups/ButtonGroup.svelte +41 -64
- package/buttongroups/ButtonGroup.svelte.d.ts +7 -23
- package/buttongroups/ButtonGroupOutline.svelte +41 -66
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +7 -23
- package/buttons/Button.svelte +48 -35
- package/buttons/Button.svelte.d.ts +9 -20
- package/buttons/ColorShadowButton.svelte +22 -16
- package/buttons/ColorShadowButton.svelte.d.ts +8 -18
- package/buttons/GradientDuotoneButton.svelte +20 -15
- package/buttons/GradientDuotoneButton.svelte.d.ts +8 -18
- package/buttons/GradientMonochromeButton.svelte +22 -16
- package/buttons/GradientMonochromeButton.svelte.d.ts +8 -18
- package/buttons/GradientOutlineButton.svelte +30 -25
- package/buttons/GradientOutlineButton.svelte.d.ts +8 -18
- package/cards/Card.svelte +73 -71
- package/cards/Card.svelte.d.ts +12 -26
- package/cards/CtaCard.svelte +48 -58
- package/cards/CtaCard.svelte.d.ts +8 -32
- package/cards/EcommerceCard.svelte +77 -77
- package/cards/EcommerceCard.svelte.d.ts +10 -28
- package/cards/HorizontalCard.svelte +21 -24
- package/cards/HorizontalCard.svelte.d.ts +9 -22
- package/cards/InteractiveCard.svelte +96 -110
- package/cards/InteractiveCard.svelte.d.ts +10 -50
- package/darkmode/DarkMode.svelte +60 -69
- package/darkmode/DarkMode.svelte.d.ts +5 -12
- package/dropdowns/DropdownDefault.svelte.d.ts +4 -4
- package/footer/LogoFooter.svelte +32 -48
- package/footer/LogoFooter.svelte.d.ts +11 -46
- package/footer/SimpleFooter.svelte +20 -33
- package/footer/SimpleFooter.svelte.d.ts +8 -36
- package/footer/SitemapFooter.svelte +43 -112
- package/footer/SitemapFooter.svelte.d.ts +13 -59
- package/footer/SocialMediaFooter.svelte.d.ts +14 -14
- package/modals/ExtraLargeModal.svelte +187 -191
- package/modals/ExtraLargeModal.svelte.d.ts +9 -27
- package/modals/LargeModal.svelte +188 -191
- package/modals/LargeModal.svelte.d.ts +9 -27
- package/modals/MediumModal.svelte +191 -200
- package/modals/MediumModal.svelte.d.ts +9 -27
- package/modals/ModalButton.svelte +40 -35
- package/modals/ModalButton.svelte.d.ts +7 -17
- package/modals/SignInModal.svelte +151 -160
- package/modals/SignInModal.svelte.d.ts +10 -24
- package/modals/SmallModal.svelte +188 -191
- package/modals/SmallModal.svelte.d.ts +9 -27
- package/modals/modalStores.d.ts +2 -1
- package/modals/modalStores.js +1 -2
- package/navbar/DropdownNavbar.svelte +117 -202
- package/navbar/DropdownNavbar.svelte.d.ts +8 -52
- package/navbar/Navbar.svelte +68 -99
- package/navbar/Navbar.svelte.d.ts +8 -26
- package/package.json +9 -2
- package/spinners/Spinner.svelte +63 -57
- package/spinners/Spinner.svelte.d.ts +8 -17
- package/spinners/SpinnerButton.svelte +31 -31
- package/spinners/SpinnerButton.svelte.d.ts +6 -15
- package/tabs/DefaultTabs.svelte +13 -39
- package/tabs/DefaultTabs.svelte.d.ts +7 -23
- package/tabs/InteractiveTabs.svelte +33 -63
- package/tabs/InteractiveTabs.svelte.d.ts +7 -35
- package/tabs/PillTabs.svelte +12 -34
- package/tabs/PillTabs.svelte.d.ts +7 -21
- package/tooltips/LightTooltip.svelte +112 -114
- package/tooltips/LightTooltip.svelte.d.ts +6 -21
- package/tooltips/Tooltip.svelte +113 -114
- package/tooltips/Tooltip.svelte.d.ts +6 -21
- package/types.d.ts +66 -0
- package/types.js +1 -0
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let linkClass;
|
|
15
|
-
if (btnColor === "blue") {
|
|
1
|
+
<script >export let img = {
|
|
2
|
+
src: '/images/product-1.png',
|
|
3
|
+
alt: 'product image'
|
|
4
|
+
};
|
|
5
|
+
export let link = '/';
|
|
6
|
+
export let btnColor = 'blue';
|
|
7
|
+
export let rel;
|
|
8
|
+
export let title = 'Apple Watch Series 7 GPS, Aluminium Case, Starlight Sport';
|
|
9
|
+
export let stars = 5;
|
|
10
|
+
export let price = '$555';
|
|
11
|
+
let spanClass;
|
|
12
|
+
let linkClass;
|
|
13
|
+
if (btnColor === 'blue') {
|
|
16
14
|
spanClass =
|
|
17
|
-
|
|
15
|
+
'bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 ml-3';
|
|
18
16
|
linkClass =
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
'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';
|
|
18
|
+
}
|
|
19
|
+
else if (btnColor === 'gray') {
|
|
21
20
|
spanClass =
|
|
22
|
-
|
|
21
|
+
'bg-gray-100 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-200 dark:text-gray-800 ml-3';
|
|
23
22
|
linkClass =
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
'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';
|
|
24
|
+
}
|
|
25
|
+
else if (btnColor === 'red') {
|
|
26
26
|
spanClass =
|
|
27
|
-
|
|
27
|
+
'bg-red-100 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800 ml-3';
|
|
28
28
|
linkClass =
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
'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';
|
|
30
|
+
}
|
|
31
|
+
else if (btnColor === 'yellow') {
|
|
31
32
|
spanClass =
|
|
32
|
-
|
|
33
|
+
'bg-yellow-100 text-yellow-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-yellow-200 dark:text-yellow-800 ml-3';
|
|
33
34
|
linkClass =
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
'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';
|
|
36
|
+
}
|
|
37
|
+
else if (btnColor === 'green') {
|
|
36
38
|
spanClass =
|
|
37
|
-
|
|
39
|
+
'bg-green-100 text-green-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-800 ml-3';
|
|
38
40
|
linkClass =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
'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';
|
|
42
|
+
}
|
|
43
|
+
else if (btnColor === 'indigo') {
|
|
41
44
|
spanClass =
|
|
42
|
-
|
|
45
|
+
'bg-indigo-100 text-indigo-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-indigo-200 dark:text-indigo-800 ml-3';
|
|
43
46
|
linkClass =
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
'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';
|
|
48
|
+
}
|
|
49
|
+
else if (btnColor === 'purple') {
|
|
46
50
|
spanClass =
|
|
47
|
-
|
|
51
|
+
'bg-purple-100 text-purple-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-purple-200 dark:text-purple-800 ml-3';
|
|
48
52
|
linkClass =
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
'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';
|
|
54
|
+
}
|
|
55
|
+
else if (btnColor === 'pink') {
|
|
51
56
|
spanClass =
|
|
52
|
-
|
|
57
|
+
'bg-pink-100 text-pink-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-pink-200 dark:text-pink-800 ml-3';
|
|
53
58
|
linkClass =
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
'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';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
56
62
|
spanClass =
|
|
57
|
-
|
|
63
|
+
'bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 ml-3';
|
|
58
64
|
linkClass =
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
'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';
|
|
66
|
+
}
|
|
61
67
|
</script>
|
|
62
68
|
|
|
63
|
-
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<span class="text-3xl font-bold text-gray-900 dark:text-white"
|
|
93
|
-
>{price}</span
|
|
94
|
-
>
|
|
95
|
-
<a href={link} {rel} class={linkClass}>Add to cart</a>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
69
|
+
<div class="max-w-sm bg-white rounded-lg shadow-md dark:bg-gray-800 dark:border-gray-700">
|
|
70
|
+
<a href={link} {rel}>
|
|
71
|
+
<img class="p-8 rounded-t-lg" src={img.src} alt={img.alt} />
|
|
72
|
+
</a>
|
|
73
|
+
<div class="px-5 pb-5">
|
|
74
|
+
<a href={link} {rel}>
|
|
75
|
+
<h3 class="text-xl font-semibold tracking-tight text-gray-900 dark:text-white">
|
|
76
|
+
{title}
|
|
77
|
+
</h3>
|
|
78
|
+
</a>
|
|
79
|
+
<div class="flex items-center mt-2.5 mb-5">
|
|
80
|
+
{#each { length: stars } as _, i}
|
|
81
|
+
<svg
|
|
82
|
+
class="w-5 h-5 text-yellow-300"
|
|
83
|
+
fill="currentColor"
|
|
84
|
+
viewBox="0 0 20 20"
|
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
86
|
+
><path
|
|
87
|
+
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
|
|
88
|
+
/></svg
|
|
89
|
+
>
|
|
90
|
+
{/each}
|
|
91
|
+
<span class={spanClass}>{stars}</span>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="flex justify-between items-center">
|
|
94
|
+
<span class="text-3xl font-bold text-gray-900 dark:text-white">{price}</span>
|
|
95
|
+
<a href={link} {rel} class={linkClass}>Add to cart</a>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
98
|
</div>
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} EcommerceCardProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} EcommerceCardEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} EcommerceCardSlots */
|
|
4
|
-
export default class EcommerceCard extends SvelteComponentTyped<{
|
|
5
|
-
rel: any;
|
|
6
|
-
link?: string;
|
|
7
|
-
btnColor?: string;
|
|
8
|
-
img?: {
|
|
9
|
-
src: string;
|
|
10
|
-
alt: string;
|
|
11
|
-
};
|
|
12
|
-
title?: string;
|
|
13
|
-
stars?: string;
|
|
14
|
-
price?: string;
|
|
15
|
-
}, {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
}, {}> {
|
|
18
|
-
}
|
|
19
|
-
export type EcommerceCardProps = typeof __propDef.props;
|
|
20
|
-
export type EcommerceCardEvents = typeof __propDef.events;
|
|
21
|
-
export type EcommerceCardSlots = typeof __propDef.slots;
|
|
22
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ImgType, Colors } from '../types';
|
|
23
3
|
declare const __propDef: {
|
|
24
4
|
props: {
|
|
25
|
-
|
|
5
|
+
img?: ImgType;
|
|
26
6
|
link?: string;
|
|
27
|
-
btnColor?:
|
|
28
|
-
|
|
29
|
-
src: string;
|
|
30
|
-
alt: string;
|
|
31
|
-
};
|
|
7
|
+
btnColor?: Colors;
|
|
8
|
+
rel: string;
|
|
32
9
|
title?: string;
|
|
33
|
-
stars?:
|
|
10
|
+
stars?: number;
|
|
34
11
|
price?: string;
|
|
35
12
|
};
|
|
36
13
|
events: {
|
|
@@ -38,4 +15,9 @@ declare const __propDef: {
|
|
|
38
15
|
};
|
|
39
16
|
slots: {};
|
|
40
17
|
};
|
|
18
|
+
export declare type EcommerceCardProps = typeof __propDef.props;
|
|
19
|
+
export declare type EcommerceCardEvents = typeof __propDef.events;
|
|
20
|
+
export declare type EcommerceCardSlots = typeof __propDef.slots;
|
|
21
|
+
export default class EcommerceCard extends SvelteComponentTyped<EcommerceCardProps, EcommerceCardEvents, EcommerceCardSlots> {
|
|
22
|
+
}
|
|
41
23
|
export {};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let header = "Lorem ipsum dolor sit ametit.";
|
|
1
|
+
<script >export let link;
|
|
2
|
+
export let rel;
|
|
3
|
+
export let img = '/images/image-4.jpeg';
|
|
4
|
+
export let alt;
|
|
5
|
+
export let header = 'Lorem ipsum dolor sit ametit.';
|
|
7
6
|
</script>
|
|
8
7
|
|
|
9
8
|
<a
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
href={link}
|
|
10
|
+
{rel}
|
|
11
|
+
class="flex flex-col items-center bg-white rounded-lg border shadow-md md:flex-row md:max-w-xl hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700"
|
|
13
12
|
>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</p>
|
|
28
|
-
</div>
|
|
13
|
+
<img
|
|
14
|
+
class="object-cover w-full h-96 rounded-t-lg md:h-auto md:w-48 md:rounded-none md:rounded-l-lg"
|
|
15
|
+
src={img}
|
|
16
|
+
{alt}
|
|
17
|
+
/>
|
|
18
|
+
<div class="flex flex-col justify-between p-4 leading-normal">
|
|
19
|
+
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
|
|
20
|
+
{header}
|
|
21
|
+
</h5>
|
|
22
|
+
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
|
|
23
|
+
<slot />
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
29
26
|
</a>
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} HorizontalCardProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} HorizontalCardEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} HorizontalCardSlots */
|
|
4
|
-
export default class HorizontalCard extends SvelteComponentTyped<{
|
|
5
|
-
link: any;
|
|
6
|
-
rel: any;
|
|
7
|
-
alt: any;
|
|
8
|
-
header?: string;
|
|
9
|
-
img?: string;
|
|
10
|
-
}, {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
export type HorizontalCardProps = typeof __propDef.props;
|
|
17
|
-
export type HorizontalCardEvents = typeof __propDef.events;
|
|
18
|
-
export type HorizontalCardSlots = typeof __propDef.slots;
|
|
19
1
|
import { SvelteComponentTyped } from "svelte";
|
|
20
2
|
declare const __propDef: {
|
|
21
3
|
props: {
|
|
22
|
-
link:
|
|
23
|
-
rel:
|
|
24
|
-
alt: any;
|
|
25
|
-
header?: string;
|
|
4
|
+
link: string;
|
|
5
|
+
rel: string;
|
|
26
6
|
img?: string;
|
|
7
|
+
alt: string;
|
|
8
|
+
header?: string;
|
|
27
9
|
};
|
|
28
10
|
events: {
|
|
29
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -32,4 +14,9 @@ declare const __propDef: {
|
|
|
32
14
|
default: {};
|
|
33
15
|
};
|
|
34
16
|
};
|
|
17
|
+
export declare type HorizontalCardProps = typeof __propDef.props;
|
|
18
|
+
export declare type HorizontalCardEvents = typeof __propDef.events;
|
|
19
|
+
export declare type HorizontalCardSlots = typeof __propDef.slots;
|
|
20
|
+
export default class HorizontalCard extends SvelteComponentTyped<HorizontalCardProps, HorizontalCardEvents, HorizontalCardSlots> {
|
|
21
|
+
}
|
|
35
22
|
export {};
|
|
@@ -1,127 +1,113 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
const toggleDropdown = () => {
|
|
1
|
+
<script >let isOpen = true;
|
|
2
|
+
const toggleDropdown = () => {
|
|
4
3
|
isOpen = !isOpen;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
href: "profile",
|
|
18
|
-
label: "Profile",
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
export let img = {
|
|
22
|
-
src: "",
|
|
23
|
-
alt: "",
|
|
24
|
-
};
|
|
25
|
-
export let header = "Lorem ipsum";
|
|
26
|
-
export let content = "Proin efficitur purus felis.";
|
|
27
|
-
export let buttonColor = "blue";
|
|
28
|
-
export let link1 = { href: "", title: "", rel: "" };
|
|
29
|
-
export let link2 = { href: "", title: "", rel: "" };
|
|
30
|
-
let linkClass;
|
|
31
|
-
if (buttonColor === "blue") {
|
|
4
|
+
};
|
|
5
|
+
export let dropdownLinks;
|
|
6
|
+
export let img;
|
|
7
|
+
export let header = 'Lorem ipsum';
|
|
8
|
+
export let content = 'Proin efficitur purus felis.';
|
|
9
|
+
export let buttonColor = 'blue';
|
|
10
|
+
export let link1;
|
|
11
|
+
export let link2;
|
|
12
|
+
let linkClass;
|
|
13
|
+
if (buttonColor === 'blue') {
|
|
32
14
|
linkClass =
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
16
|
+
}
|
|
17
|
+
else if (buttonColor === 'gray') {
|
|
35
18
|
linkClass =
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
20
|
+
}
|
|
21
|
+
else if (buttonColor === 'red') {
|
|
38
22
|
linkClass =
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-red-700 rounded-lg hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
24
|
+
}
|
|
25
|
+
else if (buttonColor === 'yellow') {
|
|
41
26
|
linkClass =
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
28
|
+
}
|
|
29
|
+
else if (buttonColor === 'green') {
|
|
44
30
|
linkClass =
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-green-700 rounded-lg hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
32
|
+
}
|
|
33
|
+
else if (buttonColor === 'indigo') {
|
|
47
34
|
linkClass =
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
36
|
+
}
|
|
37
|
+
else if (buttonColor === 'purple') {
|
|
50
38
|
linkClass =
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
40
|
+
}
|
|
41
|
+
else if (buttonColor === 'pink') {
|
|
53
42
|
linkClass =
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
56
46
|
linkClass =
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
48
|
+
}
|
|
59
49
|
</script>
|
|
60
50
|
|
|
61
51
|
<div
|
|
62
|
-
|
|
52
|
+
class="max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700"
|
|
63
53
|
>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
<div class="flex justify-end px-4 pt-4">
|
|
55
|
+
<button
|
|
56
|
+
id="dropdownButton"
|
|
57
|
+
on:click={toggleDropdown}
|
|
58
|
+
class="sm:inline-block 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-1.5"
|
|
59
|
+
type="button"
|
|
60
|
+
>
|
|
61
|
+
<svg
|
|
62
|
+
class="w-6 h-6"
|
|
63
|
+
fill="currentColor"
|
|
64
|
+
viewBox="0 0 20 20"
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
+
><path
|
|
67
|
+
d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"
|
|
68
|
+
/></svg
|
|
69
|
+
>
|
|
70
|
+
</button>
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
72
|
+
<div
|
|
73
|
+
id="dropdown"
|
|
74
|
+
class:hidden={isOpen}
|
|
75
|
+
class:block={!isOpen}
|
|
76
|
+
class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 absolute"
|
|
77
|
+
>
|
|
78
|
+
<ul class="py-1" aria-labelledby="dropdownButton">
|
|
79
|
+
{#each dropdownLinks as { href, name, rel }}
|
|
80
|
+
<li>
|
|
81
|
+
<a
|
|
82
|
+
{href}
|
|
83
|
+
{rel}
|
|
84
|
+
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"
|
|
85
|
+
>{name}</a
|
|
86
|
+
>
|
|
87
|
+
</li>
|
|
88
|
+
{/each}
|
|
89
|
+
</ul>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
102
92
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
>
|
|
124
|
-
{/if}
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
93
|
+
<div class="flex flex-col items-center pb-10">
|
|
94
|
+
<img class="mb-3 w-24 h-24 rounded-full shadow-lg" src={img.src} alt={img.alt} />
|
|
95
|
+
<h3 class="mb-1 text-xl font-medium text-gray-900 dark:text-white">
|
|
96
|
+
{header}
|
|
97
|
+
</h3>
|
|
98
|
+
<span class="text-sm text-gray-500 dark:text-gray-400">{content}</span>
|
|
99
|
+
<div class="flex mt-4 space-x-3 lg:mt-6">
|
|
100
|
+
{#if link1.link}
|
|
101
|
+
<a href={link1.link} rel={link1.rel} class={linkClass}>{link1.name}</a>
|
|
102
|
+
{/if}
|
|
103
|
+
{#if link2.link}
|
|
104
|
+
<a
|
|
105
|
+
href={link2.link}
|
|
106
|
+
rel={link2.rel}
|
|
107
|
+
class="inline-flex items-center py-2 px-4 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-blue-300 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-800"
|
|
108
|
+
>{link2.name}</a
|
|
109
|
+
>
|
|
110
|
+
{/if}
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
127
113
|
</div>
|
|
@@ -1,63 +1,23 @@
|
|
|
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
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { DropdownLinkType, ImgType, LinkType } from '../types';
|
|
34
3
|
declare const __propDef: {
|
|
35
4
|
props: {
|
|
5
|
+
dropdownLinks: DropdownLinkType[];
|
|
6
|
+
img: ImgType;
|
|
36
7
|
header?: string;
|
|
37
|
-
img?: {
|
|
38
|
-
src: string;
|
|
39
|
-
alt: string;
|
|
40
|
-
};
|
|
41
|
-
dropdownLinks?: {
|
|
42
|
-
href: string;
|
|
43
|
-
label: string;
|
|
44
|
-
}[];
|
|
45
8
|
content?: string;
|
|
46
9
|
buttonColor?: string;
|
|
47
|
-
link1
|
|
48
|
-
|
|
49
|
-
title: string;
|
|
50
|
-
rel: string;
|
|
51
|
-
};
|
|
52
|
-
link2?: {
|
|
53
|
-
href: string;
|
|
54
|
-
title: string;
|
|
55
|
-
rel: string;
|
|
56
|
-
};
|
|
10
|
+
link1: LinkType;
|
|
11
|
+
link2: LinkType;
|
|
57
12
|
};
|
|
58
13
|
events: {
|
|
59
14
|
[evt: string]: CustomEvent<any>;
|
|
60
15
|
};
|
|
61
16
|
slots: {};
|
|
62
17
|
};
|
|
18
|
+
export declare type InteractiveCardProps = typeof __propDef.props;
|
|
19
|
+
export declare type InteractiveCardEvents = typeof __propDef.events;
|
|
20
|
+
export declare type InteractiveCardSlots = typeof __propDef.slots;
|
|
21
|
+
export default class InteractiveCard extends SvelteComponentTyped<InteractiveCardProps, InteractiveCardEvents, InteractiveCardSlots> {
|
|
22
|
+
}
|
|
63
23
|
export {};
|