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
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)
|
|
@@ -30,7 +34,7 @@
|
|
|
30
34
|
|
|
31
35
|
[Cards](https://flowbite-svelte.vercel.app/cards)
|
|
32
36
|
|
|
33
|
-
## Dark mode
|
|
37
|
+
## Dark mode components
|
|
34
38
|
|
|
35
39
|
[Dark mode](https://flowbite-svelte.vercel.app/darkmode)
|
|
36
40
|
|
|
@@ -42,15 +46,15 @@
|
|
|
42
46
|
|
|
43
47
|
[Forms](https://flowbite-svelte.vercel.app/forms)
|
|
44
48
|
|
|
45
|
-
## Footer
|
|
49
|
+
## Footer components
|
|
46
50
|
|
|
47
51
|
[Footer](https://flowbite-svelte.vercel.app/footer)
|
|
48
52
|
|
|
49
|
-
## Icons
|
|
53
|
+
## Icons components
|
|
50
54
|
|
|
51
55
|
[Icons](https://flowbite-svelte.vercel.app/icons)
|
|
52
56
|
|
|
53
|
-
## List group
|
|
57
|
+
## List group components
|
|
54
58
|
|
|
55
59
|
[List group](https://flowbite-svelte.vercel.app/list-group)
|
|
56
60
|
|
|
@@ -62,6 +66,14 @@
|
|
|
62
66
|
|
|
63
67
|
[Navbars](https://flowbite-svelte.vercel.app/navbar)
|
|
64
68
|
|
|
69
|
+
## Pagination components
|
|
70
|
+
|
|
71
|
+
[Pagination](https://flowbite-svelte.vercel.app/paginations)
|
|
72
|
+
|
|
73
|
+
## Sidebar components
|
|
74
|
+
|
|
75
|
+
[Sidebar](https://flowbite-svelte.vercel.app/sidebars)
|
|
76
|
+
|
|
65
77
|
## Spinner components
|
|
66
78
|
|
|
67
79
|
[Spinners](https://flowbite-svelte.vercel.app/spinners)
|
|
@@ -70,6 +82,14 @@
|
|
|
70
82
|
|
|
71
83
|
[Tabs](https://flowbite-svelte.vercel.app/tabs)
|
|
72
84
|
|
|
85
|
+
## Timeline components
|
|
86
|
+
|
|
87
|
+
[Timeline](https://flowbite-svelte.vercel.app/timelines)
|
|
88
|
+
|
|
89
|
+
## Toast components
|
|
90
|
+
|
|
91
|
+
[Toast](https://flowbite-svelte.vercel.app/toasts)
|
|
92
|
+
|
|
73
93
|
## Tooltip components
|
|
74
94
|
|
|
75
95
|
[Tooltips](https://flowbite-svelte.vercel.app/tooltips)
|
package/alerts/Alert.svelte
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
<script >
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
export let color = 'blue';
|
|
2
4
|
export let alertId = 'alert-1';
|
|
3
5
|
export let closeBtn = false;
|
|
6
|
+
export let btn1 = false;
|
|
4
7
|
let hidden = false;
|
|
8
|
+
const handlebtn1 = () => {
|
|
9
|
+
dispatch('handlebtn1');
|
|
10
|
+
};
|
|
5
11
|
const handleHide = () => {
|
|
6
12
|
hidden = !hidden;
|
|
7
13
|
};
|
|
@@ -72,6 +78,7 @@ else {
|
|
|
72
78
|
buttonClass =
|
|
73
79
|
'ml-auto -mx-1.5 -my-1.5 bg-gray-100 text-gray-500 rounded-lg focus:ring-2 focus:ring-gray-400 p-1.5 hover:bg-gray-200 inline-flex h-8 w-8 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
|
|
74
80
|
}
|
|
81
|
+
let button1Class = 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
75
82
|
</script>
|
|
76
83
|
|
|
77
84
|
<div id={alertId} class:hidden class={divClass} role="alert">
|
|
@@ -101,4 +108,20 @@ else {
|
|
|
101
108
|
>
|
|
102
109
|
</button>
|
|
103
110
|
{/if}
|
|
111
|
+
{#if btn1}
|
|
112
|
+
<button on:click={handlebtn1} type="button" class={buttonClass} aria-label="Close">
|
|
113
|
+
<span class="sr-only">Close</span>
|
|
114
|
+
<svg
|
|
115
|
+
class="w-5 h-5"
|
|
116
|
+
fill="currentColor"
|
|
117
|
+
viewBox="0 0 20 20"
|
|
118
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
119
|
+
><path
|
|
120
|
+
fill-rule="evenodd"
|
|
121
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
122
|
+
clip-rule="evenodd"
|
|
123
|
+
/></svg
|
|
124
|
+
>
|
|
125
|
+
</button>
|
|
126
|
+
{/if}
|
|
104
127
|
</div>
|
package/alerts/Alert.svelte.d.ts
CHANGED
package/badges/BadgeIcon.svelte
CHANGED
package/index.d.ts
CHANGED
|
@@ -52,11 +52,27 @@ 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";
|
|
59
|
+
export { default as Sidebar } from "./sidebars/Sidebar.svelte";
|
|
55
60
|
export { default as Spinner } from "./spinners/Spinner.svelte";
|
|
56
61
|
export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
|
|
62
|
+
export { default as InteractiveTabHead } from "./tabs/InteractiveTabHead.svelte";
|
|
57
63
|
export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
|
|
58
64
|
export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
|
|
59
65
|
export { default as PillTabs } from "./tabs/PillTabs.svelte";
|
|
66
|
+
export { default as TabContent } from "./tabs/TabContent.svelte";
|
|
67
|
+
export { default as Group } from "./timelines/Group.svelte";
|
|
68
|
+
export { default as GroupItem } from "./timelines/GroupItem.svelte";
|
|
69
|
+
export { default as Activity } from "./timelines/Activity.svelte";
|
|
70
|
+
export { default as ActivityItem } from "./timelines/ActivityItem.svelte";
|
|
71
|
+
export { default as Timeline } from "./timelines/Timeline.svelte";
|
|
72
|
+
export { default as TimelineItem } from "./timelines/TimelineItem.svelte";
|
|
73
|
+
export { default as TimelineHorizontal } from "./timelines/TimelineHorizontal.svelte";
|
|
74
|
+
export { default as TimelineItemHorizontal } from "./timelines/TimelineItemHorizontal.svelte";
|
|
75
|
+
export { default as TimelineItemVertical } from "./timelines/TimelineItemVertical.svelte";
|
|
60
76
|
export { default as Toast } from "./toasts/Toast.svelte";
|
|
61
77
|
export { default as Tooltip } from "./tooltips/Tooltip.svelte";
|
|
62
78
|
export { default as LightTooltip } from "./tooltips/LightTooltip.svelte";
|
package/index.js
CHANGED
|
@@ -82,14 +82,38 @@ 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
|
+
|
|
91
|
+
// Sidebar
|
|
92
|
+
export { default as Sidebar } from './sidebars/Sidebar.svelte'
|
|
93
|
+
|
|
85
94
|
// Spin
|
|
86
95
|
export { default as Spinner } from'./spinners/Spinner.svelte'
|
|
87
96
|
export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
|
|
88
97
|
|
|
89
98
|
// Tabs
|
|
99
|
+
export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte'
|
|
90
100
|
export { default as InteractiveTabs } from'./tabs/InteractiveTabs.svelte'
|
|
91
101
|
export { default as DefaultTabs } from'./tabs/DefaultTabs.svelte'
|
|
92
|
-
export { default as PillTabs } from'./tabs/PillTabs.svelte'
|
|
102
|
+
export { default as PillTabs } from './tabs/PillTabs.svelte'
|
|
103
|
+
export { default as TabContent } from './tabs/TabContent.svelte'
|
|
104
|
+
|
|
105
|
+
// Timeline
|
|
106
|
+
export { default as Group } from './timelines/Group.svelte'
|
|
107
|
+
export { default as GroupItem } from './timelines/GroupItem.svelte'
|
|
108
|
+
export { default as Activity } from './timelines/Activity.svelte'
|
|
109
|
+
export { default as ActivityItem } from './timelines/ActivityItem.svelte'
|
|
110
|
+
export { default as Timeline } from './timelines/Timeline.svelte'
|
|
111
|
+
export { default as TimelineItem } from './timelines/TimelineItem.svelte'
|
|
112
|
+
export { default as TimelineHorizontal } from './timelines/TimelineHorizontal.svelte'
|
|
113
|
+
export { default as TimelineItemHorizontal } from './timelines/TimelineItemHorizontal.svelte'
|
|
114
|
+
export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
|
|
115
|
+
|
|
116
|
+
|
|
93
117
|
|
|
94
118
|
// Toast
|
|
95
119
|
export { default as Toast } from './toasts/Toast.svelte'
|
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type ExtraLargeModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type ExtraLargeModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type ExtraLargeModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class ExtraLargeModal extends SvelteComponentTyped<ExtraLargeModalProps, ExtraLargeModalEvents, ExtraLargeModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
package/modals/LargeModal.svelte
CHANGED
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type LargeModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type LargeModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type LargeModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class LargeModal extends SvelteComponentTyped<LargeModalProps, LargeModalEvents, LargeModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -8,10 +8,10 @@ export let textColor = 'gray';
|
|
|
8
8
|
export let title = 'Terms of Service';
|
|
9
9
|
export let btn1;
|
|
10
10
|
export let btn2;
|
|
11
|
-
const closeModal = () => {
|
|
11
|
+
export const closeModal = () => {
|
|
12
12
|
modalIdStore.update((value) => (value = null));
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
let showModalId;
|
|
15
15
|
modalIdStore.subscribe((value) => {
|
|
16
16
|
showModalId = value;
|
|
17
17
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type MediumModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type MediumModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type MediumModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class MediumModal extends SvelteComponentTyped<MediumModalProps, MediumModalEvents, MediumModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -6,10 +6,11 @@ export let lostPasswordLink;
|
|
|
6
6
|
export let rememberMe = false;
|
|
7
7
|
export let signUp;
|
|
8
8
|
export let action;
|
|
9
|
-
|
|
9
|
+
export let emailPlaceholder = 'name@company.com';
|
|
10
|
+
export const closeModal = () => {
|
|
10
11
|
modalIdStore.update((value) => (value = null));
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
let showModalId;
|
|
13
14
|
modalIdStore.subscribe((value) => {
|
|
14
15
|
showModalId = value;
|
|
15
16
|
});
|
|
@@ -95,7 +96,7 @@ else {
|
|
|
95
96
|
name="email"
|
|
96
97
|
id="email-{id}"
|
|
97
98
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
|
|
98
|
-
placeholder=
|
|
99
|
+
placeholder={emailPlaceholder}
|
|
99
100
|
required
|
|
100
101
|
/>
|
|
101
102
|
</div>
|
|
@@ -9,7 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
rememberMe?: boolean;
|
|
10
10
|
signUp: string;
|
|
11
11
|
action: string;
|
|
12
|
-
|
|
12
|
+
emailPlaceholder?: string;
|
|
13
|
+
closeModal?: () => void;
|
|
13
14
|
};
|
|
14
15
|
events: {
|
|
15
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -20,5 +21,6 @@ export declare type SignInModalProps = typeof __propDef.props;
|
|
|
20
21
|
export declare type SignInModalEvents = typeof __propDef.events;
|
|
21
22
|
export declare type SignInModalSlots = typeof __propDef.slots;
|
|
22
23
|
export default class SignInModal extends SvelteComponentTyped<SignInModalProps, SignInModalEvents, SignInModalSlots> {
|
|
24
|
+
get closeModal(): () => void;
|
|
23
25
|
}
|
|
24
26
|
export {};
|
package/modals/SmallModal.svelte
CHANGED
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type SmallModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type SmallModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type SmallModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class SmallModal extends SvelteComponentTyped<SmallModalProps, SmallModalEvents, SmallModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
<script >import { page, session } from '$app/stores';
|
|
2
|
-
|
|
3
|
-
let block = false;
|
|
4
|
-
let activeDropdown = undefined;
|
|
5
|
-
const handleDropdown = (id) => {
|
|
6
|
-
hidden = !hidden;
|
|
7
|
-
block = !block;
|
|
8
|
-
activeDropdown = id;
|
|
9
|
-
};
|
|
2
|
+
import NavDropdown from './NavDropdown.svelte';
|
|
10
3
|
let barHidden = true;
|
|
11
4
|
const handleClickbtn = () => {
|
|
12
5
|
barHidden = !barHidden;
|
|
@@ -65,41 +58,16 @@ export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-f
|
|
|
65
58
|
</button>
|
|
66
59
|
<div class="w-full md:block md:w-auto" class:hidden={barHidden} id="mobile-menu">
|
|
67
60
|
<ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
|
|
68
|
-
{#each menus as {
|
|
61
|
+
{#each menus as { name, href, rel, child }}
|
|
69
62
|
{#if child}
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
><path
|
|
79
|
-
fill-rule="evenodd"
|
|
80
|
-
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"
|
|
81
|
-
clip-rule="evenodd"
|
|
82
|
-
/></svg
|
|
83
|
-
></button
|
|
84
|
-
>
|
|
85
|
-
{#if activeDropdown === id}
|
|
86
|
-
<!-- Dropdown menu -->
|
|
87
|
-
<div
|
|
88
|
-
class:hidden
|
|
89
|
-
class:block
|
|
90
|
-
class={dropdownDiv}
|
|
91
|
-
style="position: absolute; margin: 0px;"
|
|
92
|
-
>
|
|
93
|
-
<ul class="py-1" aria-labelledby="dropdownLargeButton">
|
|
94
|
-
{#each child as item}
|
|
95
|
-
<li>
|
|
96
|
-
<a href={item.href} {rel} class={dropdownLinkClassWithChild}>{item.name}</a>
|
|
97
|
-
</li>
|
|
98
|
-
{/each}
|
|
99
|
-
</ul>
|
|
100
|
-
</div>
|
|
101
|
-
{/if}
|
|
102
|
-
</li>
|
|
63
|
+
<NavDropdown
|
|
64
|
+
{liButtonClass}
|
|
65
|
+
{dropdownDiv}
|
|
66
|
+
{name}
|
|
67
|
+
{child}
|
|
68
|
+
{rel}
|
|
69
|
+
{dropdownLinkClassWithChild}
|
|
70
|
+
/>
|
|
103
71
|
{:else}
|
|
104
72
|
<li>
|
|
105
73
|
<a
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script >export let liButtonClass;
|
|
2
|
+
export let name;
|
|
3
|
+
let hidden = true;
|
|
4
|
+
let block = false;
|
|
5
|
+
export let child;
|
|
6
|
+
const handleDropdown = () => {
|
|
7
|
+
hidden = !hidden;
|
|
8
|
+
block = !block;
|
|
9
|
+
};
|
|
10
|
+
export let dropdownDiv;
|
|
11
|
+
export let dropdownLinkClassWithChild;
|
|
12
|
+
export let rel;
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<li>
|
|
16
|
+
<button on:click={() => handleDropdown()} class={liButtonClass}
|
|
17
|
+
>{name}
|
|
18
|
+
<svg
|
|
19
|
+
class="ml-1 w-4 h-4"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
viewBox="0 0 20 20"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
><path
|
|
24
|
+
fill-rule="evenodd"
|
|
25
|
+
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"
|
|
26
|
+
clip-rule="evenodd"
|
|
27
|
+
/></svg
|
|
28
|
+
></button
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
<!-- Dropdown menu -->
|
|
32
|
+
<div class:hidden class:block class={dropdownDiv} style="position: absolute; margin: 0px;">
|
|
33
|
+
<ul class="py-1" aria-labelledby="dropdownLargeButton">
|
|
34
|
+
{#each child as item}
|
|
35
|
+
<li>
|
|
36
|
+
<a href={item.href} {rel} class={dropdownLinkClassWithChild}>{item.name}</a>
|
|
37
|
+
</li>
|
|
38
|
+
{/each}
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
</li>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { NavbarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
liButtonClass: string;
|
|
6
|
+
name: string;
|
|
7
|
+
child: NavbarType[];
|
|
8
|
+
dropdownDiv: string;
|
|
9
|
+
dropdownLinkClassWithChild: string;
|
|
10
|
+
rel: string;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type NavDropdownProps = typeof __propDef.props;
|
|
18
|
+
export declare type NavDropdownEvents = typeof __propDef.events;
|
|
19
|
+
export declare type NavDropdownSlots = typeof __propDef.slots;
|
|
20
|
+
export default class NavDropdown extends SvelteComponentTyped<NavDropdownProps, NavDropdownEvents, NavDropdownSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script >import { page, session } from '$app/stores';
|
|
2
|
-
export let
|
|
2
|
+
export let name = 'Svelte Flow';
|
|
3
3
|
export let logo = '/images/mkdir-logo.png';
|
|
4
4
|
export let alt = 'Svelte Flow';
|
|
5
5
|
export let textsize = 'text-sm';
|
|
@@ -19,7 +19,7 @@ export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gr
|
|
|
19
19
|
<div class={navDivClass}>
|
|
20
20
|
<a href="/" class="flex">
|
|
21
21
|
<img src={logo} {alt} />
|
|
22
|
-
<span class={spanClass}>{
|
|
22
|
+
<span class={spanClass}>{name}</span>
|
|
23
23
|
</a>
|
|
24
24
|
<button
|
|
25
25
|
on:click={handleClickbtn}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
|
+
"main": "./package/index.js",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Shinichi Okada",
|
|
7
8
|
"email": "connect@codewithshin.com",
|
|
@@ -124,13 +125,32 @@
|
|
|
124
125
|
"./modals/SmallModal.svelte": "./modals/SmallModal.svelte",
|
|
125
126
|
"./modals/modalStores": "./modals/modalStores.js",
|
|
126
127
|
"./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
|
|
128
|
+
"./navbar/NavDropdown.svelte": "./navbar/NavDropdown.svelte",
|
|
127
129
|
"./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
|
|
130
|
+
"./paginations/Next.svelte": "./paginations/Next.svelte",
|
|
131
|
+
"./paginations/Pagination.svelte": "./paginations/Pagination.svelte",
|
|
132
|
+
"./paginations/Previous.svelte": "./paginations/Previous.svelte",
|
|
133
|
+
"./paginations/TableData.svelte": "./paginations/TableData.svelte",
|
|
134
|
+
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
135
|
+
"./sidebars/SidebarDropdown.svelte": "./sidebars/SidebarDropdown.svelte",
|
|
128
136
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
129
137
|
"./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
|
|
130
138
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
131
139
|
"./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
|
|
140
|
+
"./tabs/InteractiveTabHead.svelte": "./tabs/InteractiveTabHead.svelte",
|
|
132
141
|
"./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
|
|
133
142
|
"./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
|
|
143
|
+
"./tabs/TabContent.svelte": "./tabs/TabContent.svelte",
|
|
144
|
+
"./tabs/tabStore": "./tabs/tabStore.js",
|
|
145
|
+
"./timelines/Activity.svelte": "./timelines/Activity.svelte",
|
|
146
|
+
"./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
|
|
147
|
+
"./timelines/Group.svelte": "./timelines/Group.svelte",
|
|
148
|
+
"./timelines/GroupItem.svelte": "./timelines/GroupItem.svelte",
|
|
149
|
+
"./timelines/Timeline.svelte": "./timelines/Timeline.svelte",
|
|
150
|
+
"./timelines/TimelineHorizontal.svelte": "./timelines/TimelineHorizontal.svelte",
|
|
151
|
+
"./timelines/TimelineItem.svelte": "./timelines/TimelineItem.svelte",
|
|
152
|
+
"./timelines/TimelineItemHorizontal.svelte": "./timelines/TimelineItemHorizontal.svelte",
|
|
153
|
+
"./timelines/TimelineItemVertical.svelte": "./timelines/TimelineItemVertical.svelte",
|
|
134
154
|
"./toasts/Toast.svelte": "./toasts/Toast.svelte",
|
|
135
155
|
"./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
|
|
136
156
|
"./tooltips/Tooltip.svelte": "./tooltips/Tooltip.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 {};
|