flowbite-svelte 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -4
- package/alerts/Alert.svelte +24 -1
- package/alerts/Alert.svelte.d.ts +3 -0
- package/badges/BadgeIcon.svelte +1 -1
- package/index.d.ts +16 -0
- package/index.js +25 -1
- package/modals/ExtraLargeModal.svelte +2 -2
- package/modals/ExtraLargeModal.svelte.d.ts +2 -1
- package/modals/LargeModal.svelte +2 -2
- package/modals/LargeModal.svelte.d.ts +2 -1
- package/modals/MediumModal.svelte +2 -2
- package/modals/MediumModal.svelte.d.ts +2 -1
- package/modals/SignInModal.svelte +4 -3
- package/modals/SignInModal.svelte.d.ts +3 -1
- package/modals/SmallModal.svelte +2 -2
- package/modals/SmallModal.svelte.d.ts +2 -1
- package/navbar/DropdownNavbar.svelte +10 -42
- package/navbar/NavDropdown.svelte +41 -0
- package/navbar/NavDropdown.svelte.d.ts +22 -0
- package/navbar/Navbar.svelte +2 -2
- package/navbar/Navbar.svelte.d.ts +1 -1
- package/package.json +21 -1
- package/paginations/Next.svelte +28 -0
- package/paginations/Next.svelte.d.ts +19 -0
- package/paginations/Pagination.svelte +67 -0
- package/paginations/Pagination.svelte.d.ts +27 -0
- package/paginations/Previous.svelte +28 -0
- package/paginations/Previous.svelte.d.ts +19 -0
- package/paginations/TableData.svelte +28 -0
- package/paginations/TableData.svelte.d.ts +25 -0
- package/sidebars/Sidebar.svelte +54 -0
- package/sidebars/Sidebar.svelte.d.ts +19 -0
- package/sidebars/SidebarDropdown.svelte +50 -0
- package/sidebars/SidebarDropdown.svelte.d.ts +17 -0
- package/tabs/InteractiveTabHead.svelte +53 -0
- package/tabs/InteractiveTabHead.svelte.d.ts +37 -0
- package/tabs/InteractiveTabs.svelte +7 -3
- package/tabs/TabContent.svelte +32 -0
- package/tabs/TabContent.svelte.d.ts +36 -0
- package/tabs/tabStore.d.ts +2 -0
- package/tabs/tabStore.js +2 -0
- package/timelines/Activity.svelte +6 -0
- package/timelines/Activity.svelte.d.ts +18 -0
- package/timelines/ActivityItem.svelte +29 -0
- package/timelines/ActivityItem.svelte.d.ts +17 -0
- package/timelines/Group.svelte +11 -0
- package/timelines/Group.svelte.d.ts +20 -0
- package/timelines/GroupItem.svelte +49 -0
- package/timelines/GroupItem.svelte.d.ts +17 -0
- package/timelines/Timeline.svelte +6 -0
- package/timelines/Timeline.svelte.d.ts +18 -0
- package/timelines/TimelineHorizontal.svelte +6 -0
- package/timelines/TimelineHorizontal.svelte.d.ts +18 -0
- package/timelines/TimelineItem.svelte +37 -0
- package/timelines/TimelineItem.svelte.d.ts +17 -0
- package/timelines/TimelineItemHorizontal.svelte +38 -0
- package/timelines/TimelineItemHorizontal.svelte.d.ts +17 -0
- package/timelines/TimelineItemVertical.svelte +54 -0
- package/timelines/TimelineItemVertical.svelte.d.ts +17 -0
- package/toasts/Toast.svelte +0 -1
- package/types.d.ts +59 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let icon = false;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const previous = () => {
|
|
5
|
+
dispatch('previous');
|
|
6
|
+
};
|
|
7
|
+
const next = () => {
|
|
8
|
+
dispatch('next');
|
|
9
|
+
};
|
|
10
|
+
export let pages;
|
|
11
|
+
export let ulClass = 'inline-flex -space-x-px items-center';
|
|
12
|
+
export let pageClass = 'py-2 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
13
|
+
export let previousClass = 'py-2 px-3 ml-0 leading-tight text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
14
|
+
export let nextClass = 'py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
15
|
+
export let iconPreviousClass = 'block py-2 px-3 ml-0 leading-tight text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
16
|
+
export let iconNextClass = 'block py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<nav aria-label="Page navigation">
|
|
20
|
+
<ul class={ulClass}>
|
|
21
|
+
<li>
|
|
22
|
+
{#if icon}
|
|
23
|
+
<a href="/" on:click|preventDefault={previous} class={iconPreviousClass}>
|
|
24
|
+
<span class="sr-only">Previous</span>
|
|
25
|
+
<svg
|
|
26
|
+
class="w-5 h-5"
|
|
27
|
+
fill="currentColor"
|
|
28
|
+
viewBox="0 0 20 20"
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
><path
|
|
31
|
+
fill-rule="evenodd"
|
|
32
|
+
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
|
|
33
|
+
clip-rule="evenodd"
|
|
34
|
+
/></svg
|
|
35
|
+
>
|
|
36
|
+
</a>
|
|
37
|
+
{:else}
|
|
38
|
+
<a href="/" on:click|preventDefault={previous} class={previousClass}>Previous</a>
|
|
39
|
+
{/if}
|
|
40
|
+
</li>
|
|
41
|
+
{#each pages as { pageNum, href }}
|
|
42
|
+
<li>
|
|
43
|
+
<a {href} class={pageClass}>{pageNum}</a>
|
|
44
|
+
</li>
|
|
45
|
+
{/each}
|
|
46
|
+
<li>
|
|
47
|
+
{#if icon}
|
|
48
|
+
<a href="/" on:click|preventDefault={next} class={iconNextClass}>
|
|
49
|
+
<span class="sr-only">Next</span>
|
|
50
|
+
<svg
|
|
51
|
+
class="w-5 h-5"
|
|
52
|
+
fill="currentColor"
|
|
53
|
+
viewBox="0 0 20 20"
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
><path
|
|
56
|
+
fill-rule="evenodd"
|
|
57
|
+
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
|
58
|
+
clip-rule="evenodd"
|
|
59
|
+
/></svg
|
|
60
|
+
>
|
|
61
|
+
</a>
|
|
62
|
+
{:else}
|
|
63
|
+
<a href="/" on:click|preventDefault={next} class={nextClass}>Next</a>
|
|
64
|
+
{/if}
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</nav>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { PageType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
icon?: boolean;
|
|
6
|
+
pages: PageType[];
|
|
7
|
+
ulClass?: string;
|
|
8
|
+
pageClass?: string;
|
|
9
|
+
previousClass?: string;
|
|
10
|
+
nextClass?: string;
|
|
11
|
+
iconPreviousClass?: string;
|
|
12
|
+
iconNextClass?: string;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
previous: CustomEvent<any>;
|
|
16
|
+
next: CustomEvent<any>;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export declare type PaginationProps = typeof __propDef.props;
|
|
23
|
+
export declare type PaginationEvents = typeof __propDef.events;
|
|
24
|
+
export declare type PaginationSlots = typeof __propDef.slots;
|
|
25
|
+
export default class Pagination extends SvelteComponentTyped<PaginationProps, PaginationEvents, PaginationSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let icon = false;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const previous = () => {
|
|
5
|
+
dispatch('previous');
|
|
6
|
+
};
|
|
7
|
+
export let previousClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
8
|
+
if (icon) {
|
|
9
|
+
previousClass += ' mr-3';
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<a href="/" on:click|preventDefault={previous} class={previousClass}>
|
|
14
|
+
{#if icon}
|
|
15
|
+
<svg
|
|
16
|
+
class="mr-2 w-5 h-5"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
viewBox="0 0 20 20"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
><path
|
|
21
|
+
fill-rule="evenodd"
|
|
22
|
+
d="M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z"
|
|
23
|
+
clip-rule="evenodd"
|
|
24
|
+
/></svg
|
|
25
|
+
>
|
|
26
|
+
{/if}
|
|
27
|
+
Previous
|
|
28
|
+
</a>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
icon?: boolean;
|
|
5
|
+
previousClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
previous: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type PreviousProps = typeof __propDef.props;
|
|
15
|
+
export declare type PreviousEvents = typeof __propDef.events;
|
|
16
|
+
export declare type PreviousSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Previous extends SvelteComponentTyped<PreviousProps, PreviousEvents, PreviousSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
const previous = () => {
|
|
4
|
+
dispatch('previous');
|
|
5
|
+
};
|
|
6
|
+
const next = () => {
|
|
7
|
+
dispatch('next');
|
|
8
|
+
};
|
|
9
|
+
export let helper;
|
|
10
|
+
export let btnPreClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-l hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
11
|
+
export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-r border-0 border-l border-gray-700 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="flex flex-col items-center">
|
|
15
|
+
{#if helper}
|
|
16
|
+
<!-- Help text -->
|
|
17
|
+
<span class="text-sm text-gray-700 dark:text-gray-400">
|
|
18
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span> to
|
|
19
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
20
|
+
of <span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span> Entries
|
|
21
|
+
</span>
|
|
22
|
+
{/if}
|
|
23
|
+
<!-- Buttons -->
|
|
24
|
+
<div class="inline-flex mt-2 xs:mt-0">
|
|
25
|
+
<button on:click={previous} class={btnPreClass}> Prev </button>
|
|
26
|
+
<button on:click={next} class={btnNextClass}> Next </button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
helper: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
total: number;
|
|
8
|
+
};
|
|
9
|
+
btnPreClass?: string;
|
|
10
|
+
btnNextClass?: string;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
previous: CustomEvent<any>;
|
|
14
|
+
next: CustomEvent<any>;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export declare type TableDataProps = typeof __propDef.props;
|
|
21
|
+
export declare type TableDataEvents = typeof __propDef.events;
|
|
22
|
+
export declare type TableDataSlots = typeof __propDef.slots;
|
|
23
|
+
export default class TableData extends SvelteComponentTyped<TableDataProps, TableDataEvents, TableDataSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script >import SidebarDropdown from './SidebarDropdown.svelte';
|
|
2
|
+
export let site;
|
|
3
|
+
export let links;
|
|
4
|
+
export let cta;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<aside class="w-64" aria-label="Sidebar">
|
|
8
|
+
<div class="overflow-y-auto py-4 px-3 bg-gray-50 rounded dark:bg-gray-800">
|
|
9
|
+
{#if site}
|
|
10
|
+
<a href={site.href} class="flex items-center pl-2.5 mb-5">
|
|
11
|
+
<img src={site.img} class="h-6 mr-3 sm:h-7" alt={site.name} />
|
|
12
|
+
<span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white"
|
|
13
|
+
>{site.name}</span
|
|
14
|
+
>
|
|
15
|
+
</a>
|
|
16
|
+
{/if}
|
|
17
|
+
<ul class="space-y-2">
|
|
18
|
+
{#each links as link (link.id)}
|
|
19
|
+
{#if link.children}
|
|
20
|
+
<SidebarDropdown {link} />
|
|
21
|
+
{:else}
|
|
22
|
+
<li>
|
|
23
|
+
<a
|
|
24
|
+
href={link.href}
|
|
25
|
+
rel={link.rel}
|
|
26
|
+
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
27
|
+
>
|
|
28
|
+
{#if link.icon}
|
|
29
|
+
<svelte:component this={link.icon} className="h-4 w-4 mr-2" />
|
|
30
|
+
{/if}
|
|
31
|
+
<span class="ml-3">{link.name}</span>
|
|
32
|
+
{#if link.subtext}
|
|
33
|
+
{@html link.subtext}
|
|
34
|
+
{/if}
|
|
35
|
+
</a>
|
|
36
|
+
</li>
|
|
37
|
+
{/if}
|
|
38
|
+
{/each}
|
|
39
|
+
</ul>
|
|
40
|
+
{#if cta}
|
|
41
|
+
<div id="dropdown-cta" class="p-4 mt-6 bg-blue-50 rounded-lg dark:bg-blue-900" role="alert">
|
|
42
|
+
<div class="flex items-center mb-3">
|
|
43
|
+
<span
|
|
44
|
+
class="bg-orange-100 text-orange-800 text-sm font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-orange-200 dark:text-orange-900"
|
|
45
|
+
>{cta.label}</span
|
|
46
|
+
>
|
|
47
|
+
</div>
|
|
48
|
+
<p class="mb-3 text-sm text-blue-900 dark:text-blue-400">
|
|
49
|
+
{cta.text}
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
</aside>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SiteType, SidebarType, SidebarCtaType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
site: SiteType;
|
|
6
|
+
links: SidebarType[];
|
|
7
|
+
cta: SidebarCtaType;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type SidebarProps = typeof __propDef.props;
|
|
15
|
+
export declare type SidebarEvents = typeof __propDef.events;
|
|
16
|
+
export declare type SidebarSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Sidebar extends SvelteComponentTyped<SidebarProps, SidebarEvents, SidebarSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script >import { slide } from 'svelte/transition';
|
|
2
|
+
export let link;
|
|
3
|
+
let isOpen = false;
|
|
4
|
+
let activeDropdown = undefined;
|
|
5
|
+
const handleDropdown = (id) => {
|
|
6
|
+
isOpen = !isOpen;
|
|
7
|
+
activeDropdown = id;
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<li>
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
on:click={() => handleDropdown(link.id)}
|
|
15
|
+
class="flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
16
|
+
aria-controls="dropdown"
|
|
17
|
+
data-collapse-toggle="dropdown"
|
|
18
|
+
>
|
|
19
|
+
{#if link.icon}
|
|
20
|
+
<svelte:component this={link.icon} className="h-4 w-4 mr-2" />
|
|
21
|
+
{/if}
|
|
22
|
+
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item="">{link.name}</span>
|
|
23
|
+
<svg
|
|
24
|
+
sidebar-toggle-item=""
|
|
25
|
+
class="w-6 h-6"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
viewBox="0 0 20 20"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
><path
|
|
30
|
+
fill-rule="evenodd"
|
|
31
|
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
32
|
+
clip-rule="evenodd"
|
|
33
|
+
/></svg
|
|
34
|
+
>
|
|
35
|
+
</button>
|
|
36
|
+
{#if isOpen && link.id == activeDropdown}
|
|
37
|
+
<ul id="dropdown" class="py-2 space-y-2" transition:slide={{ duration: 500 }}>
|
|
38
|
+
{#each link.children as child}
|
|
39
|
+
<li>
|
|
40
|
+
<a
|
|
41
|
+
href={child.href}
|
|
42
|
+
rel={child.rel}
|
|
43
|
+
class="flex items-center p-2 pl-11 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
44
|
+
>{child.name}</a
|
|
45
|
+
>
|
|
46
|
+
</li>
|
|
47
|
+
{/each}
|
|
48
|
+
</ul>
|
|
49
|
+
{/if}
|
|
50
|
+
</li>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SidebarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
link: SidebarType;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type SidebarDropdownProps = typeof __propDef.props;
|
|
13
|
+
export declare type SidebarDropdownEvents = typeof __propDef.events;
|
|
14
|
+
export declare type SidebarDropdownSlots = typeof __propDef.slots;
|
|
15
|
+
export default class SidebarDropdown extends SvelteComponentTyped<SidebarDropdownProps, SidebarDropdownEvents, SidebarDropdownSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script >import { tabStore } from './tabStore';
|
|
2
|
+
export let tabs;
|
|
3
|
+
export let tabId = 'myTab';
|
|
4
|
+
export let activeTabValue = 1;
|
|
5
|
+
const handleClick = (tabValue) => () => {
|
|
6
|
+
tabStore.update((n) => (n = tabValue));
|
|
7
|
+
activeTabValue = tabValue;
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
@component
|
|
13
|
+
Header part of Interactive tab component. Use with TabContent.
|
|
14
|
+
|
|
15
|
+
@param tabs: TabHeadType[];
|
|
16
|
+
@param tabId = 'myTab';
|
|
17
|
+
|
|
18
|
+
- Usage:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<InteractiveHead>
|
|
22
|
+
<TabContent>
|
|
23
|
+
Some HTML|Component|string
|
|
24
|
+
</TabContent>
|
|
25
|
+
</InteractiveHead>
|
|
26
|
+
```
|
|
27
|
+
-->
|
|
28
|
+
<div class="mb-4 border-b border-gray-200">
|
|
29
|
+
<ul
|
|
30
|
+
class="flex flex-wrap -mb-px text-sm font-medium text-center"
|
|
31
|
+
id={tabId}
|
|
32
|
+
data-tabs-toggle="#myTabContent"
|
|
33
|
+
role="tablist"
|
|
34
|
+
>
|
|
35
|
+
{#each tabs as { name, id }}
|
|
36
|
+
<li class="mr-2" role="presentation">
|
|
37
|
+
<button
|
|
38
|
+
on:click={handleClick(id)}
|
|
39
|
+
class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
|
|
40
|
+
id="{name}-tab"
|
|
41
|
+
data-tabs-target="#{name}"
|
|
42
|
+
type="button"
|
|
43
|
+
role="tab"
|
|
44
|
+
class:active={activeTabValue === id}
|
|
45
|
+
aria-controls={name}
|
|
46
|
+
aria-selected="false">{name}</button
|
|
47
|
+
>
|
|
48
|
+
</li>
|
|
49
|
+
{/each}
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<slot />
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabHeadType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: TabHeadType[];
|
|
6
|
+
tabId?: string;
|
|
7
|
+
activeTabValue?: number;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type InteractiveTabHeadProps = typeof __propDef.props;
|
|
17
|
+
export declare type InteractiveTabHeadEvents = typeof __propDef.events;
|
|
18
|
+
export declare type InteractiveTabHeadSlots = typeof __propDef.slots;
|
|
19
|
+
/**
|
|
20
|
+
* Header part of Interactive tab component. Use with TabContent.
|
|
21
|
+
*
|
|
22
|
+
* @param tabs: TabHeadType[];
|
|
23
|
+
* @param tabId = 'myTab';
|
|
24
|
+
*
|
|
25
|
+
* - Usage:
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <InteractiveHead>
|
|
29
|
+
* <TabContent>
|
|
30
|
+
* Some HTML|Component|string
|
|
31
|
+
* </TabContent>
|
|
32
|
+
* </InteractiveHead>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export default class InteractiveTabHead extends SvelteComponentTyped<InteractiveTabHeadProps, InteractiveTabHeadEvents, InteractiveTabHeadSlots> {
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -30,9 +30,13 @@ export let tabs;
|
|
|
30
30
|
role="tabpanel"
|
|
31
31
|
aria-labelledby="{name}-tab"
|
|
32
32
|
>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
{#if typeof content === 'string'}
|
|
34
|
+
<p class="text-sm text-gray-500 dark:text-gray-400">
|
|
35
|
+
{@html content}
|
|
36
|
+
</p>
|
|
37
|
+
{:else}
|
|
38
|
+
<svelte:component this={content} />
|
|
39
|
+
{/if}
|
|
36
40
|
</div>
|
|
37
41
|
{/if}
|
|
38
42
|
{/each}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script >import { tabStore } from './tabStore';
|
|
2
|
+
export let divClass = 'p-4 rounded-lg dark:bg-gray-800';
|
|
3
|
+
export let tab;
|
|
4
|
+
let activeTabValue;
|
|
5
|
+
tabStore.subscribe((value) => {
|
|
6
|
+
activeTabValue = value;
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
@component
|
|
12
|
+
Content part of Interactive tab component. Use with InteractiveHead.
|
|
13
|
+
|
|
14
|
+
- let tabId = 'myTab';
|
|
15
|
+
- let tabs: TabHeadType;
|
|
16
|
+
- let divClass: string;
|
|
17
|
+
- Usage:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<InteractiveHead>
|
|
21
|
+
<TabContent>
|
|
22
|
+
Some HTML|Component|string
|
|
23
|
+
</TabContent>
|
|
24
|
+
</InteractiveHead>
|
|
25
|
+
```
|
|
26
|
+
-->
|
|
27
|
+
|
|
28
|
+
{#if activeTabValue === tab.id}
|
|
29
|
+
<div class={divClass} id="{tab.id}Content" role="tabpanel" aria-labelledby="{tab.name}-tab">
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
{/if}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabHeadType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
divClass?: string;
|
|
6
|
+
tab: TabHeadType;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type TabContentProps = typeof __propDef.props;
|
|
16
|
+
export declare type TabContentEvents = typeof __propDef.events;
|
|
17
|
+
export declare type TabContentSlots = typeof __propDef.slots;
|
|
18
|
+
/**
|
|
19
|
+
* Content part of Interactive tab component. Use with InteractiveHead.
|
|
20
|
+
*
|
|
21
|
+
* - let tabId = 'myTab';
|
|
22
|
+
* - let tabs: TabHeadType;
|
|
23
|
+
* - let divClass: string;
|
|
24
|
+
* - Usage:
|
|
25
|
+
*
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <InteractiveHead>
|
|
28
|
+
* <TabContent>
|
|
29
|
+
* Some HTML|Component|string
|
|
30
|
+
* </TabContent>
|
|
31
|
+
* </InteractiveHead>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export default class TabContent extends SvelteComponentTyped<TabContentProps, TabContentEvents, TabContentSlots> {
|
|
35
|
+
}
|
|
36
|
+
export {};
|
package/tabs/tabStore.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
olClass?: string;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare type ActivityProps = typeof __propDef.props;
|
|
14
|
+
export declare type ActivityEvents = typeof __propDef.events;
|
|
15
|
+
export declare type ActivitySlots = typeof __propDef.slots;
|
|
16
|
+
export default class Activity extends SvelteComponentTyped<ActivityProps, ActivityEvents, ActivitySlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script >export let activities;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
{#each activities as { title, date, src, alt, text }}
|
|
5
|
+
<li class="mb-10 ml-6">
|
|
6
|
+
<span
|
|
7
|
+
class="flex absolute -left-3 justify-center items-center w-6 h-6 bg-blue-200 rounded-full ring-8 ring-white dark:ring-gray-900 dark:bg-blue-900"
|
|
8
|
+
>
|
|
9
|
+
<img class="rounded-full shadow-lg" {src} {alt} />
|
|
10
|
+
</span>
|
|
11
|
+
<div
|
|
12
|
+
class="p-4 bg-white rounded-lg border border-gray-200 shadow-sm dark:bg-gray-700 dark:border-gray-600"
|
|
13
|
+
>
|
|
14
|
+
<div class="justify-between items-center mb-3 sm:flex">
|
|
15
|
+
<time class="mb-1 text-xs font-normal text-gray-400 sm:order-last sm:mb-0">{date}</time>
|
|
16
|
+
<div class="text-sm font-normal text-gray-500 lex dark:text-gray-300">
|
|
17
|
+
{@html title}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
{#if text}
|
|
21
|
+
<div
|
|
22
|
+
class="p-3 text-xs italic font-normal text-gray-500 bg-gray-50 rounded-lg border border-gray-200 dark:bg-gray-600 dark:border-gray-500 dark:text-gray-300"
|
|
23
|
+
>
|
|
24
|
+
{@html text}
|
|
25
|
+
</div>
|
|
26
|
+
{/if}
|
|
27
|
+
</div>
|
|
28
|
+
</li>
|
|
29
|
+
{/each}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ActivityType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
activities: ActivityType[];
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type ActivityItemProps = typeof __propDef.props;
|
|
13
|
+
export declare type ActivityItemEvents = typeof __propDef.events;
|
|
14
|
+
export declare type ActivityItemSlots = typeof __propDef.slots;
|
|
15
|
+
export default class ActivityItem extends SvelteComponentTyped<ActivityItemProps, ActivityItemEvents, ActivityItemSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script >export let divClass = 'p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700';
|
|
2
|
+
export let timeClass = 'text-lg font-semibold text-gray-900 dark:text-white';
|
|
3
|
+
export let date;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class={divClass}>
|
|
7
|
+
<time class={timeClass}>{date}</time>
|
|
8
|
+
<ol class="mt-3 divide-y divider-gray-200 dark:divide-gray-700">
|
|
9
|
+
<slot />
|
|
10
|
+
</ol>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
divClass?: string;
|
|
5
|
+
timeClass?: string;
|
|
6
|
+
date: Date | string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type GroupProps = typeof __propDef.props;
|
|
16
|
+
export declare type GroupEvents = typeof __propDef.events;
|
|
17
|
+
export declare type GroupSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Group extends SvelteComponentTyped<GroupProps, GroupEvents, GroupSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|