flowbite-svelte 0.11.1 → 0.12.2
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/cards/InteractiveCard.svelte +3 -3
- package/index.d.ts +15 -1
- package/index.js +18 -2
- 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 +2 -2
- package/modals/SignInModal.svelte.d.ts +2 -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 +17 -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 +2 -49
- package/sidebars/SidebarDropdown.svelte +50 -0
- package/sidebars/SidebarDropdown.svelte.d.ts +17 -0
- package/tabs/FullWidthTabs.svelte +31 -0
- package/tabs/FullWidthTabs.svelte.d.ts +18 -0
- package/tabs/IconTabs.svelte +24 -0
- package/tabs/IconTabs.svelte.d.ts +18 -0
- package/tabs/InteractiveTabHead.svelte +53 -0
- package/tabs/InteractiveTabHead.svelte.d.ts +37 -0
- package/tabs/InteractiveTabs.svelte +1 -1
- package/tabs/TabContent.svelte +32 -0
- package/tabs/TabContent.svelte.d.ts +36 -0
- package/tabs/UnderlineTabs.svelte +20 -0
- package/tabs/UnderlineTabs.svelte.d.ts +18 -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/TimelineItemHorizontal.svelte +16 -20
- package/timelines/TimelineItemHorizontal.svelte.d.ts +2 -2
- package/timelines/TimelineItemVertical.svelte +15 -1
- package/types.d.ts +37 -2
|
@@ -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 {};
|
package/sidebars/Sidebar.svelte
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
<script >import
|
|
1
|
+
<script >import SidebarDropdown from './SidebarDropdown.svelte';
|
|
2
2
|
export let site;
|
|
3
3
|
export let links;
|
|
4
4
|
export let cta;
|
|
5
|
-
let isOpen = false;
|
|
6
|
-
let activeDropdown = undefined;
|
|
7
|
-
const handleDropdown = (id) => {
|
|
8
|
-
isOpen = !isOpen;
|
|
9
|
-
activeDropdown = id;
|
|
10
|
-
};
|
|
11
5
|
</script>
|
|
12
6
|
|
|
13
7
|
<aside class="w-64" aria-label="Sidebar">
|
|
@@ -23,48 +17,7 @@ const handleDropdown = (id) => {
|
|
|
23
17
|
<ul class="space-y-2">
|
|
24
18
|
{#each links as link (link.id)}
|
|
25
19
|
{#if link.children}
|
|
26
|
-
<
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
on:click={() => handleDropdown(link.id)}
|
|
30
|
-
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"
|
|
31
|
-
aria-controls="dropdown"
|
|
32
|
-
data-collapse-toggle="dropdown"
|
|
33
|
-
>
|
|
34
|
-
{#if link.icon}
|
|
35
|
-
<svelte:component this={link.icon} className="h-4 w-4 mr-2" />
|
|
36
|
-
{/if}
|
|
37
|
-
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item=""
|
|
38
|
-
>{link.name}</span
|
|
39
|
-
>
|
|
40
|
-
<svg
|
|
41
|
-
sidebar-toggle-item=""
|
|
42
|
-
class="w-6 h-6"
|
|
43
|
-
fill="currentColor"
|
|
44
|
-
viewBox="0 0 20 20"
|
|
45
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
-
><path
|
|
47
|
-
fill-rule="evenodd"
|
|
48
|
-
d="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"
|
|
49
|
-
clip-rule="evenodd"
|
|
50
|
-
/></svg
|
|
51
|
-
>
|
|
52
|
-
</button>
|
|
53
|
-
{#if isOpen && link.id == activeDropdown}
|
|
54
|
-
<ul id="dropdown" class="py-2 space-y-2" transition:slide={{ duration: 500 }}>
|
|
55
|
-
{#each link.children as child}
|
|
56
|
-
<li>
|
|
57
|
-
<a
|
|
58
|
-
href={child.href}
|
|
59
|
-
rel={child.rel}
|
|
60
|
-
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"
|
|
61
|
-
>{child.name}</a
|
|
62
|
-
>
|
|
63
|
-
</li>
|
|
64
|
-
{/each}
|
|
65
|
-
</ul>
|
|
66
|
-
{/if}
|
|
67
|
-
</li>
|
|
20
|
+
<SidebarDropdown {link} />
|
|
68
21
|
{:else}
|
|
69
22
|
<li>
|
|
70
23
|
<a
|
|
@@ -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,31 @@
|
|
|
1
|
+
<script >export let tabs;
|
|
2
|
+
export let tabLabel;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="sm:hidden">
|
|
6
|
+
<label for="tabs" class="sr-only">{tabLabel}</label>
|
|
7
|
+
<select
|
|
8
|
+
id="tabs"
|
|
9
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
10
|
+
>
|
|
11
|
+
{#each tabs as { name }}
|
|
12
|
+
<option>{name}</option>
|
|
13
|
+
{/each}
|
|
14
|
+
</select>
|
|
15
|
+
</div>
|
|
16
|
+
<ul
|
|
17
|
+
class="hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400"
|
|
18
|
+
>
|
|
19
|
+
{#each tabs as { name, href, rel, active }}
|
|
20
|
+
<li class="w-full">
|
|
21
|
+
<a
|
|
22
|
+
{href}
|
|
23
|
+
{rel}
|
|
24
|
+
class={active
|
|
25
|
+
? 'inline-block p-4 w-full text-gray-900 bg-gray-100 rounded-l-lg focus:ring-4 focus:ring-blue-300 active focus:outline-none dark:bg-gray-700 dark:text-white'
|
|
26
|
+
: 'inline-block p-4 w-full bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-blue-300 focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700'}
|
|
27
|
+
aria-current="page">{name}</a
|
|
28
|
+
>
|
|
29
|
+
</li>
|
|
30
|
+
{/each}
|
|
31
|
+
</ul>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: TabType[];
|
|
6
|
+
tabLabel: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type FullWidthTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type FullWidthTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type FullWidthTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class FullWidthTabs extends SvelteComponentTyped<FullWidthTabsProps, FullWidthTabsEvents, FullWidthTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script >export let tabs;
|
|
2
|
+
export let iconClass = 'mr-2 w-5 h-5 text-gray-400 group-hover:text-gray-500 dark:text-gray-500 dark:group-hover:text-gray-300';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="border-b border-gray-200 dark:border-gray-700">
|
|
6
|
+
<ul
|
|
7
|
+
class="flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500 dark:text-gray-400"
|
|
8
|
+
>
|
|
9
|
+
{#each tabs as { name, active, href, rel, icon }}
|
|
10
|
+
<li class="mr-2">
|
|
11
|
+
<a
|
|
12
|
+
{href}
|
|
13
|
+
{rel}
|
|
14
|
+
class={active
|
|
15
|
+
? 'inline-flex p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500 group'
|
|
16
|
+
: ' inline-flex p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 group '}
|
|
17
|
+
>
|
|
18
|
+
<svelte:component this={icon} className={iconClass} />
|
|
19
|
+
{name}
|
|
20
|
+
</a>
|
|
21
|
+
</li>
|
|
22
|
+
{/each}
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IconTabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: IconTabType[];
|
|
6
|
+
iconClass?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type IconTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type IconTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type IconTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class IconTabs extends SvelteComponentTyped<IconTabsProps, IconTabsEvents, IconTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
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 {};
|
|
@@ -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 {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script >export let divClass = 'text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:text-gray-400 dark:border-gray-700';
|
|
2
|
+
export let tabs;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class={divClass}>
|
|
6
|
+
<ul class="flex flex-wrap -mb-px">
|
|
7
|
+
{#each tabs as { name, active, href, rel }}
|
|
8
|
+
<li class="mr-2">
|
|
9
|
+
<a
|
|
10
|
+
{href}
|
|
11
|
+
{rel}
|
|
12
|
+
class={active
|
|
13
|
+
? 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500'
|
|
14
|
+
: ' inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 '}
|
|
15
|
+
>{name}</a
|
|
16
|
+
>
|
|
17
|
+
</li>
|
|
18
|
+
{/each}
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
divClass?: string;
|
|
6
|
+
tabs: TabType[];
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type UnderlineTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type UnderlineTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type UnderlineTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class UnderlineTabs extends SvelteComponentTyped<UnderlineTabsProps, UnderlineTabsEvents, UnderlineTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
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>
|