flowbite-svelte 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  [Accordions](https://flowbite-svelte.vercel.app/accordions)
12
12
 
13
+ ## Avatar components
14
+
15
+ [Avatar](https://flowbite-svelte.vercel.app/avatar)
16
+
13
17
  ## Alert components
14
18
 
15
19
  [Alerts](https://flowbite-svelte.vercel.app/alerts)
@@ -62,6 +66,10 @@
62
66
 
63
67
  [Navbars](https://flowbite-svelte.vercel.app/navbar)
64
68
 
69
+ ## Sidebar components
70
+
71
+ [Sidebar](https://flowbite-svelte.vercel.app/sidebars)
72
+
65
73
  ## Spinner components
66
74
 
67
75
  [Spinners](https://flowbite-svelte.vercel.app/spinners)
@@ -70,6 +78,10 @@
70
78
 
71
79
  [Tabs](https://flowbite-svelte.vercel.app/tabs)
72
80
 
81
+ ## Toast components
82
+
83
+ [Toast](https://flowbite-svelte.vercel.app/toasts)
84
+
73
85
  ## Tooltip components
74
86
 
75
87
  [Tooltips](https://flowbite-svelte.vercel.app/tooltips)
package/index.d.ts CHANGED
@@ -52,16 +52,25 @@ export { default as SignInModal } from "./modals/SignInModal.svelte";
52
52
  export { default as SmallModal } from "./modals/SmallModal.svelte";
53
53
  export { default as Navbar } from "./navbar/Navbar.svelte";
54
54
  export { default as DropdownNavbar } from "./navbar/DropdownNavbar.svelte";
55
+ export { default as Pagination } from "./paginations/Pagination.svelte";
56
+ export { default as Previous } from "./paginations/Previous.svelte";
57
+ export { default as Next } from "./paginations/Next.svelte";
58
+ export { default as TableData } from "./paginations/TableData.svelte";
55
59
  export { default as Sidebar } from "./sidebars/Sidebar.svelte";
56
60
  export { default as Spinner } from "./spinners/Spinner.svelte";
57
61
  export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
58
62
  export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
59
63
  export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
60
64
  export { default as PillTabs } from "./tabs/PillTabs.svelte";
65
+ export { default as Group } from "./timelines/Group.svelte";
66
+ export { default as GroupItem } from "./timelines/GroupItem.svelte";
67
+ export { default as Activity } from "./timelines/Activity.svelte";
68
+ export { default as ActivityItem } from "./timelines/ActivityItem.svelte";
61
69
  export { default as Timeline } from "./timelines/Timeline.svelte";
62
70
  export { default as TimelineItem } from "./timelines/TimelineItem.svelte";
63
- export { default as TimelineItemVertical } from "./timelines/TimelineItemVertical.svelte";
71
+ export { default as TimelineHorizontal } from "./timelines/TimelineHorizontal.svelte";
64
72
  export { default as TimelineItemHorizontal } from "./timelines/TimelineItemHorizontal.svelte";
73
+ export { default as TimelineItemVertical } from "./timelines/TimelineItemVertical.svelte";
65
74
  export { default as Toast } from "./toasts/Toast.svelte";
66
75
  export { default as Tooltip } from "./tooltips/Tooltip.svelte";
67
76
  export { default as LightTooltip } from "./tooltips/LightTooltip.svelte";
package/index.js CHANGED
@@ -82,6 +82,12 @@ export { default as SmallModal } from'./modals/SmallModal.svelte'
82
82
  export { default as Navbar } from'./navbar/Navbar.svelte'
83
83
  export { default as DropdownNavbar } from'./navbar/DropdownNavbar.svelte'
84
84
 
85
+ // Pagination
86
+ export { default as Pagination } from './paginations/Pagination.svelte'
87
+ export { default as Previous } from './paginations/Previous.svelte'
88
+ export { default as Next } from './paginations/Next.svelte'
89
+ export { default as TableData } from './paginations/TableData.svelte'
90
+
85
91
  // Sidebar
86
92
  export { default as Sidebar } from './sidebars/Sidebar.svelte'
87
93
 
@@ -95,10 +101,17 @@ export { default as DefaultTabs } from'./tabs/DefaultTabs.svelte'
95
101
  export { default as PillTabs } from './tabs/PillTabs.svelte'
96
102
 
97
103
  // Timeline
104
+ export { default as Group } from './timelines/Group.svelte'
105
+ export { default as GroupItem } from './timelines/GroupItem.svelte'
106
+ export { default as Activity } from './timelines/Activity.svelte'
107
+ export { default as ActivityItem } from './timelines/ActivityItem.svelte'
98
108
  export { default as Timeline } from './timelines/Timeline.svelte'
99
109
  export { default as TimelineItem } from './timelines/TimelineItem.svelte'
100
- export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
110
+ export { default as TimelineHorizontal } from './timelines/TimelineHorizontal.svelte'
101
111
  export { default as TimelineItemHorizontal } from './timelines/TimelineItemHorizontal.svelte'
112
+ export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
113
+
114
+
102
115
 
103
116
  // Toast
104
117
  export { default as Toast } from './toasts/Toast.svelte'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "./package/index.js",
6
6
  "author": {
@@ -126,6 +126,10 @@
126
126
  "./modals/modalStores": "./modals/modalStores.js",
127
127
  "./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
128
128
  "./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
129
+ "./paginations/Next.svelte": "./paginations/Next.svelte",
130
+ "./paginations/Pagination.svelte": "./paginations/Pagination.svelte",
131
+ "./paginations/Previous.svelte": "./paginations/Previous.svelte",
132
+ "./paginations/TableData.svelte": "./paginations/TableData.svelte",
129
133
  "./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
130
134
  "./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
131
135
  "./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
@@ -133,6 +137,10 @@
133
137
  "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
134
138
  "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
135
139
  "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
140
+ "./timelines/Activity.svelte": "./timelines/Activity.svelte",
141
+ "./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
142
+ "./timelines/Group.svelte": "./timelines/Group.svelte",
143
+ "./timelines/GroupItem.svelte": "./timelines/GroupItem.svelte",
136
144
  "./timelines/Timeline.svelte": "./timelines/Timeline.svelte",
137
145
  "./timelines/TimelineHorizontal.svelte": "./timelines/TimelineHorizontal.svelte",
138
146
  "./timelines/TimelineItem.svelte": "./timelines/TimelineItem.svelte",
@@ -0,0 +1,28 @@
1
+ <script >import { createEventDispatcher } from 'svelte';
2
+ export let icon = false;
3
+ const dispatch = createEventDispatcher();
4
+ const next = () => {
5
+ dispatch('next');
6
+ };
7
+ export let nextClass = '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
+ nextClass += ' ml-3';
10
+ }
11
+ </script>
12
+
13
+ <a href="/" on:click|preventDefault={next} class={nextClass}>
14
+ Next
15
+ {#if icon}
16
+ <svg
17
+ class="ml-2 w-5 h-5"
18
+ fill="currentColor"
19
+ viewBox="0 0 20 20"
20
+ xmlns="http://www.w3.org/2000/svg"
21
+ ><path
22
+ fill-rule="evenodd"
23
+ d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
24
+ clip-rule="evenodd"
25
+ /></svg
26
+ >
27
+ {/if}
28
+ </a>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ icon?: boolean;
5
+ nextClass?: string;
6
+ };
7
+ events: {
8
+ next: CustomEvent<any>;
9
+ } & {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type NextProps = typeof __propDef.props;
15
+ export declare type NextEvents = typeof __propDef.events;
16
+ export declare type NextSlots = typeof __propDef.slots;
17
+ export default class Next extends SvelteComponentTyped<NextProps, NextEvents, NextSlots> {
18
+ }
19
+ export {};
@@ -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,6 @@
1
+ <script >export let olClass = 'relative border-l border-gray-200 dark:border-gray-700';
2
+ </script>
3
+
4
+ <ol class={olClass}>
5
+ <slot />
6
+ </ol>
@@ -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 {};
@@ -0,0 +1,49 @@
1
+ <script >export let timelines;
2
+ </script>
3
+
4
+ {#each timelines as { title, src, alt, isPrivate, href, comment }}
5
+ <li>
6
+ <a {href} class="block items-center p-3 sm:flex hover:bg-gray-100 dark:hover:bg-gray-700">
7
+ <img class="mr-3 mb-3 w-12 h-12 rounded-full sm:mb-0" {src} {alt} />
8
+ <div class="text-gray-600 dark:text-gray-400">
9
+ <div class="text-base font-normal">
10
+ {@html title}
11
+ </div>
12
+ {#if comment}
13
+ <div class="text-sm font-normal">{comment}</div>
14
+ {/if}
15
+ <span class="inline-flex items-center text-xs font-normal text-gray-500 dark:text-gray-400">
16
+ {#if isPrivate}
17
+ <svg
18
+ class="mr-1 w-3 h-3"
19
+ fill="currentColor"
20
+ viewBox="0 0 20 20"
21
+ xmlns="http://www.w3.org/2000/svg"
22
+ ><path
23
+ fill-rule="evenodd"
24
+ d="M3.707 2.293a1 1 0 00-1.414 1.414l14 14a1 1 0 001.414-1.414l-1.473-1.473A10.014 10.014 0 0019.542 10C18.268 5.943 14.478 3 10 3a9.958 9.958 0 00-4.512 1.074l-1.78-1.781zm4.261 4.26l1.514 1.515a2.003 2.003 0 012.45 2.45l1.514 1.514a4 4 0 00-5.478-5.478z"
25
+ clip-rule="evenodd"
26
+ /><path
27
+ d="M12.454 16.697L9.75 13.992a4 4 0 01-3.742-3.741L2.335 6.578A9.98 9.98 0 00.458 10c1.274 4.057 5.065 7 9.542 7 .847 0 1.669-.105 2.454-.303z"
28
+ /></svg
29
+ >
30
+ Private
31
+ {:else}
32
+ <svg
33
+ class="mr-1 w-3 h-3"
34
+ fill="currentColor"
35
+ viewBox="0 0 20 20"
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ ><path
38
+ fill-rule="evenodd"
39
+ d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z"
40
+ clip-rule="evenodd"
41
+ /></svg
42
+ >
43
+ Public
44
+ {/if}
45
+ </span>
46
+ </div>
47
+ </a>
48
+ </li>
49
+ {/each}
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { GroupTimelineType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ timelines: GroupTimelineType[];
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type GroupItemProps = typeof __propDef.props;
13
+ export declare type GroupItemEvents = typeof __propDef.events;
14
+ export declare type GroupItemSlots = typeof __propDef.slots;
15
+ export default class GroupItem extends SvelteComponentTyped<GroupItemProps, GroupItemEvents, GroupItemSlots> {
16
+ }
17
+ export {};
@@ -1,13 +1,27 @@
1
1
  <script >export let timelineItems;
2
2
  </script>
3
3
 
4
- {#each timelineItems as { date, title, text, href, linkname, icon }}
4
+ {#each timelineItems as { date, title, text, icon }}
5
5
  <li class="relative mb-6 sm:mb-0">
6
6
  <div class="flex items-center">
7
7
  <div
8
8
  class="flex z-10 justify-center items-center w-6 h-6 bg-blue-200 rounded-full ring-0 ring-white dark:bg-blue-900 sm:ring-8 dark:ring-gray-900 shrink-0"
9
9
  >
10
- {icon}
10
+ {#if icon}
11
+ <svelte:component this={icon} className="h-4 w-4" />
12
+ {:else}
13
+ <svg
14
+ class="w-3 h-3 text-blue-600 dark:text-blue-300"
15
+ fill="currentColor"
16
+ viewBox="0 0 20 20"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ ><path
19
+ fill-rule="evenodd"
20
+ d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
21
+ clip-rule="evenodd"
22
+ /></svg
23
+ >
24
+ {/if}
11
25
  </div>
12
26
  <div class="hidden sm:flex w-full bg-gray-200 h-0.5 dark:bg-gray-700" />
13
27
  </div>
@@ -19,24 +33,6 @@
19
33
  <p class="text-base font-normal text-gray-500 dark:text-gray-400">
20
34
  {text}
21
35
  </p>
22
- {#if href}
23
- <a
24
- {href}
25
- class="inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"
26
- >{linkname}
27
- <svg
28
- class="ml-2 w-3 h-3"
29
- fill="currentColor"
30
- viewBox="0 0 20 20"
31
- xmlns="http://www.w3.org/2000/svg"
32
- ><path
33
- fill-rule="evenodd"
34
- d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
35
- clip-rule="evenodd"
36
- /></svg
37
- ></a
38
- >
39
- {/if}
40
36
  </div>
41
37
  </li>
42
38
  {/each}
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { TimelineItemType } from '../types';
2
+ import type { TimelineItemHorizontalType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- timelineItems: TimelineItemType[];
5
+ timelineItems: TimelineItemHorizontalType[];
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
@@ -6,7 +6,21 @@
6
6
  <span
7
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
8
  >
9
- <svelte:component this={icon} className="h-4 w-4" />
9
+ {#if icon}
10
+ <svelte:component this={icon} className="h-4 w-4" />
11
+ {:else}
12
+ <svg
13
+ class="w-3 h-3 text-blue-600 dark:text-blue-300"
14
+ fill="currentColor"
15
+ viewBox="0 0 20 20"
16
+ xmlns="http://www.w3.org/2000/svg"
17
+ ><path
18
+ fill-rule="evenodd"
19
+ d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
20
+ clip-rule="evenodd"
21
+ /></svg
22
+ >
23
+ {/if}
10
24
  </span>
11
25
 
12
26
  <h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white">
package/types.d.ts CHANGED
@@ -121,8 +121,33 @@ export interface TimelineItemType {
121
121
  export interface TimelineItemVerticalType {
122
122
  date: Date | string;
123
123
  title: string;
124
- icon: typeof SvelteComponent;
124
+ icon?: typeof SvelteComponent;
125
125
  href?: string;
126
126
  linkname?: string;
127
127
  text?: HTMLElement | string;
128
128
  }
129
+ export interface TimelineItemHorizontalType {
130
+ date: Date | string;
131
+ title: string;
132
+ icon?: typeof SvelteComponent;
133
+ text?: HTMLElement | string;
134
+ }
135
+ export interface ActivityType {
136
+ title: HTMLElement | string;
137
+ date: Date | string;
138
+ src: string;
139
+ alt: string;
140
+ text?: HTMLElement | string;
141
+ }
142
+ export interface GroupTimelineType {
143
+ title: string | HTMLElement;
144
+ src: string;
145
+ alt: string;
146
+ href?: string;
147
+ isPrivate?: boolean;
148
+ comment?: string | HTMLElement;
149
+ }
150
+ export interface PageType {
151
+ pageNum: number;
152
+ href: string;
153
+ }