flowbite-svelte 0.9.1 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordions/AccordionItem.svelte +31 -34
- package/accordions/AccordionItem.svelte.d.ts +6 -16
- package/buttongroups/ButtonGroup.svelte +8 -21
- package/buttongroups/ButtonGroup.svelte.d.ts +1 -1
- package/buttongroups/ButtonGroupOutline.svelte +8 -21
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +1 -1
- package/cards/CtaCard.svelte +8 -19
- package/cards/CtaCard.svelte.d.ts +2 -2
- package/cards/EcommerceCard.svelte +1 -1
- package/cards/EcommerceCard.svelte.d.ts +2 -2
- 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/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 +59 -106
- package/footer/SocialMediaFooter.svelte.d.ts +14 -66
- 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 +1 -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 +55 -7
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "@codewithshin/svelte-heroicons";
|
|
8
|
-
export let id;
|
|
9
|
-
const store = getContext("svelte-collapsible-accordion");
|
|
10
|
-
$: params = {
|
|
1
|
+
<script >import { getContext } from 'svelte';
|
|
2
|
+
import collapse from 'svelte-collapse';
|
|
3
|
+
import { ChevronDownIconSolid, ChevronUpIconSolid } from '@codewithshin/svelte-heroicons';
|
|
4
|
+
export let id;
|
|
5
|
+
const store = getContext('svelte-collapsible-accordion');
|
|
6
|
+
$: params = {
|
|
11
7
|
open: $store.id === id,
|
|
12
8
|
duration: $store.duration,
|
|
13
|
-
easing: $store.easing
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
easing: $store.easing
|
|
10
|
+
};
|
|
11
|
+
const handleToggle = () => {
|
|
16
12
|
if (params.open) {
|
|
17
|
-
|
|
18
|
-
} else {
|
|
19
|
-
store.update((s) => Object.assign(s, { id }));
|
|
13
|
+
store.update((s) => Object.assign(s, { id: null }));
|
|
20
14
|
}
|
|
21
|
-
|
|
15
|
+
else {
|
|
16
|
+
store.update((s) => Object.assign(s, { id }));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
22
19
|
</script>
|
|
23
20
|
|
|
24
21
|
<h2 aria-expanded={params.open}>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
<button
|
|
23
|
+
on:click={handleToggle}
|
|
24
|
+
type="button"
|
|
25
|
+
class:rounded-t-xl={id === '1'}
|
|
26
|
+
class:border-t-0={id !== '1'}
|
|
27
|
+
class="flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"
|
|
28
|
+
>
|
|
29
|
+
<span><slot name="header" /></span>
|
|
30
|
+
{#if params.open}
|
|
31
|
+
<ChevronUpIconSolid />
|
|
32
|
+
{:else}
|
|
33
|
+
<ChevronDownIconSolid />
|
|
34
|
+
{/if}
|
|
35
|
+
</button>
|
|
39
36
|
</h2>
|
|
40
37
|
<div use:collapse={params}>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
<div class="p-5 border border-t-0 border-gray-200 dark:border-gray-700">
|
|
39
|
+
<slot name="body" />
|
|
40
|
+
</div>
|
|
44
41
|
</div>
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} AccordionItemProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} AccordionItemEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} AccordionItemSlots */
|
|
4
|
-
export default class AccordionItem extends SvelteComponentTyped<{
|
|
5
|
-
id: any;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
header: {};
|
|
10
|
-
body: {};
|
|
11
|
-
}> {
|
|
12
|
-
}
|
|
13
|
-
export type AccordionItemProps = typeof __propDef.props;
|
|
14
|
-
export type AccordionItemEvents = typeof __propDef.events;
|
|
15
|
-
export type AccordionItemSlots = typeof __propDef.slots;
|
|
16
1
|
import { SvelteComponentTyped } from "svelte";
|
|
17
2
|
declare const __propDef: {
|
|
18
3
|
props: {
|
|
19
|
-
id:
|
|
4
|
+
id: string;
|
|
20
5
|
};
|
|
21
6
|
events: {
|
|
22
7
|
[evt: string]: CustomEvent<any>;
|
|
@@ -26,4 +11,9 @@ declare const __propDef: {
|
|
|
26
11
|
body: {};
|
|
27
12
|
};
|
|
28
13
|
};
|
|
14
|
+
export declare type AccordionItemProps = typeof __propDef.props;
|
|
15
|
+
export declare type AccordionItemEvents = typeof __propDef.events;
|
|
16
|
+
export declare type AccordionItemSlots = typeof __propDef.slots;
|
|
17
|
+
export default class AccordionItem extends SvelteComponentTyped<AccordionItemProps, AccordionItemEvents, AccordionItemSlots> {
|
|
18
|
+
}
|
|
29
19
|
export {};
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
<script >export let buttons
|
|
2
|
-
{
|
|
3
|
-
name: 'Profile',
|
|
4
|
-
link: '/'
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
name: 'Settings',
|
|
8
|
-
link: '/'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'Messages',
|
|
12
|
-
link: '/'
|
|
13
|
-
}
|
|
14
|
-
];
|
|
1
|
+
<script >export let buttons;
|
|
15
2
|
let btnLength = buttons.length;
|
|
16
3
|
let classFirst = 'inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-l-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white';
|
|
17
4
|
let classMiddle = 'inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white border-t border-b border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white';
|
|
@@ -19,14 +6,14 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
19
6
|
</script>
|
|
20
7
|
|
|
21
8
|
<div class="inline-flex rounded-md shadow-sm" role="group">
|
|
22
|
-
{#each buttons as { name, icon,
|
|
9
|
+
{#each buttons as { name, icon, href, rel }, i}
|
|
23
10
|
{#if i === 0}
|
|
24
11
|
<button type="button" class={classFirst}>
|
|
25
12
|
{#if icon}
|
|
26
13
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
27
14
|
{/if}
|
|
28
|
-
{#if
|
|
29
|
-
<a href
|
|
15
|
+
{#if href}
|
|
16
|
+
<a {href} {rel}>{name}</a>
|
|
30
17
|
{:else}
|
|
31
18
|
{name}
|
|
32
19
|
{/if}
|
|
@@ -36,8 +23,8 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
36
23
|
{#if icon}
|
|
37
24
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
38
25
|
{/if}
|
|
39
|
-
{#if
|
|
40
|
-
<a href
|
|
26
|
+
{#if href}
|
|
27
|
+
<a {href} {rel}>{name}</a>
|
|
41
28
|
{:else}
|
|
42
29
|
{name}
|
|
43
30
|
{/if}
|
|
@@ -47,8 +34,8 @@ let classLast = 'inline-flex relative items-center py-2 px-4 text-sm font-medium
|
|
|
47
34
|
{#if icon}
|
|
48
35
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
49
36
|
{/if}
|
|
50
|
-
{#if
|
|
51
|
-
<a href
|
|
37
|
+
{#if href}
|
|
38
|
+
<a {href} {rel}>{name}</a>
|
|
52
39
|
{:else}
|
|
53
40
|
{name}
|
|
54
41
|
{/if}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
<script >export let buttons
|
|
2
|
-
{
|
|
3
|
-
name: 'Profile',
|
|
4
|
-
link: '/'
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
name: 'Settings',
|
|
8
|
-
link: '/'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'Messages',
|
|
12
|
-
link: '/'
|
|
13
|
-
}
|
|
14
|
-
];
|
|
1
|
+
<script >export let buttons;
|
|
15
2
|
let btnLength = buttons.length;
|
|
16
3
|
let classFirst = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent rounded-l-lg border border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700';
|
|
17
4
|
let classMiddle = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent border-t border-b border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700';
|
|
@@ -19,14 +6,14 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
19
6
|
</script>
|
|
20
7
|
|
|
21
8
|
<div class="inline-flex rounded-md shadow-sm">
|
|
22
|
-
{#each buttons as {
|
|
9
|
+
{#each buttons as { href, name, rel, icon }, i}
|
|
23
10
|
{#if i === 0}
|
|
24
11
|
<button type="button" class={classFirst}>
|
|
25
12
|
{#if icon}
|
|
26
13
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
27
14
|
{/if}
|
|
28
|
-
{#if
|
|
29
|
-
<a href
|
|
15
|
+
{#if href}
|
|
16
|
+
<a {href} {rel}>{name}</a>
|
|
30
17
|
{:else}
|
|
31
18
|
{name}
|
|
32
19
|
{/if}
|
|
@@ -36,8 +23,8 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
36
23
|
{#if icon}
|
|
37
24
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
38
25
|
{/if}
|
|
39
|
-
{#if
|
|
40
|
-
<a href
|
|
26
|
+
{#if href}
|
|
27
|
+
<a {href} {rel}>{name}</a>
|
|
41
28
|
{:else}
|
|
42
29
|
{name}
|
|
43
30
|
{/if}
|
|
@@ -47,8 +34,8 @@ let classLast = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gra
|
|
|
47
34
|
{#if icon}
|
|
48
35
|
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
49
36
|
{/if}
|
|
50
|
-
{#if
|
|
51
|
-
<a href
|
|
37
|
+
{#if href}
|
|
38
|
+
<a {href} {rel}>{name}</a>
|
|
52
39
|
{:else}
|
|
53
40
|
{name}
|
|
54
41
|
{/if}
|
package/cards/CtaCard.svelte
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
<script >import Button from '../buttons/Button.svelte';
|
|
2
2
|
export let title = 'Work fast from anywhere';
|
|
3
3
|
export let headColor = 'gray';
|
|
4
|
-
export let btns
|
|
5
|
-
{
|
|
6
|
-
textSize: 'text-base',
|
|
7
|
-
name: 'Download it',
|
|
8
|
-
type: 'blue',
|
|
9
|
-
link: '/about'
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
textSize: 'text-base',
|
|
13
|
-
name: 'Get in on',
|
|
14
|
-
type: 'red-outline',
|
|
15
|
-
link: '/'
|
|
16
|
-
}
|
|
17
|
-
];
|
|
4
|
+
export let btns;
|
|
18
5
|
let headClass;
|
|
19
6
|
if (headColor === 'blue') {
|
|
20
7
|
headClass = 'mb-2 text-3xl font-bold text-blue-900 dark:text-white';
|
|
@@ -55,10 +42,12 @@ else {
|
|
|
55
42
|
<slot />
|
|
56
43
|
</p>
|
|
57
44
|
<div class="justify-center items-center space-y-4 sm:flex sm:space-y-0 sm:space-x-4">
|
|
58
|
-
{#
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
{#if btns}
|
|
46
|
+
{#each btns as { name, textSize, type, href, rel, rounded }}
|
|
47
|
+
<a {href} {rel}>
|
|
48
|
+
<Button {name} {rounded} {type} {textSize} />
|
|
49
|
+
</a>
|
|
50
|
+
{/each}
|
|
51
|
+
{/if}
|
|
63
52
|
</div>
|
|
64
53
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CardButtonType, Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
title?: string;
|
|
6
6
|
headColor?: Colors;
|
|
7
|
-
btns
|
|
7
|
+
btns: CardButtonType[];
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ImgType, Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
img?:
|
|
5
|
+
img?: ImgType;
|
|
6
6
|
link?: string;
|
|
7
7
|
btnColor?: Colors;
|
|
8
8
|
rel: string;
|
|
@@ -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.href}
|
|
101
|
+
<a href={link1.href} rel={link1.rel} class={linkClass}>{link1.name}</a>
|
|
102
|
+
{/if}
|
|
103
|
+
{#if link2.href}
|
|
104
|
+
<a
|
|
105
|
+
href={link2.href}
|
|
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>
|